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 04-02-2008, 01:25 PM
Bulle
Hill Giant
 
Join Date: Jan 2008
Posts: 102
Default

The "handin" plug-in is a facility to check that a player gives the proper items, and consume them if it is the case. It should really be used as the last check in an "if" chain, as it performs a side-effect (removes the given items, they are given it is too late).

So you can probably avoid having the player "loose" the items by first checking for your max_level (and anything else), then when all conditions are fulfilled perform the hand-in. Basically you check that the PC fulfills the conditions for the hand-in, then you have the NPC accept the items. "accept-and-eat" would be a good description for the "handin".

Another solution you have is to re-summon the given items in case you use "handin" first (gulp the items are eaten, only use with troll NPCs). Add a summonitem instruction with the item ID and 4 occurences. The "return_items" plugin does just that.

Or if you want to make tests on the items given by the player before doing other tests (may be in some case you would like to), you can always return to the definition of the "handin" and use the "$itemcount" map, which associates given item IDs to the amount of items given. Remeber to check that an item has been given before checking its amount. You can even adjust the amount given as you want, in the same way "handin" works.
For example you could use (from a silly quest I have been writing) :
Code:
if(defined($itemcount{13078}) && $itemcount{13078} >= 4 # Summoned: Black Bread)
    {
      $itemcount{13078} = $itemcount{13078} - 4; # Summoned: Black Bread
      if($itemcount{13078} == 0)
      { delete $itemcount{13078}; }
      quest::say("Groumph ! It fuud, but not guud. Belux said me eat dat ? OK me eat. Me not want Glob froglok.");
I hope this clears out how "handin" works. In fact it is a quite small function, worth reading for sure.
Reply With Quote
  #2  
Old 04-02-2008, 01:39 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

I have a related question - how would you write a code for NPC to automaticly return anything given wihout checkign for specific item?

So far I only figured out how to do it by checking for item which does not even exist (id 1000), but there got to be way to do it simpler?

Code:
sub EVENT_ITEM
{
	if (plugin::check_handin(\%itemcount,1000=>1)) 
	{
	quest::say("imposible just happened");	
	}

	else 
	{
	plugin::return_items(\%itemcount);	
	}
}
Reply With Quote
  #3  
Old 04-02-2008, 01:51 PM
Bulle
Hill Giant
 
Join Date: Jan 2008
Posts: 102
Default

I do not know how other people do, but I use my little spoon.

OK silly reference to a joke about consultants, may be only known in France sorry

More to the point I simply do :
sub EVENT_ITEM
{
plugin::return_items(\%itemcount);
}

and it works. I saw in another thread it could be done as a default for all NPCs without quests (and may be it is in PEQ right now).
Reply With Quote
  #4  
Old 04-02-2008, 02:00 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

ah Thank you
Reply With Quote
  #5  
Old 06-09-2008, 03:04 PM
xxarthurxx
Hill Giant
 
Join Date: Jun 2006
Location: San Jo, Cali
Posts: 180
Default

i have tried every combination of the quest return items plugin and none of them will actually return any items, the npc just eats it every time.. what am i doing wrong?

samples ive tried:

sub EVENT_ITEM {
plugin::return_items(\%itemcount);
}

sub EVENT_ITEM {
plugin::return_items(\%itemcount);
return;
}

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

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


and the full quest:

sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 16905 => 1, 16857 => 1, 10035 => 1))
{
quest::emote("removes a item from his pocket.");
quest::say("This is yours. Care for it well!");
quest::summonitem(10051); #gemmed crown
}
else
{
plugin::return_items(\%itemcount);
}
}
Reply With Quote
  #6  
Old 06-09-2008, 05:06 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Make sure you have the return items plugin in your eqemu/plugin directory.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 06-09-2008, 09:06 PM
xxarthurxx
Hill Giant
 
Join Date: Jun 2006
Location: San Jo, Cali
Posts: 180
Default

ah didnt think about that, that has to be what im missing. is there any chance i could get the link for all plugins? i cant seem to find them on the eqemu site.
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:00 PM.


 

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