Hey folks, I have a quest file that I cannot for the life of me figure out what is wrong. I need a pair of fresh eyes cause mine are crossing at this point.
Code:
my $a;
my $b;
my $c;
my $d;
my $e;
my $f;
my $g;
my $MobToSpawn;
$Night = undef;
sub EVENT_SPAWN {
if (($zonetime >= 0)&&($zonetime <= 800)){ #nighttime
quest::setglobal(Night,1,3,F);}
elsif (($zonetime >= 2000)&&($zonetime <= 2359)){ #nighttime
quest::setglobal(Night,1,3,F);}
else{ #daytime
quest::setglobal(Night,0,3,F);}}
sub EVENT_WAYPOINT {
if (($zonetime >= 0)&&($zonetime <= 800)){ #nighttime
quest::setglobal(Night,1,3,F);}
# quest::say("Night Global is $Night");} #undead are 1
elsif (($zonetime >= 2000)&&($zonetime <= 2359)){ #nighttime
quest::setglobal(Night,1,3,F);}
#quest::say("Night Global is $Night");} #undead are 1
else{ #daytime
quest::setglobal(Night,0,3,F);}}
#quest::say("Night Global is $Night");}}
## End spawn Script
sub EVENT_SIGNAL {
if ($signal == 1){
quest::settimer("1", 10);
quest::shout("Got Signal");
quest::shout("Timer is $timer");
}
}
sub EVENT_TIMER {
if($timer eq "1"){
quest::shout("Timer Triggered!");
if(defined $qglobals{Night} && $qglobals{Night} == 1){
my $random_result = int(rand(100));
my $a = 1526; #npc - ##a_decaying_skeleton
my $b = 1528; #npc - ##a_restless_skeleton
my $c = 1530; #npc - ##a_putrid_skeleton
my $d = 1532; #npc - ##a_dread_corpse
my $e = 1534; #npc - ##a_skeleton
my $f = 4171; #npc - Varsoon
my $g = 4147; #npc - Pyzjn
my $MobToSpawn = quest::ChooseRandom($a,$d,$f,$a,$b,$c,$d,$e,$f,$a,$b,$c,$d,$e,$f,$g);
if($random_result<16){
quest::say("Spawning mariner trigger1");
quest::spawn2($MobToSpawn,5,0,-1028.3,5120,115.2,112);
}elsif(($random_result>=16) && ($random_result<32)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,6,0,-877.4,4058.1,-41.3,.5);
}elsif(($random_result>=32) && ($random_result<48)){
quest::say("Spawning shaman trigger3");
quest::spawn2($MobToSpawn,7,0,32.6,4695.1,2.1,190.5);
}elsif(($random_result>=48) && ($random_result<64)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,8,0,-464.1,4492.2,95.8,202.1);
}elsif(($random_result>=64) && ($random_result<80)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,8,0,-917.1,4679.2,43.4,74.9,1);
}elsif(($random_result>=80) && ($random_result<101)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,8,0,-917.1,4679.2,43.4,74.9,1);
}
} else {
my $random_result = int(rand(100));
my $a=1524; #npc - ##a mangy Rat
my $b=1525; #npc - ##a_brown_bear
my $c=1527; #npc - ##a_grizzly_bea
my $d=1529; #npc - ##a_large_rat
my $e=1531; #npc - ##a_fire_beetle
my $f=1533; #npc - ##a_gray_wolf
my $g=1535; #npc - ##a_giant_rat
my $MobToSpawn = quest::ChooseRandom($a,$d,$f,$a,$b,$c,$d,$e,$f,$a,$b,$c,$d,$e,$f,$g);
if($random_result<16){
quest::say("Spawning mariner trigger1");
quest::spawn2($MobToSpawn,5,0,-1028.3,5120,115.2,112);
}elsif(($random_result>=16) && ($random_result<32)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,6,0,-877.4,4058.1,-41.3,.5);
}elsif(($random_result>=32) && ($random_result<48)){
quest::say("Spawning shaman trigger3");
quest::spawn2($MobToSpawn,7,0,32.6,4695.1,2.1,190.5);
}elsif(($random_result>=48) && ($random_result<64)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,8,0,-464.1,4492.2,95.8,202.1);
}elsif(($random_result>=64) && ($random_result<80)){
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,8,0,-917.1,4679.2,43.4,74.9,1);
}else{(($random_result>=80) && ($random_result<101))
quest::say("Spawning skeleton trigger2");
quest::spawn2($MobToSpawn,8,0,-917.1,4679.2,43.4,74.9,1);
}
}
}
}
My timer receives the signal but does not start the timer, at all. Nothing in the timer section will fire, not even the shout.