Code:
my $x;
my $y;
my $z;
my $h;
sub EVENT_SPAWN {
quest::setnexthpevent(91);
}
sub EVENT_HP {
if($hpevent == 91) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
quest::setnexthpevent(76);
}
if($hpevent == 76) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
quest::setnexthpevent(56);
}
if($hpevent == 56) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
quest::setnexthpevent(26);
}
if($hpevent == 26) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
}
}
sub EVENT_DEATH {
quest::shout ("$name and the others may have beaten me, but they are no match for the beast!");
quest::depop(2700255);
quest::depop(2700256);
}