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 03-05-2009, 01:12 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default Stopping a timer on aggro loss

Would this work for stopping a timer when aggro is lost? Putting this within the sub EVENT_TIMER

Code:
$h = $npc->GetHateTop();

if ($h==0)
{
quest::stoptimer(1);
quest::stoptimer(2);
}
I'm not where I can test it, just curious if I'm on the right path. I'm a virtual noob when it comes to perl...just gettin started!
Reply With Quote
  #2  
Old 03-05-2009, 02:42 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You don't want to stop a timer from within EVENT_TIMER unless you are stopping one timer from another timer. The simple way is to just use EVENT_COMBAT like so:

Code:
sub EVENT_COMBAT {

  if ($combat_state == 0) {
    quest::stoptimer("BossAE");
    quest::stoptimer("BossResAE");
    quest::stoptimer("BossProc");
    quest::stoptimer("RandomNuke");
    quest::depopall(899007);
  }

}
We use this all of the time for resetting events/encounters if a raid wipes.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 03-05-2009, 02:52 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

/smacks forehead

Thanks Trevius, I keep tryin to do everything the hard way lol.
Reply With Quote
  #4  
Old 03-05-2009, 03:23 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Good to know we are on the right track for scripting though....not sure why folks just set mobs up to proc instead of making them right.....
Reply With Quote
  #5  
Old 03-05-2009, 10:50 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

I hate to ask Trev, but can you critique this? I can't get the AE's to fire. If I just make him talk with quest::say it works though! So I figure it has to do with the $userid and some way to carry it over from EVENT_AGGRO or maybe GetTopHate()?

Code:
sub EVENT_AGGRO { 
quest::settimer(1, 12); 
quest::settimer(2, 36); 
} 

sub EVENT_TIMER { 

if($timer eq "1") { 
quest::CastSpell($userid, 861); 
} 
if($timer eq "2") { 
quest::CastSpell($userid, 789); 
} 
} 

sub EVENT_COMBAT { 
  if ($combat_state == 0) { 
    quest::stoptimer("1"); 
    quest::stoptimer("2"); 
  
  } 
}
Reply With Quote
  #6  
Old 03-06-2009, 08:02 PM
nilbog
Hill Giant
 
Join Date: Nov 2007
Posts: 198
Default

Code:
#861 = lava breath
#789 = dragon roar


sub EVENT_AGGRO {
quest::settimer(1, 12);
quest::settimer(2, 36);
}
}

sub EVENT_TIMER {
if($timer eq "1") {
$npc->CastSpell(861,$userid);
}
if($timer eq "2") {
$npc->CastSpell(789,$userid);
}
}

sub EVENT_COMBAT {
  if ($combat_state == 0) {
    quest::stoptimer("1");
    quest::stoptimer("2");
 
  }
}
Replacing quest::CastSpell($userid, 861); with $npc->CastSpell(861,$userid);, makes first AE (861)go off, but not the 2nd one, like the 2nd timer is not working. and after a #repop, mob still is casting 861 .. like the stoptimers are not working.

Anyone have further insight into this? Is there a way for 2 timers to run simultaneously without stopping until end of combat?.. or what all is wrong with this quest
Reply With Quote
  #7  
Old 03-08-2009, 08:46 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

This works.

The issues we were having are the fact that the stoptimer doesn't trigger with #repop, only if he exits the combat_state via killing someone or by them zoning.
Reply With Quote
  #8  
Old 03-10-2009, 10:38 AM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Interesting side note to this ordeal; Sometimes the script will not work correctly till a server reboot.

Thanks for the closer to this Trev!
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 11:43 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3