JS-EVENT-EXAMPLE
The following is an example of how you can spawn an event from within JavaScript. It sends custom event 1000 to the actor in 2d4 pulses and includes an actor of "self.fighting". (Note how for the current event the actor is "actor" but this spawned event's actor will be "self.fighting". This is an example of how JavaScript events are more flexible than Behavior-Response spawning -- you can pick exactly who you want the self and actor to be in an event.)
Event.spawn( actor, 1000, Mud.dice( 2, 4 ), self.fighting );
This example sends the event to the room the self happens to be in at the time the event comes due (4 pulses).
Event.spawn( self, 'room', 1000, 4 );
If 'self' was a character, this spawn would send the event to the character and its inventory in 2 pulses:
Event.spawn( 'in', self, 1000, 2 );