generated from Jaysyn/ModuleTemplate
76 lines
1.6 KiB
Plaintext
76 lines
1.6 KiB
Plaintext
#include "nw_i0_tool"
|
|
|
|
void main()
|
|
|
|
|
|
{
|
|
object oAtt = GetLastDamager();
|
|
int iDmg = GetDamageDealtByType(DAMAGE_TYPE_BLUDGEONING) + GetDamageDealtByType(DAMAGE_TYPE_PIERCING) + GetDamageDealtByType(DAMAGE_TYPE_SLASHING) ;
|
|
iDmg += d10(1);
|
|
object oWp = GetItemInSlot (INVENTORY_SLOT_RIGHTHAND, oAtt);
|
|
if (GetBaseItemType(oWp) == BASE_ITEM_LIGHTCROSSBOW ||
|
|
GetBaseItemType(oWp) == BASE_ITEM_HEAVYCROSSBOW ||
|
|
GetBaseItemType(oWp) == BASE_ITEM_LONGBOW ||
|
|
GetBaseItemType(oWp) == BASE_ITEM_SHORTBOW ||
|
|
GetBaseItemType(oWp) == BASE_ITEM_DART ||
|
|
GetBaseItemType(oWp) == BASE_ITEM_SHURIKEN ||
|
|
GetBaseItemType(oWp) == BASE_ITEM_SLING)
|
|
{
|
|
|
|
if (iDmg == 0)
|
|
{
|
|
ActionSpeakString ("Miss ...");
|
|
return;
|
|
}
|
|
else if (iDmg <= 5)
|
|
{
|
|
ActionSpeakString ("Hit ... outer ring");
|
|
return;
|
|
}
|
|
else if (iDmg <= 10)
|
|
{
|
|
ActionSpeakString ("Hit ... Middle ring");
|
|
return;
|
|
object oPC = GetPCSpeaker();
|
|
|
|
RewardPartyXP(1, oPC, FALSE);
|
|
|
|
|
|
}
|
|
else if (iDmg <= 15 )
|
|
{
|
|
ActionSpeakString ("Hit ... Nearly Bulls-Eye");
|
|
return;
|
|
|
|
object oPC = GetPCSpeaker();
|
|
|
|
RewardPartyXP(5, oPC, FALSE);
|
|
|
|
|
|
}
|
|
else if (iDmg <= 20 )
|
|
{
|
|
ActionSpeakString ("Hit ... Bulls eye!!!");
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object oPC = GetPCSpeaker();
|
|
|
|
RewardPartyXP(10, oPC, FALSE);
|
|
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
ActionSpeakString ("This is an Archery Target - not a Stuffed Dummy...");
|
|
}
|
|
|
|
|
|
}
|