Re: mobact.c

From: Zizazat Lazuras (zizazat@hotmail.com)
Date: 01/21/02


I answered my own question with more debugging. Code to follow:

found = FALSE;
  switch (GET_CLASS(ch)) {
    case CLASS_THIEF:
      if (GET_POS(ch) == POS_STANDING && (!MOB_FLAGGED(ch, MOB_SPEC)) ) {
        for (vict = world[ch->in_room].people; vict && !found; vict =
vict->next_in_room)
          if (GET_LEVEL(vict) < LVL_IMMORT && (ch != vict)) {
            if (number(1, 100) <= GET_MSKILL(ch, SKILL_STEAL)) {
              npc_steal(ch, vict);
            }
            found = TRUE;
            continue;
          }
      }
    break;
  }

Of course GET_MSKILL doesn't work for most people. But you get the idea.
There is a skill check to see if the mob is even interested in trying to
steal from someone. This is functional, and opens the door for me to do much
cooler things since I have the functionallity :)

I am going to scrap npc_steal and use do_steal, for starters.

I do wonder though if anyone can give me ideas/pointers about trying to
choose a random vict from world[ch->in_room].people. Right now the theif
always goes after the first person. Would I do something like mob scavenger
code, where it would try to determine the best_vict from world[].people?

--Ziz

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT