[Halfdone CODE] Mage

From: Uffe Svanstrom (ulfs@MAIL.KAREN.HKR.SE)
Date: 09/04/97

Hay !

Well here comes my Specproc thingy with the Mage i have been talking about
i need a little more help and then i am done with it ! :)
I will then post the final version to you fellas that is a worse coder than
i am .
(wonder if there are any in the circle list that is worse than me :) )

SPECIAL(yarrash)                /* Magikern i ett torn nanstans i 16 Zonen */

/* Coded By The Main Man .. ZORDAG ..      */
  struct char_data *vict,
  struct char_data *mob = NULL;
  static int count = 0;



  if (GET_HIT(ch) <50 && count <1)
FALSE, ch, 0, 0, TO_ROOM);
    do_say(ch, "YOU WILL NOT GET ME ALIVE !!!",
0, 0);
    act("\r\n$n swings his arms in a wierd gesture.", FALSE, ch, 0,
0, TO_ROOM);
    act("The room is filled with a blue streaking light.",
FALSE, ch, 0, 0, TO_ROOM);
    act("Suddenly you see a hideous
creature.\r\n", FALSE, ch, 0, 0, TO_ROOM);
    act("The Creature rescues
Yarrash and starts to fight YOU", FALSE, ch, 0, 0, TO_ROOM);

    mob =
read_mobile(1608, VIRTUAL);             /* Insert the Stone Golem Here*/

log("Loading Mob At Yarrash");
    char_to_room(mob, ch->in_room);

SET_BIT(AFF_FLAGS(mob), AFF_PROT_FIRE); /* give em some AFFs */


  for (tmp_ch =
world[ch->in_room].people; tmp_ch &&
       (FIGHTING(tmp_ch) != vict);
tmp_ch = tmp_ch->next_in_room);

                                        /* This makes the PC,NPC stop
fighting        */
    if (FIGHTING(vict) == tmp_ch)

 if (FIGHTING(tmp_ch))
    if (FIGHTING(ch))


    set_fighting(mob, vict);    /* make loaded mob
fight victim            */
    set_fighting(vict, mob);    /* make victim fight mob
    set_fighting(ch, vict);             /* make character (mage) fight victim   */

  count = 1;                    /* counter so the mob wont load again   */



Now the Mage (yarrash) loads the mob when his HP is below 50 points and
when the counter is <1
My problem right now is, when the players managed to kill the LOADED STONE
and killed the mage (yarrash) i somehow have to RESET the count variable so
that the next time the
SPECIAL(yarrash) is loaded it will work properly (ie: counter = 0 so it can
load the mob again)
as the code is now it wount work. (sadly)

Also tried to do a thing when the mage is POS_DEAD or POS_MORTALLYW
it will set then count = 0;
but if the mob (mage) is dead .. naturly the special(yarrash) wount
beloaded ...

and if i do a get_hit(ch) <10 count =0
it starts loading the mob again ... so that was not an smart idea ...

Any suggestions ???

Also wonders how i freeze all the players and the mob in a special room at
the same time
i have tried with those
prob is that it first do the ch for the pulse and the after the ch it does
it for the vict ..


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |

This archive was generated by hypermail 2b30 : 12/08/00 PST