Checking for MOB status

For builders to discuss and ask building questions.
Post Reply
User avatar
Duranamir
Sword Grand Master
Sword Grand Master
Posts: 740
Joined: Thu Nov 27, 2003 11:58 am
Location: Skull port

Checking for MOB status

Post by Duranamir » Fri Mar 31, 2006 12:31 pm

Is there any way of checking the status i.e. stunned sleeping etc of a mob from an object program ?. For example a weapon that does something nasty on a final hit ?.

Also can an object out of combat check the status of a mob in the same room. i know it can check for the presence of the a particular mob in the room but can it target it for further query?.

Also can 1 mob check the status of a second mob in the same room ?. I guess the first mob could check its own status and tell the second mob but i was interested to see if it can be done the other way round.

Duranamir
User avatar
Kregor
Sword Grand Master
Sword Grand Master
Posts: 1474
Joined: Sun Jul 11, 2004 6:14 am
Location: Baldur's Gate

Re: Checking for MOB status

Post by Kregor » Fri Mar 31, 2006 4:45 pm

Duranamir wrote:Is there any way of checking the status i.e. stunned sleeping etc of a mob from an object program ?. For example a weapon that does something nasty on a final hit ?.
If I recall correctly, according to the records in code testing, fight_prog can now be put on a weapon. Also, I believe $f would be the target that the wielder is fighting. And "if position()" checks the position of a mob -- of which, stunned is 3 -- So I *think* a fight prog would be able to be something like:

Code: Select all

>fight_prog 100~
if position($f) == 3
  do nasty prog stuff
This would have to be confirmed to work, though.
Duranamir wrote:Also can an object out of combat check the status of a mob in the same room. i know it can check for the presence of the a particular mob in the room but can it target it for further query?.
Only way I could think, would be a random check (rand_prog), which would of course check continually, as long as it's out of a container or held/worn.
Duranamir wrote:Also can 1 mob check the status of a second mob in the same room ?. I guess the first mob could check its own status and tell the second mob but i was interested to see if it can be done the other way round.
Again, the mobs could check on each other using rand_prog, periodically checking for the status of the other mob, targeting it by the mob's name, or vnum.

Code: Select all

>rand_prog 30~
if name($r) == mMOBVNUM
  if position($r) == 3
    execute prog
"There is no safety for honest men except by believing all possible evil of evil men."

Kregor - Ranger of Tangled Trees
Rozor - Lady Luck's Duelist
Tygen - Ranger-Bard of Mielikki
Post Reply