Page 1 of 1

Ghouls Touch

Posted: Fri Oct 21, 2022 6:08 pm
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");
    }
}

Re: Ghouls Touch

Posted: Sun Oct 30, 2022 8:41 pm
by dragon slayer
Very Awesome Script.