ettin that throws rocks
Posted: Sun Jan 15, 2012 6:16 pm
This is a script for ettins or any monster you want to tie it to. It will throw a rock at a player. if the player is mounted it will dismount him and take stama dn health from player.
if the player isnt mounted will just take stam and health from him.
I used a rock graphic you can change this if you like tho to anything.
Sound can be changed as well
if the player isnt mounted will just take stam and health from him.
I used a rock graphic you can change this if you like tho to anything.
Sound can be changed as well
var rockSound = 0x01f2;// change the sound the rock makes here
var rockmovingEffect = 0x1368;// this is the moving effect you see when the ettin shoot at you.
var hitMsg = "You have been hit with a rock!";
var dismountMsg = "You have been knocked off your mount!";
function onCombatStart( pAttacker, pDefender )
{
if( pDefender.isonhorse )
{
DoMovingEffect( pAttacker, pDefender, rockmovingEffect, 0x10, 0x00, false );
pDefender.SoundEffect( rockSound, true );
pDefender.EmoteMessage( dismountMsg );
pDefender.Dismount();
pDefender.health = (pDefender.health -3);
pDefender.stamina = (pDefender.stamina -10);
return true;
}
else
DoMovingEffect( pAttacker, pDefender, rockmovingEffect, 0x10, 0x00, false );
pDefender.SoundEffect( rockSound, true );
pDefender.EmoteMessage( hitMsg );
pDefender.health = (pDefender.health -3);
pDefender.stamina = (pDefender.stamina -10);
return true;
}
function onDefense( pAttacker, pDefender )
{
var iNum = RandomNumber( 0, 1000 );
if( iNum > 700 )
{
if( pDefender.health < pDefender.maxhp )
{
var dice;
dice = RollDice(1,20,0);
if (dice < 3)
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
pAttacker.Dismount();
return false;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
if (dice < 6)
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
pAttacker.Dismount();
return false;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
if (dice < 16)
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.Dismount();
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
return false;
}
}
}
function onCombatEnd( pDefender, pAttacker )
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.Dismount();
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return true;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return true;
}
var rockmovingEffect = 0x1368;// this is the moving effect you see when the ettin shoot at you.
var hitMsg = "You have been hit with a rock!";
var dismountMsg = "You have been knocked off your mount!";
function onCombatStart( pAttacker, pDefender )
{
if( pDefender.isonhorse )
{
DoMovingEffect( pAttacker, pDefender, rockmovingEffect, 0x10, 0x00, false );
pDefender.SoundEffect( rockSound, true );
pDefender.EmoteMessage( dismountMsg );
pDefender.Dismount();
pDefender.health = (pDefender.health -3);
pDefender.stamina = (pDefender.stamina -10);
return true;
}
else
DoMovingEffect( pAttacker, pDefender, rockmovingEffect, 0x10, 0x00, false );
pDefender.SoundEffect( rockSound, true );
pDefender.EmoteMessage( hitMsg );
pDefender.health = (pDefender.health -3);
pDefender.stamina = (pDefender.stamina -10);
return true;
}
function onDefense( pAttacker, pDefender )
{
var iNum = RandomNumber( 0, 1000 );
if( iNum > 700 )
{
if( pDefender.health < pDefender.maxhp )
{
var dice;
dice = RollDice(1,20,0);
if (dice < 3)
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
pAttacker.Dismount();
return false;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
if (dice < 6)
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
pAttacker.Dismount();
return false;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
if (dice < 16)
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.Dismount();
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return false;
}
return false;
}
}
}
function onCombatEnd( pDefender, pAttacker )
{
if( pAttacker.isonhorse )
{
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( dismountMsg );
pAttacker.Dismount();
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return true;
}
else
DoMovingEffect( pDefender, pAttacker, rockmovingEffect, 0x10, 0x00, false );
pAttacker.SoundEffect( rockSound, true );
pAttacker.EmoteMessage( hitMsg );
pAttacker.health = (pAttacker.health -3);
pAttacker.stamina = (pAttacker.stamina -10);
return true;
}