I am thinking in how to make a program to lead the mob to another room in a date and time, without the mob get lost.
For example, I found this code:
time_prog 22
yawn
emote lies down
sleep
This makes the mob sleep at 22h, right?
I can make the mob go east at 22h and then sleep in a bed, right?
The problem is: if some player uses a charm spell to force the mob out of the room, how do I make the program examine the room where the mob is and lead the mob to the right place?
Thanks in advance!
Use mpgoto and a room echo. Wont matter where in the world the mob is at the appointed time, he'll end up in his bed like he's supposed to be.
There is no way for the prog to navigate the mob to the right room, unless you coding something new in (such as moving based on the track code).
Series of goto commands "navigates" just fine, Ive used the trick a number of times myself.
I don't consider that navigating. :P I meant moving (north/west/etc).
SMAUG 1.8 has a "MPHUNT" command that lets an NPC track a player or NPC, then attack on sight...
Maybe something like this....
guard james(vnum #1) - stationed at "East Gate", (vnum #100)
gilbert_rat (vnum #2) -
At time 22, James want to go to bed, in his barrack (vnum #130).
>time_prog 22
mpat 130 mpmload 2 1
mphunt gilbert_rat
>entry_prog 100
if mobinroom(gilbert_rat) == 1
mppeace $i
say Home sweet home...
say Hello there buddy...
sleep
endif
I wonder if you could combine mphunt and the pacifist flag to make is more simple, so that it doesn't attack.
Pacifist flags on either/both NPCs will not start a fight, but the "hunting" NPC will still be stuck in a fighting "mode".
(If you "if isfight($i)", it will return true).
With MPPEACE, the fighting is suppressed immediately, so the fight won't start at all.
Ah, I didn't think the mppeace would work in time before a few hits got in.