EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Help with item turn in quest (https://www.eqemulator.org/forums/showthread.php?t=29998)

ChaosSlayerZ 11-17-2009 11:43 PM

Help with item turn in quest
 
I need help with a simple turn in.

In the script below you can give npc one out of many possible items, and then I want npc to give it right back to you.
If this would be just 1 item, it would be easy...
Suggestions?

Code:

sub EVENT_ITEM
{


        if(plugin::check_handin(\%itemcount, 1060 => 1) ||
        plugin::check_handin(\%itemcount, 1189 => 1) ||
        plugin::check_handin(\%itemcount, 1190 => 1) ||
        plugin::check_handin(\%itemcount, 1191 => 1) ||
        plugin::check_handin(\%itemcount, 1192 => 1) ||
        plugin::check_handin(\%itemcount, 1193 => 1)        )
        {
        quest::say("Yes I recognize this item");


        }


        else
        {
        plugin::return_items(\%itemcount);        }

}


joligario 11-18-2009 06:45 AM

In your if check, don't use the plugin and it won't eat the item.

Congdar 11-18-2009 10:17 AM

Remove the else block and just have the return_items line after the if block. It will return everything. Inside your if, you can do your special processing for the checked item id's.

ChaosSlayerZ 11-18-2009 11:22 AM

I got you! Thank you =)

ChaosSlayerZ 11-25-2009 06:04 PM

I got one more question - what If I want npc to report which item specifically was given to him? I do not want to make 100 IF statements, so is something like this possible:

Give item to npc > item id stored into $a > npc says "you gave me item id $a"

or close to that?

trevius 11-25-2009 06:40 PM

From the Quest Tutorial Wiki Page:

http://www.eqemulator.net/wiki/wikka...=QuestTutorial

Code:

$item1 - The item# in the first slot.
$item2 - The item# in the second slot.
$item3 - The item# in the third slot.
$item4 - The item# in the fourth slot.

Just use those variables for your script.

Congdar 11-25-2009 06:51 PM

I didn't test this, but maybe something like this?
Code:

sub EVENT_ITEM
{
        if($item1 > 0)
        {
                $itemName = quest::getItemName($item1);
                quest::say("Thank you for the $itemName");
        }
        if($item2 > 0)
        {
                $itemName = quest::getItemName($item2);
                quest::say("...and thank you for the $itemName");
        }
        if($item3 > 0)
        {
                $itemName = quest::getItemName($item3);
                quest::say("...and thank you for the $itemName");
        }
        if($item4 > 0)
        {
                $itemName = quest::getItemName($item4);
                quest::say("...and thank you for the $itemName");
        }
        if($platinum > 0)
        {
                quest::say("Thank you for the $platinum Platinum");
        }
        if($gold > 0)
        {
                quest::say("...and thank you for the $gold Gold");
        }
        if($silver > 0)
        {
                quest::say("...and thank you for the $silver Silver");
        }
        if($copper > 0)
        {
                quest::say("...and thank you for the $copper Copper");
        }
        quest::say("...but I'm not interested.");
        quest::emote("gives back your stuff");

        plugin::return_items(\%itemcount);
        if($platinum != 0 || $gold !=0 || $silver != 0 || $copper != 0)
        {
                quest::givecash($copper, $silver, $gold, $platinum);
        }
}


ChaosSlayerZ 11-25-2009 07:00 PM

AWESOME!! Thank you very much guys, you saved me a week of work! =)

one final question - for Item# corresponds to specific item slot- top to bottom? Let say players puts his 2 items into 1st and 3rd slot, will script read them as item1 and item3 or as 1 and 2?

trevius 11-25-2009 07:23 PM

Yeah, I am pretty sure it is top to bottom, so 1st and 3rd slot would be $item1 and $item3.


All times are GMT -4. The time now is 07:56 PM.

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