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

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

10-15-2011, 03:08 PM
|
Sarnak
|
|
Join Date: Dec 2007
Posts: 60
|
|
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.
|
 |
|
 |

10-15-2011, 03:22 PM
|
Dragon
|
|
Join Date: Dec 2008
Location: Tennessee
Posts: 656
|
|
Oh shit i misread the item id's sorry. Everything is looking the same to me today. Your level check was right.
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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 07:50 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |