Armor Quest for all Classes and Teleporter
This is an armor quest for all classes. The quest will also teleport the player to a zone (crushbone in this example).
The player gets drops from a zone that are notes, molds, instructions, or whatever you want to name them. An example of the items I created for this quest are "Boot Instructions". Any class can turn in those boot instructions and get boots specific to their class, and the same goes for all of the other instructions for the rest of the armor set (7 total different pieces). All you need to do is create the 7 different custom note drops, and add them to the quest, and then either find pre-existing class specific armor sets or make your own custom ones and add them to the quest. It is pretty straight foward. In the code below, I have PoH/PoF armor already in for the pure melee classes. So, you can try it out easily just by making your custom notes and plugging the ID into the check_handin. I have tested this quest and it works 100% on my server. You will need to edit the npc text to reflect what you want/need. Code:
############# |
Hey Trev, Tried out this code tonight, making a server for me and a few friends to play on...I know the code works on your server, cause i have multiple toons 70+ on there, and never had any trouble. I tried editing the code to add in my own stuff, gear rewards and whatnot, but the guy just eats the turn ins. I am using Prathun in gloomingdeep as my armor guy. Here is a snippet of the code...
Code:
sub EVENT_ITEM { |
Try changing your my $rewards = to my %rewards =
|
Does this code really work for all classes?
Quote:
|
it was at %rewards to start, i didnt work, so i tried $, ended up with the same problem. The guy just eats the turn ins.
Quote:
|
you might want to try shadowknight...
|
Quote:
Code:
$class == 'Shadowknight' Code:
$class eq "Shadowknight" Next, you must use Code:
my %rewards = ( "blah" => blah ); Just looking at your code though, if the above was % to start with, I don't see anything that sticks out as a problem and I'm not anywhere where I can test it right now. But you should stick this: Code:
else { I would check your quest logs to see if they are any help. Try putting some debugging print steps in there to help you narrow down the issue. If you still haven't resolved it later I'll try it on my server. |
*smacks head on desk* Well, I figured out the problem. I am a noob to all of this, never did any coding past BASIC and a tiny bit of VB. I had the return_item code ya mentioned at the bottom of the quest, as i copied and pasted Trev's code, just changing what i wanted. I summoned a random item, and turned it in, but he said nothing, and didnt give it back, just ate it. Well i did some looking into the plugin::check_handin...and it appears I did not have the plugin. So it wasn't checking anything i handed it, just eating it. I added the code I found after searching on the boards to the plugin folder, and it now works =). Thank you all for your replies, and sorry to have just missed something that simple, lol.
I did not know the plugin::blah_blah was an actual plugin until i did a search for it, so everything seem to be working now =). Thank you all again. |
Ya, I should have posted the corrections to that quest after I made them sorry lol. There was another class typo too that most probably wouldn't notice at first:
Code:
$class == 'Mage' Code:
$class == 'Magician' Code:
#An Armor Quest For all classes |
Decided to take a shot at cleaning up things;p I'm not exactly proficient at auto generating complex hash/array combos. And there is definitely redundancy in my example that could be cleaned up. But, here is an alternative method that may be easier for the average joe to pick up and change/add things that he wants with little quest scripting experience.
Code:
############# One thing I'd like to point out is that when you see this much redundancy such as in my hash for item turn in for each class, rest assured that it could be optimized a little more |
I tried to modify the code a little for personalization, and did extensive modifications to the items, and it is still not working. I used the last one that was posted as a model. Here is my code:
Code:
#A conversation to Teleport Player to lvl 40-50 zone (Dulak) |
Strait writes quests in a completely different way than I do, so that is a little hard for me to read. But, you might want to start by removing all of the elsifs from your EVENT_SAY, and change them to just plain "if" instead. I am pretty sure elsif will break the quest completely using it like that.
The best way to troubleshoot a problem like that is to start with just the EVENT_SAY section and test to make sure that works. Then, add in the rest in small examples piece by piece until you get it all working. That hash looks a little complex to me lol. I don't think Strait tested his code at all, but if you use the code I posted in this thread, it works perfectly. Though, mine could probably use better commenting to make it easier to understand. But it is pretty straight forward. If I was to write it all over again now, I am sure it would be much smaller and cleaner lol. I have learned a lot since that submission. |
I modified your code to work for my server, and it still does not work, am I missing something?
Code:
#An Armor Quest for all classes |
Any time you are only checking for certain classes and not all classes, then you have to do a Not Equal check as well for the other classes you don't want to use that turn in.
Don't ask me why it doesn't work the other way, as I have no clue. I also don't know why for equals you have to use ==, but for not equals, you have to use "ne". It doesn't make sense to me, but it does work. Here is an example of what I mean: Code:
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) Also, don't forget to add this at the bottom as shown in my example: Code:
else { I imagine there are much better ways of doing this, but I haven't really gone back and tried lately. The next time I make a similar armor quest using better code, I will definitely post it. |
Now my code has changed to the below code, thanks to your suggestions =) However, it is still not working in game for some reason:
Code:
#An Armor Quest for all classes |
The best way to solve a quest issue is to copy your entire quest into notepad so you don't lose it and then start with just 1 very small section at a time to make sure they work. Eventually you will get to a point where it doesn't work at all and you will know that the last thing you added is what caused it.
Try just using this from your code as the entire quest: Code:
sub EVENT_ITEM { |
Moving the plugins is what worked, thank you =)
|
Trev, can't
$class == 'Warrior' be replaced with $class == 1 ? |
Since that quest, I have refined our armor scripts that use Arrays a bit to make them cleaner and a bit easier to manage. If done properly, I don't think the whole "if $class" stuff needs to be checked at all. Here is an example of the new format we use on Storm Haven for a bit more advanced Arrays for armor quests:
Code:
#Rough Defiant Armor Quests |
looks interetsing, but you not answering my question though =P
I have looked at the quest wiki, and it doesn't say anywhere if numbers instead of class names can be used for the IF check - you know like 1 (warrior), 7 (monk) etc |
Technically, it should have been "$class eq 'Warrior'", not "$class == 'Warrior'", but I could never get it to work that way for some reason. My best guess is that it is automatically replacing the class name with the number. If so, then I don't see any reason why using the numbers wouldn't work. It might be a bit harder to reference what is going on in your scripts though if you do.
The reason I mentioned the new code I am using is because checking for which class it is should not have to be done with an array, since $class already does that. You just have to do things in the right order for them to work properly. It can make scripts much easier to manage. I am probably going to try to work up some more similar variations to the script above that I just posted. I will try to get one up that also has arrays for turn ins. It should make dealing with armor quests or epic quests considerably cleaner and much less scripting. |
Actually, it should be $class eq "Warrior" with double quotes. Using single quotes is an array of char's, while double quotes is used for strings. Maybe why it didn't work. I like the way you do it now with the hashes. That's pretty slick. I love perl.
|
Quote:
|
If you really had a reason to use numbers for classes, it would be easy to make a hash to do it. But, it would just be extra work that isn't really needed unless you needed numbers to do a random or something. Here is an example:
Code:
%ClassConvert = ( #Convert each Class Name into a Number Then, to get that class number, you could just do this: Code:
my $classnum = $ClassConvert{$class}; Then, you can do: Code:
if ($classnum == 1) |
There might be a $client->GetClass() type of command also. I know when I was working on $client->GetBaseRace(), it gives an integer rather than "Erudite".
|
I'm just curious but can this code be used to summon more than one item for a specific class? For example if I need to summon 2 weapons for a class who dual wields. I've tried a few things but I couldn't get anything to work.
Code:
sub EVENT_ITEM { |
For classes that get more than 1 reward as their epic 1.0, I just had to make sections for each of them:
Code:
if (($class == 'Warrior') && ($class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman' && $class ne 'Wizard' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker')) |
Thanks, that got it. I was trying a few things to do it in one block but I'm not knowledgeable enough in perl to do so. Using if, elsif, statements worked flawlessly.
|
[QUOTE=Andrew80k;171254]Actually, it should be $class eq "Warrior" with double quotes. Using single quotes is an array of char's, while double quotes is used for strings.QUOTE]
This solved another problem of mine. Thanks Andrew80K. |
no idea how, but double post.. sry ><
|
Thanks for the quest trev. I have edited the quest some but every time I turn in an item the NPC always says "I have no use for this item NAME, take it back". He says it whether I give him the right item, or if I give him a wrong item. He also never gives any item back. Here is the code im using:
Code:
sub EVENT_SAY |
I think just some "if" should be "elsif", see below (cant test it atm though, but should work).
Code:
sub EVENT_SAY |
Thanks so much for your help Lillu, I will test this when I am at home from work :)
|
All times are GMT -4. The time now is 07:35 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.