Log in

View Full Version : Need some timer help please.


Born2rot
08-26-2012, 07:24 PM
So I have a custom pet that is a buff bot that can be summoned from a clicky for 15 seconds. When he spawns he'll AE buff and then if anyone enters or leaves his area he'll buff them as well. It's got a cooldown on it, and it's nice for rebuffing while raiding. My issue is, for some reason he's not depoping anymore when the timer is up. Not sure what was changed. If anyone could help, thanks!


sub EVENT_SPAWN {
my $NPCName = $npc->GetCleanName();
$x = $npc->GetX();
$y = $npc->GetY();
$range = 25;

quest::set_proximity($x - $range, $x + $range, $y - $range, $y + $range);
quest::settimer("killbuff", 15);
quest::shout("WOOOO! Glad to be out of that freaking bottle! I'm sure if I was a dog I'd hump your leg right now I'm so happy! All those near me come get some buffs,
I feel I'm only here for a short time!");

my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
$ent->SpellFinished(5278, $ent);
$ent->SpellFinished(5415, $ent);
$ent->SpellFinished(5312, $ent);
$ent->SpellFinished(5405, $ent);
$ent->SpellFinished(5521, $ent);
$ent->SpellFinished(5365, $ent);
$ent->SpellFinished(278, $ent);
$ent->SpellFinished(939, $ent);
$ent->SpellFinished(3360, $ent);
$ent->SpellFinished(25251, $ent);

}
}

sub EVENT_ENTER
{
quest::say("Feel my power!");

quest::selfcast(5278);
quest::selfcast(5415);
quest::selfcast(5312);
quest::selfcast(5405);
quest::selfcast(5521);
quest::selfcast(5365);
quest::selfcast(278);
quest::selfcast(939);
quest::selfcast(3360);
quest::selfcast(13);
quest::selfcast(25251);
}


}
sub EVENT_EXIT
{
quest::say("Feel my power!");

quest::selfcast(5278);
quest::selfcast(5415);
quest::selfcast(5312);
quest::selfcast(5405);
quest::selfcast(5521);
quest::selfcast(5365);
quest::selfcast(278);
quest::selfcast(939);
quest::selfcast(3360);
quest::selfcast(13);
quest::selfcast(25251);
}

sub EVENT_TIMER {
if($timer eq "killbuff") {
quest::shout("Crap! The magic is pulling me back into that stupid bottle.....!");
quest::depop();
quest::stoptimer("killbuff");
}
}


Goregut

joligario
08-26-2012, 08:40 PM
If you did a true copy/paste, you have a line break in your first shout.

Born2rot
08-26-2012, 09:56 PM
Nothing wrong with him shouting. Everything works as it's suppose to. He just won't depop when the timer is up.

Randymarsh9
08-27-2012, 12:11 AM
There's an extra close bracket on the sub EVENT_ENTER.

lerxst2112
08-27-2012, 12:46 AM
C:\Temp>perl -c test.pl
Unmatched right curly bracket at test.pl line 47, at end of line
syntax error at test.pl line 47, near "}"
syntax error at test.pl line 63, near "}"
syntax error at test.pl line 70, near "}"
test.pl had compilation errors.

Born2rot
08-27-2012, 08:12 AM
Wow duh. Thanks guys!



Goregut