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-15-2011, 02:52 PM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 656
Default

I believe you are using else wrong for what you are trying to do. All but the first if should be elsif otherwise you would have to have the else statement after each if in order for the hand in to be returned properly.

Code:
sub EVENT_ITEM
{
#Hand in event AMBER & level check
if  ((plugin::check_handin(\%itemcount, 10022 => 1)) && ($ulevel>=8))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(315,316,317)); #r2
}
#Hand in event PERIDOT & level check

elsif  ((plugin::check_handin(\%itemcount, 10028 => 1)) && ($ulevel>=16))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(397,398,399,400)); #r3
}
#Hand in event fire opal & level check

elsif  ((plugin::check_handin(\%itemcount, 10031 => 1)) && ($ulevel>=23))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(396,396)); #r5
}
#Hand in event fire emerald & level check

elsif  ((plugin::check_handin(\%itemcount, 10033 => 1)) && ($ulevel>=30))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(570,571,572)); #r7
}
#Hand in event sapphire & level check

elsif  ((plugin::check_handin(\%itemcount, 10034 => 1)) && ($ulevel>=37))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(573,574,575,576)); #r8
}
#Hand in event ruby & level check

elsif  ((plugin::check_handin(\%itemcount, 10035 => 1)) && ($ulevel>=44))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(8184,8185)); #r9
}
#Hand in event diamond & level check

elsif ((plugin::check_handin(\%itemcount, 10037 => 1)) && ($ulevel>=51))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(628,629,630,631)); #r11
}
#Hand in event blue diamond & level check

elsif  ((plugin::check_handin(\%itemcount, 22503 => 1)) && ($ulevel>=55))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem. You have reached the most powerful companion I can summon.");
quest::selfcast(quest::ChooseRandom(632,633,634,635)); #r12
}

else {
quest::say("What Am I suppsoed to do with this...thing? This isn't what I need at all. Take it back!");
plugin::return_items(\%itemcount);
}

}
Also look at your level checks in sub EVENT_ITEM. If the character doing the hand in is above level 8 the first check will always be true which will likely cause it to stop right there.
Reply With Quote
  #2  
Old 10-15-2011, 03:08 PM
LordAdakos
Sarnak
 
Join Date: Dec 2007
Posts: 60
Default hmm

so do i need to put quantifiers on the level checks, such as:
Code:
if  ((plugin::check_handin(\%itemcount, xxxx => 1)) && ($ulevel>=8) && ($ulevel<16))
to check max level for the hand in?

what if i wanted someone to be able to hand in the current level gem or a lower level gem ?
Should I:
Code:
 
if plugin handin item = xxxx && level is > 55
do something for lvl 55+
elseif
if plugin handin item = xxxx && level is > 50
do something for lvl 50+
elseif
if plugin handin item = xxxx && level is > 55
do something for lvl 55+
elseif
if plugin handin item = xxxx && level is > 40
do something for lvl 40+
elseif
return the stuff
would that work?


Also, it shouldnt stop after the first check becuase " the item = 10022 "AND the "level is greater than 8", right? it has to BOTH be true with an AND statement. The level may be >8 but the item isnt true, so that would invalidate the AND statement.


Replacing the IF's with ELSEIF's makes the NPC eat the items in all cases.
Reply With Quote
  #3  
Old 10-15-2011, 03:22 PM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 656
Default

Oh shit i misread the item id's sorry. Everything is looking the same to me today. Your level check was right.
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 07:50 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