Page 1 of 1

ettin that throws rocks

Posted: Sun Jan 15, 2012 6:16 pm
by dragon slayer
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
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;
}

Re: ettin that throws rocks

Posted: Sun Jan 15, 2012 8:44 pm
by Blue Dragon
Good script.

If you think convenient, i have two suggestions:

- Ettin throw the stone only when the player is faraway / away from him.

- Whenever ettin throw the stone, knock down a player. Could have a probability to overthrow or not overthrow.

Re: ettin that throws rocks

Posted: Wed Jan 18, 2012 10:14 pm
by Blue Dragon
This script is really cool. I was testing it best and I noticed that when the ettin loses the player's target, as for example, when he is on a boat or on top of a hill inaccessible, the ettin begins "strafe" rocks. It was one of the things that I thought he could do and really does: P.

Noticed the script and I tried to modify a few things that I think could be the coolest, but don't know do anything =/. However learned to do things fairly simple, how to make a emote message appear above the ettin LOL.

I realized that this first part that I put below, corresponds to the part that controls the ettin to throw stones at player when it is out of reach. It is also the part that controls the ettin ticking the first stone to show the player in first time.

Wouldn't it be possible to make him throw the first stone was only about two seconds after he see the player, at a minimum (before you see the ettin, you are already hit by a stone ...)? And also the stones that it throws when loses the target of at least every eight seconds?

In the part below put a rock chart and a sound which I thought was cool, bawls for the male and female characters, plus a message to the ettin emote. Just don't know do the shouting out when the char for man or woman ...

If you can do what I said in my first post, about it only throw rock in the character in players are distant/fleeing, when a character appears/reappear, and make adjustments that said here now, the script would be perfect to my point of view.

Remembering, are just suggestions. Do something only if convenient, have patience and animation to do this... I only contribute with suggestions that for me would be better, just that...

Code: Select all

var rockSound = 0x145;// change the sound the rock makes here
var bawlmaleSound = 0x540; // bawl of the male character to be hit
var bawlfemaleSound = 0x327; // bawl of the female character to be hit
var rockmovingEffect = 0x1362;// this is the moving effect you see when the ettin shoot at you.
var hitMsg = "Voce foi atingido por uma rocha!";
var ettinMsg = "*Ettin pega uma grande rocha...*";
var dismountMsg = "Voce foi derrubado de sua montaria!";

function onCombatStart( pAttacker, pDefender )
{

    if( pDefender.isonhorse )
    {
          pAttacker.EmoteMessage( ettinMsg )
          DoMovingEffect( pAttacker, pDefender, rockmovingEffect, 0x10, 0x00, false );
          pDefender.SoundEffect( rockSound, true );
          pDefender.SoundEffect( gritoSound, true ); 
          pDefender.EmoteMessage( dismountMsg ); 
          pDefender.Dismount();
          pDefender.health = (pDefender.health -15);
          pDefender.stamina = (pDefender.stamina -1);
      return false;
        }
        else
          pAttacker.EmoteMessage( ettinMsg )
          DoMovingEffect( pAttacker, pDefender, rockmovingEffect, 0x10, 0x00, false );
          pDefender.SoundEffect( rockSound, true ); 
          pDefender.SoundEffect( gritoSound, true ); 
          pDefender.EmoteMessage( hitMsg );
          pDefender.health = (pDefender.health -15);
          pDefender.stamina = (pDefender.stamina -1);
      return false;
}

Re: ettin that throws rocks

Posted: Fri Mar 16, 2012 8:51 pm
by stranf
Gotta give this one a try. Brings back memories when I was 8 years old and those drasted rock-throwing Ettins and Cyclops of Ultima IV were the bane of many adventures!