Permalink
Browse files

[11901] Prevent EVENT_T_TIMER_OCC to expire while evading

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
  • Loading branch information...
Quriq14 authored and Schmoozerd committed Feb 6, 2012
1 parent f7173d6 commit 14b1dcbf6a669827e29b09504e6c15c80b1967f4
Showing with 4 additions and 8 deletions.
  1. +2 −2 doc/EventAI.txt
  2. +1 −5 src/game/CreatureEventAI.cpp
  3. +1 −1 src/shared/revision_nr.h
View
@@ -65,7 +65,7 @@ Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_E
# Internal name Param usage Description
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY IN COMBAT.
-1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY OUT OF COMBAT.
+1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY OUT OF COMBAT WHILE NOT EVADING.
2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when the Creature's HP is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4).
3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once the Creature's Mana% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4).
4 EVENT_T_AGGRO NONE Expires ONLY upon the Creature's INITIAL Aggro at the Start of Combat (Does NOT Repeat).
@@ -180,7 +180,7 @@ Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
+OUT OF COMBAT ONLY! NOT WHILE EVADING. - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
This is commonly used for events that occur and repeat outside of combat.
---------------
@@ -156,7 +156,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pHolder.UpdateRepeatTimer(m_creature,event.timer.repeatMin,event.timer.repeatMax);
break;
case EVENT_T_TIMER_OOC:
- if (m_creature->isInCombat())
+ if (m_creature->isInCombat() || m_creature->IsInEvadeMode())
return false;
//Repeat Timers
@@ -1136,10 +1136,6 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
//Check if we are in combat (also updates calls threat update code)
bool Combat = m_creature->SelectHostileTarget() && m_creature->getVictim();
- //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
- if (!m_creature->isAlive())
- return;
-
if (!m_bEmptyList)
{
//Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
View
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "11900"
+ #define REVISION_NR "11901"
#endif // __REVISION_NR_H__

0 comments on commit 14b1dcb

Please sign in to comment.