JS-CHAR-INVOKE
The syntax for the Char invoke method is:
Char.invoke( <mobile vnum>, <target>, [ <option0>, ..., <optionN> ] )
Where options are:
| 'charm' | Specify that the mobile be charmed to the target (the target must be a character for this to work). |
| 'loyal' | Specify that the mobile be naturally charmed to the target (i.e. charm cannot be dispelled; the target must be a character for this to work). |
| 'spawn' | Mark the mobile as being spawned and and send it it a "spawned" event. |
| 'pet' | Only summon the mobile if the target has enough pet levels to take it. |
| 'limit', <limit> | Only invokes the mobile if there are fewer than limit mobiles loaded. |
The invoke method on characters allows you to create a new mobile. The "target" can either be a room number or a mobile, object, or room object.
The mobile and a target room can also be given by address: Char.invoke( 'club.xena', 'club.clubroom' ) (see JS-NAMES).
The following bit of JavaScript invokes mobile 30000 and charms it to the actor but only if there are less than 3 in the game currently.
Char.invoke( 30000, actor, 'charm', 'limit', 3 );