Initial Upload
Initial Upload
This commit is contained in:
33
_module/nss/weaponabsorber.nss
Normal file
33
_module/nss/weaponabsorber.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user