diff --git a/Perl-EVENT_ITEM_CLICK.md b/Perl-EVENT_ITEM_CLICK.md index 61cf224..61dff16 100755 --- a/Perl-EVENT_ITEM_CLICK.md +++ b/Perl-EVENT_ITEM_CLICK.md @@ -1,4 +1,5 @@ -EVENT_ITEM_CLICK +EVENT_ITEM_CLICK is triggered when a client clicks an item with a click effect. This is a useful script to put in the Global quest scripts directory, so that you can make an item click work anywhere in the world. + ### Exports **Name**|**Type**|**Description** :-----|:-----|:----- @@ -16,4 +17,24 @@ sub EVENT_ITEM_CLICK { } ``` +### Triggered + +* Triggered when a client clicks on item with a click effect. + +### Examples + +* This example is taken from the Evil Eye Costume Kit, which is part of the Halloween Costume illusion items. +* Note that the `scriptfileid` field for the item is set to 30073 in the database. +* Note that a corresponding quest file exists at global/items/script_30073.pl. + +```perl +sub EVENT_ITEM_CLICK { + #::: Use == for numeric comparison to Item ID 54711 - Evil Eye Costume Kit + if ($itemid == 54711) { + #::: Change the player's race to 469 - Evil Eye + quest::playerrace(469); + } +} +``` + Generated On 2018-01-15T22:07:30-08:00 \ No newline at end of file