Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2010, 05:27 PM
boo2
Fire Beetle
 
Join Date: May 2008
Location: Bahamas
Posts: 10
Default qglobal issues

sub EVENT_SAY {

my $journey = quest::saylink("journey", 0, "journey");

if($text=~/hail/i){
$client->Message(10, "Grizzly Adams says, 'Hello there $name. I am the recruiter of all the new soldiers in the Qeynos Militia. Would you like to begin your $journey?'");

}


elsif($text=~/journey/i){
{
quest::summonitem(107;
quest::setglobal("NoteToSun",1,5,"F");
$client->Message(10, "Grizzly Adams says, 'Welcome to the Militia, $name. You will report to Tzu with this note, and he will take it from there. Good luck.'"); }

}
elsif($text=~/journey/i && !defined $qglobals{NoteToSun}); {
$client->Message(10, "Grizzly Adams says, 'I have already recruited you'"); }
}
}

------------------


What is wrong with the qglobal? I just can't seem to get it to work!

Can anyone explain it further?
Reply With Quote
  #2  
Old 03-15-2010, 06:43 PM
nenelan
Hill Giant
 
Join Date: Feb 2008
Posts: 116
Default

A. Use the code tags when posting codes. It preserves formatting and makes it a hell of a lot easier to read.

B. Double check to make sure that your mob has qglobals enabled, it most likely is because C is your issue here. Doesn't hurt to double check.

C. You have Statement 1: "If Text is Hail", Statement 2: else "If Text is Journey", Statement 3: else "if Text is Journey AND qglobal is not defined". Statement 2 will always be evaluated before Statement 3, and even if Statement 3 is true, Statement 2 will be true first. Change the 2nd Statement to if the qglobal is defined and the text is there, and the final one as an elsif qglobal is not defined and the text is there.
Reply With Quote
  #3  
Old 03-15-2010, 08:12 PM
boo2
Fire Beetle
 
Join Date: May 2008
Location: Bahamas
Posts: 10
Default

Code:
# Grizzly

my $globalname = "Grizzly";

sub EVENT_SAY {
my $NPCName = $npc->GetCleanName();

my $journey    = quest::saylink("journey", 0, "journey");

   if($text=~/hail/i && $qglobals{$globalname} == 2){
         quest::emote(" stares at you with disbelief.");
   }
    elsif($text=~/hail/i && !$qglobals{$globalname} ){
        quest::say("Greetings $name, I am the Milita Recruiter. Would you like to begin your $journey?");
   }
    elsif($text=~/journey/i){
        quest::setglobal("$globalname",1,2,"F");
        quest::summonitem(33969);
        quest::say("Welcome to the Militia, $name. You will report to Tzu with this note, and he will take it from there. Good luck."); }
}
}
that is what i have now, now it crashes the zone.

I want you to be able to get your note from this guy, and then he will just stare at you in disbelief if you hail him again.
Reply With Quote
  #4  
Old 03-15-2010, 08:52 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Code:
# Grizzly

sub EVENT_SAY {
  my $journey = quest::saylink("journey", 0, "journey");

  if($text=~/hail/i) {
    if($qglobals{Grizzly} == 2) {
      quest::emote("stares at you with disbelief.");
    }
    else {
      quest::say("Greetings $name, I am the Milita Recruiter. Would you like to begin your $journey?");
    }
  }
  if($text=~/journey/i) {
    quest::setglobal("Grizzly",1,2,"F");
    quest::summonitem(33969);
    quest::say("Welcome to the Militia, $name. You will report to Tzu with this note, and he will take it from there. Good luck.");
  }
}
Not sure about the saylink.. I haven't used those before.
Reply With Quote
  #5  
Old 03-15-2010, 11:04 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, saylinks need to be made within an EVENT, not outside of them. Though, while looking at this, I figured out why that is and will fix it tonight so it stops crashing zones at least if defined outside of an EVENT.

As for the saylink there, you can simplify it to just this:

Code:
my $journey = quest::saylink("journey");
And that will do the same thing. The 0 you had is an option to let you make the saylink silent if you set it to 1. Then, you don't see the response from the player at all. The second text at the end is just an option so the link can say a different message from what the player actually says when clicking it. So, you can have the link show "bind your soul", and when clicked, the player might say "bind my soul", and so on.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:49 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3