PWE_PRC8/_module/nss/archery_ondamage.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

49 lines
1.4 KiB
Plaintext

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_THROWINGAXE ||
GetBaseItemType(oWp) == BASE_ITEM_SLING)
{
if (iDmg == 0)
{
ActionSpeakString ("Miss ... Need Glasses?");
return;
}
else if (iDmg <= 5)
{
ActionSpeakString ("Hit ... Outer ring");
return;
}
else if (iDmg <= 10)
{
ActionSpeakString ("Hit ... Middle ring");
return;
}
else if (iDmg <= 15 )
{
ActionSpeakString ("Hit ... Nearly Bulls-Eye");
return;
}
else if (iDmg <25 )
{
ActionSpeakString ("Hit ... Bulls eye!!!");
return;
}
else
{
return;
}
}
}