a working version of the first script for comparison:
Code:
##northwind.pl
sub EVENT_SPAWN
{
my $randomgail = (int(rand(1800)) + 300);
my $randomgust = (int(rand(1200)) + 300);
my $randombreeze = (int(rand(600)) + 300);
quest::settimer("gail",$randomgail);
quest::settimer("gust",$randomgust);
quest::settimer("breeze", $randombreeze);
}
sub EVENT_TIMER
{
my $delaywind = (int(rand(10)) + 1);
if ($timer eq "breeze")
{
quest::settimer("windone",$delaywind);
quest::ze(10, "The tree tops begin to rustle...");
}
elsif ($timer eq "gust")
{
quest::settimer("windtwo",$delaywind);
quest::ze(10, "The tree tops begin to rustle...");
}
elsif ($timer eq "gail")
{
quest::settimer("windthree",$delaywind);
quest::ze(10, "The tree tops begin to rustle...");
}
elsif ($timer eq "windone")
{
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
if($npc->CheckLoS($ent))
{
$npc->SignalClient($ent, 11111);
quest::ze(10, "A gentle breeze passes through.");
quest::stoptimer("windone");
}
else
{
}
}
}
elsif ($timer eq "windtwo")
{
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
if($npc->CheckLoS($ent))
{
$ent->DoKnockback($npc, 2, 0);
quest::ze(10, "A gust from the North sweeps through.");
quest::stoptimer("windtwo");
}
else
{
}
}
}
elsif ($timer eq "windthree")
{
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
if($npc->CheckLoS($ent))
{
$ent->DoKnockback($npc, 1, 0);
quest::stoptimer("windthree");
quest::settimerMS("constwind", 150);
quest::ze(10, "The wind howls...");
}
else
{
}
}
}
elsif ($timer eq "constwind")
{
my $randomstopwind = int(rand(10));
if ($randomstopwind < 9)
{
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
if($npc->CheckLoS($ent))
{
$ent->DoKnockback($npc, 0.20, 0);
}
else
{
}
}
}
else
{
quest::stoptimer("constwind");
quest::ze(10, "The wind dies down");
}
}
else
{
}
}
Just to verify, will...
Code:
elsif ($timer eq "windtwo")
{
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
if($npc->CheckLoS($ent))
{
$ent->DoKnockback($npc, 2, 0);
quest::ze(10, "A gust from the North sweeps through.");
quest::stoptimer("windtwo");
}
else
{
}
}
}
...work for validating a player is still in the zone, as it checks the list then checks LoS (which would report back a 0 for any player on the list no longer present?) for any client on the list each time the timers go off?