Log in

View Full Version : Different Classes Get Different Messages


merb
07-19-2009, 10:08 PM
I'm working on a quest right now that all classes can do. However, after turning in the final item to the quest giver, if you are a Shadowknight, he:

1) Gives you the item back
2) Gives you experience
3) Tells you to find another NPC

BUT, if you are any other class, he:

1) Says some stuff
2) Gives you experience

Then, the next NPC that you are sent to if you are a sk, if you hand him the item as a sk, he:

1) Gives the item back
2) Says some text to begin another quest

Any other class just gets text. For the first quest mob, here's what I've got for the turn-in:

if (($itemcount{8911} == 1)&&($uclass = 5)) {
quest::say("Very good, but maybe you should keep this. I believe you will have more use for it than I. Maybe Dsarrik can help you.");
quest::exp(10000);
quest::summonitem("8911");
}
elsif ($itemcount{8911} == 1) {
quest::say("Well now look at that! I believe you, $name, have done a great deed this day!");
quest::exp(10000);
}
}

I know on the "elsif" line, I should probably change it to something like:

elsif (($itemcount{8911} == 1)&&($uclass = <class #'s>))

However, I inserted all class numbers in the "$uclass =" line except 5, and any other class still returns the line as if you WERE a shadowknight.

So basically, for either npc, how would I get them to respond differently to a Shadowknight than any other class?

Sion
07-19-2009, 10:45 PM
The variable for the player's class is actually $class rather than $uclass. $class stores the name of the player's class as a string,
so if you wanted to check if the player was a shadowknight in your example, the first line would be:

if (($itemcount{8911} == 1) && $class eq "Shadowknight")

merb
07-20-2009, 07:29 PM
I changed the line to look like this:

if (($itemcount{8911} == 1)&&($class eq = "Shadowknight")) {
quest::say("Very good, but maybe you should keep this. I believe you will have more use for it than I. Maybe Dsarrik can help you.");
quest::exp(10000);
quest::summonitem("8911");
}
elsif ($itemcount{8911} == 1) {
quest::say("Well now look at that! I believe you, $name, have done a great deed this day!");
quest::exp(10000);
}
}

And now I'm not getting a response at all when I do the turn in, shadowknight or otherwise. For the other quest mob involved, I changed it as well and he won't even respond to hails.

Capheus
07-20-2009, 09:08 PM
This should take care of your handin problems. Using eq "Shadowknight" for the shadowknight part of the handin and ne "Shadowknight" for everyone else. In the skickies there should be links to the perl system here to make things easier.

Trevius has some good links to look at here: http://www.eqemulator.net/forums/showthread.php?t=26075


sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount,8911=>1)) {

if ($class eq "Shadowknight") {
quest::say("Very good, but maybe you should keep this. I believe you will have more use for it than I. Maybe Dsarrik can help you.");
quest::exp(10000);
quest::summonitem("8911");
}

if ($class ne "Shadowknight") {
quest::say("Well now look at that! I believe you, $name, have done a great deed this day!");
quest::exp(10000);
}

}
plugin::return_items(\%itemcount);
}