View Single Post
  #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