View Single Post
  #1  
Old 09-10-2012, 04:31 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default Updating task during timer tick

I am getting stuck on the very end of this task. Basically an ooze spawns from a different script, grows in size and then is supposed to despawn. After the despawn I need to manually update the task. If you look in my script I also have a death event. If I manually kill the ooze then the task does indeed update. How come I cannot update from the timer event ? Everything works except the task never updates unless I kill the ooze myself.

Code:
## Provocating - Dragons of Mist
## a_hungry_ooze_bud.pl

my $current_size=7;

sub EVENT_SPAWN {
	quest::settimer("increase_size", 3); 
}

sub EVENT_TIMER {
	if($timer eq "increase_size") {
		if ($current_size<25)
		{
			$current_size=$current_size+4;
			quest::npcsize($current_size);
			quest::say("The hungry ooze grows bigger and bigger as it continues to eat the bixie's jum jum silo!");
		} else {
			quest::say("The hungry ooze explodes as it devours all the jum jum in the silo!");
			quest::updatetaskactivity(248, 3); # Bixie Menace: The Silo (#3)
			quest::depop();
		}
	}
}

sub EVENT_DEATH{
	quest::updatetaskactivity(248, 3); # Bixie Menace: The Silo (#3)
}
Reply With Quote