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