PDA

View Full Version : Mini Inny spawn


JrFaust
10-18-2006, 04:13 PM
This is my first attempt at perl let alone a quest but I worked out the bugs, I believe this is the way the spawn should work. Please let me know if there was a better way and/or if I made any mistakes.

This is the apprentice 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) && ($grums==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)

And this is the High Priest code.

# nadox
# a_luggald_apprentice.pl
# a_Luggald_High_Priest.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

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) && ($grums==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)

Angelox
10-19-2006, 01:17 AM
This is very nice, have you tested it yet?

JrFaust
10-19-2006, 03:23 AM
Yeah might have been why it took me a week to get it running, I like to know that every part is working the way I expect. That and it took a bit to verify how the different parts of the spawn worked. But I do have it running on my server so far every thing I could think of works.

There are two parts I couldn't verify one ceremony end part, I don't know if there's a time out on live or not, I just put that in there so that it would end if you didn't kill all four apprentice before they repop and so others couldn't walk into a partal quest. The other is if Inny despawns.

fathernitwit
10-21-2006, 05:12 PM
what is the "$grums == 2" stuff about? I dont see any way for that variable to be set...

Angelox
10-22-2006, 01:44 AM
what is the "$grums == 2" stuff about? I dont see any way for that variable to be set...
this is to insure we don't get two Garodizan_Razorfin's spawned at the same time. The PL will still work, but it's not not right; should be;
if (($random_result<=5) && ($razo==2)){

That way if both conditions are met, Garodizan_Razorfin will spawn.

and $razo should go to three untill he dies;

sub EVENT_DEATH{
quest::delglobal("razo");
quest::setglobal("razo","2","3","F");
$razo=undef;
};
# EOF zone: nadox NPCs:#Garodizan_Razorfin (227113)
Probably my mistake, as he used part of my script for his.
And it IS my mistake, as I see where i did this many times ( I was copy-pasting to hurry and didn't make the changes).
I have to go back and fix them all

EDIT:
I fixed all the PL's for Nadox and posted - remember one thing though, you should have a system for checking and or reseting the globals, in case you reboot your server and the some of these mobs are still up. If you haven't read this yet, here's what I do;
http://blackwater/~angelox/#link2

JrFaust
10-22-2006, 08:38 AM
Oops I didn't catch that, but to tell the truth I just made sure that it was there since it was in all the other Nadox .PL files.

Nice catch.
I'll remember to look closer at all the code next time. :D