Disorder
02-17-2013, 04:38 AM
Greetings!
I'm having trouble with this quest. I cannot get check_handin to function as I see it in other peoples quests. First, here is my quest code...
##################################
# Ragged Jep NPCID: 1000
# Qeynos
# Blue Fish Meat Quest
# Ragged Jep's Rusty Fishing Hook Quest
# Ragged Jep's Bobber Quest
# Created 02/16/2013 by Disorder
##################################
$help = quest::saylink("help");
$fish = quest::saylink("Ol' Chomper");
$bobber = quest::saylink("Prized Fishing Bobber");
$food = quest::saylink("fish meat");
$more = quest::saylink("more");
sub EVENT_SPAWN
{
quest::set_proximity($x - 35, $x + 35, $y - 35, $y + 35);
}
sub EVENT_ENTER
{
if ($ulevel <=2)
{
$client->Message (315, "Ragged Jep whispers to you, 'Woah, good thing I decided to go fishing today! Come over and talk with me when you gather your bearings.'");
}
}
sub EVENT_SAY
{
if ($text=~/Hail/i)
{
plugin::Whisper("Hello, $name! I'm Jep, just a poor fisherman. I really thought I was going to be rich! I thought I caught $fish! Nope, thats not my luck today.
What were you doing floating out there anyway? Well, I'm the hero of the day. Hey, since you're already wet, how about giving me some $help?");
}
if($text=~/help/i)
{
plugin::Whisper("Oh thank you! I lost my $bobber to one of those darn fish. Do you think you could retrieve it for me? While you're looking for it, could you get me some $food?
Since I lost my Prized Fishing Bobber, I have not been able to catch fish like normal. I'm so hungry!");
}
elsif($text=~/Prized Fishing Bobber/i)
{
plugin::Whisper("Oh yes! I won it in a bet with Dolorn McHorn, the Harbor Manager. He's not been so busy since ships haven't been able to come to town. He's taken up drinking instead.
Lucky for me, he made a drunk bet, and lost. Now I can feed myself quite well... until I lost the bobber. Bring it back to me when you find it!");
}
elsif($text=~/fish meat/i)
{
plugin::Whisper("Yes, I'm so hungry! I really could go for some Blue Fin fish meat. Four pieces ought to do the trick for today.");
}
elsif($text=~/Ol' Chomper/i)
{
plugin::Whisper("WHERE?!?! Oh.. whew. Yeah. right. Sorry, I get a little jumpy. He's the reason I fish from the shore and not on my old rickety boat here. Some say Ol' Chomper is just
a story made up to scare kids. I've seen him! Everyone thinks I'm crazy. One time in my old boat, I was fishing in the deeper waters when out of nowhere
Ol' Chomper surfaced. About ate me and the boat whole! I was able to lodge my boat ore in his jaws, just in time to escape. Bah, who cares. No one believes me anyway.");
}
elsif($text=~/more/i)
{
plugin::Whisper("Oh, I'm glad you asked. I'm emberrased to say. One evening while I was on the docks south of here, Dolorn McHorn managed to sneak up behind me while I was gutting my fish.
The bastard pushed me into the water! I'm not a strong swimmer and my knife that I use to gut fish fell to the ocean floor. I can't swim that deep to get it.
Would you retrieve it for me?");
}
}
sub EVENT_ITEM
{
if ((plugin::check_handin(\%itemcount, 1373 => 4)))
{
plugin::Whisper("Thanks, $name! Perhaps you would be interested in helping me some $more?");
quest::exp("20000");
quest::ding();
}
elsif ((plugin::check_handin(\%itemcount, 1378 => 1)))
{
plugin::Whisper("Oh thank you so much, $name! I can't wait to show Dolorn McHorn's drunk arse that I got my bobber back. He was quite delighted to know I had lost it.");
quest::exp("45000");
quest::ding();
}
elsif ((plugin::check_handin(\%itemcount, 1377 =>1)))
{
if (($ulevel <= 5 && !defined $qglobals{jep_knife}))
{
quest::setglobal("jep_knife","1","4","M30");
quest::exp("20000");
quest::ding();
}
else
{
plugin::return_items(\%itemcount);
plugin::Whisper("Oh, $name, you already brought my knife back. Thank you though! You can have this one back.");
}
}
else
{
plugin::return_items(\%itemcount);
quest::Whisper("I don't want that. Here, take it back, $name.");
}
}
## END OF QUEST ##
Notice for example this:
elsif ((plugin::check_handin(\%itemcount, 1378 => 1)))
If i do not wrap this in so many parenthesis my quest stops functioning completely. Quests from the DB read like this:
elsif (plugin::check_handin(\%itemcount, 25832 => 3, 24934 => 1))
Not a huge deal, but I think I may be making a mistake some where else.
Also, I can not get this section of the code to work properly...
elsif ((plugin::check_handin(\%itemcount, 1377 =>1)))
{
if (($ulevel <= 5 && !defined $qglobals{jep_knife}))
{
quest::setglobal("jep_knife","1","4","M30");
quest::exp("20000");
quest::ding();
}
else
{
plugin::return_items(\%itemcount);
plugin::Whisper("Oh, $name, you already brought my knife back. Thank you though! You can have this one back.");
}
}
The npc will say the text nested in the else statement, but he will not return the item. He returns all other items from the following else statement in the parent if statement.
Any help would be appreciated. Don't mind my horrible quest writing creativity. Got to start somewhere :)
Have fun!
I'm having trouble with this quest. I cannot get check_handin to function as I see it in other peoples quests. First, here is my quest code...
##################################
# Ragged Jep NPCID: 1000
# Qeynos
# Blue Fish Meat Quest
# Ragged Jep's Rusty Fishing Hook Quest
# Ragged Jep's Bobber Quest
# Created 02/16/2013 by Disorder
##################################
$help = quest::saylink("help");
$fish = quest::saylink("Ol' Chomper");
$bobber = quest::saylink("Prized Fishing Bobber");
$food = quest::saylink("fish meat");
$more = quest::saylink("more");
sub EVENT_SPAWN
{
quest::set_proximity($x - 35, $x + 35, $y - 35, $y + 35);
}
sub EVENT_ENTER
{
if ($ulevel <=2)
{
$client->Message (315, "Ragged Jep whispers to you, 'Woah, good thing I decided to go fishing today! Come over and talk with me when you gather your bearings.'");
}
}
sub EVENT_SAY
{
if ($text=~/Hail/i)
{
plugin::Whisper("Hello, $name! I'm Jep, just a poor fisherman. I really thought I was going to be rich! I thought I caught $fish! Nope, thats not my luck today.
What were you doing floating out there anyway? Well, I'm the hero of the day. Hey, since you're already wet, how about giving me some $help?");
}
if($text=~/help/i)
{
plugin::Whisper("Oh thank you! I lost my $bobber to one of those darn fish. Do you think you could retrieve it for me? While you're looking for it, could you get me some $food?
Since I lost my Prized Fishing Bobber, I have not been able to catch fish like normal. I'm so hungry!");
}
elsif($text=~/Prized Fishing Bobber/i)
{
plugin::Whisper("Oh yes! I won it in a bet with Dolorn McHorn, the Harbor Manager. He's not been so busy since ships haven't been able to come to town. He's taken up drinking instead.
Lucky for me, he made a drunk bet, and lost. Now I can feed myself quite well... until I lost the bobber. Bring it back to me when you find it!");
}
elsif($text=~/fish meat/i)
{
plugin::Whisper("Yes, I'm so hungry! I really could go for some Blue Fin fish meat. Four pieces ought to do the trick for today.");
}
elsif($text=~/Ol' Chomper/i)
{
plugin::Whisper("WHERE?!?! Oh.. whew. Yeah. right. Sorry, I get a little jumpy. He's the reason I fish from the shore and not on my old rickety boat here. Some say Ol' Chomper is just
a story made up to scare kids. I've seen him! Everyone thinks I'm crazy. One time in my old boat, I was fishing in the deeper waters when out of nowhere
Ol' Chomper surfaced. About ate me and the boat whole! I was able to lodge my boat ore in his jaws, just in time to escape. Bah, who cares. No one believes me anyway.");
}
elsif($text=~/more/i)
{
plugin::Whisper("Oh, I'm glad you asked. I'm emberrased to say. One evening while I was on the docks south of here, Dolorn McHorn managed to sneak up behind me while I was gutting my fish.
The bastard pushed me into the water! I'm not a strong swimmer and my knife that I use to gut fish fell to the ocean floor. I can't swim that deep to get it.
Would you retrieve it for me?");
}
}
sub EVENT_ITEM
{
if ((plugin::check_handin(\%itemcount, 1373 => 4)))
{
plugin::Whisper("Thanks, $name! Perhaps you would be interested in helping me some $more?");
quest::exp("20000");
quest::ding();
}
elsif ((plugin::check_handin(\%itemcount, 1378 => 1)))
{
plugin::Whisper("Oh thank you so much, $name! I can't wait to show Dolorn McHorn's drunk arse that I got my bobber back. He was quite delighted to know I had lost it.");
quest::exp("45000");
quest::ding();
}
elsif ((plugin::check_handin(\%itemcount, 1377 =>1)))
{
if (($ulevel <= 5 && !defined $qglobals{jep_knife}))
{
quest::setglobal("jep_knife","1","4","M30");
quest::exp("20000");
quest::ding();
}
else
{
plugin::return_items(\%itemcount);
plugin::Whisper("Oh, $name, you already brought my knife back. Thank you though! You can have this one back.");
}
}
else
{
plugin::return_items(\%itemcount);
quest::Whisper("I don't want that. Here, take it back, $name.");
}
}
## END OF QUEST ##
Notice for example this:
elsif ((plugin::check_handin(\%itemcount, 1378 => 1)))
If i do not wrap this in so many parenthesis my quest stops functioning completely. Quests from the DB read like this:
elsif (plugin::check_handin(\%itemcount, 25832 => 3, 24934 => 1))
Not a huge deal, but I think I may be making a mistake some where else.
Also, I can not get this section of the code to work properly...
elsif ((plugin::check_handin(\%itemcount, 1377 =>1)))
{
if (($ulevel <= 5 && !defined $qglobals{jep_knife}))
{
quest::setglobal("jep_knife","1","4","M30");
quest::exp("20000");
quest::ding();
}
else
{
plugin::return_items(\%itemcount);
plugin::Whisper("Oh, $name, you already brought my knife back. Thank you though! You can have this one back.");
}
}
The npc will say the text nested in the else statement, but he will not return the item. He returns all other items from the following else statement in the parent if statement.
Any help would be appreciated. Don't mind my horrible quest writing creativity. Got to start somewhere :)
Have fun!