Ghouls Touch

Got any custom JavaScript additions/tweaks you think other people would like to see? Post 'em here!
Post Reply
Azzerhoden
UOX3 Newbie
Posts: 16
Joined: Wed Oct 05, 2022 3:10 pm
Has thanked: 0
Been thanked: 8 times

Ghouls Touch

Post by Azzerhoden »

Added the following script based on DragonSlayers advance spider ai script. This script add's similar functionality to the ghouls paralyzation special effects from D&D. The ghouls has to hit to cause damage, and by default there is a 25% chance for the special attack to come into play. There is also a chance the player resists the effects.
// Gives the ghoul a chance to paralyze player any time damage is done towards him just change the iNum > 700 to what ever number of chance you want to make it do more.

var iSpecialAttack = 25;   // This is the % chance the ghoul will attempt to paralyze
var resistModifyer = 1;    // How effective the players magic resistance is to ward off the attack

function onAttack( pAttacker, pDefender )
{
    var iCurrentHps = pDefender.maxhp;
    var iNum = RandomNumber( 0, 100 );
    if (iNum < iSpecialAttack)  // there is a 25% chance the ghoul will inflict a paralyzation attack
    {
        var iResistRoll = RandomNumber( 0, 1000 );
        if( iResistRoll > ( pDefender.skills.magicresistance / resistModifyer))
        {  
            if( pDefender.health < iCurrentHps )
            {
                var mSpell = Spells[38];
                pDefender.frozen = 1;
                pDefender.SpellStaticEffect( mSpell );
                pDefender.SoundEffect( 0x0204, true );  
                pDefender.EmoteMessage("You are paralyzed by the ghouls attack");
                pDefender.StartTimer(10000, 0, true);
                iCurrentHps = pDefender.health;
            }
        }
        else
        {
            pDefender.EmoteMessage("You resist the ghoul's touch");
        }
    }
}

function onTimer(pAttacker,timerID)
{
    var socket = pAttacker.socket;
    if(timerID == 0)
    {
             pAttacker.frozen = 0;
             pAttacker.EmoteMessage( "You have regained mobility");
    }
}
These users thanked the author Azzerhoden for the post (total 2):
Xuridragon slayer
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

Very Awesome Script.
Post Reply