EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   help plz, setglobal error (https://www.eqemulator.org/forums/showthread.php?t=14528)

sandy 06-24-2004 02:09 AM

help plz, setglobal error
 
I have written this quest, and i get a "setglobal error inserting 4 : DBcore::Runquery : no result

here's the npc_types :
Code:

INSERT INTO `npc_types` VALUES (214021, 'Vallon_Zek', NULL, 73, 289, 1, 19, 150000, 2, 0, 0, '25', 0, 0, 16037, 0, 13, 1, 0, 839, 'SE', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '1.07', '2', 0, 0, 0, 0, 0, 0, 1, 1, 1, 0);
INSERT INTO `npc_types` VALUES (214093, 'Vallon_Zek', NULL, 64, 289, 1, 19, 60000, 2, 0, 0, '25', 0, 0, 16000, 0, 0, 1, 0, 745, 'S', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0.8', '1.5', 0, 0, 0, 0, 0, 0, 1, 1, 1, 0);
INSERT INTO `npc_types` VALUES (214094, 'Vallon_Zek', NULL, 64, 289, 1, 19, 100000, 2, 0, 0, '25', 0, 0, 16037, 0, 13, 1, 0, 839, 'S', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '1.07', '2', 0, 0, 0, 0, 0, 0, 1, 1, 1, 0);

214021.pl :
Code:

sub EVENT_SPAWN
{
quest::setnexthpevent(40);
quest::setglobal("vallonevent","4","1","D1");
}

sub EVENT_HP
{
  if ( $hpevent == 40 ) {
    quest::depop();
    quest::setglobal("vallonevent","3","1","D1");
    $random = int(rand(5));
    for ($i=0; $i < 5; $i++) {
      if ( $i == $random ) {
        $vallon = 214094;
      } else {
        $vallon = 214093;
      }
      if ( $i == 0 ) {
        quest::spawn($vallon,0,0,-637,1989,197,272);
      } elsif ( $i == 1 ) {
        quest::spawn($vallon,0,0,-556,1933,197,272);
      } elsif ( $i == 2 ) {
        quest::spawn($vallon,0,0,-559,2027,197,272);
      } elsif ( $i == 3 ) {
        quest::spawn($vallon,0,0,-557,1963,197,272);
      } elsif ( $i == 4 ) {
        quest::spawn($vallon,0,0,-585,1971,197,272);
      }
    }
  }
}

214094.pl :

Code:

sub EVENT_SPAWN
{

  if ( ( $vallonevent == "3" ) || ( $vallonevent == "2" ) || ( $vallonevent == "1" ) ) {
    quest::setnexthpevent(40);
  }

}

sub EVENT_HP
{

  if ( $hpevent == 40 ) {

      quest::depop();
      if ( $vallonevent == "3" ) {
        quest::setglobal("vallonevent","2","1","D1");
      } elsif ( $vallonquest == "2" ) {
        quest::setglobal("vallonevent","1","1","D1");
      } elsif ( $vallonevent == "1" ) {
        quest::setglobal("vallonevent","0","1","D1");
      }
      $random = int(rand(5));
      for ($i=0; $i < 5; $i++) {
        if ( $i == $random ) {
          $vallon = 214094;
        } else {
          $vallon = 214093;
        }
        if ( $i == 0 ) {
          quest::spawn($vallon,0,0,-637,1989,197,272);
        } elsif ( $i == 1 ) {
          quest::spawn($vallon,0,0,-556,1933,197,272);
        } elsif ( $i == 2 ) {
          quest::spawn($vallon,0,0,-559,2027,197,272);
        } elsif ( $i == 3 ) {
          quest::spawn($vallon,0,0,-557,1963,197,272);
        } elsif ( $i == 4 ) {
          quest::spawn($vallon,0,0,-585,1971,197,272);
        }
      }
 
  }

}

any idea what's wrong ?

KhaN 06-24-2004 03:07 AM

Quote:

setglobal error inserting 4 : DBcore::Runquery : no result
Even if error appear, your global is still writen in DB, so, no worry.

For me, the quest should look like this, i know you want that your mobs spawn randomly, as i never used perl random function, i just applyed your random function as a sub, if your random function is correct (and after looking a perl website, it look like), it should work like this.

TriggerZek Script
Code:

sub EVENT_SPAWN
{
 quest::setnexthpevent(40);
}
sub EVENT_HP
{
 if ( $hpevent == 40 )
 {
  if ($VallonTrigger == "2")
  {
  quest::setglobal("VallonTrigger",$VallonTrigger + 1,"1","D1");
  Random ();
  $VallonTrigger = "";
  }
  if ($VallonTrigger == "3")
  {
  quest::setglobal("VallonTrigger",$VallonTrigger + 1,"1","D1");
  Random ();
  $VallonTrigger = "";
  }
 }
}
sub Random
{
 $random = int(rand(5));
 for ($i=0; $i < 5; $i++)
 {
  if ( $i == $random )
  {
  $vallon = 214094;
  }
  else
  {
  $vallon = 214093;
  }
  if ( $i == 0 )
  {
  quest::spawn($vallon,0,0,-637,1989,197,272);
  }
  elsif ( $i == 1 )
  {
  quest::spawn($vallon,0,0,-556,1933,197,272);
  }
  elsif ( $i == 2 )
  {
  quest::spawn($vallon,0,0,-559,2027,197,272);
  }
  elsif ( $i == 3 )
  {
  quest::spawn($vallon,0,0,-557,1963,197,272);
  }
  elsif ( $i == 4 )
  {
  quest::spawn($vallon,0,0,-585,1971,197,272);
  }
 }
}

RealZek Script
Code:

sub EVENT_SPAWN
{
 quest::setnexthpevent(40);
 quest::setglobal("VallonTrigger","1","1","D1");
 $VallonTrigger = "";
}
sub EVENT_HP
{
 if ( $hpevent == 40 )
 {
  if ($VallonTrigger == "1")
  {
  quest::depop();
  quest::setglobal("VallonTrigger",$VallonTrigger + 1,"1","D1");
  Random ();
  $VallonTrigger = "";
  }
 }
}
sub Random
{
 $random = int(rand(5));
 for ($i=0; $i < 5; $i++)
 {
  if ( $i == $random )
  {
  $vallon = 214094;
  }
  else
  {
  $vallon = 214093;
  }
  if ( $i == 0 )
  {
  quest::spawn($vallon,0,0,-637,1989,197,272);
  }
  elsif ( $i == 1 )
  {
  quest::spawn($vallon,0,0,-556,1933,197,272);
  }
  elsif ( $i == 2 )
  {
  quest::spawn($vallon,0,0,-559,2027,197,272);
  }
  elsif ( $i == 3 )
  {
  quest::spawn($vallon,0,0,-557,1963,197,272);
  }
  elsif ( $i == 4 )
  {
  quest::spawn($vallon,0,0,-585,1971,197,272);
  }
 }
}



All times are GMT -4. The time now is 11:45 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.