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 10-05-2004, 07:15 PM
srarcade
Fire Beetle
 
Join Date: Sep 2004
Location: FL
Posts: 19
Default Multiple Turn-Ins working?

Are multiple turn ins working in 5.9DR2 release? Here is what I'm trying to do:

Code:
sub EVENT_ITEM
{
 if ($itemcount{13006} == 1 && $itemcount{10503} == 1 && $itemcount{10300} == 1 && $itemcount{12038} == 1)
 {
        quest::say("Well what do we have here? Ah, one moment while I smith you up some of me finest armors.");
        quest::exp(250);
        quest::spawnitem(3053);
        quest::say("There ye go, a fancy banded helm for ya. Come back soon!");
 }
 else
 {
        quest::say("What'ya givin me gifts for? Well I'll take it anyway..thanks.");
 }
}
Thanks
Reply With Quote
  #2  
Old 10-05-2004, 11:26 PM
The_Horrid
Fire Beetle
 
Join Date: May 2004
Posts: 14
Default

Use

Code:
if (($itemcount{123456} == 1) && ($itemcount{78910} ==1)  && ($itemcount{23456} == 1))
etc.. enclose each $itemcount{} == X in it's own set of parenthesis, AND enclosed them all in one () as well...

And I am not too sure Else is part of Perl's else statements, may try 'elsif' instead, not sure though. GL.


The_Horrid
Reply With Quote
  #3  
Old 10-06-2004, 12:14 AM
srarcade
Fire Beetle
 
Join Date: Sep 2004
Location: FL
Posts: 19
Default

I've tried that too. Else works fine, if you hand him any item he'll give you the else stuff. If i shorten the script to require 1 item, it works fine too. If i require multiple items, he just eats them, but the script works because you can talk to him.
Reply With Quote
  #4  
Old 10-06-2004, 01:24 AM
The_Horrid
Fire Beetle
 
Join Date: May 2004
Posts: 14
Default

The Ifs (()) works.

Remove the Else parts, and check the turn-in then, if it works, then there is some syntax your not following with If/Else

The_Horrid
Reply With Quote
  #5  
Old 10-06-2004, 01:27 AM
The_Horrid
Fire Beetle
 
Join Date: May 2004
Posts: 14
Default

Caught this just now,

Code:
quest::spawnitem();
use:

Code:
quest::summonitem();
see if that works

The_Horrid
Reply With Quote
  #6  
Old 10-06-2004, 04:39 AM
cofruben
Old-EQEmu Developer
 
Join Date: Oct 2002
Location: Spain
Posts: 323
Default

why not just use $item1,$item2,etc...
Reply With Quote
  #7  
Old 10-06-2004, 04:45 AM
srarcade
Fire Beetle
 
Join Date: Sep 2004
Location: FL
Posts: 19
Default

Got it to work. Not sure why but the else makes it break. I tried it without the else before and it didnt work but I probably had a syntax error somewhere.

Working example of multiple item hand in:
Code:
sub EVENT_ITEM
{
 if(($itemcount{120003} == 1) && ($itemcount{10503} == 1) && ($itemcount{10300} ==1 ) && ($itemcount{12038} ==1))
 {
        quest::say("Well what do we have here? Ah, one moment while I smith you up some of me finest armors.");
        quest::exp(2500);
        quest::summonitem(3053);
        quest::say("There ye go, a fancy banded helm for ya. Come back soon!");
 }
}
Reply With Quote
  #8  
Old 10-06-2004, 07:26 AM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

If you minimize the code does it still break? I am not sure how the exp/spawnitem commands would affect the other block, but I am curious. Example:

Code:
if ($itemcount{a} == 1 &&
    $itemcount{b} == 1)
{
   quest::say("items handed in");
}
else
{
   quest::say("got different items");
}
Reply With Quote
  #9  
Old 10-06-2004, 10:44 AM
srarcade
Fire Beetle
 
Join Date: Sep 2004
Location: FL
Posts: 19
Default

You know thats what I thought too, so I wrote alot of quests that way. Then when I went to try them, none of them work. So I added the else in there as a test to see if just the multi line was the bad one, and sure enough, the npcs would react to the else statement. Now, even if you 'properly' code the multi line and include an else, it still breaks. So i ended up removing the else line of all my hand in quests for now. I would like to have it because it shows the player that they didnt just eat items but were handed the wrong thing.

