// 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");
}
}
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");
}
}