Help with this script please?
To start :P the script works fine in terms of it accomplishes what it is supposed to.
The problem is that the script completely ignores the level check for the player. I would like it to be so that the script will not work and hand back the items if the player is NOT exactly level 65. Checking the script with a command line prompt using perl it goes through without problem. I just came back to scripting for eqemu and am sure I am missing something simple so would anyone please allow me to feel very stupid and point out what im missing lol Code:
sub EVENT_SAY{ |
try if ($ulevel == 65) {
|
Thank you for the reply I did try that and on changing it disallows any items to be traded correct or not and does not finish the script or give the items back
Any other ideas? My best guess is I would have to make that change but the problem is the double if section meaning this Code:
sub EVENT_ITEM I tried Code:
sub EVENT_ITEM |
Code:
sub EVENT_SAY{ |
Ok.. I seem to be making progress Ive made changes to reflect yours. It works thank you:P
The only issue is if you are not eligable to do the quest the NPC does not give you the items back. I will take it from here and figure it out. Thank you so much for your help. |
Check where you have your else statement. At the moment its only set to return items when a level 65 screws up the handin, id move the else statement outside of the level check and see how that works for ya.
|
Code:
sub EVENT_SAY |
You NEVER EVER EVER put the return items call inside ANY logic blocks.
It goes in a script once and once only at the end of sub EVENT_ITEM Code:
sub EVENT_ITEM { |
Quote:
This works just fine for me: http://perl.pastebin.mozilla.org/4759052 |
Just because it works, does not mean it is the best way to handle it. There was a LOT of misundstanding of this functionality when it was first introduced years ago and a lot of working, but technically incorrect scripts went in the quest repo.
Best practice is to put it once at the end of the script. The %itemcount hash will have its contents modified by your prior logic and only ever needs called once to then summon the items still left in the hash onto the player's cursor. All it takes is a bad logic loop without a return in it to have items never returned as noted by the OP. |
Unless you really like typing or copy/pasting there's no reason to have the same statement in multiple places, and as a bonus like Sorvani said, you won't miss one accidentally.
|
Yeah, it makes sense. I understand the reasoning behind doing it your way, I just don't do it that way.
|
All times are GMT -4. The time now is 05:10 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.