-
Notifications
You must be signed in to change notification settings - Fork 760
Doevent
Haru edited this page Oct 19, 2016
·
1 revision
- doevent <"event label">;
This command invokes a script at given event label in an another NPC. The parameter event label has the form "NpcName::OnLabel" and unlike in donpcevent, it cannot target multiple NPCs by omitting the NPC name. It works much like a goto command into an another NPC. If there was an RID attached to the invoking script, it will be attached to the invoked script as well.
This command is not used very much, because it is more limited than donpcevent and passing RID to another script is usually not required.
prontera,152,150,5 script NPC2 53,{ // ... OnTalk: [[npctalk]] "Everyone look, "+[[strcharinfo]](0)+" tries to buy forbidden goods!"; [[end]]; }
Every time a player talks to NPC1, NPC2 will scream into it's area, what the player is about to do. Since doevent passes the RID to NPC2, it can use strcharinfo to retrieve the player's name.