Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-24-2004, 02:09 AM
sandy
Hill Giant
 
Join Date: Oct 2002
Posts: 212
Default 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 ?
__________________
Sandy
Reply With Quote
  #2  
Old 06-24-2004, 03:07 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

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); 
  }
 }
}
__________________

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:18 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