34 lines
825 B
Plaintext
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);
|
||
|
}
|
||
|
}
|
||
|
}
|