From 97cb838de15081f5d46bbd786efb16259aa1a417 Mon Sep 17 00:00:00 2001 From: Quriq14 Date: Mon, 6 Feb 2012 21:17:27 +0100 Subject: [PATCH] [11901] Prevent EVENT_T_TIMER_OCC to expire while evading Signed-off-by: Schmoozerd --- doc/EventAI.txt | 4 ++-- src/game/CreatureEventAI.cpp | 6 +----- src/shared/revision_nr.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/doc/EventAI.txt b/doc/EventAI.txt index b1d780c8a..fd74436e1 100644 --- a/doc/EventAI.txt +++ b/doc/EventAI.txt @@ -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. --------------- diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index dd9488d9c..11e691a09 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -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 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2c1b37017..a845060f4 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11900" + #define REVISION_NR "11901" #endif // __REVISION_NR_H__