MMD_PRC8/_module/nss/use_archery_targ.nss
Jaysyn904 adeff59f82 Initial commit
Initial commit.
2024-08-02 23:18:00 -04:00

35 lines
1.1 KiB
Plaintext

void main()
{
int iDamage = GetDamageDealtByType(DAMAGE_TYPE_BASE_WEAPON);
object oPC = GetLastDamager(OBJECT_SELF);
object oWep = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
int iType = GetBaseItemType(oWep);
if (iType == BASE_ITEM_DART || iType == BASE_ITEM_GRENADE || iType == BASE_ITEM_HEAVYCROSSBOW || iType == BASE_ITEM_LIGHTCROSSBOW
|| iType == BASE_ITEM_LONGBOW || iType == BASE_ITEM_SHORTBOW || iType == BASE_ITEM_SHURIKEN || iType == BASE_ITEM_SLING || iType == BASE_ITEM_THROWINGAXE)
{
GiveXPToCreature(oPC,iDamage);
string sDamage = IntToString(iDamage);
if (iDamage >= 15)
{
FloatingTextStringOnCreature("Nice shot. "+sDamage+" XP awarded. 50 XP bonus awarded.",oPC);
GiveXPToCreature(oPC,50);
}
else
{
FloatingTextStringOnCreature(sDamage+" XP awarded.",oPC);
}
}
else
{
FloatingTextStringOnCreature("This is for use with ranged weapons.",oPC);
}
}