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

10-05-2004, 07:15 PM
|
Fire Beetle
|
|
Join Date: Sep 2004
Location: FL
Posts: 19
|
|
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
|

10-05-2004, 11:26 PM
|
Fire Beetle
|
|
Join Date: May 2004
Posts: 14
|
|
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
|

10-06-2004, 12:14 AM
|
Fire Beetle
|
|
Join Date: Sep 2004
Location: FL
Posts: 19
|
|
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.
|

10-06-2004, 01:24 AM
|
Fire Beetle
|
|
Join Date: May 2004
Posts: 14
|
|
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
|

10-06-2004, 01:27 AM
|
Fire Beetle
|
|
Join Date: May 2004
Posts: 14
|
|
Caught this just now,
Code:
quest::spawnitem();
use:
Code:
quest::summonitem();
see if that works
The_Horrid
|

10-06-2004, 04:39 AM
|
Old-EQEmu Developer
|
|
Join Date: Oct 2002
Location: Spain
Posts: 323
|
|
why not just use $item1,$item2,etc...
|

10-06-2004, 04:45 AM
|
Fire Beetle
|
|
Join Date: Sep 2004
Location: FL
Posts: 19
|
|
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!");
}
}
|

10-06-2004, 07:26 AM
|
Hill Giant
|
|
Join Date: Dec 2003
Posts: 166
|
|
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");
}
|

10-06-2004, 10:44 AM
|
Fire Beetle
|
|
Join Date: Sep 2004
Location: FL
Posts: 19
|
|
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
|

10-07-2004, 01:41 AM
|
Hill Giant
|
|
Join Date: Dec 2003
Posts: 166
|
|
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.
|

12-16-2004, 06:42 PM
|
 |
Hill Giant
|
|
Join Date: Sep 2004
Posts: 100
|
|
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...
|
 |
|
 |

12-17-2004, 07:51 AM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
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.
|
 |
|
 |

12-17-2004, 08:12 AM
|
Discordant
|
|
Join Date: Feb 2003
Location: Wish I knew.
Posts: 251
|
|
So.... perl > sonys quest system! Stacking works ^_^
__________________
* KingMort has left #eqemu
<Richardo> KingDrama has left #EQEMU
<Richardo> the rule my pants!
|

11-05-2009, 05:50 PM
|
Sarnak
|
|
Join Date: Feb 2006
Posts: 60
|
|
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) && ($itemcount{2433} == 1) && ($itemcount{2434} ==1 ) && ($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);
}
}
|
|

11-05-2009, 06:35 PM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
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);
}
}
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 06:58 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |