qglobal's
ok this is trevius's quest i used it to check my qglobal's but i cant seem to get them to keep it this quest just keeps giving the person level 71 any idea's of why my qglobal's wont work?
Code:
sub EVENT_SAY { |
ok i got
Code:
sub EVENT_SAY { |
Ok i figured out how to check them just wondering why this quest right here will set the epic1.5 value 1 and not do the rest of the quest
Code:
sub EVENT_SAY { if ($text=~/hail/i) { |
Yeah, sorry, but that is a pretty old quest I submitted. I have since learned how to use qglobals and such properly, and that way is not the proper way to do it. It should actually work most of the time, but can cause some nasty bugs that you don't want to have to deal with :P Your script would actually seem to work fine most of the time, accept you have some parenthesis in the wrong places in your EVENT_ITEM that is breaking that section of the script.
Anyway, the proper way to check a qglobal value is to write it like this: Code:
if ($itemcount {1387} == 1 && $qglobals{Epic1.5} == 1) { Instead of the way you have it like this: Code:
if (($itemcount {1387} == 1)) && ($Epic1.5 == 1) { Code:
if (plugin::check_handin(\%itemcount, 1387 => 1) && $qglobals{Epic1.5} == 1) { http://www.eqemulator.net/wiki/wikka...=QuestTutorial There are 2 more things I think are worth mentioning in regards to qglobals: 1. Always make sure you enable the NPC to see qglobals by setting the qglobal field in the npc_types table to 1. 2. Check the wiki page above to understand the options field for qglobals. By setting it to 0 like you are, it means that only that particular NPC in that particular zone will see that qglobal for that particular player. If you wanted another NPC to check it, they would not see it. |
one more thing. In my experience, if the qglobal check happens after the item check, if the player doing the turn in has the proper item, but not the qglobal flag, the NPC will eat the proper item. Doing the qglobal check before the item check resolve this issue.
|
ahh thank you both so much ill try that later when i get a chance'
|
Yeah, I didn't want to get that far into explaining it just yet hehe. The reason that is, is because the ifs check from left to right and if it hits one that is false, it doesn't bother checking any of the others. So, that will let it return the items that were handed in, because the plugin will think that the items were not successfully turned in, I believe. By having them in the order I put them from left to right, it checks that the hand in is correct first, and so no matter what, the return items plugin won't return those items once the check_handin has been verified correct. So, in that case, if they fail to meet the qglobal, it won't reward them, but it also won't return their items.
I am basically just saying what Lillu had already said, but explaining the why of how it works so you can better understand how to write that type of check. |
you all helped me alot and im grateful for it
|
All times are GMT -4. The time now is 05:13 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.