PDA

View Full Version : Turn in 3 items for a class-specific weapon


Randymarsh9
02-01-2009, 08:23 PM
Can anyone tell me what is wrong with this? It all works up until the turn in where he will eat the items and give no reward.

#Gives an archtype specific item after killing Grummus, Gyrme, Aramin

sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("There is nothing to be joyous about when speaking in a [land] such as this.");
}
if($text=~/land/i){
quest::emote("sighs deeply");
quest::say("This land, Plane of Disease, is a most sickening place. I wish nothing more than to have it annihilated. It's very existence makes me disgusted. Perhaps, you and some other adventurers will be able to [purify] this land forever.");
}
if($text=~/purify/i){
quest::say("There are three foul [beings] that reside here. I am certain that with them dead, no more filth will be able to survive here.");
}
if($text=~/beings/i){
quest::say("For the sake of Norrath, destroy Gryme the Crypt Guardian, Aramin the Spider Guardian, and finally kill Grummus. Bring to me an item that will prove they are dead.");
}
}

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 51624 => 1, 1563 => 1, 1568 => 1)){
quest::say("My mind can be at ease knowing those fiends are no more.");
quest::emote("pulls a gleaming weapon out of s bag.");
quest::say("Take this weapon. I am sure you will be able to make use of it.");
if($class eq 'Warrior'){quest::summonitem(1569);}
elsif($class eq 'Cleric'){quest::summonitem(1582);}
elsif($class eq 'Paladin'){quest::summonitem(1577);}
elsif($class eq 'Ranger'){quest::summonitem(1569);}
elsif($class eq 'Shadowknight'){quest::summonitem(1577);}
elsif($class eq 'Druid'){quest::summonitem(1582);}
elsif($class eq 'Monk'){quest::summonitem(1579);}
elsif($class eq 'Bard'){quest::summonitem(1569);}
elsif($class eq 'Rogue'){quest::summonitem(1581);}
elsif($class eq 'Shaman'){quest::summonitem(1582);}
elsif($class eq 'Necromancer'){quest::summonitem(1581);}
elsif($class eq 'Wizard'){quest::summonitem(1581);}
elsif($class eq 'Magician'){quest::summonitem(1581);}
elsif($class eq 'Enchanter'){quest::summonitem(1581);}
elsif($class eq 'Beastlord'){quest::summonitem(1579);}
elsif($class eq 'Berserker'){quest::summonitem(1577);}
}
}

joligario
02-01-2009, 11:16 PM
Not sure if it really makes a difference since it is a string...

Have you tried "Warrior" instead of 'Warrior' (etc, etc)

Randymarsh9
02-02-2009, 12:09 AM
Yeah I did quotes instead, but it made no difference

AndMetal
02-02-2009, 03:01 AM
I think you may be missing a few semicolons at the end:

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 51624 => 1, 1563 => 1, 1568 => 1)) {
quest::say("My mind can be at ease knowing those fiends are no more.");
quest::emote("pulls a gleaming weapon out of s bag.");
quest::say("Take this weapon. I am sure you will be able to make use of it.");
if($class eq 'Warrior') {quest::summonitem(1569);}
elsif($class eq 'Cleric') {quest::summonitem(1582);}
elsif($class eq 'Paladin') {quest::summonitem(1577);}
elsif($class eq 'Ranger') {quest::summonitem(1569);}
elsif($class eq 'Shadowknight') {quest::summonitem(1577);}
elsif($class eq 'Druid') {quest::summonitem(1582);}
elsif($class eq 'Monk') {quest::summonitem(1579);}
elsif($class eq 'Bard') {quest::summonitem(1569);}
elsif($class eq 'Rogue') {quest::summonitem(1581);}
elsif($class eq 'Shaman') {quest::summonitem(1582);}
elsif($class eq 'Necromancer') {quest::summonitem(1581);}
elsif($class eq 'Wizard') {quest::summonitem(1581);}
elsif($class eq 'Magician') {quest::summonitem(1581);}
elsif($class eq 'Enchanter') {quest::summonitem(1581);}
elsif($class eq 'Beastlord') {quest::summonitem(1579);}
elsif($class eq 'Berserker') {quest::summonitem(1577);};
};
}

On a side note, I would recommend using a switch/case (or possibly an array) instead of a string of if/elsif statements:


sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 51624 => 1, 1563 => 1, 1568 => 1)) {
quest::say("My mind can be at ease knowing those fiends are no more.");
quest::emote("pulls a gleaming weapon out of s bag.");
quest::say("Take this weapon. I am sure you will be able to make use of it.");
my $reward = 1001; #Cloth Cap is the booby prize if you're none of these classes
switch ($class) {
case "Warrior" {$reward = 1569;}
case "Cleric" {$reward = 1582;}
case "Paladin" {$reward = 1577;}
case "Ranger" {$reward = 1569;}
case "Shadowknight" {$reward = 1577;}
case "Druid" {$reward = 1582;}
case "Monk" {$reward = 1579;}
case "Bard" {$reward = 1569;}
case "Rogue" {$reward = 1581;}
case "Shaman" {$reward = 1582;}
case "Necromancer" {$reward = 1581;}
case "Wizard" {$reward = 1581;}
case "Magician" {$reward = 1581;}
case "Enchanter" {$reward = 1581;}
case "Beastlord" {$reward = 1579;}
case "Berserker" {$reward = 1577;}
};
quest::summonitem($reward);
};
}

Randymarsh9
02-02-2009, 08:02 AM
I added the semicolons after those, but the quest still didn't work. Then I changed it to the format you suggested, but it still did the same thing. He just will not hand out a reward. This is how it looks now.


#Gives an archtype specific item after killing Grummus, Gyrme, Aramin

sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("There is nothing to be joyous about when speaking in a [land] such as this.");
}
if($text=~/land/i){
quest::emote("sighs deeply");
quest::say("This land, Plane of Disease, is a most sickening place. I wish nothing more than to have it annihilated. It's very existence makes me disgusted. Perhaps, you and some other adventurers will be able to [purify] this land forever.");
}
if($text=~/purify/i){
quest::say("There are three foul [beings] that reside here. I am certain that with them dead, no more filth will be able to survive here.");
}
if($text=~/beings/i){
quest::say("For the sake of Norrath, destroy Gryme the Crypt Guardian, Aramin the Spider Guardian, and finally kill Grummus. Bring to me an item that will prove they are dead.");
}
}

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 51624 => 1, 1563 => 1, 1568 => 1)){
quest::say("My mind can be at ease knowing those fiends are no more.");
quest::emote("pulls a gleaming weapon out of a bag.");
quest::say("Take this weapon. I am sure you will be able to make use of it.");
my $reward = 1001; #Cloth Cap Is the booby prize if you're none of these classes
switch ($class) {
case "Warrior" {$reward = 1569;}
case "Cleric" {$reward = 1582;}
case "Paladin" {$reward = 1577;}
case "Ranger" {$reward = 1569;}
case "Shadowknight" {$reward = 1577;}
case "Druid" {$reward = 1582;}
case "Monk" {$reward = 1579;}
case "Bard" {$reward = 1569;}
case "Rogue" {$reward = 1581;}
case "Shaman" {$reward = 1582;}
case "Necromancer" {$reward = 1581;}
case "Wizard" {$reward = 1581;}
case "Magician" {$reward = 1581;}
case "Enchanter" {$reward = 1581;}
case "Beastlord" {$reward = 1579;}
case "Berserker" {$reward = 1577;}
};
quest::summonitem($reward);
};
}

joligario
02-02-2009, 08:56 AM
Yeah, I've never had to use those semicolons before either.

Question: Does he give you the text and just no item or does he not even give you the text/emotes?

EDIT: Looks like the last 2 items are not in the lucy database. Are they in your custom database?

trevius
02-02-2009, 04:56 PM
I have a couple simple class armor set quests posted in the custom section that should work for what you want to do. Here is one:

http://www.eqemulator.net/forums/showthread.php?t=24921

It is actually written a bit crudely as it was one of my very early quest scripts, but it does work. I am sure I could write it much cleaner and more compact now, but I just haven't had the time to do it and no need to fix what isn't broken :P The best way would be using arrays. I have some scripts posted in the custom section that use arrays as well, so they might be useful for reference (which is why I posted them in the first place).

ChaosSlayer
02-03-2009, 01:55 PM
I hardly see anything "crude" there Trev =P
Its a simple and well writen out quest code =)

For the purpose of this thread this is the only part truly needed:



sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 1319 => 1)) {
my %rewards = (
"Warrior" => 4917, "Rogue" => 4907, "Monk" => 1206, "Berserker" => 55607, "Shadowknight" => 9829, "Paladin" => 9829, "Ranger" => 9829, "Bard" => 9829, "Beastlord" => 9829, "Cleric" => 9829, "Druid" => 9829, "Shaman" => 9829, "Wizard" => 9829, "Mage" => 9829, "Enchanter" => 9829, "Necromancer" => 9829
);

if(defined($rewards{$class})) {
quest::summonitem($rewards{$class});
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
}
}

Andrew80k
02-03-2009, 02:14 PM
Just for completions sake I'll ask the easy question, you do have the plugins, yes?

And for any hand in quest you should also use the return_items plugin for returning wrong items.

Randymarsh9
02-03-2009, 03:11 PM
This is now what my item part looks like. It still isn't working. The items needed are all the correct items, and I checked my plugins folder and it has the check_handin, guildmasters, check_hasitem, and soulbinders.

sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 51624 => 1, 1563=> 1, 1568=> 1)) {
my %rewards = (
"Warrior" => 1569, "Rogue" => 1581, "Monk" => 1579, "Berserker" => 1577, "Shadowknight" => 1577, "Paladin" => 1577, "Ranger" => 1569, "Bard" => 1569, "Beastlord" => 1579, "Cleric" => 1582, "Druid" => 1582, "Shaman" => 1582, "Wizard" => 1581, "Mage" => 1581, "Enchanter" => 1581, "Necromancer" => 1581
);

if(defined($rewards{$class})) {
quest::say("My mind can be at ease knowing those fiends are no more.");
quest::emote("pulls a gleaming weapon out of a bag.");
quest::summonitem($rewards{$class});
quest::say("Take this weapon. I am sure you will be able to make use of it.");
}
}
}

ChaosSlayer
02-03-2009, 03:26 PM
does any other quest with items hand in works?

Randymarsh9
02-03-2009, 03:28 PM
Yeah all my other quests work. This is the only one I have done with multiple items and rewards though, but I don't think that really makes a difference.

Randymarsh9
02-03-2009, 03:59 PM
The items names that I am turning in have an asterisk in them. Do you think that could be throwing the whole thing off?

Andrew80k
02-03-2009, 04:02 PM
The items names that I am turning in have an asterisk in them. Do you think that could be throwing the whole thing off?
No it doesn't look at the name. The plugin is pretty simple. Which plugins folder are you using? There are a couple. But since you said other handin quests were working I assume you have them in the right spot. Try running the quest from the command line, ie perl <questname> and see if that gives you anything. You can also look in the logs to see if you get any errors.

Randymarsh9
02-03-2009, 04:48 PM
where do I run it from? will I need to Cd into another directory

Randymarsh9
02-03-2009, 05:48 PM
Ok, I added the return item thing to see if he would return items, but he doesn't even do that.

sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 51624 => 1, 1563=> 1, 1568=> 1)) {
my %rewards = (
"Warrior" => 1569, "Rogue" => 1581, "Monk" => 1579, "Berserker" => 1577, "Shadowknight" => 1577, "Paladin" => 1577, "Ranger" => 1569, "Bard" => 1569, "Beastlord" => 1579, "Cleric" => 1582, "Druid" => 1582, "Shaman" => 1582, "Wizard" => 1581, "Mage" => 1581, "Enchanter" => 1581, "Necromancer" => 1581
);

if(defined($rewards{$class})) {
quest::say("My mind can be at ease knowing those fiends are no more.");
quest::emote("pulls a gleaming weapon out of a bag.");
quest::summonitem($rewards{$class});
quest::say("Take this weapon. I am sure you will be able to make use of it.");
}
}
else {
plugin::return_items(\%itemcount);
quest::say("I have no use for this item, $name. Take it back.");
}

}

Andrew80k
02-03-2009, 06:13 PM
Did you try running it on the command line to see what you got back?

Randymarsh9
02-03-2009, 06:35 PM
I don't know where I need to type it in. I did perl Vinius_the_Benevolent in cmd.exe and it said it couldn't find it, but I also ran it for another quest which I know works and said the same thing, so I know i need to change directory, but I don't know to what.

trevius
02-03-2009, 06:51 PM
Your quest file should be located in your C:\eqemu\quests\zonename folder, where zonename is the name of the zone your NPC is located in.

Also, there is a plugin folder in the C:\eqemu\quests\ directory that has the plugin files, but those files need to be moved directly to your C:\eqemu\plugins folder. Some older quests don't use the plugins, so maybe that is why you see others as working even if your plugins might not be in the correct place still.

Randymarsh9
02-03-2009, 07:10 PM
I already did that when I set up my server

Randymarsh9
02-03-2009, 07:31 PM
wow, lol. I had the plugins folder inside another plugins folder. I just moved them out and it worked. I don't know how all of my problems are always something so stupid

trevius
02-03-2009, 07:32 PM
The best solution to testing what the problem is, is to simplify the quest as much as possible and then add in stuff one by one and test it after each time you update it until you have it completed the way you want to. So, try just running this script and see what happens:

sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 1568 => 1)) {
quest::say("I got your turn in. Here is your reward.");
quest::summonitem(1001);
}

}

If that works, then your script itself is just written wrong. If that doesn't work, then you have an issue with plugins or perl.

trevius
02-03-2009, 07:33 PM
wow, lol. I had the plugins folder inside another plugins folder. I just moved them out and it worked. I don't know how all of my problems are always something so stupid


It is always best to double and then triple check stuff like that!

Randymarsh9
02-03-2009, 07:38 PM
Thanks for all the help. I learned A LOT more about questing. Maybe in a couple more threads I will actually not be completely talentless.