Thread: Signalling mobs
View Single Post
  #7  
Old 08-11-2007, 02:40 AM
JrFaust
Sarnak
 
Join Date: Aug 2005
Location: Overthere
Posts: 82
Default Sample code

I used that guide for a script almost exactly like you want. You can look this code over for examples.

Code:
# nadox
# a_Luggald_High_Priest.pl
# a_luggald_apprentice.pl
# respawn named mob on a #Garodizan_Razorfin (227113) death
# Enestox, Angelox
#
# The High Priest (227081) will spawn Innoruuk (186107) 30 seconds after
# all four luggald apprentices (227089) are dead if the ceremony doesn't end.
# The timer kills the ceremony at 10 minutes from the first kill.
# The 10 minute timer also is the repop time of the apprentices.
# JrFaust

sub EVENT_ATTACK {
 quest::signalwith(227081,1,0);
}
   
sub EVENT_DEATH{
 quest::signalwith(227081,2,30);
 my $random_result = int(rand(100));
 my $a = 227113;#Garodizan_Razorfin
 my $x = $npc->GetX();
 my $y = $npc->GetY();
 my $z = $npc->GetZ(); 
 my $h = $npc->GetHeading();
 if (($random_result<=5) && ($razo==2)){
  quest::spawn2($a,1,0,$x,$y,$z,$h);
  quest::delglobal("razo");
  quest::setglobal("razo","3","3","F");
  $razo=undef;
  }else{
  #do nothing 
 }
}

# EOF zone: nadox NPCs:#Garodizan_Razorfin (227113)
Code:
# respawn named mob on a #Garodizan_Razorfin (227113) death
# Enestox, Angelox
#
# The High Priest (227081) will spawn Innoruuk (186107) 30 seconds after
# all four luggald apprentices (227089) are dead if the ceremony doesn't end.
# The timer kills the ceremony at 10 minutes from the first kill.
# The 10 minute timer also is the repop time of the apprentices.
# JrFaust

my $counter;

sub EVENT_SPAWN {
  $counter = 0;
}

sub EVENT_SIGNAL {
  $counter += 1;
  if ($signal == 1){
    if ($counter == 1){
      quest::say("And the ceremony begins.");
    }
  }
  if ($signal == 2){
    quest::settimer("ceremony",600);
    if ($counter == 8){
      quest::say("Innoruuk protect us!");
      quest::settimer("inny",30);
      quest::stoptimer("ceremony");
      $counter = 0;
    }
   }
}

sub EVENT_TIMER{
  if ($timername == "ceremony"){
    quest::stoptimer("ceremony");
    $counter = 0;
  }
  if ($timername == "inny"){
    quest::stoptimer("inny");
    quest::unique_spawn(186107,0,0,1714.00,669.00,-87.00);
  }
}
   
sub EVENT_DEATH{
 my $random_result = int(rand(100));
 my $a = 227113;#Garodizan_Razorfin
 my $x = $npc->GetX();
 my $y = $npc->GetY();
 my $z = $npc->GetZ(); 
 my $h = $npc->GetHeading();
 if (($random_result<=5) && ($razo==2)){
  quest::spawn2($a,1,0,$x,$y,$z,$h);
  quest::delglobal("razo");
  quest::setglobal("razo","3","3","F");
  $razo=undef;
  }else{
  #do nothing 
 }
 quest::stoptimer("ceremony");
}

# EOF zone: nadox NPCs:#Garodizan_Razorfin (227113)
Reply With Quote