LoD_PRC8/_module/nss/weaponabsorber.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

34 lines
825 B
Plaintext

void main()
{
//Check to see if weapon type is valid.
object oAttacker = GetLastDamager();
object oWeapon = GetLastWeaponUsed (oAttacker);
if (GetWeaponRanged(oWeapon) == TRUE || GetBaseItemType(oWeapon) == BASE_ITEM_BRACER)
{
return;
}
if (GetAbilityModifier(ABILITY_STRENGTH, oAttacker) + d20(1) > 26)
{
return;
}
else
{
if (GetResRef(oWeapon) == "")
{
// custom item
ClearAllActions();
ActionTakeItem(oWeapon,oAttacker);
ActionAttack(oAttacker);
}
else
{
DestroyObject(oWeapon);
object oItem = CreateItemOnObject(GetTag(oWeapon), OBJECT_SELF);
SetDroppableFlag(oItem, TRUE);
// SetIdentified(oWeapon, FALSE);
}
}
}