Hercules Elf Bot - Oct 14, 2009 15:54
Originally posted by [b]Gepard[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3650
Script commands documentation (doc/script_commands.txt) doesn't mention two things (first one is rather important):
1. ?: operator
Very useful e.g. to replace if(Sex) mes "..."; else mes "..."; clauses with simple mes "Welcome, " + (Sex?"Mr.":"Mrs.") + " " + strcharinfo(0); or to replace any other simple if-else clauses. It might be worth mentioning that ?: has low priority and has to be enclosed with parenthesis in most (if not all) cases.
2. "Global" labels
There's a catch with labels and doevent. If you call a label (using doevent) and called label is in NPC that has trigger area, that label must end with "Global" to work globally (i.e. if RID is outside of the trigger area, which usually happens since otherwise there would be no point calling the label with doevent, because OnTouch would do the job). For further reference look for npc_event in npc.c.