Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 09-10-2012, 05:57 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

first thing that comes to mind is there is not active $client information in the EVENT_TIMER sub routine. How would the quest function know which client to update?
Reply With Quote
  #3  
Old 09-11-2012, 05:22 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Sorvani is exactly right. Since the timer event itself is triggered by a timer and not by a client, there is no way for it to know which client to update. Your best bet is probably to have the NPC send a signal to player.pl and then update your task from there for anyone that has it.

Basically, you would remove the line that updates the task activity and insteal put the line below:

Code:
$npc->SignalAllClients(1);
That will send a signal of 1 to all clients in the zone. Then, you would make a player.pl file and add the following sub:

player.pl
Code:
sub EVENT_SIGNAL {

	if ($signal == 1)
	{
		my $IsTaskActive = quest::istaskactivityactive(248, 2);
		
		if ($IsTaskActive == 1) { 
			quest::updatetaskactivity(248, 3); 
		}
	}	
}
I think that should do what you are wanting, but I didn't test it so you may need to work with it a little.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 09-11-2012, 01:47 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Nothing seems to be working past the line that is now changed to...
Code:
$npc->SignalAllClients(1);
I am guessing there is something wrong there.

Here is what I have, if I leave it like this the mob never despawns. If I remark the new line out, he does despawn.
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!");
			$npc->SignalAllClients(1);
			quest::depop();
		}
	}
}
Reply With Quote
  #5  
Old 09-11-2012, 05:23 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Should be $entity_list->SignalAllClients(1) from what I can tell.
Reply With Quote
  #6  
Old 09-11-2012, 09:13 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Woo hoo ! Worked like a champ, and I learned something new !
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:27 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3