Its kind of wierd the perl parser is that picky, i mean geeze. Thats like saying (1)+(1) != 1+1
Reply With Quote
  #10  
Old 10-07-2004, 01:41 AM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

It's more likely that there is some sort of bug in the implementation. Would you be able to create a script that calls multiple functions, but makes them the same function? For instance, on turn-in use four separate quest::say calls, with varying input, then try quest::summonitem:

Code:
if ($itemcount{a} == 1)
{
   quest::say("if test");
   quest::say("if test");
   quest::say("if test");
   quest::say("if test");
}
else
{
   quest::say("else test");
}
There was/is a bug that causes one function call to interfere with another in some situations. It doesn't look like my fix for this was ever commited. I don't see how that problem would affect this, but you might want to give it a try and see what happens. Here is the thread with instruction. I think it should still work with the latest release: http://www.eqemulator.net/forums/viewtopic.php?t=13906.
Reply With Quote
  #11  
Old 12-16-2004, 06:42 PM
mystic414's Avatar
mystic414
Hill Giant
 
Join Date: Sep 2004
Posts: 100
Default

Sorry to post to a 2-month-old thread, but I just realized this, and thought it might be helpful for others to know:

Quote:
Originally Posted by cofruben
why not just use $item1,$item2,etc...
If you use the ($item1==x) && ($item2==x) syntax like you suggest, then the player has to hand the items in to the NPC in that exact order.

If you use the ($itemcount{x} == 1) && ($itemcount{x} == 1) syntax, it doesn't matter what order the items are handed in.

Basically, using $itemcount is more player-friendly. The only time I can think of to use $item1, etc would be if you were designing some evil quest where you wanted to penalize the player for not handing in the items in the specified order...
Reply With Quote
  #12  
Old 12-17-2004, 07:51 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by mystic414
Sorry to post to a 2-month-old thread, but I just realized this, and thought it might be helpful for others to know:

Quote:
Originally Posted by cofruben
why not just use $item1,$item2,etc...
If you use the ($item1==x) && ($item2==x) syntax like you suggest, then the player has to hand the items in to the NPC in that exact order.

If you use the ($itemcount{x} == 1) && ($itemcount{x} == 1) syntax, it doesn't matter what order the items are handed in.

Basically, using $itemcount is more player-friendly. The only time I can think of to use $item1, etc would be if you were designing some evil quest where you wanted to penalize the player for not handing in the items in the specified order...
Also, if you use itemcount{} you can stack items and it will recognize it. So you arent restricted to collections of 4 items.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #13  
Old 12-17-2004, 08:12 AM
Scorpx725
Discordant
 
Join Date: Feb 2003
Location: Wish I knew.
Posts: 251
Default

So.... perl > sonys quest system! Stacking works ^_^
__________________
* KingMort has left #eqemu
<Richardo> KingDrama has left #EQEMU
<Richardo> the rule my pants!
Reply With Quote
  #14  
Old 11-05-2009, 05:50 PM
typenamehere
Sarnak
 
Join Date: Feb 2006
Posts: 59
Default

hm for some reason my npc is just eating my items, was wondering if anyone could spot my error
Quote:
sub EVENT_SAY
{


if ($text =~/Hail/i){
quest::say ("Give me all four of their heads, and I shall reward you."); }
}

sub EVENT_ITEM
{
if(($itemcount{2432} == 1) &amp;&amp; ($itemcount{2433} == 1) &amp;&amp; ($itemcount{2434} ==1 ) &amp;&amp; ($itemcount{2435} ==1))
{
quest::say("Well what do we have here? A job well done indeed!");
quest::spawn2(1247,0,0,$x-20,$y+1,$z,$h);
}
}
Reply With Quote
  #15  
Old 11-05-2009, 06:35 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

for turn in, try this instead

Code:
sub EVENT_ITEM
{
	if (plugin::check_handin(\%itemcount, 2432=>1, 2433=>1, 2434=>1, 2435=>1)) 
	{
quest::say("Well what do we have here? A job well done indeed!");
quest::spawn2(1247,0,0,$x-20,$y+1,$z,$h);

	}


	else 
	{
	plugin::return_items(\%itemcount);	
	}
}
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 12:22 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3