Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2009, 11:43 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default 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);	}

}
Reply With Quote
  #2  
Old 11-18-2009, 06:45 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

In your if check, don't use the plugin and it won't eat the item.
Reply With Quote
  #3  
Old 11-18-2009, 10:17 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

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.
Reply With Quote
  #4  
Old 11-18-2009, 11:22 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

I got you! Thank you =)
Reply With Quote
  #5  
Old 11-25-2009, 06:04 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

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?
Reply With Quote
  #6  
Old 11-25-2009, 06:40 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

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.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 11-25-2009, 06:51 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

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);
	}
}
Reply With Quote
  #8  
Old 11-25-2009, 07:00 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

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?
Reply With Quote
  #9  
Old 11-25-2009, 07:23 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, I am pretty sure it is top to bottom, so 1st and 3rd slot would be $item1 and $item3.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:30 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3