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-08-2011, 05:32 PM
Rhodan
Hill Giant
 
Join Date: Oct 2006
Posts: 179
Default Why this doesn't work

From the Lief Faladim NPC in Kithicor. THere are three hand ins and two work. The one that requires money doesn't and I don't see anything wrong (comparing to other quests).

Perhaps the $gold doesn't work properly? I summoned the exact items specified and handed in 2000 gold pieces at the same time. I get back the items but not the gold.

Code:
sub EVENT_ITEM {
    if(plugin::check_handin(\%itemcount, 12321 => 1, 12320 => 1)) {
	quest::summonitem(3190);
    } 
    if (plugin::check_handin(\%itemcount, 12305 => 1, 12306 => 1, $gold >= 2000)) {
    quest::say("Here are your boots.");
      quest::summonitem(3192);
    }
    if (plugin::check_handin(\%itemcount, 10059 => 1, 12328 => 1)) {
      quest::say("Here are your leggings.");
      quest::summonitem(3191);
    }
    else {
	plugin::return_items(\%itemcount);
	return 1;
    }
Reply With Quote
  #2  
Old 11-08-2011, 08:16 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

I can't answer your gold question, but your script has the same problem that many others do. If you're checking for a series of items with the intent to return anything not used at the end you must use if/elsif/else, otherwise the last else only applies to the last if.
Reply With Quote
  #3  
Old 11-08-2011, 08:22 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I didn't test this, but it should work:

Code:
sub EVENT_ITEM {

	if(plugin::check_handin(\%itemcount, 12321 => 1, 12320 => 1))
	{
		quest::summonitem(3190);
	}

	if ($gold >= 2000 && plugin::check_handin(\%itemcount, 12305 => 1, 12306 => 1))
	{
		quest::say("Here are your boots.");
		quest::summonitem(3192);

	}
	else
	{
		if($gold)
		{
			$client->AddMoneyToPP(0, 0, $gold, 0, 1);
			quest::say("That is not the required amount!");
			$gold = undef;
		}
	}

	if (plugin::check_handin(\%itemcount, 10059 => 1, 12328 => 1))
	{
		quest::say("Here are your leggings.");
		quest::summonitem(3191);
	}

	plugin::return_items(\%itemcount);

}
Your main issue is that $gold >= 2000 can not be passed into the check_handin plugin.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 11-08-2011, 08:28 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by lerxst2112 View Post
I can't answer your gold question, but your script has the same problem that many others do. If you're checking for a series of items with the intent to return anything not used at the end you must use if/elsif/else, otherwise the last else only applies to the last if.
I think most people misunderstand how to us the return_items plugin properly. Of course, it works in most cases as an else to the last if for most scenarios. The way I use it is out in the open at the end of the EVENT_ITEM sub (as shown in the example in my last post). Based on how the check_handin and return_items plugins work, you will only be returned items that weren't used by the check_handin plugin. So, leaving it out in the open at the end of the sub just makes sure any left over items will get returned.

One case where adding it as an else to the last if won't work is if someone turns in the needed item(s) for the last turn in, but also turns in an extra item. They will get the reward, but will not get their extra item back.

The main case in which you might need an if/elsif/else, is if you also want to give a return items say message if the turn in was incorrect.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 11-09-2011 at 12:35 AM..
Reply With Quote
  #5  
Old 11-09-2011, 08:56 PM
Rhodan
Hill Giant
 
Join Date: Oct 2006
Posts: 179
Default

I think I see. The original quest script has the $gold as an input to the plugin

if (plugin::check_handin(\%itemcount, 12305 => 1, 12306 => 1, $gold >= 2000)) {

And the plugin doesn't understand it so it returns false and hands back the items it understood without completing the transaction. The modified script by Trevius has the $gold conditional outside the plugin inputs so it's evaluated correctly. I'll make the changes and test it out.

Thanks muchly! I'll report any others in the quest bugs area. Seems not too many people are playing rangers, or perhaps just not doing class quests in the lower levels so these go unreported.
Reply With Quote
  #6  
Old 11-11-2011, 08:57 AM
Rhodan
Hill Giant
 
Join Date: Oct 2006
Posts: 179
Default

I can't seem to find a description for AddMoneyToPP() anywhere. Its not in the wiki or in the pearl lexicon that I could find. Is there anywhere it's described?
Reply With Quote
  #7  
Old 11-11-2011, 05:28 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

http://www.eqemulator.net/wiki/wikka...uestCheatSheet
Reply With Quote
  #8  
Old 11-11-2011, 05:52 PM
Rhodan
Hill Giant
 
Join Date: Oct 2006
Posts: 179
Default

Awesome thanks! Lots to look at and experiment with.
Reply With Quote
  #9  
Old 11-12-2011, 07:04 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

That particular command is a Quest Object, which are on this page:

http://www.eqemulator.net/wiki/wikka...a=QuestObjects
__________________
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 11:47 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3