%Hash to Shorten Multiple Quests from 1 NPC - Not Working
After working on this for a few days with no luck, I am posting here to see if anyone can help. I have been trying to figure it out by learning Perl on my own, but I just can't get it working.
What I am trying to do is to have 1 NPC that has multiple quests, where each quest is just a simple turn in X and get reward Y. But in this case, I have over 40 turn ins and 40 rewards, so I am hoping to figure out how to write the quest without making each turn in and reward the long way. I am pretty sure that this can be done with hashes, but I just don't know enough about it yet to get it functioning at all. Here is a small example of what I am trying to do: Code:
sub EVENT_ITEM { Code:
#my $value = 0; |
Well, I was finally able to get it working with the hash properly! But, for some reason, I can't get the return items plugin working properly for it. The code below works perfectly if you turn in the correct items, but if you turn in the wrong items, it will just eat them. I commented out the return plugin section because it was breaking the script. Basically with the return items plugin set to be used, it causes the return text to be said 3 times and then just returns the item you turned in. This is the case for the first 2 items, but the 3rd (last) item in the hash will actually still turn in properly for some reason.
Code:
sub EVENT_ITEM { |
Try putting the return_items outside of your for loop. Also check your brackets, they may not actually be in the order you intend.
|
or move it in right after the check_handin
|
Here another way of doing it , without sorting the Hash..
Code:
|
Which looks and handles much better!
|
Thanks for the help guys. I will try messing with it a bit more when I get home tonight. Here is the actual quest that I am using right now that completely works other than returning items not in the hash values:
Code:
sub EVENT_ITEM { So far I am very happy with the system. Once I get it working flawlessly with the return item, I will post all of the credit system quests, which includes quests for mobs that give credit when they die as well as these quests for rewards that credits can be used for (along with an item turn-in in this case). I think they could be useful to other custom servers. |
All times are GMT -4. The time now is 05:58 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.