EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Help with a return item quest. (https://www.eqemulator.org/forums/showthread.php?t=41121)

cannon 01-24-2017 06:00 PM

Help with a return item quest.
 
hands in item 1
receives item 2

item 2 is LORE

tries to hand in item 1 while already having item 2 in inventory which is LORE

npc eats item and the you already have a LORE item message appears.

How would I go about having item 1 returned if the player already has the LORE item?

sub EVENT_SAY{
if($text=~/hail/i){
if(plugin::check_hasitem($client, item2)){
quest::say("You already have this item!");
}
if (plugin::check_handin(\%item1, ($item{$class}) => 1))
my %giveitem= (warrior"item2);
else {
plugin::return_items(\%item2);
# quest::say ("You already have a LORE item, $name.");
}
}
}

Looking for a way to check if the returned item is already present on the player and then issue back the item that was turned in.

ghanja 01-25-2017 12:10 AM

The above has syntax errors and doesn't look complete, sorta like you copy/pasted only what you felt was relevant. Which is ok mind you, however; the below may not do all you wanted it to do as a result:

Code:

sub EVENT_SPAWN {
        plugin::SetProx(20,20);
}

sub EVENT_ENTER {
        quest::say("How are you enjoying your ".quest::varlink(1111)."?") if plugin::check_hasitem($client, 1111);
}

sub EVENT_SAY {
        if($text=~/hail/i) {
                if (plugin::check_hasitem($client, 1111)) {
                        quest::say ("You already have a ".quest::varlink(1111)."!");
                } else {
                        quest::say ("Oh, hello $name, so have you come to claim your ".quest::varlink(1111)."?");
                }
        }
}

sub EVENT_ITEM {
        if (!plugin::check_hasitem($client, 1111) && plugin::check_handin(\%item1, 2222 => 1)) {
                quest::say ("Congratulations $name! Enjoy your ".quest::varlink(1111)."!");
                quest::summonitem(1111);
        } else {
                plugin::returnitems(\%itemcount);
        }
}


cannon 01-25-2017 07:41 PM

Thanks again for your help and time.


All times are GMT -4. The time now is 02:32 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.