Thread: Qglobal problem
View Single Post
  #21  
Old 06-22-2006, 08:05 AM
Adrianne
Fire Beetle
 
Join Date: Oct 2004
Posts: 20
Default

Code:
      sub EVENT_SAY
  {
  if ($text=~/hail/i && $zavious == 1)
  {
    $zavious = undef;
    quest::say("Have you retrieved the four books that the Ambassador requested
    from Crushbone?");
  }
  if ($text=~/hail/i && $zavious == 2)
  {
    $zavious = undef;
    quest::say("Are you [willing] to perform another task for the council?");
  }
  if ($text=~/hail/i && $zavious == 3)
  {
    $zavious = undef;
    quest::say("Have you discovered what else the orcs are doing in Crushbone?");
  }
  if ($text=~/hail/i && $zavious == 4)
  {
    $zavious = undef;
    quest::say("Good luck on your journey $name. May the Five light your path.");
  }
  if ($text=~/willing/i && $zavious == 2)
  {
     $zavious = undef;
    quest::say("Good, then you shall set off immediately to Crushbone. Some of
    the adventurers that returned reported seeing a log cabin holding someone of
    importance. We wish you to seek this person out and discover what else the
    Orcs are doing. #summonitem 69977");
    quest::setglobal("zavious",3,0,"M2");
    $zavious = undef;
  }
  if ($zavious == 0)
  {
  $zavious = undef;
  if ($text=~/Hail/i)
  {
    quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
    me you would be arriving shortly. Do you have the four books that the
    Ambassador told you to retrieve from Crushbone? If so, hand them to me.
    #summonitem 51510");
    quest::setglobal("zavious",1,0,"M2");
    $zavious = undef;
  }
  }
}


  sub EVENT_ITEM
  {
  if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1)
  {
   $zavious = undef;
   quest::say("Ahhh you have returned with the books. You say the humanoids call
   themselves Orcs?  Hmmm.. Interesting.. The council will study these books to
   decipher what is written within them. Ambassador Dumont thanks you as do I,
   brave $race. If your still [willing] they have another task for you.");
   quest::setglobal("zavious",2,0,"M2");
   $zavious = undef;
  }
  elsif (plugin::check_handin(\%itemcount, 69977 => 1) && $zavious == 3)
  {
    $zavious = undef;
   quest::say("What is this $name? It appears to be some kind of battleplan. Is
   that Felwithe?! This truly is an amazing discovery my friend. Take this to
   Councillor Elandilira. I think she may like to hear of this discovery. It is
   a quick translation of the battleplans.");
   quest::summonitem(1004);
   quest::setglobal("zavious",4,0,"M2");
   $zavious = undef;
  }
  else
  {
   (plugin::return_items(\%itemcount));
   quest::say("This isn't what I'm looking for.");
  }
}
}
Code:
if ($zavious == 0)
  {
  $zavious = undef;
  if ($text=~/Hail/i)
  {
    quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
    me you would be arriving shortly. Do you have the four books that the
    Ambassador told you to retrieve from Crushbone? If so, hand them to me.
    #summonitem 51510");
    quest::setglobal("zavious",1,0,"M2");
    $zavious = undef;
basically $zavious doesnt exist before this. #summonitem 51510 is just temperary so the tester knows what items to summon to test it. The "if ($zavious == 0)" is the first variable. Then global sets this to 1, so now, it no longer gives this message when you hail. it gives:
Code:
{
  if ($text=~/hail/i && $zavious == 1)
  {
    $zavious = undef;
    quest::say("Have you retrieved the four books that the Ambassador requested
    from Crushbone?");
Up to this point, the script works correctly as far as I know, now.. Heres the part that seems broken. I try to update the variable $zavious in the database to 2.. and it doesnt want to update.. Ive tried everything known to me:P heres the part:

Code:
{
  if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1)
  {
   $zavious = undef;
   quest::say("Ahhh you have returned with the books. You say the humanoids call
   themselves Orcs?  Hmmm.. Interesting.. The council will study these books to
   decipher what is written within them. Ambassador Dumont thanks you as do I,
   brave $race. If your still [willing] they have another task for you.");
   quest::setglobal("zavious",2,0,"M2");
   $zavious = undef;
after the turn in of the 4 items with the item number of 51510, and $zavious == 1.. which it does, it works, because variable is 1. you now have the option to say [willing] since $zavious == 2.
Code:
if ($text=~/hail/i && $zavious == 2)
  {
    $zavious = undef;
    quest::say("Are you [willing] to perform another task for the council?");
  }
well your supposed to... but for the life of me, zavious, in mysql.. I use navicat to check, will not update... it will go from 0 to 1, where 0 is when the variable doesnt exist.. so basically it will create a 1 in the variable for zavious. quest::setglobal("zavious",2,0,"M2"); doesnt seem to update at all, and $zavious = undef; doesnt work. The variable just is stuck at 1...

If theres a better way of doing this, please tell me. I just need my quest to progress so that people cant do it over and over again, or even repeat previous steps, to prevent wasted time by the player. I would appreciate any examples, or ideas with some kinda examples or fix. Thanks alot guys. I know you guys work hard, but if I can just figure this out, Id be willing to post my finished scripts, because this will help alot of newer people, Im positive:P
Reply With Quote