Originally Posted by
Rivory
I just switched 25 seconds to 24 seconds between waves to make it more accurate.
I was testing it with 24 seconds at first, but, for example, text for wave #13 was ~7 seconds ahead of the actual spawn.
Today I had time to actually test it thoroughly and made a macro that told me time difference since the last use of said macro. Was getting 24.8-25.3 results.
DBM just uses a timer that runs every 25 seconds, BW shows 22 secs since the spell I mentioned before (which is why you don't get a bar if you don't let them start casting). So I used 25 too.
Also it seems it turns off in P4 properly.
I also fixed a logical mistake I made in Untrigger function, here's an update: http://pastebin.com/fviFXtDL
This is the macro, btw:
Code:
/run timediff = timediff or 0 print(GetTime() - timediff) timediff = GetTime()
If you wanna test it yourself.
--------------------------------------------------
Originally Posted by
Rivory
Hardest thing will be figuring out how that triggers work.
So, basically, I made two triggers. Made the aura show up when any of the triggers *cough* triggers, to make it easier for me.
Trigger #1 happens every frame and does this:
Code:
1. Check if value of the variable called "checking" is 'true'. If it's not, exit the function, return false;
2. Get current time and compare it with a variable that stores time for the next wave. If the former's less than the latter, exit the function, return false;
3. Set that variable to current time + 25;
4. Set another variable to current time (since I made the text to show for 10 seconds OR until all the imps die, whatever happens sooner, I need to store that);
5. Increment the variable storing waves by 1 and the variable storing imps alive by 3;
6. Return true (returning true makes the aura show up).
To put it mildly, a timer.
Trigger #2 listens to
a) ENCOUNTER_START and does this
Code:
1. Set variables storing imps, waves to 0;
2. Set "checking" to false.
b) UNIT_SPELLCAST_SUCCEEDED and does this:
Code:
If it's a Fel Portal cast => Set the variable storing time for next wave to current time + 12 (this is actually very accurate); set "checking" to true.
If it's a stacking buff on the boss that he gains in P4 => set "checking" to false.
c) COMBAT_LOG_EVENT_UNFILTERED and does this:
Code:
1. Checks the message. If it's not "UNIT_DIED", then exit the function;
2. If it is, then parse the unit's GUID. It contains an NPC ID for NPC units. If it is 94231, then decrement the variable storing number of imps by 1.
To put it mildly, logic that decides whether the timer should be running and that handles imps dying.