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 10-11-2008, 05:30 PM
Sylaei
Hill Giant
 
Join Date: Jan 2007
Posts: 124
Default Lang quest - $qglobals not working.

Ok, guys, I give up. I can't get this to work. I'm sure the quest is right, I think this might be something I need to add or change in the database but I can't seem to find it.

I have a new npc in pok that I want to teach you a lang for pp. I thought I'd use a global variable to determine if you had paid and then let you tell him what lang you wanted to learn. I realize there are eaiser ways to do this i.e. turn in an item, but I wanted to see if this was possible. It should be, but I'm stumped.
Here is the quest so far:

Code:
#Script to learn a language for 10pp each.
sub EVENT_SAY
{
 if($text=~/Hail/i)
  {
    quest::say("I can teach you a Language if you will give me 10 pp and then tell me the language you wish to learn.  I can teach the following languages: Barbarian, Erudian, Elvish, Dark Elvish, Dwarvish");
  }
  if($text=~/Barbarian/i)
  {
    if (defined($qglobals{lang}))
    {
        quest:setlanguage(1,100);
        quest:delglobal("lang");
    }
    else
    {
        quest::say("You must pay first! Nobody gets barbarian for free.");
    }
  }
  if($text=~/Erudian/i)
  {
    if (defined($qglobals{lang}))
    {
        quest:setlanguage(2,100);
        quest:delglobal("lang");
    }
    else
    {
        quest::say("You must pay first! Nobody gets a free languague.");
    }
  }
  if($text=~/Elvish/i)
  {
    if (defined($qglobals{lang}))
    {
        quest:setlanguage(3,100);
        quest:delglobal("lang");
    }
    else
    {
        quest::say("You must pay first! Nobody gets a free languague.");
    }
  }
  if($text=~/Dark Elvish/i)
  {
    if (defined($qglobals{lang}))
    {
        quest:setlanguage(4,100);
        quest:delglobal("lang");
    }
    else
    {
        quest::say("You must pay first! Nobody gets a free languague.");
    }
  }
  if($text=~/Dwarvish/i)
  {
    if (defined($qglobals{lang}))
    {
        quest:setlanguage(5,100);
        quest:delglobal("lang");
    }
    else
    {
        quest::say("You must pay first! Nobody gets a free languague.");
    }
  }
}

sub EVENT_ITEM
{
    if ($platinum == 10)
    {
        quest::setglobal("lang", 1, 1, "Y1");
        quest::say("Done.  Which Language do you want to learn?");

    }
}
__________________
Syl

"The significant problems we have cannot be solved at the same level of thinking with which we created them."
Albert Einstein
Reply With Quote
  #2  
Old 10-11-2008, 07:22 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Don't forget all quest commands need double-colons

Code:
quest::command
Also, ensure your NPC has the ability to set globals in the npc_types table.
Reply With Quote
  #3  
Old 10-11-2008, 11:27 PM
Sylaei
Hill Giant
 
Join Date: Jan 2007
Posts: 124
Default

Thanks, I missed the single colon. Copy and Paste can get you into trouble

I didn't have the npc set to use globals.

I'll have to restart the server I assume to get it to take affect.
__________________
Syl

"The significant problems we have cannot be solved at the same level of thinking with which we created them."
Albert Einstein
Reply With Quote
  #4  
Old 10-13-2008, 03:38 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I think a simple repop or at most zone reset will make the qglobal setting take effect.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 10-14-2008, 12:22 AM
Sylaei
Hill Giant
 
Join Date: Jan 2007
Posts: 124
Default

I did have to do a reboot. A repop didn't work. Is it enough to get everyone out of the zone? That also didn't work. A reboot did, but I'd rather do a zone reset if there is some way to force it.

That fixed it, the script is working fine.

Thanks
__________________
Syl

"The significant problems we have cannot be solved at the same level of thinking with which we created them."
Albert Einstein
Reply With Quote
  #6  
Old 10-14-2008, 12:47 AM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

I have not played with the globals but I know for regular quest changes a #reloadpl usually works.
Reply With Quote
  #7  
Old 10-14-2008, 03:51 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

If your zones are static, having everyone leave isn't the same as a reset, but if they are all dynamic it basically is. You can always use #zoneshutdown <zonename> to force it to shut down. Make sure to zone out first =P
__________________
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 04:21 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3