Forgotten1
01-28-2010, 08:03 PM
I'm trying to build a quest template i'll use for a weapon NPC. The part I can't get to work is the class checks on the items. It seems like he's not doing them at all. I removed warrior as a class, then tried a turn in after reloading quests and he still gave me all of the items. This is a problem since the actual items he gives will be class specific!
I've been trying to figure out what I have wrong for 2 hours now, but alas I'm still stuck. Any help would be appreciated..I'm new to this.
sub EVENT_SAY
{
my $locate = quest::saylink("What do you need me to find?", 0, "locate");
if($text=~/hail/i && $qglobals{startweap} == 0)
{
quest::say("Hrm, Zilgru sent another one of ya to me huh? Alright, here's yer weapon. It was clean, lucky for you. Speak to me again and maybe we can work on getting you something with a little more bang...");
quest::setglobal("startweap","1","0","F");
quest::summonitem("1079");
quest::summonitem("1096");
}
if ($text=~/hail/i && $qglobals{startweap} == 1)
{
quest::say("What's that? Ah right, I said I would help you make a better weapon. Well you see, I may be a Master Weaponsmith, but that does not mean I can make a weapon out of this carpet under my feet! You will need to [$locate] certain items for me.");
}
if ($text=~/find/i && $qglobals{startweap} == 1)
{
quest::setglobal("startweap","2","0","F");
quest::say("Well let me think will ya? You can't gather the right stuff to make anything too powerful yet, no no yer much too young to be able to gather those materials. Ahah, yes that's the one! Okay, $name, in order to create your weapon I will need two Forgotten Rat Tails and Fang of a Forgotten Snake. Bring me those items, and I shall create yer first true weapon.");
}
if ($text=~/hail/i && $qglobals{startweap} == 2)
{
quest::say("What are ye waitin' for? Go gather those items! Bring me those two Forgotten Rat Tails and that Fang of a Forgotten Snake. That slithering bugger, he's a tough one to catch..");
}
}
sub EVENT_ITEM
{
if(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Ranger, Beastlord"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Monk"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Warrior, Bard, Ranger"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Cleric, Druid, Shaman"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Necromancer, Wizard, Magician, Enchanter"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Berserker, Shadowknight, Paladin"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
else {
quest::say("Sorry, your class does not get an epic on this server.");
quest::summonitem(1387);
}
}
else {
quest::say("I do not need this.");
plugin::return_items(\%itemcount);
}
}
Thanks.
I've been trying to figure out what I have wrong for 2 hours now, but alas I'm still stuck. Any help would be appreciated..I'm new to this.
sub EVENT_SAY
{
my $locate = quest::saylink("What do you need me to find?", 0, "locate");
if($text=~/hail/i && $qglobals{startweap} == 0)
{
quest::say("Hrm, Zilgru sent another one of ya to me huh? Alright, here's yer weapon. It was clean, lucky for you. Speak to me again and maybe we can work on getting you something with a little more bang...");
quest::setglobal("startweap","1","0","F");
quest::summonitem("1079");
quest::summonitem("1096");
}
if ($text=~/hail/i && $qglobals{startweap} == 1)
{
quest::say("What's that? Ah right, I said I would help you make a better weapon. Well you see, I may be a Master Weaponsmith, but that does not mean I can make a weapon out of this carpet under my feet! You will need to [$locate] certain items for me.");
}
if ($text=~/find/i && $qglobals{startweap} == 1)
{
quest::setglobal("startweap","2","0","F");
quest::say("Well let me think will ya? You can't gather the right stuff to make anything too powerful yet, no no yer much too young to be able to gather those materials. Ahah, yes that's the one! Okay, $name, in order to create your weapon I will need two Forgotten Rat Tails and Fang of a Forgotten Snake. Bring me those items, and I shall create yer first true weapon.");
}
if ($text=~/hail/i && $qglobals{startweap} == 2)
{
quest::say("What are ye waitin' for? Go gather those items! Bring me those two Forgotten Rat Tails and that Fang of a Forgotten Snake. That slithering bugger, he's a tough one to catch..");
}
}
sub EVENT_ITEM
{
if(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Ranger, Beastlord"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Monk"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Warrior, Bard, Ranger"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Cleric, Druid, Shaman"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Necromancer, Wizard, Magician, Enchanter"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
elsif(($itemcount{1333} == 2) && ($itemcount{1340} == 1) && ($qglobals{startweap} == 2) && ($class == "Berserker, Shadowknight, Paladin"))
{
quest::say("Not bad, maybe you're not as feable as I thought you were. Next time I will have a task that's much more challenging..");
quest::summonitem("1192");
quest::summonitem("25716");
quest::summonitem("25719");
quest::summonitem("25723");
quest::summonitem("1266");
quest::summonitem("1267");
quest::summonitem("1270");
}
else {
quest::say("Sorry, your class does not get an epic on this server.");
quest::summonitem(1387);
}
}
else {
quest::say("I do not need this.");
plugin::return_items(\%itemcount);
}
}
Thanks.