From 1a6a634bec3b1762351cf8d08973bb2a6681b6d5 Mon Sep 17 00:00:00 2001 From: TurmoilToad Date: Mon, 2 Jul 2018 19:38:52 -0400 Subject: [PATCH] Updated Perl API Perl Sub Event Examples (markdown) --- Perl-API---Perl-Sub-Event-Examples.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Perl-API---Perl-Sub-Event-Examples.md b/Perl-API---Perl-Sub-Event-Examples.md index ddbe50a..de336d3 100644 --- a/Perl-API---Perl-Sub-Event-Examples.md +++ b/Perl-API---Perl-Sub-Event-Examples.md @@ -254,7 +254,28 @@ sub EVENT_COMBAT { ### Trigger -- when a combine is unsuccessful. +- When a combine is unsuccessful. You would likely use this event in your global / player.pl file. + +### Exports + +| Name | Type | Description +| --- | --- | --- | +|recipe_id | int | quest::say($recipe_id); # returns int +|recipe_name | int | quest::say($recipe_name); # returns int + +### Example + +- In this example, we watch for a player failing the combine for a Hand Made Backpack and then tease them. + +```perl +sub EVENT_COMBINE_FAILURE { + #:: Match Recipe 2686: "Hand Made Backpack" by ID + if ($recipe_id == 2686) { + #:: Send the client a message in color 15 (yellow) + $client->Message(15,"Awww...now where are you going to put all of your stuff?"); + } +} +``` # EVENT_COMBINE_SUCCESS