MPEXAMPLES2
Keywords:
MPEXAMPLES2
Example of using DELAY and REMEMBER:
In #MOBILES text file:
M greet 1002 100
M delay 1003 100
In the olc mobile edit:
MOBPrograms for [ 1000]:
Number Vnum Trigger Phrase
------ ---- ------- ------
[ 0] 1002 GREET 100
[ 1] 1003 DELAY 100
In #MOBPROGS
#1002
if isevil $n
say You infidel! Go away or face the wrath of mighty Mota!
mob remember $n
mob delay 10
break
endif
#1003
if hastarget $i
growl
mob echo $I screams and attacks $Q.
mob kill $q
else
mob forget
endif
How this works: When the player enters a room, the mobile checks if the player is evil. If this is the case, the mobile makes the player the target (mob remember) and sets up a delay of 10 * PULSE_MOBILE. When the delay expires, program #1003 is activated. The mobile checks if the target is still in the room (hastarget), and if the player hasn't left, the mobile attacks ($q and $Q refer to the target). If the player has left, the mobile will forget the player (mob forget).
More Examples: help mpexamples3
See Also
Mobhelp
Ifhelp
If Checks
Variables
Mob Asound
Mob Echo
Mob Oload
Mob Kill
Mob Flee
Mob Remove
Mob Junk
Mob Purge
Mob At
Mob Goto
Mob Transfer
Mob Force
Mob Cast
Mob Damage
Mob Delay
Mob Cancel
Mob Remember
Mob Forget
Mob Call
Mob Tgive
Mobprogram List
Mobile Programs
Triggers
Operators
Mpsyntax
Mp Building
Mpexamples
Mprog Character Variables
Mpcommands
Checkmoblog
Medit
Vnum
Trigger Hpcnt
Wimpy
Spells
Obj Type Token
Mpexamples1
Mpexamples2
Mpexamples3
Wizhelp
Mobsay
Mobemote
Olc Command
Building
Olc Medit