Re: sneak and awarness

From: ironfist (ironfist@texas.net)
Date: 12/05/01


David Cole wrote:

> Hello,
>
> I added a new skill called Awarness, where if someone has the skill, they
> can detect if someone is sneaking/hidden etc... My problem is im trying to
> add it to act.movement.c in the spot where it tells you in what direction
> they left or entered, but my little hack job of coding it isnt working to
> well, can someone take a look and maybe exsplain to me what im doing wrong?
>
>   if (AFF_FLAGGED(ch, AFF_SNEAK)) {
>  if (GET_SKILL(world[ch->in_room].people, SKILL_AWARNESS) >= 1)
>     sprintf(buf2, "$n sneaks in from %s.", alt_dirs[rev_dir[dir]]);
>     act(buf2, FALSE, ch, 0, world[ch->in_room].people, TO_VICT);
>     improve_skill(ch, SKILL_AWARNESS);
>   } else
>   bla bla flying, walking, levitating......
>

well first you need brackets with your if statement but you also
need to loop through everyone in the room to send them the message.

declare struct char_data *vict;

  if (AFF_FLAGGED(ch, AFF_SNEAK)) {
    for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room) {
      /* if you want to use a dice roll */
      if (GET_SKILL(vict, SKILL_AWARENESS) > number(1, 101)) {
        sprintf(buf2, "$n sneaks in from %s.", dirs[rev_dir[dir]]);
        act(buf2, FALSE, ch, 0, vict, TO_VICT);
      }
    }
  }
   /* called after the loop so you only improve once */
   improve_skill(ch, SKILL_AWARNESS);
}else ....

think that should work...

Also, thanks to Welcor for the advice on kill_ems, seems to work so far =)


R.M.
ironfist@texas.net

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



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