EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Stopping a timer on aggro loss (https://www.eqemulator.org/forums/showthread.php?t=27620)

Dibalamin 03-05-2009 01:12 PM

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!

trevius 03-05-2009 02:42 PM

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.

Dibalamin 03-05-2009 02:52 PM

/smacks forehead

Thanks Trevius, I keep tryin to do everything the hard way lol.

Dibalamin 03-05-2009 03:23 PM

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.....

Dibalamin 03-05-2009 10:50 PM

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");
 
  }
}


nilbog 03-06-2009 08:02 PM

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

Dibalamin 03-08-2009 08:46 PM

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.

Dibalamin 03-10-2009 10:38 AM

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

Thanks for the closer to this Trev!


All times are GMT -4. The time now is 07:20 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.