Author Sticky: Post Working Scripts Here
Vulcano Posted: Monday, 22 July 05:54PM
Living Iron Statue absorb weapon script. Absorbs melee weapons and gauntlets if strength check (DC 15) is failed. Drops item on death. Does not absorb missile weapon launchers.

I'm an old school, boxed set D&D player and I needed some scripts to emulate those old school monsters. This is one of them.

Code:
void main()

{

    //Check to see if weapon type is valid.

    object oAttacker = GetLastDamager();

    object oWeapon = GetLastWeaponUsed (oAttacker);

    if (GetWeaponRanged(oWeapon) == TRUE)

        return;

    if (GetAbilityModifier(ABILITY_STRENGTH, oAttacker) + d20(1) > 15)

        return;

    else

    {

        DestroyObject(oWeapon);

        SpeakString("Your weapon has been absorbed into the Iron Statue!");

        CreateItemOnObject(GetTag(oWeapon), OBJECT_SELF);

    }

}



Creature OnDamaged event handler, Shield Guardian model, level 4 construct, statistics for this and many old school monsters converted to 3E can be found here.