Re: Various cool Problems !

From: Rasdan (rasdan@PEAK.ORG)
Date: 09/02/97

> >> int counter;
> >> ~~~cut
> >> if (get_hit(ch) <50 && counter <1)
>    and here i load in the mob
> >> counter = 1;
> then i  set counter = 1 so it wont go into this if the next time ??
> >> Understand my thoughts ?! how do i make so that it only will jump into this
> >> if thingy once, ie only loads the mob once ??
> >>
> >Just make a char flag that is set when the mob is loaded, if this flag is
> >set, don't load:
> hmm, feels like stoopid to do a new flag for just this thing
> aint there a way to do the counter
> so if counter = 1 it wont do it ?

No it won't, because each time the function is called, it will reset the
counter variable, can't have that. A char flag is the best way to do it,
and there are a lot of them. Besides, if you run out of them, you can
always add more. I have added 4 new sets of aff_flags, it's not hard. :)

> >> Next problem is !
> >> I have flagged the loaded mob with a couple of AFF, like sanc, charm,
> >> no probs there
> >> but how do i tell the loaded mob to start fight the character that fights
> >> his master (the mage)
> >> and also i need something like that the loaded mob will RESCUE the mage so
> >> that  the loaded mob will take all the hits while the mage heals up a bit.
> >
> >  if (FIGHTING(ch))
> >    hit(vict, FIGHTING(ch), TYPE_UNDEFINED);
> but this dosnt solve the RESCUE of the mage
> just like the skill RESCUE, the stone golem should do a RESCUE MAGE thingy ?
Oh, look at the code in rescue itself, I believe you need to use

> >>     mob = read_mobile(mob, 3062);  /* Insert the Stone Golem Here */
> >>
> >read_mobile requires two different arguments, the first being the number
> >of the mob (either real or vnum), and the second telling it what type of
> >mob to load (VIRTUAL or REAL).
> Whoooa , now you lost me ( Darn)
> i have tried to change those numbers but i still gets the little puff  when
> it loads up , and i sure wonder why !
> the first being the number of the mob , do you mean the text "mob"
> if i change it to a number the mud kinda crash.
> and the secound , yepps i have changed it to but i still get puff loaded !

From db.c:
  struct char_data *read_mobile(int nr, int type);

Okay, the first argument MUST be a number, not a pointer. The second must
either be REAL OR VIRTUAL, unless you have changed the way it works.

So, say for example your mob vnum is 3030, then to load that mob you
would do:
  if (!(mob = read_mobile(3030, VIRTUAL))) {
    log("Bad mob VNUM in Wizard Rescue function, No mob loading.");
    send_to_char("There is a problem with this function, report.\r\n", ch);

  That will load the mob, and do error checking in case the VNUM is


  I have done so much,
  with so little,                         James C. Thomas Jr.
  for so long,                                 Rasdan
  That I can do anything                Head Coder of Finality!
  with nothing.
Finality is based upon CircleMUD 3.0, check us out:

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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