SimpleHookEvent: Difference between revisions
Jump to navigation
Jump to search
m (add category on SimpleHookEvent, which i forgot) |
No edit summary |
||
Line 1: | Line 1: | ||
{{Template:SimpleHookEvent}} | |||
: | [[Category:EventMacro_Automacros]] | ||
[[Category:EventMacro_Conditions_Event]] | [[Category:EventMacro_Conditions_Event]] |
Revision as of 10:10, 5 July 2019
- SimpleHookEvent
-
- Description: Is checked every time the hook you set, is triggered.
- Syntax:
SimpleHookEvent <hook name>
- Example:
SimpleHookEvent target_died
- Set all variables the hook have as:
$.SimpleHookEventLast <Capitalized variable name>
- Example 1:
Plugins::callHook("target_died", {monster => $monsters_old{$ID}}); SimpleHookEvent target_died $.SimpleHookEventLastMonster => monster ID in target_died hook
- Example 2:
Plugins::callHook ('open_shop', {title => $shop{title}, items => \@items}); SimpleHookEvent open_shop $.SimpleHookEventLastTitle @.SimpleHookEventLastItems $.SimpleHookEventLastItems[0]
- Example 3:
my %hook_args = ( serverIndex => $index, itemID => $itemID, ); Plugins::callHook('packet_useitem', \%hook_args); SimpleHookEvent packet_useitem %.SimpleHookEventLastHook_args $.SimpleHookEventLastHook_args{serverIndex}