feat(Core/Maps): AreaBoundary (#10525)
* cherry-picked commit (2da458c56d)
This commit is contained in:
parent
c1747f2fbf
commit
ab4ee71762
169 changed files with 918 additions and 628 deletions
|
|
@ -15,8 +15,8 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Define.h"
|
||||
#include "LogCommon.h"
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ void GuardAI::Reset()
|
|||
me->CastSpell(me, 18950 /*SPELL_INVISIBILITY_AND_STEALTH_DETECTION*/, true);
|
||||
}
|
||||
|
||||
void GuardAI::EnterEvadeMode()
|
||||
void GuardAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
static int Permissible(Creature const* creature);
|
||||
|
||||
void Reset() override;
|
||||
void EnterEvadeMode() override;
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override;
|
||||
void JustDied(Unit* killer) override;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ NullCreatureAI::NullCreatureAI(Creature* c) : CreatureAI(c) { me->SetReactState(
|
|||
void PassiveAI::UpdateAI(uint32)
|
||||
{
|
||||
if (me->IsInCombat() && me->getAttackers().empty())
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
|
||||
void PossessedAI::AttackStart(Unit* target)
|
||||
|
|
@ -66,11 +66,11 @@ void CritterAI::DamageTaken(Unit*, uint32&, DamageEffectType, SpellSchoolMask)
|
|||
_combatTimer = 1;
|
||||
}
|
||||
|
||||
void CritterAI::EnterEvadeMode()
|
||||
void CritterAI::EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STATE_FLEEING))
|
||||
me->SetControlled(false, UNIT_STATE_FLEEING);
|
||||
CreatureAI::EnterEvadeMode();
|
||||
CreatureAI::EnterEvadeMode(why);
|
||||
_combatTimer = 0;
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ void CritterAI::UpdateAI(uint32 diff)
|
|||
{
|
||||
_combatTimer += diff;
|
||||
if (_combatTimer >= 5000)
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
void MoveInLineOfSight(Unit*) override {}
|
||||
void AttackStart(Unit* target) override;
|
||||
void UpdateAI(uint32) override;
|
||||
void EnterEvadeMode() override {}
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override {}
|
||||
|
||||
void JustDied(Unit*) override;
|
||||
void KilledUnit(Unit* victim) override;
|
||||
|
|
@ -57,7 +57,7 @@ public:
|
|||
void MoveInLineOfSight(Unit*) override {}
|
||||
void AttackStart(Unit*) override {}
|
||||
void UpdateAI(uint32) override {}
|
||||
void EnterEvadeMode() override {}
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override {}
|
||||
void OnCharmed(bool /*apply*/) override {}
|
||||
|
||||
static int Permissible(Creature const*) { return PERMIT_BASE_IDLE; }
|
||||
|
|
@ -69,7 +69,7 @@ public:
|
|||
explicit CritterAI(Creature* c) : PassiveAI(c) { _combatTimer = 0; }
|
||||
|
||||
void DamageTaken(Unit* /*done_by*/, uint32& /*damage*/, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override;
|
||||
void EnterEvadeMode() override;
|
||||
void EnterEvadeMode(EvadeReason why) override;
|
||||
void UpdateAI(uint32) override;
|
||||
|
||||
// Xinef: Added
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ public:
|
|||
//
|
||||
void MoveInLineOfSight(Unit* /*who*/) override {} // CreatureAI interferes with returning pets
|
||||
void MoveInLineOfSight_Safe(Unit* /*who*/) {} // CreatureAI interferes with returning pets
|
||||
void EnterEvadeMode() override {} // For fleeing, pets don't use this type of Evade mechanic
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override {} // For fleeing, pets don't use this type of Evade mechanic
|
||||
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override;
|
||||
|
||||
void PetStopAttack() override;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void TotemAI::MoveInLineOfSight(Unit* /*who*/)
|
|||
{
|
||||
}
|
||||
|
||||
void TotemAI::EnterEvadeMode()
|
||||
void TotemAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
me->CombatStop(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,10 @@ public:
|
|||
|
||||
void MoveInLineOfSight(Unit* who) override;
|
||||
void AttackStart(Unit* victim) override;
|
||||
void EnterEvadeMode() override;
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override;
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* /*spellInfo*/) override;
|
||||
|
||||
void DoAction(int32 param) override;
|
||||
|
||||
void UpdateAI(uint32 diff) override;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AreaBoundary.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
|
@ -24,6 +25,7 @@
|
|||
#include "MapReference.h"
|
||||
#include "Player.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Language.h"
|
||||
|
||||
class PhasedRespawn : public BasicEvent
|
||||
{
|
||||
|
|
@ -196,9 +198,9 @@ void CreatureAI::TriggerAlert(Unit const* who) const
|
|||
me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void CreatureAI::EnterEvadeMode()
|
||||
void CreatureAI::EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
if (!_EnterEvadeMode())
|
||||
if (!_EnterEvadeMode(why))
|
||||
return;
|
||||
|
||||
LOG_DEBUG("entities.unit", "Creature {} enters evade mode.", me->GetEntry());
|
||||
|
|
@ -290,7 +292,7 @@ bool CreatureAI::UpdateVictim()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CreatureAI::_EnterEvadeMode()
|
||||
bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
{
|
||||
|
|
@ -357,6 +359,44 @@ void CreatureAI::MoveBackwardsChecks() {
|
|||
me->GetMotionMaster()->MoveBackwards(victim, moveDist);
|
||||
}
|
||||
|
||||
bool CreatureAI::IsInBoundary(Position const* who) const
|
||||
{
|
||||
if (!_boundary)
|
||||
return true;
|
||||
|
||||
if (!who)
|
||||
who = me;
|
||||
|
||||
return (CreatureAI::IsInBounds(*_boundary, who) != _negateBoundary);
|
||||
}
|
||||
|
||||
bool CreatureAI::IsInBounds(CreatureBoundary const& boundary, Position const* pos)
|
||||
{
|
||||
for (AreaBoundary const* areaBoundary : boundary)
|
||||
if (!areaBoundary->IsWithinBoundary(pos))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CreatureAI::CheckInRoom()
|
||||
{
|
||||
if (IsInBoundary())
|
||||
return true;
|
||||
else
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_BOUNDARY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void CreatureAI::SetBoundary(CreatureBoundary const* boundary, bool negateBoundaries /*= false*/)
|
||||
{
|
||||
_boundary = boundary;
|
||||
_negateBoundary = negateBoundaries;
|
||||
me->DoImmediateBoundaryCheck();
|
||||
}
|
||||
|
||||
Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType)
|
||||
{
|
||||
return me->SummonCreature(entry, pos, summonType, despawnTime);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#ifndef ACORE_CREATUREAI_H
|
||||
#define ACORE_CREATUREAI_H
|
||||
|
||||
#include "AreaBoundary.h"
|
||||
#include "Common.h"
|
||||
#include "Creature.h"
|
||||
#include "UnitAI.h"
|
||||
|
|
@ -29,6 +30,8 @@ class Creature;
|
|||
class Player;
|
||||
class SpellInfo;
|
||||
|
||||
typedef std::vector<AreaBoundary const*> CreatureBoundary;
|
||||
|
||||
#define TIME_INTERVAL_LOOK 5000
|
||||
#define VISIBILITY_RANGE 10000
|
||||
|
||||
|
|
@ -78,10 +81,19 @@ protected:
|
|||
Creature* DoSummon(uint32 entry, Position const& pos, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
Creature* DoSummon(uint32 entry, WorldObject* obj, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
|
||||
public:
|
||||
// EnumUtils: DESCRIBE THIS
|
||||
enum EvadeReason
|
||||
{
|
||||
EVADE_REASON_NO_HOSTILES, // the creature's threat list is empty
|
||||
EVADE_REASON_BOUNDARY, // the creature has moved outside its evade boundary
|
||||
EVADE_REASON_SEQUENCE_BREAK, // this is a boss and the pre-requisite encounters for engaging it are not defeated yet
|
||||
EVADE_REASON_OTHER
|
||||
};
|
||||
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr);
|
||||
explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), m_MoveInLineOfSight_locked(false) {}
|
||||
|
||||
explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), m_MoveInLineOfSight_locked(false) { }
|
||||
|
||||
~CreatureAI() override {}
|
||||
|
||||
|
|
@ -100,7 +112,7 @@ public:
|
|||
virtual bool CanRespawn() { return true; }
|
||||
|
||||
// Called for reaction at stopping attack at no attackers or targets
|
||||
virtual void EnterEvadeMode();
|
||||
virtual void EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER);
|
||||
|
||||
// Called for reaction at enter to combat if not in combat yet (enemy can be nullptr)
|
||||
virtual void EnterCombat(Unit* /*victim*/) {}
|
||||
|
|
@ -187,10 +199,20 @@ public:
|
|||
|
||||
virtual void PetStopAttack() { }
|
||||
|
||||
// boundary system methods
|
||||
virtual bool CheckInRoom();
|
||||
CreatureBoundary const* GetBoundary() const { return _boundary; }
|
||||
void SetBoundary(CreatureBoundary const* boundary, bool negativeBoundaries = false);
|
||||
|
||||
static bool IsInBounds(CreatureBoundary const& boundary, Position const* who);
|
||||
bool IsInBoundary(Position const* who = nullptr) const;
|
||||
protected:
|
||||
virtual void MoveInLineOfSight(Unit* /*who*/);
|
||||
|
||||
bool _EnterEvadeMode();
|
||||
bool _EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER);
|
||||
|
||||
CreatureBoundary const* _boundary;
|
||||
bool _negateBoundary;
|
||||
|
||||
private:
|
||||
bool m_MoveInLineOfSight_locked;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AreaBoundary.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
|
|
@ -171,7 +172,6 @@ bool SummonList::IsAnyCreatureInCombat() const
|
|||
ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature),
|
||||
me(creature),
|
||||
IsFleeing(false),
|
||||
_evadeCheckCooldown(2500),
|
||||
_isCombatMovementAllowed(true)
|
||||
{
|
||||
_isHeroic = me->GetMap()->IsHeroic();
|
||||
|
|
@ -489,23 +489,6 @@ enum eNPCs
|
|||
NPC_FREYA = 32906,
|
||||
};
|
||||
|
||||
bool ScriptedAI::EnterEvadeIfOutOfCombatArea()
|
||||
{
|
||||
if (me->IsInEvadeMode() || !me->IsInCombat())
|
||||
return false;
|
||||
|
||||
if (_evadeCheckCooldown == GameTime::GetGameTime().count())
|
||||
return false;
|
||||
|
||||
_evadeCheckCooldown = GameTime::GetGameTime().count();
|
||||
|
||||
if (!CheckEvadeIfOutOfCombatArea())
|
||||
return false;
|
||||
|
||||
EnterEvadeMode();
|
||||
return true;
|
||||
}
|
||||
|
||||
Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura, bool mustBeInLOS) const
|
||||
{
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
|
|
@ -531,9 +514,10 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
|
|||
BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature),
|
||||
instance(creature->GetInstanceScript()),
|
||||
summons(creature),
|
||||
_boundary(instance ? instance->GetBossBoundary(bossId) : nullptr),
|
||||
_bossId(bossId)
|
||||
{
|
||||
if (instance)
|
||||
SetBoundary(instance->GetBossBoundary(bossId));
|
||||
}
|
||||
|
||||
void BossAI::_Reset()
|
||||
|
|
@ -583,59 +567,10 @@ void BossAI::TeleportCheaters()
|
|||
ThreatContainer::StorageType threatList = me->getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && !CheckBoundary(target))
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && !IsInBoundary(target))
|
||||
target->NearTeleportTo(x, y, z, 0);
|
||||
}
|
||||
|
||||
bool BossAI::CheckBoundary(Unit* who)
|
||||
{
|
||||
if (!GetBoundary() || !who)
|
||||
return true;
|
||||
|
||||
for (BossBoundaryMap::const_iterator itr = GetBoundary()->begin(); itr != GetBoundary()->end(); ++itr)
|
||||
{
|
||||
switch (itr->first)
|
||||
{
|
||||
case BOUNDARY_N:
|
||||
if (who->GetPositionX() > itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_S:
|
||||
if (who->GetPositionX() < itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_E:
|
||||
if (who->GetPositionY() < itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_W:
|
||||
if (who->GetPositionY() > itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_NW:
|
||||
if (who->GetPositionX() + who->GetPositionY() > itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_SE:
|
||||
if (who->GetPositionX() + who->GetPositionY() < itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_NE:
|
||||
if (who->GetPositionX() - who->GetPositionY() > itr->second)
|
||||
return false;
|
||||
break;
|
||||
case BOUNDARY_SW:
|
||||
if (who->GetPositionX() - who->GetPositionY() < itr->second)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void BossAI::JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
|
|
|
|||
|
|
@ -344,7 +344,6 @@ struct ScriptedAI : public CreatureAI
|
|||
void SetCombatMovement(bool allowMovement);
|
||||
bool IsCombatMovementAllowed() const { return _isCombatMovementAllowed; }
|
||||
|
||||
bool EnterEvadeIfOutOfCombatArea();
|
||||
virtual bool CheckEvadeIfOutOfCombatArea() const { return false; }
|
||||
|
||||
// return true for heroic mode. i.e.
|
||||
|
|
@ -416,7 +415,6 @@ struct ScriptedAI : public CreatureAI
|
|||
|
||||
private:
|
||||
Difficulty _difficulty;
|
||||
uint32 _evadeCheckCooldown;
|
||||
bool _isCombatMovementAllowed;
|
||||
bool _isHeroic;
|
||||
};
|
||||
|
|
@ -428,7 +426,6 @@ public:
|
|||
~BossAI() override {}
|
||||
|
||||
InstanceScript* const instance;
|
||||
BossBoundaryMap const* GetBoundary() const { return _boundary; }
|
||||
|
||||
void JustSummoned(Creature* summon) override;
|
||||
void SummonedCreatureDespawn(Creature* summon) override;
|
||||
|
|
@ -453,23 +450,12 @@ protected:
|
|||
void _JustDied();
|
||||
void _JustReachedHome() { me->setActive(false); }
|
||||
|
||||
bool CheckInRoom()
|
||||
{
|
||||
if (CheckBoundary(me))
|
||||
return true;
|
||||
|
||||
EnterEvadeMode();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CheckBoundary(Unit* who);
|
||||
void TeleportCheaters();
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
private:
|
||||
BossBoundaryMap const* const _boundary;
|
||||
uint32 const _bossId;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ void npc_escortAI::ReturnToLastPoint()
|
|||
me->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z);
|
||||
}
|
||||
|
||||
void npc_escortAI::EnterEvadeMode()
|
||||
void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
void ReturnToLastPoint();
|
||||
|
||||
void EnterEvadeMode() override;
|
||||
void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override;
|
||||
|
||||
void UpdateAI(uint32 diff) override; //the "internal" update, calls UpdateEscortAI()
|
||||
virtual void UpdateEscortAI(uint32 diff); //used when it's needed to add code in update (abilities, scripted events, etc)
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void FollowerAI::JustRespawned()
|
|||
Reset();
|
||||
}
|
||||
|
||||
void FollowerAI::EnterEvadeMode()
|
||||
void FollowerAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public:
|
|||
|
||||
void MoveInLineOfSight(Unit*) override;
|
||||
|
||||
void EnterEvadeMode() override;
|
||||
void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override;
|
||||
|
||||
void JustDied(Unit*) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -618,7 +618,7 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data)
|
|||
MovepointReached(Data);
|
||||
}
|
||||
|
||||
void SmartAI::EnterEvadeMode()
|
||||
void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
// xinef: fixes strange jumps when charming SmartAI npc
|
||||
if (!me->IsAlive() || me->IsInEvadeMode())
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public:
|
|||
void EnterCombat(Unit* enemy) override;
|
||||
|
||||
// Called for reaction at stopping attack at no attackers or targets
|
||||
void EnterEvadeMode() override;
|
||||
void EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER) override;
|
||||
|
||||
// Called when the creature is killed
|
||||
void JustDied(Unit* killer) override;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
}
|
||||
|
||||
Creature::Creature(bool isWorldObject): Unit(isWorldObject), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0), m_lootRecipientGroup(0),
|
||||
m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_wanderDistance(0.0f),
|
||||
m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_wanderDistance(0.0f), m_boundaryCheckTime(2500),
|
||||
m_transportCheckTimer(1000), lootPickPocketRestoreTime(0), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE),
|
||||
m_spawnId(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
|
||||
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0), m_moveInLineOfSightDisabled(false), m_moveInLineOfSightStrictlyDisabled(false),
|
||||
|
|
@ -689,6 +689,17 @@ void Creature::Update(uint32 diff)
|
|||
SelectVictim();
|
||||
}
|
||||
|
||||
// periodic check to see if the creature has passed an evade boundary
|
||||
if (IsAIEnabled && !IsInEvadeMode() && IsInCombat())
|
||||
{
|
||||
if (diff >= m_boundaryCheckTime)
|
||||
{
|
||||
AI()->CheckInRoom();
|
||||
m_boundaryCheckTime = 2500;
|
||||
} else
|
||||
m_boundaryCheckTime -= diff;
|
||||
}
|
||||
|
||||
Unit* owner = GetCharmerOrOwner();
|
||||
if (IsCharmed() && !IsWithinDistInMap(owner, GetMap()->GetVisibilityRange(), true, false))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -285,6 +285,8 @@ public:
|
|||
[[nodiscard]] float GetWanderDistance() const { return m_wanderDistance; }
|
||||
void SetWanderDistance(float dist) { m_wanderDistance = dist; }
|
||||
|
||||
void DoImmediateBoundaryCheck() { m_boundaryCheckTime = 0; }
|
||||
|
||||
uint32 m_groupLootTimer; // (msecs)timer used for group loot
|
||||
uint32 lootingGroupLowGUID; // used to find group which is looting corpse
|
||||
|
||||
|
|
@ -402,6 +404,7 @@ protected:
|
|||
uint32 m_respawnDelay; // (secs) delay between corpse disappearance and respawning
|
||||
uint32 m_corpseDelay; // (secs) delay between death and corpse disappearance
|
||||
float m_wanderDistance;
|
||||
uint32 m_boundaryCheckTime; // (msecs) remaining time for next evade boundary check
|
||||
uint16 m_transportCheckTimer;
|
||||
uint32 lootPickPocketRestoreTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Define.h"
|
||||
#include "Item.h"
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
|
||||
|
|
|
|||
|
|
@ -14038,7 +14038,7 @@ void Unit::TauntFadeOut(Unit* taunter)
|
|||
if (m_ThreatMgr.isThreatListEmpty())
|
||||
{
|
||||
if (creature->IsAIEnabled)
|
||||
creature->AI()->EnterEvadeMode();
|
||||
creature->AI()->EnterEvadeMode(CreatureAI::EVADE_REASON_NO_HOSTILES);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -14124,7 +14124,7 @@ Unit* Creature::SelectVictim()
|
|||
for (Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
|
||||
if ((*itr)->GetBase()->IsPermanent())
|
||||
{
|
||||
AI()->EnterEvadeMode();
|
||||
AI()->EnterEvadeMode(CreatureAI::EVADE_REASON_NO_HOSTILES);
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Unit.h"
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include "Unit.h"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
|
|
|
|||
|
|
@ -31,6 +31,12 @@
|
|||
#include "Spell.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
BossBoundaryData::~BossBoundaryData()
|
||||
{
|
||||
for (const_iterator it = begin(); it != end(); ++it)
|
||||
delete it->boundary;
|
||||
}
|
||||
|
||||
void InstanceScript::SaveToDB()
|
||||
{
|
||||
std::string data = GetSaveData();
|
||||
|
|
@ -120,6 +126,13 @@ bool InstanceScript::IsEncounterInProgress() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void InstanceScript::LoadBossBoundaries(const BossBoundaryData& data)
|
||||
{
|
||||
for (BossBoundaryEntry const& entry : data)
|
||||
if (entry.bossId < bosses.size())
|
||||
bosses[entry.bossId].boundary.push_back(entry.boundary);
|
||||
}
|
||||
|
||||
void InstanceScript::LoadMinionData(const MinionData* data)
|
||||
{
|
||||
while (data->entry)
|
||||
|
|
@ -137,7 +150,7 @@ void InstanceScript::LoadDoorData(const DoorData* data)
|
|||
while (data->entry)
|
||||
{
|
||||
if (data->bossId < bosses.size())
|
||||
doors.insert(std::make_pair(data->entry, DoorInfo(&bosses[data->bossId], data->type, BoundaryType(data->boundary))));
|
||||
doors.insert(std::make_pair(data->entry, DoorInfo(&bosses[data->bossId], data->type)));
|
||||
|
||||
++data;
|
||||
}
|
||||
|
|
@ -268,28 +281,6 @@ void InstanceScript::AddDoor(GameObject* door, bool add)
|
|||
if (add)
|
||||
{
|
||||
data.bossInfo->door[data.type].insert(door);
|
||||
switch (data.boundary)
|
||||
{
|
||||
default:
|
||||
case BOUNDARY_NONE:
|
||||
break;
|
||||
case BOUNDARY_N:
|
||||
case BOUNDARY_S:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionX();
|
||||
break;
|
||||
case BOUNDARY_E:
|
||||
case BOUNDARY_W:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionY();
|
||||
break;
|
||||
case BOUNDARY_NW:
|
||||
case BOUNDARY_SE:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionX() + door->GetPositionY();
|
||||
break;
|
||||
case BOUNDARY_NE:
|
||||
case BOUNDARY_SW:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionX() - door->GetPositionY();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
data.bossInfo->door[data.type].erase(door);
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@
|
|||
#ifndef ACORE_INSTANCE_DATA_H
|
||||
#define ACORE_INSTANCE_DATA_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "ZoneScript.h"
|
||||
#include <set>
|
||||
|
||||
#define OUT_SAVE_INST_DATA LOG_DEBUG("scripts.ai", "Saving Instance Data for Instance {} (Map {}, Instance Id {})", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_SAVE_INST_DATA_COMPLETE LOG_DEBUG("scripts.ai", "Saving Instance Data for Instance {} (Map {}, Instance Id {}) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
|
|
@ -67,30 +69,30 @@ enum DoorType
|
|||
MAX_DOOR_TYPES,
|
||||
};
|
||||
|
||||
enum BoundaryType
|
||||
{
|
||||
BOUNDARY_NONE = 0,
|
||||
BOUNDARY_N,
|
||||
BOUNDARY_S,
|
||||
BOUNDARY_E,
|
||||
BOUNDARY_W,
|
||||
BOUNDARY_NE,
|
||||
BOUNDARY_NW,
|
||||
BOUNDARY_SE,
|
||||
BOUNDARY_SW,
|
||||
BOUNDARY_MAX_X = BOUNDARY_N,
|
||||
BOUNDARY_MIN_X = BOUNDARY_S,
|
||||
BOUNDARY_MAX_Y = BOUNDARY_W,
|
||||
BOUNDARY_MIN_Y = BOUNDARY_E,
|
||||
};
|
||||
|
||||
typedef std::map<BoundaryType, float> BossBoundaryMap;
|
||||
|
||||
struct DoorData
|
||||
{
|
||||
uint32 entry, bossId;
|
||||
DoorType type;
|
||||
uint32 boundary;
|
||||
};
|
||||
|
||||
struct BossBoundaryEntry
|
||||
{
|
||||
uint32 const bossId;
|
||||
AreaBoundary const* const boundary;
|
||||
};
|
||||
|
||||
struct BossBoundaryData
|
||||
{
|
||||
typedef std::vector<BossBoundaryEntry> StorageType;
|
||||
typedef StorageType::const_iterator const_iterator;
|
||||
|
||||
BossBoundaryData(std::initializer_list<BossBoundaryEntry> data) : _data(data) { }
|
||||
~BossBoundaryData();
|
||||
const_iterator begin() const { return _data.begin(); }
|
||||
const_iterator end() const { return _data.end(); }
|
||||
|
||||
private:
|
||||
StorageType _data;
|
||||
};
|
||||
|
||||
struct MinionData
|
||||
|
|
@ -110,16 +112,15 @@ struct BossInfo
|
|||
EncounterState state;
|
||||
DoorSet door[MAX_DOOR_TYPES];
|
||||
MinionSet minion;
|
||||
BossBoundaryMap boundary;
|
||||
CreatureBoundary boundary;
|
||||
};
|
||||
|
||||
struct DoorInfo
|
||||
{
|
||||
explicit DoorInfo(BossInfo* _bossInfo, DoorType _type, BoundaryType _boundary)
|
||||
: bossInfo(_bossInfo), type(_type), boundary(_boundary) {}
|
||||
explicit DoorInfo(BossInfo* _bossInfo, DoorType _type)
|
||||
: bossInfo(_bossInfo), type(_type) { }
|
||||
BossInfo* bossInfo;
|
||||
DoorType type;
|
||||
BoundaryType boundary;
|
||||
};
|
||||
|
||||
struct MinionInfo
|
||||
|
|
@ -225,7 +226,7 @@ public:
|
|||
virtual bool SetBossState(uint32 id, EncounterState state);
|
||||
EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; }
|
||||
static std::string GetBossStateName(uint8 state);
|
||||
BossBoundaryMap const* GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : nullptr; }
|
||||
CreatureBoundary const* GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : nullptr; }
|
||||
BossInfo const* GetBossInfo(uint32 id) const { return &bosses[id]; }
|
||||
|
||||
// Achievement criteria additional requirements check
|
||||
|
|
@ -255,6 +256,7 @@ public:
|
|||
virtual void DoAction(int32 /*action*/) {}
|
||||
protected:
|
||||
void SetBossNumber(uint32 number) { bosses.resize(number); }
|
||||
void LoadBossBoundaries(BossBoundaryData const& data);
|
||||
void LoadDoorData(DoorData const* data);
|
||||
void LoadMinionData(MinionData const* data);
|
||||
void LoadObjectData(ObjectData const* creatureData, ObjectData const* gameObjectData);
|
||||
|
|
|
|||
113
src/server/game/Maps/AreaBoundary.cpp
Normal file
113
src/server/game/Maps/AreaBoundary.cpp
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AreaBoundary.h"
|
||||
#include "Unit.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
// ---== RECTANGLE ==---
|
||||
RectangleBoundary::RectangleBoundary(float southX, float northX, float eastY, float westY, bool isInverted) :
|
||||
AreaBoundary(isInverted), _minX(southX), _maxX(northX), _minY(eastY), _maxY(westY) { }
|
||||
bool RectangleBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
return !(
|
||||
pos->GetPositionX() < _minX ||
|
||||
pos->GetPositionX() > _maxX ||
|
||||
pos->GetPositionY() < _minY ||
|
||||
pos->GetPositionY() > _maxY
|
||||
);
|
||||
}
|
||||
|
||||
// ---== CIRCLE ==---
|
||||
CircleBoundary::CircleBoundary(Position const& center, double radius, bool isInverted) :
|
||||
AreaBoundary(isInverted), _center(center), _radiusSq(radius*radius) { }
|
||||
|
||||
CircleBoundary::CircleBoundary(Position const& center, Position const& pointOnCircle, bool isInverted) :
|
||||
AreaBoundary(isInverted), _center(center), _radiusSq(_center.GetDoubleExactDist2dSq(pointOnCircle)) { }
|
||||
|
||||
bool CircleBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
double offX = _center.GetDoublePositionX() - pos->GetPositionX();
|
||||
double offY = _center.GetDoublePositionY() - pos->GetPositionY();
|
||||
return offX * offX + offY * offY <= _radiusSq;
|
||||
}
|
||||
|
||||
// ---== ELLIPSE ==---
|
||||
EllipseBoundary::EllipseBoundary(Position const& center, double radiusX, double radiusY, bool isInverted) :
|
||||
AreaBoundary(isInverted), _center(center), _radiusYSq(radiusY*radiusY), _scaleXSq(_radiusYSq / (radiusX*radiusX)) { }
|
||||
|
||||
bool EllipseBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
double offX = _center.GetDoublePositionX() - pos->GetPositionX();
|
||||
double offY = _center.GetDoublePositionY() - pos->GetPositionY();
|
||||
return (offX*offX)*_scaleXSq + (offY*offY) <= _radiusYSq;
|
||||
}
|
||||
|
||||
// ---== TRIANGLE ==---
|
||||
TriangleBoundary::TriangleBoundary(Position const& pointA, Position const& pointB, Position const& pointC, bool isInverted) :
|
||||
AreaBoundary(isInverted), _a(pointA), _b(pointB), _c(pointC), _abx(_b.GetDoublePositionX()-_a.GetDoublePositionX()), _bcx(_c.GetDoublePositionX()-_b.GetDoublePositionX()), _cax(_a.GetDoublePositionX() - _c.GetDoublePositionX()), _aby(_b.GetDoublePositionY()-_a.GetDoublePositionY()), _bcy(_c.GetDoublePositionY()-_b.GetDoublePositionY()), _cay(_a.GetDoublePositionY() - _c.GetDoublePositionY()) { }
|
||||
bool TriangleBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
// half-plane signs
|
||||
bool sign1 = ((-_b.GetDoublePositionX() + pos->GetPositionX()) * _aby - (-_b.GetDoublePositionY() + pos->GetPositionY()) * _abx) < 0;
|
||||
bool sign2 = ((-_c.GetDoublePositionX() + pos->GetPositionX()) * _bcy - (-_c.GetDoublePositionY() + pos->GetPositionY()) * _bcx) < 0;
|
||||
bool sign3 = ((-_a.GetDoublePositionX() + pos->GetPositionX()) * _cay - (-_a.GetDoublePositionY() + pos->GetPositionY()) * _cax) < 0;
|
||||
|
||||
// if all signs are the same, the point is inside the triangle
|
||||
return ((sign1 == sign2) && (sign2 == sign3));
|
||||
}
|
||||
|
||||
// ---== PARALLELOGRAM ==---
|
||||
ParallelogramBoundary::ParallelogramBoundary(Position const& cornerA, Position const& cornerB, Position const& cornerD, bool isInverted) :
|
||||
AreaBoundary(isInverted), _a(cornerA), _b(cornerB), _d(cornerD), _c(DoublePosition(_d.GetDoublePositionX() + (_b.GetDoublePositionX() - _a.GetDoublePositionX()), _d.GetDoublePositionY() + (_b.GetDoublePositionY() - _a.GetDoublePositionY()))), _abx(_b.GetDoublePositionX() - _a.GetDoublePositionX()), _dax(_a.GetDoublePositionX() - _d.GetDoublePositionX()), _aby(_b.GetDoublePositionY() - _a.GetDoublePositionY()), _day(_a.GetDoublePositionY() - _d.GetDoublePositionY()) { }
|
||||
bool ParallelogramBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
// half-plane signs
|
||||
bool sign1 = ((-_b.GetDoublePositionX() + pos->GetPositionX()) * _aby - (-_b.GetDoublePositionY() + pos->GetPositionY()) * _abx) < 0;
|
||||
bool sign2 = ((-_a.GetDoublePositionX() + pos->GetPositionX()) * _day - (-_a.GetDoublePositionY() + pos->GetPositionY()) * _dax) < 0;
|
||||
bool sign3 = ((-_d.GetDoublePositionY() + pos->GetPositionY()) * _abx - (-_d.GetDoublePositionX() + pos->GetPositionX()) * _aby) < 0; // AB = -CD
|
||||
bool sign4 = ((-_c.GetDoublePositionY() + pos->GetPositionY()) * _dax - (-_c.GetDoublePositionX() + pos->GetPositionX()) * _day) < 0; // DA = -BC
|
||||
|
||||
// if all signs are equal, the point is inside
|
||||
return ((sign1 == sign2) && (sign2 == sign3) && (sign3 == sign4));
|
||||
}
|
||||
|
||||
// ---== Z RANGE ==---
|
||||
ZRangeBoundary::ZRangeBoundary(float minZ, float maxZ, bool isInverted) :
|
||||
AreaBoundary(isInverted), _minZ(minZ), _maxZ(maxZ) { }
|
||||
bool ZRangeBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
return (_minZ <= pos->GetPositionZ() && pos->GetPositionZ() <= _maxZ);
|
||||
}
|
||||
|
||||
// ---== UNION OF 2 BOUNDARIES ==---
|
||||
BoundaryUnionBoundary::BoundaryUnionBoundary(AreaBoundary const* b1, AreaBoundary const* b2, bool isInverted) :
|
||||
AreaBoundary(isInverted), _b1(b1), _b2(b2)
|
||||
{
|
||||
ASSERT(b1 && b2);
|
||||
}
|
||||
|
||||
BoundaryUnionBoundary::~BoundaryUnionBoundary()
|
||||
{
|
||||
delete _b1;
|
||||
delete _b2;
|
||||
}
|
||||
|
||||
bool BoundaryUnionBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
return (_b1->IsWithinBoundary(pos) || _b2->IsWithinBoundary(pos));
|
||||
}
|
||||
168
src/server/game/Maps/AreaBoundary.h
Normal file
168
src/server/game/Maps/AreaBoundary.h
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ACORE_AREA_BOUNDARY_H
|
||||
#define ACORE_AREA_BOUNDARY_H
|
||||
|
||||
#include "Position.h"
|
||||
|
||||
class AC_GAME_API AreaBoundary
|
||||
{
|
||||
public:
|
||||
bool IsWithinBoundary(Position const* pos) const { return pos && (IsWithinBoundaryArea(pos) != _isInvertedBoundary); }
|
||||
bool IsWithinBoundary(Position const& pos) const { return IsWithinBoundary(&pos); }
|
||||
|
||||
virtual ~AreaBoundary() { }
|
||||
|
||||
protected:
|
||||
explicit AreaBoundary(bool isInverted) : _isInvertedBoundary(isInverted) { }
|
||||
|
||||
struct DoublePosition : Position
|
||||
{
|
||||
DoublePosition(double x = 0.0, double y = 0.0, double z = 0.0, float o = 0.0f)
|
||||
: Position(float(x), float(y), float(z), o), DoublePosX(x), DoublePosY(y), DoublePosZ(z) { }
|
||||
|
||||
DoublePosition(float x, float y = 0.0f, float z = 0.0f, float o = 0.0f)
|
||||
: Position(x, y, z, o), DoublePosX(x), DoublePosY(y), DoublePosZ(z) { }
|
||||
|
||||
DoublePosition(Position const& pos)
|
||||
: Position(pos), DoublePosX(pos.m_positionX), DoublePosY(pos.m_positionY), DoublePosZ(pos.m_positionZ) { }
|
||||
|
||||
double GetDoublePositionX() const { return DoublePosX; }
|
||||
double GetDoublePositionY() const { return DoublePosY; }
|
||||
double GetDoublePositionZ() const { return DoublePosZ; }
|
||||
|
||||
double GetDoubleExactDist2dSq(DoublePosition const& pos) const
|
||||
{
|
||||
double const offX = GetDoublePositionX() - pos.GetDoublePositionX();
|
||||
double const offY = GetDoublePositionY() - pos.GetDoublePositionY();
|
||||
return (offX * offX) + (offY * offY);
|
||||
}
|
||||
|
||||
Position* sync()
|
||||
{
|
||||
m_positionX = float(DoublePosX);
|
||||
m_positionY = float(DoublePosY);
|
||||
m_positionZ = float(DoublePosZ);
|
||||
return this;
|
||||
}
|
||||
|
||||
double DoublePosX;
|
||||
double DoublePosY;
|
||||
double DoublePosZ;
|
||||
};
|
||||
|
||||
virtual bool IsWithinBoundaryArea(Position const* pos) const = 0;
|
||||
|
||||
private:
|
||||
bool _isInvertedBoundary;
|
||||
};
|
||||
|
||||
class AC_GAME_API RectangleBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
// X axis is north/south, Y axis is east/west, larger values are northwest
|
||||
RectangleBoundary(float southX, float northX, float eastY, float westY, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
float const _minX, _maxX, _minY, _maxY;
|
||||
};
|
||||
|
||||
class AC_GAME_API CircleBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
CircleBoundary(Position const& center, double radius, bool isInverted = false);
|
||||
CircleBoundary(Position const& center, Position const& pointOnCircle, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
DoublePosition const _center;
|
||||
double const _radiusSq;
|
||||
};
|
||||
|
||||
class AC_GAME_API EllipseBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
EllipseBoundary(Position const& center, double radiusX, double radiusY, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
DoublePosition const _center;
|
||||
double const _radiusYSq, _scaleXSq;
|
||||
};
|
||||
|
||||
class AC_GAME_API TriangleBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
TriangleBoundary(Position const& pointA, Position const& pointB, Position const& pointC, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
DoublePosition const _a, _b, _c;
|
||||
double const _abx, _bcx, _cax, _aby, _bcy, _cay;
|
||||
};
|
||||
|
||||
class AC_GAME_API ParallelogramBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
// Note: AB must be orthogonal to AD
|
||||
ParallelogramBoundary(Position const& cornerA, Position const& cornerB, Position const& cornerD, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
DoublePosition const _a, _b, _d, _c;
|
||||
double const _abx, _dax, _aby, _day;
|
||||
};
|
||||
|
||||
class AC_GAME_API ZRangeBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
ZRangeBoundary(float minZ, float maxZ, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
float const _minZ, _maxZ;
|
||||
};
|
||||
|
||||
class AC_GAME_API BoundaryUnionBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
BoundaryUnionBoundary(AreaBoundary const* b1, AreaBoundary const* b2, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
virtual ~BoundaryUnionBoundary();
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
AreaBoundary const* const _b1;
|
||||
AreaBoundary const* const _b2;
|
||||
};
|
||||
|
||||
#endif //ACORE_AREA_BOUNDARY_H
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Define.h"
|
||||
#include "QuestDef.h"
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
|
||||
// Evade boss
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
|
|
@ -199,7 +199,7 @@ public:
|
|||
Position const& _homePosition = me->GetHomePosition();
|
||||
if (me->GetDistance2d(_homePosition.GetPositionX(), _homePosition.GetPositionY()) > 50.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_RESET, 5000);
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
|
||||
// Evade mini bosses
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
|
|
@ -167,7 +167,7 @@ public:
|
|||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
Talk(YELL_EVADE);
|
||||
}
|
||||
ResetTimer = 5 * IN_MILLISECONDS;
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
|
||||
// Evade mini bosses
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
|
|
@ -149,7 +149,7 @@ public:
|
|||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
Talk(YELL_EVADE);
|
||||
}
|
||||
ResetTimer = 5 * IN_MILLISECONDS;
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ public:
|
|||
me->GetMotionMaster()->MoveFollow(summoner, 0.f, 0.f);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
if (Creature* flamelasher = ObjectAccessor::GetCreature(*me, _flamelasherGUID))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ public:
|
|||
_events.ScheduleEvent(EVENT_SPELL_SUMMON_VOIDWALKERS, 1000);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ public:
|
|||
events.ScheduleEvent(EVENT_KNOCK_AWAY, urand(12000, 18000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
instance->SetBossState(DATA_WARCHIEF_REND_BLACKHAND, FAIL);
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
|
|
|
|||
|
|
@ -164,11 +164,11 @@ public:
|
|||
events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(17000, 19000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
instance->SetBossState(DATA_WARCHIEF_REND_BLACKHAND, FAIL);
|
||||
instance->SetBossState(DATA_GYTH, FAIL);
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ MinionData const minionData[] =
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_GYTH_EXIT_DOOR, DATA_WARCHIEF_REND_BLACKHAND, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DRAKKISATH_DOOR_1, DATA_GENERAL_DRAKKISATH, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DRAKKISATH_DOOR_2, DATA_GENERAL_DRAKKISATH, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
{ GO_GYTH_EXIT_DOOR, DATA_WARCHIEF_REND_BLACKHAND, DOOR_TYPE_PASSAGE },
|
||||
{ GO_DRAKKISATH_DOOR_1, DATA_GENERAL_DRAKKISATH, DOOR_TYPE_PASSAGE },
|
||||
{ GO_DRAKKISATH_DOOR_2, DATA_GENERAL_DRAKKISATH, DOOR_TYPE_PASSAGE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, } // END
|
||||
};
|
||||
|
||||
class instance_blackrock_spire : public InstanceMapScript
|
||||
|
|
|
|||
|
|
@ -31,16 +31,16 @@
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_PORTCULLIS_RAZORGORE, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 175946 || GUID 7230
|
||||
{ GO_PORTCULLIS_RAZORGORE_ROOM, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_ROOM, BOUNDARY_NONE}, // ID 176964 || GUID 75158
|
||||
{ GO_PORTCULLIS_VAELASTRASZ, DATA_VAELASTRAZ_THE_CORRUPT, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 175185 || GUID 7229
|
||||
{ GO_PORTCULLIS_BROODLORD, DATA_BROODLORD_LASHLAYER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 179365 || GUID 75159
|
||||
{ GO_PORTCULLIS_THREEDRAGONS, DATA_FIREMAW, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 179115 || GUID 75165
|
||||
{ GO_PORTCULLIS_THREEDRAGONS, DATA_EBONROC, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 179115 || GUID 75165
|
||||
{ GO_PORTCULLIS_THREEDRAGONS, DATA_FLAMEGOR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 179115 || GUID 75165
|
||||
{ GO_PORTCULLIS_CHROMAGGUS, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, // ID 179116 || GUID 75161
|
||||
{ GO_PORTCULLIS_NEFARIAN, DATA_NEFARIAN, DOOR_TYPE_ROOM, BOUNDARY_NONE}, // ID 179117 || GUID 75164
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE} // END
|
||||
{ GO_PORTCULLIS_RAZORGORE, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_PASSAGE }, // ID 175946 || GUID 7230
|
||||
{ GO_PORTCULLIS_RAZORGORE_ROOM, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_ROOM, }, // ID 176964 || GUID 75158
|
||||
{ GO_PORTCULLIS_VAELASTRASZ, DATA_VAELASTRAZ_THE_CORRUPT, DOOR_TYPE_PASSAGE }, // ID 175185 || GUID 7229
|
||||
{ GO_PORTCULLIS_BROODLORD, DATA_BROODLORD_LASHLAYER, DOOR_TYPE_PASSAGE }, // ID 179365 || GUID 75159
|
||||
{ GO_PORTCULLIS_THREEDRAGONS, DATA_FIREMAW, DOOR_TYPE_PASSAGE }, // ID 179115 || GUID 75165
|
||||
{ GO_PORTCULLIS_THREEDRAGONS, DATA_EBONROC, DOOR_TYPE_PASSAGE }, // ID 179115 || GUID 75165
|
||||
{ GO_PORTCULLIS_THREEDRAGONS, DATA_FLAMEGOR, DOOR_TYPE_PASSAGE }, // ID 179115 || GUID 75165
|
||||
{ GO_PORTCULLIS_CHROMAGGUS, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179116 || GUID 75161
|
||||
{ GO_PORTCULLIS_NEFARIAN, DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 179117 || GUID 75164
|
||||
{ 0, 0, DOOR_TYPE_ROOM } // END
|
||||
};
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (!me->getThreatMgr().getThreatList().empty())
|
||||
{
|
||||
|
|
@ -245,7 +245,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,6 @@ public:
|
|||
|
||||
if (me->IsVisible())
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const override
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public:
|
|||
case EVENT_CHECK_DIST:
|
||||
if (me->GetDistance(me->GetHomePosition()) > 75.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_DIST, 5000);
|
||||
|
|
@ -325,7 +325,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
|||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (Creature* delrissa = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_DELRISSA)))
|
||||
if (!delrissa->IsAlive())
|
||||
|
|
@ -333,7 +333,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
|||
delrissa->Respawn();
|
||||
return;
|
||||
}
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(false);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public:
|
|||
instance->SetData(DATA_KIRTONOS_THE_HERALD, DONE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
instance->SetData(DATA_KIRTONOS_THE_HERALD, FAIL);
|
||||
me->DespawnOrUnsummon(1);
|
||||
|
|
|
|||
|
|
@ -111,15 +111,15 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
if (Creature* alythess = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_GRAND_WARLOCK_ALYTHESS)))
|
||||
{
|
||||
if (!alythess->IsAlive())
|
||||
alythess->Respawn(true);
|
||||
else if (!alythess->IsInEvadeMode())
|
||||
alythess->AI()->EnterEvadeMode();
|
||||
alythess->AI()->EnterEvadeMode(why);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -259,15 +259,15 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
if (Creature* scorlash = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_LADY_SACROLASH)))
|
||||
{
|
||||
if (!scorlash->IsAlive())
|
||||
scorlash->Respawn(true);
|
||||
else if (!scorlash->IsInEvadeMode())
|
||||
scorlash->AI()->EnterEvadeMode();
|
||||
scorlash->AI()->EnterEvadeMode(why);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -308,11 +308,11 @@ public:
|
|||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (me->GetReactState() == REACT_PASSIVE)
|
||||
return;
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
|
|
|
|||
|
|
@ -176,12 +176,12 @@ public:
|
|||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* muru = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_MURU)))
|
||||
if (!muru->IsInEvadeMode())
|
||||
muru->AI()->EnterEvadeMode();
|
||||
muru->AI()->EnterEvadeMode(why);
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_FIRE_BARRIER, DATA_FELMYST_DOORS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_MURUS_GATE_1, DATA_MURU, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_MURUS_GATE_2, DATA_MURU, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_BOSS_COLLISION_1, DATA_KALECGOS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_BOSS_COLLISION_2, DATA_KALECGOS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_FORCE_FIELD, DATA_KALECGOS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
{ GO_FIRE_BARRIER, DATA_FELMYST_DOORS, DOOR_TYPE_PASSAGE },
|
||||
{ GO_MURUS_GATE_1, DATA_MURU, DOOR_TYPE_ROOM },
|
||||
{ GO_MURUS_GATE_2, DATA_MURU, DOOR_TYPE_PASSAGE },
|
||||
{ GO_BOSS_COLLISION_1, DATA_KALECGOS, DOOR_TYPE_ROOM },
|
||||
{ GO_BOSS_COLLISION_2, DATA_KALECGOS, DOOR_TYPE_ROOM },
|
||||
{ GO_FORCE_FIELD, DATA_KALECGOS, DOOR_TYPE_ROOM },
|
||||
{ 0, 0, DOOR_TYPE_ROOM } // END
|
||||
};
|
||||
|
||||
class instance_sunwell_plateau : public InstanceMapScript
|
||||
|
|
|
|||
|
|
@ -402,8 +402,6 @@ public:
|
|||
else HatcherTimer -= diff;
|
||||
}
|
||||
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
if (FireBreathTimer <= diff)
|
||||
|
|
|
|||
|
|
@ -150,9 +150,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
if (GameObject* object = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_GONG_OF_BETHEKK)))
|
||||
object->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
|
||||
me->DespawnOrUnsummon(4000);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ EndScriptData */
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_FORCEFIELD, DATA_ARLOKK, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
{ GO_FORCEFIELD, DATA_ARLOKK, DOOR_TYPE_ROOM },
|
||||
{ 0, 0, DOOR_TYPE_ROOM } // END
|
||||
};
|
||||
|
||||
class instance_zulgurub : public InstanceMapScript
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ public:
|
|||
{
|
||||
damage = 0;
|
||||
me->setActive(false);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ public:
|
|||
break;
|
||||
}
|
||||
me->setActive(false);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
case EVENT_SUMMON_SOLDIERS:
|
||||
for (uint8 i = 0; i < SUNWELL_DEFENDER_NUM; ++i)
|
||||
|
|
@ -393,7 +393,7 @@ public:
|
|||
case EVENT_DISAPPEAR:
|
||||
me->SetVisible(false);
|
||||
me->setActive(false);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
case EVENT_SET_FACING:
|
||||
me->SetFacingTo(2.45f);
|
||||
|
|
@ -425,11 +425,11 @@ public:
|
|||
events.ScheduleEvent(EVENT_SET_FACING, 0);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (me->isActiveObject())
|
||||
return;
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 id) override
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ public:
|
|||
MarzonGUID.Clear();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->DisappearAndDie();
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->DisappearAndDie();
|
||||
|
||||
|
|
|
|||
|
|
@ -1011,7 +1011,7 @@ public:
|
|||
|
||||
EventMap _events;
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
|
|
@ -2353,7 +2353,7 @@ public:
|
|||
|
||||
EventMap _events;
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->RemoveAura(SPELL_HEROIC_VANGUARD);
|
||||
me->DeleteThreatList();
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ struct npc_hallows_end_soh : public ScriptedAI
|
|||
me->SetDisableGravity(true);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /* why */) override
|
||||
{
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ void hyjalAI::Reset()
|
|||
DoHide = true;
|
||||
}
|
||||
|
||||
void hyjalAI::EnterEvadeMode()
|
||||
void hyjalAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
if (me->GetEntry() != JAINA)
|
||||
me->RemoveAllAuras();
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ struct hyjalAI : public npc_escortAI
|
|||
|
||||
void Reset() override; // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
|
||||
|
||||
void EnterEvadeMode() override; // Send creature back to spawn location and evade.
|
||||
void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override; // Send creature back to spawn location and evade.
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override; // Used to reset cooldowns for our spells and to inform the raid that we're under attack
|
||||
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool CheckInRoom()
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 95.0f)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,10 +122,10 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->ClearUnitState(UNIT_STATE_ROOT);
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* attacker) override
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
|
||||
for (ObjectGuid const& guid : Eggs)
|
||||
if (Creature* egg = me->GetMap()->GetCreature(guid))
|
||||
|
|
|
|||
|
|
@ -158,11 +158,11 @@ public:
|
|||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
Cleanup();
|
||||
summons.DespawnAll();
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ public:
|
|||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->IsSummon())
|
||||
((TempSummon*)me)->UnSummon();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,10 +182,10 @@ public:
|
|||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
summons.DespawnAll();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@ public:
|
|||
npc_escortAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
SummonsFollow();
|
||||
ImmuneFlagSet(false, 35);
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
npc_escortAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void CheckPlayer()
|
||||
|
|
|
|||
|
|
@ -149,9 +149,9 @@ public:
|
|||
_events.ScheduleEvent(EVENT_FINAL_TALK, 5 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
_EnterEvadeMode(why);
|
||||
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
|
||||
if (player && player->IsInCombat() && player->getAttackerForHelper())
|
||||
|
|
@ -364,7 +364,7 @@ public:
|
|||
AttackStart(player->getAttackerForHelper());
|
||||
return;
|
||||
}
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
npc_escortAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void StartEvent(Player* player)
|
||||
|
|
|
|||
|
|
@ -306,10 +306,10 @@ public:
|
|||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
CleanUp();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void CleanUp()
|
||||
|
|
@ -343,7 +343,7 @@ public:
|
|||
Player* pWarrior = ObjectAccessor::GetPlayer(*me, PlayerGUID);
|
||||
if (!pWarrior || me->GetDistance2d(pWarrior) >= 200.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ public:
|
|||
{
|
||||
Talk(SAY_TWIGGY_FLATHEAD_DOWN);
|
||||
pWarrior->FailQuest(1719);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -435,7 +435,7 @@ public:
|
|||
if (!creature || !creature->IsAlive())
|
||||
{
|
||||
Talk(SAY_TWIGGY_FLATHEAD_OVER);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
else // Makes BIG WILL attackable.
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@ class boss_anub_arak : public CreatureScript
|
|||
|
||||
bool intro;
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->DisableRotate(false);
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
|
|
|||
|
|
@ -195,7 +195,6 @@ public:
|
|||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const override
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_KRIKTHIR_DOORS, DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_ANUBARAK_DOORS1, DATA_ANUBARAK_EVENT, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_ANUBARAK_DOORS2, DATA_ANUBARAK_EVENT, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_ANUBARAK_DOORS3, DATA_ANUBARAK_EVENT, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
{ GO_KRIKTHIR_DOORS, DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DOOR_TYPE_PASSAGE },
|
||||
{ GO_ANUBARAK_DOORS1, DATA_ANUBARAK_EVENT, DOOR_TYPE_ROOM },
|
||||
{ GO_ANUBARAK_DOORS2, DATA_ANUBARAK_EVENT, DOOR_TYPE_ROOM },
|
||||
{ GO_ANUBARAK_DOORS3, DATA_ANUBARAK_EVENT, DOOR_TYPE_ROOM },
|
||||
{ 0, 0, DOOR_TYPE_ROOM }
|
||||
};
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
|
|
|
|||
|
|
@ -140,10 +140,10 @@ struct boss_amanitar : public BossAI
|
|||
BossAI::SummonedCreatureDies(summon, killer);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId) override
|
||||
|
|
@ -245,7 +245,7 @@ struct npc_amanitar_mushrooms : public ScriptedAI
|
|||
// Disabled events
|
||||
void EnterCombat(Unit* /*who*/) override {}
|
||||
void AttackStart(Unit* /*victim*/) override {}
|
||||
void EnterEvadeMode() override {}
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override {}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -592,11 +592,11 @@ struct npc_twilight_volunteer : public ScriptedAI
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (!isSacraficeTarget)
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ public:
|
|||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const override
|
||||
|
|
@ -218,7 +217,7 @@ public:
|
|||
_events.ScheduleEvent(EVENT_LAVA_GOUT, 5000);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
// Prevent EvadeMode
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,12 +272,12 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (IsAnyPlayerValid())
|
||||
return;
|
||||
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
|
|
@ -473,7 +473,7 @@ public:
|
|||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,18 +22,24 @@
|
|||
#include "WorldPacket.h"
|
||||
#include "ruby_sanctum.h"
|
||||
|
||||
BossBoundaryData const boundaries =
|
||||
{
|
||||
{ DATA_GENERAL_ZARITHRIAN, new EllipseBoundary(Position(3013.409f, 529.492f), 45.0, 100.0) },
|
||||
{ DATA_HALION, new CircleBoundary(Position(3156.037f, 533.2656f), 48.5) }
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{GO_FIRE_FIELD, DATA_BALTHARUS_THE_WARBORN, DOOR_TYPE_PASSAGE, BOUNDARY_E },
|
||||
{GO_FLAME_WALLS, DATA_SAVIANA_RAGEFIRE, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
{GO_FLAME_WALLS, DATA_BALTHARUS_THE_WARBORN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
{GO_FLAME_WALLS, DATA_GENERAL_ZARITHRIAN, DOOR_TYPE_ROOM, BOUNDARY_NONE},
|
||||
{GO_BURNING_TREE_4, DATA_HALION_INTRO1, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
{GO_BURNING_TREE_3, DATA_HALION_INTRO1, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
{GO_BURNING_TREE_2, DATA_HALION_INTRO2, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
{GO_BURNING_TREE_1, DATA_HALION_INTRO2, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
{GO_TWILIGHT_FLAME_RING, DATA_HALION, DOOR_TYPE_ROOM, BOUNDARY_NONE},
|
||||
{0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE},
|
||||
{GO_FIRE_FIELD, DATA_BALTHARUS_THE_WARBORN, DOOR_TYPE_PASSAGE },
|
||||
{GO_FLAME_WALLS, DATA_SAVIANA_RAGEFIRE, DOOR_TYPE_PASSAGE },
|
||||
{GO_FLAME_WALLS, DATA_BALTHARUS_THE_WARBORN, DOOR_TYPE_PASSAGE },
|
||||
{GO_FLAME_WALLS, DATA_GENERAL_ZARITHRIAN, DOOR_TYPE_ROOM, },
|
||||
{GO_BURNING_TREE_4, DATA_HALION_INTRO1, DOOR_TYPE_PASSAGE },
|
||||
{GO_BURNING_TREE_3, DATA_HALION_INTRO1, DOOR_TYPE_PASSAGE },
|
||||
{GO_BURNING_TREE_2, DATA_HALION_INTRO2, DOOR_TYPE_PASSAGE },
|
||||
{GO_BURNING_TREE_1, DATA_HALION_INTRO2, DOOR_TYPE_PASSAGE },
|
||||
{GO_TWILIGHT_FLAME_RING, DATA_HALION, DOOR_TYPE_ROOM },
|
||||
{0, 0, DOOR_TYPE_ROOM },
|
||||
};
|
||||
|
||||
class instance_ruby_sanctum : public InstanceMapScript
|
||||
|
|
@ -46,6 +52,7 @@ public:
|
|||
instance_ruby_sanctum_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTERS);
|
||||
LoadBossBoundaries(boundaries);
|
||||
LoadDoorData(doorData);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,10 +128,10 @@ public:
|
|||
//me->SetLootMode(0); // [LOOT]
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->DespawnOrUnsummon(1);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
|
|
@ -225,7 +225,7 @@ public:
|
|||
events.ScheduleEvent(EVENT_SPELL_MARKED_DEATH, 1000);
|
||||
break;
|
||||
default:
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override {}
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override {}
|
||||
|
||||
void WaypointReached(uint32 i) override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ public:
|
|||
Talk(SAY_KILL_PLAYER);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ struct boss_faction_championsAI : public ScriptedAI
|
|||
pInstance->SetData(TYPE_FACTION_CHAMPIONS_PLAYER_DIED, 1);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /* why */) override
|
||||
{
|
||||
if( pInstance )
|
||||
pInstance->SetData(TYPE_FAILED, 0);
|
||||
|
|
@ -2368,7 +2368,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /* why */) override
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
|
@ -2435,7 +2435,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /* why */) override
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ public:
|
|||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
|
@ -355,7 +355,7 @@ public:
|
|||
me->DespawnOrUnsummon(10000);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
|
@ -436,7 +436,7 @@ public:
|
|||
me->DespawnOrUnsummon(10000);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
|
@ -667,7 +667,7 @@ struct boss_jormungarAI : public ScriptedAI
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
events.Reset();
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
|
@ -1000,7 +1000,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
events.Reset();
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /* why */) override
|
||||
{
|
||||
if( pInstance )
|
||||
pInstance->SetData(TYPE_FAILED, 0);
|
||||
|
|
|
|||
|
|
@ -244,8 +244,6 @@ public:
|
|||
events.ScheduleEvent(EVENT_SPELL_SUMMON_MINIONS, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const override
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ public:
|
|||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const override
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_NOVOS_CRYSTAL_1, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_NOVOS_CRYSTAL_2, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_NOVOS_CRYSTAL_3, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_NOVOS_CRYSTAL_4, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
{ GO_NOVOS_CRYSTAL_1, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM },
|
||||
{ GO_NOVOS_CRYSTAL_2, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM },
|
||||
{ GO_NOVOS_CRYSTAL_3, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM },
|
||||
{ GO_NOVOS_CRYSTAL_4, DATA_NOVOS_CRYSTALS, DOOR_TYPE_ROOM },
|
||||
{ 0, 0, DOOR_TYPE_ROOM }
|
||||
};
|
||||
|
||||
class instance_drak_tharon_keep : public InstanceMapScript
|
||||
|
|
|
|||
|
|
@ -198,10 +198,10 @@ public:
|
|||
summon->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -293,11 +293,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->DisableRotate(false);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -164,10 +164,10 @@ public:
|
|||
Talk(RAND(SAY_SLAY_1, SAY_SLAY_2));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (startFightTimer)
|
||||
Reset();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,9 +153,9 @@ public:
|
|||
Talk(RAND(SAY_SLAY_1, SAY_SLAY_2));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (startFightTimer)
|
||||
Reset();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -751,9 +751,9 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER))
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
|
@ -847,9 +847,9 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER))
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
|
@ -892,12 +892,12 @@ public:
|
|||
npc_phantom_mageAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (numOfUpd)
|
||||
return;
|
||||
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->IsSummon())
|
||||
me->ToTempSummon()->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
|
@ -990,9 +990,9 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER))
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
|
@ -1073,9 +1073,9 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER))
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
|
@ -1157,9 +1157,9 @@ public:
|
|||
DoSpellAttackIfReady(SPELL_SHOOT);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER))
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
|
@ -1202,7 +1202,7 @@ public:
|
|||
Position p = me->GetHomePosition();
|
||||
if (me->GetExactDist(&p) > 30.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1234,10 +1234,10 @@ public:
|
|||
pInstance->SetData(DATA_FROSTSWORN_GENERAL, DONE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
pInstance->SetData(ACTION_SPIRITUAL_REFLECTIONS_HIDE, 1);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1296,10 +1296,10 @@ public:
|
|||
me->CastSpell((Unit*)nullptr, SPELL_SPIRIT_BURST, false);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->UpdatePosition(me->GetHomePosition(), true);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
me->SetVisible(false);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ public:
|
|||
if (x < 600.0f || x > 770.0f || y < -270.0f || y > -137.0f || z < 514.0f || z > 550.0f)
|
||||
{
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
if (CreatureGroup* f = me->GetFormation())
|
||||
{
|
||||
const CreatureGroup::CreatureGroupMemberType& m = f->GetMembers();
|
||||
|
|
@ -289,11 +289,11 @@ public:
|
|||
Talk(SAY_SLAY_1);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->DisableRotate(false);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1117,7 +1117,7 @@ public:
|
|||
return who->GetEntry() == NPC_FALLEN_WARRIOR;
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /* why */) override
|
||||
{
|
||||
if (!me->IsAlive() || me->IsInEvadeMode())
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@
|
|||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_ECK_DOORS, DATA_MOORABI, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_ECK_UNDERWATER_GATE, DATA_ECK_THE_FEROCIOUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_GAL_DARAH_DOORS0, DATA_GAL_DARAH, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_GAL_DARAH_DOORS1, DATA_GAL_DARAH, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_GAL_DARAH_DOORS2, DATA_GAL_DARAH, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
{ GO_ECK_DOORS, DATA_MOORABI, DOOR_TYPE_PASSAGE },
|
||||
{ GO_ECK_UNDERWATER_GATE, DATA_ECK_THE_FEROCIOUS, DOOR_TYPE_PASSAGE },
|
||||
{ GO_GAL_DARAH_DOORS0, DATA_GAL_DARAH, DOOR_TYPE_ROOM },
|
||||
{ GO_GAL_DARAH_DOORS1, DATA_GAL_DARAH, DOOR_TYPE_PASSAGE },
|
||||
{ GO_GAL_DARAH_DOORS2, DATA_GAL_DARAH, DOOR_TYPE_PASSAGE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM }
|
||||
};
|
||||
|
||||
class instance_gundrak : public InstanceMapScript
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ public:
|
|||
valid = false;
|
||||
if (!valid)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +418,7 @@ public:
|
|||
DoSpellAttackIfReady(_isEmpowered ? SPELL_EMPOWERED_SHADOW_LANCE : SPELL_SHADOW_LANCE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (_evading)
|
||||
return;
|
||||
|
|
@ -430,7 +430,7 @@ public:
|
|||
taldaram->AI()->EnterEvadeMode();
|
||||
if (Creature* valanar = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRINCE_VALANAR_GUID)))
|
||||
valanar->AI()->EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
_evading = false;
|
||||
}
|
||||
};
|
||||
|
|
@ -507,7 +507,7 @@ public:
|
|||
valid = false;
|
||||
if (!valid)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -702,7 +702,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (_evading)
|
||||
return;
|
||||
|
|
@ -711,10 +711,10 @@ public:
|
|||
DoAction(ACTION_REMOVE_INVOCATION);
|
||||
_evading = true;
|
||||
if (Creature* keleseth = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRINCE_KELESETH_GUID)))
|
||||
keleseth->AI()->EnterEvadeMode();
|
||||
keleseth->AI()->EnterEvadeMode(why);
|
||||
if (Creature* valanar = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRINCE_VALANAR_GUID)))
|
||||
valanar->AI()->EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
valanar->AI()->EnterEvadeMode(why);
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
_evading = false;
|
||||
}
|
||||
};
|
||||
|
|
@ -791,7 +791,7 @@ public:
|
|||
valid = false;
|
||||
if (!valid)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -959,10 +959,10 @@ public:
|
|||
{
|
||||
Creature* keleseth = instance->instance->GetCreature(instance->GetGuidData(DATA_PRINCE_KELESETH_GUID));
|
||||
Creature* taldaram = instance->instance->GetCreature(instance->GetGuidData(DATA_PRINCE_TALDARAM_GUID));
|
||||
if (keleseth && taldaram && CheckBoundary(me) && CheckBoundary(keleseth) && CheckBoundary(taldaram))
|
||||
if (keleseth && taldaram && IsInBoundary(me) && IsInBoundary(keleseth) && IsInBoundary(taldaram))
|
||||
return true;
|
||||
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -999,7 +999,7 @@ public:
|
|||
}
|
||||
if (!visualSpellId || !current || !next || !current->IsInCombat() || !next->IsInCombat())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
next->SetHealth(current->GetHealth());
|
||||
|
|
@ -1041,7 +1041,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (_evading)
|
||||
return;
|
||||
|
|
@ -1050,10 +1050,10 @@ public:
|
|||
DoAction(ACTION_REMOVE_INVOCATION);
|
||||
_evading = true;
|
||||
if (Creature* keleseth = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRINCE_KELESETH_GUID)))
|
||||
keleseth->AI()->EnterEvadeMode();
|
||||
keleseth->AI()->EnterEvadeMode(why);
|
||||
if (Creature* taldaram = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRINCE_TALDARAM_GUID)))
|
||||
taldaram->AI()->EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode();
|
||||
taldaram->AI()->EnterEvadeMode(why);
|
||||
BossAI::EnterEvadeMode(why);
|
||||
_evading = false;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public:
|
|||
{
|
||||
if (!instance->CheckRequiredBosses(DATA_BLOOD_QUEEN_LANA_THEL, who->ToPlayer()) || !me->IsVisible())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT);
|
||||
return;
|
||||
}
|
||||
|
|
@ -552,7 +552,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
const Map::PlayerList& pl = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
|
|
@ -564,7 +564,7 @@ public:
|
|||
{
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
_EnterEvadeMode();
|
||||
_EnterEvadeMode(why);
|
||||
Reset();
|
||||
GoToMinchar();
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ public:
|
|||
|
||||
if (!instance->CheckRequiredBosses(DATA_DEATHBRINGER_SAURFANG, who->ToPlayer()))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT);
|
||||
return;
|
||||
}
|
||||
|
|
@ -405,7 +405,7 @@ public:
|
|||
if (Player* p = itr->GetSource())
|
||||
if (p->GetTransport())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -495,9 +495,9 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SAURFANG_EVENT_NPC)))
|
||||
creature->AI()->DoAction(ACTION_EVADE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public:
|
|||
{
|
||||
if (!instance->CheckRequiredBosses(DATA_FESTERGUT, who->ToPlayer()))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT);
|
||||
return;
|
||||
}
|
||||
|
|
@ -151,11 +151,11 @@ public:
|
|||
instance->SetBossState(DATA_FESTERGUT, FAIL);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE)))
|
||||
professor->AI()->EnterEvadeMode();
|
||||
professor->AI()->EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ public:
|
|||
_events.ScheduleEvent(EVENT_CLEAVE, urand(3000, 6000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
|
@ -1116,7 +1116,7 @@ public:
|
|||
_events.ScheduleEvent(EVENT_CLEAVE, urand(3000, 6000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
|
@ -1492,7 +1492,7 @@ struct gunship_npc_AI : public ScriptedAI
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
if (!me->IsAlive() || !me->IsInCombat())
|
||||
return;
|
||||
|
|
@ -1553,7 +1553,7 @@ struct npc_gunship_boarding_addAI : public ScriptedAI
|
|||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
if (!me->IsAlive() || !me->IsInCombat())
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -983,7 +983,7 @@ public:
|
|||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) override {}
|
||||
void EnterEvadeMode() override {}
|
||||
void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override {}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ public:
|
|||
{
|
||||
sayFestergutDeathTimer = 0;
|
||||
Talk(SAY_FESTERGUT_DEATH);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
}
|
||||
else
|
||||
sayFestergutDeathTimer -= diff;
|
||||
|
|
@ -512,7 +512,7 @@ public:
|
|||
{
|
||||
sayRotfaceDeathTimer = 0;
|
||||
Talk(SAY_ROTFACE_DEATH);
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
}
|
||||
else
|
||||
sayRotfaceDeathTimer -= diff;
|
||||
|
|
@ -520,7 +520,7 @@ public:
|
|||
else if (bCallEvade)
|
||||
{
|
||||
bCallEvade = false;
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -665,12 +665,12 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
Position p = me->GetHomePosition();
|
||||
if (!me->IsInCombat() && me->GetExactDist2d(&p) > 10.0f)
|
||||
me->GetMotionMaster()->MoveCharge(tablePos.GetPositionX(), tablePos.GetPositionY(), tablePos.GetPositionZ(), 15.0f, POINT_TABLE);
|
||||
BossAI::EnterEvadeMode();
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void ChangePhase()
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ public:
|
|||
{
|
||||
if (!instance->CheckRequiredBosses(DATA_ROTFACE, who->ToPlayer()))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT);
|
||||
return;
|
||||
}
|
||||
|
|
@ -219,13 +219,13 @@ public:
|
|||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->DisableRotate(false);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE)))
|
||||
professor->AI()->EnterEvadeMode();
|
||||
professor->AI()->EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
||||
|
|
@ -407,7 +407,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
|
@ -492,7 +492,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue