(another) quest global question
Is it possible to set a quest global upon turning in an item?
Looked through forum post after forum post, as well as the wiki. And if there is, I am just not finding it. ;S |
Not sure if you meant this, but setting a qglobal in sub EVENT_ITEM is working the same way as in sub EVENT_SAY.
like: Code:
sub EVENT_ITEM { |
That's exactly what I was looking for. For some reason, I can't seem to get my NPC to use the global when I hand him an item, and since it's a two-part quest.. it's bothersome.
|
Check if the NPC's qglobal flag is set to 1. I tend to forget about that. :)
|
Hmm, seems to be something wrong.
If you still could assist me, i would greatly appreciate it. I just need to figure out globals, and then maybe it wont be such a pain in the ass. Thanks Basically, I want the texts that do not require the quest global to go out as normal, but if you hail him after you turn in the item, he would respond with the same thing he does after you turn in the item, and keep on going from there. the only problem is, it all works great, he won't do the second part once I turn it in, but as soon as I turn it in, everyone is able to do the second conversation. Code:
sub EVENT_SAY |
I can look into this tonight. just a quick guess till then, there were a missing $, and also setting qglobal to zero means making it undefined. I also set your qglobal to be visible zonewide (you can change it back to quest::setglobal("rin_quest",1,1,"F"); if you like).
Can't test it atm, but try this: Code:
sub EVENT_SAY |
Just an FYI, but, you should never use quest globals like this:
Code:
elsif($text=~/Hail/i && $rin_quest == 1) To use qglobals the right way and ensure that you never run into issues that could cause you major headaches (believe me, I have been through this myself lol), then use them in this way instead: Code:
elsif($text=~/Hail/i && $qglobals{rin_quest} == 1) Also, I didn't review the full script you have there completely, but your elsif here would definitely be a problem: Code:
if($text=~/Hail/i) A better way to write this might be the following: Code:
if($text=~/Hail/i) |
Rather try this, I was sleepy :p
Code:
my $globalname = rin_quest; |
Trev beats me as always hehe :)
|
Thanks a ton folks! I really appreciate it. Quest globals are a pain in the ass to me, but this was a big help.
|
Quote:
Code:
if(defined($qglobals{rin_quest}) && $qglobals{rin_quest} == 1) |
Quote:
In this case where all you are doing is setting a flag once, the second part is not needed. Code:
if(defined($qglobals{rin_quest})) Code:
if(defined($qglobals{rin_quest}) && $qglobals{rin_quest} == 1) Additionally, organization of the code helps readability for others should the script need to be updated to extend the quest or change it. Code:
EVENT_SAY { Code:
EVENT_SAY { |
All times are GMT -4. The time now is 01:33 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.