mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Merge branch '3.3.5-boundaryagain' into 3.3.5-base (PR #16270)
(cherry picked from commit 1050b68899)
This commit is contained in:
@@ -80,7 +80,7 @@ class CreatureAI : public UnitAI
|
||||
Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
|
||||
bool CheckBoundary(Position* who = nullptr) const;
|
||||
void SetBoundary(CreatureBoundary const* boundary) { _boundary = boundary; CheckInRoom(); }
|
||||
void SetBoundary(CreatureBoundary const* boundary) { _boundary = boundary; me->DoImmediateBoundaryCheck(); }
|
||||
public:
|
||||
enum EvadeReason
|
||||
{
|
||||
|
||||
@@ -638,6 +638,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
|
||||
float GetRespawnRadius() const { return m_respawnradius; }
|
||||
void SetRespawnRadius(float dist) { m_respawnradius = dist; }
|
||||
|
||||
void DoImmediateBoundaryCheck() { m_boundaryCheckTime = 0; }
|
||||
uint32 GetCombatPulseDelay() const { return m_combatPulseDelay; }
|
||||
void SetCombatPulseDelay(uint32 delay) // (secs) interval at which the creature pulses the entire zone into combat (only works in dungeons)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,12 @@
|
||||
#include "WorldSession.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
BossBoundaryData::~BossBoundaryData()
|
||||
{
|
||||
for (const_iterator it = begin(); it != end(); ++it)
|
||||
delete it->boundary;
|
||||
}
|
||||
|
||||
void InstanceScript::SaveToDB()
|
||||
{
|
||||
std::string data = GetSaveData();
|
||||
|
||||
@@ -82,7 +82,19 @@ struct BossBoundaryEntry
|
||||
uint32 const bossId;
|
||||
AreaBoundary const* const boundary;
|
||||
};
|
||||
typedef std::list<BossBoundaryEntry> BossBoundaryData;
|
||||
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
|
||||
{
|
||||
|
||||
@@ -32,15 +32,16 @@ class AreaBoundary
|
||||
BOUNDARY_PARALLELOGRAM,
|
||||
BOUNDARY_Z_RANGE,
|
||||
};
|
||||
virtual ~AreaBoundary() { }
|
||||
BoundaryType GetBoundaryType() const { return m_boundaryType; }
|
||||
bool IsWithinBoundary(const Position* pos) const { return (IsWithinBoundaryArea(pos) != m_isInvertedBoundary); }
|
||||
|
||||
struct DoublePosition : Position
|
||||
{
|
||||
double d_positionX, d_positionY, d_positionZ;
|
||||
DoublePosition(double x = 0, double y = 0, double z = 0, float o = 0)
|
||||
: Position((float)x, (float)y, (float)z, o), d_positionX(x), d_positionY(y), d_positionZ(z) { }
|
||||
DoublePosition(float x = 0, float y = 0, float z = 0, float o = 0)
|
||||
DoublePosition(double x = 0.0, double y = 0.0, double z = 0.0, float o = 0.0f)
|
||||
: Position(x, y, z, o), d_positionX(x), d_positionY(y), d_positionZ(z) { }
|
||||
DoublePosition(float x, float y = 0.0f, float z = 0.0f, float o = 0.0f)
|
||||
: Position(x, y, z, o), d_positionX(x), d_positionY(y), d_positionZ(z) { }
|
||||
DoublePosition(const Position& pos)
|
||||
: DoublePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()) { }
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
Talk(SAY_RESPAWN);
|
||||
}
|
||||
|
||||
bool CheckInRoom()
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
Talk(SAY_BUFF);
|
||||
}
|
||||
|
||||
bool CheckInRoom()
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
|
||||
@@ -22,12 +22,11 @@
|
||||
#include "Player.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
AreaBoundary const* const mainBoundary = new CircleBoundary(Position(563.26f, 139.6f), 75.0);
|
||||
BossBoundaryData const boundaries = {
|
||||
{ BOSS_BEASTS, mainBoundary },
|
||||
{ BOSS_JARAXXUS, mainBoundary },
|
||||
{ BOSS_CRUSADERS, mainBoundary },
|
||||
{ BOSS_VALKIRIES, mainBoundary },
|
||||
{ BOSS_BEASTS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
|
||||
{ BOSS_JARAXXUS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
|
||||
{ BOSS_CRUSADERS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
|
||||
{ BOSS_VALKIRIES, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
|
||||
{ BOSS_ANUBARAK, new EllipseBoundary(Position(746.0f, 135.0f), 100.0, 75.0) }
|
||||
};
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ class boss_sindragosa : public CreatureScript
|
||||
{
|
||||
if (!instance->CheckRequiredBosses(DATA_SINDRAGOSA, victim->ToPlayer()))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
EnterEvadeMode(EVADE_REASON_SEQUENCE_BREAK);
|
||||
instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT);
|
||||
return;
|
||||
}
|
||||
@@ -276,6 +276,13 @@ class boss_sindragosa : public CreatureScript
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (_isInAirPhase && why == EVADE_REASON_BOUNDARY)
|
||||
return;
|
||||
BossAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void JustReachedHome() override
|
||||
{
|
||||
BossAI::JustReachedHome();
|
||||
|
||||
@@ -94,6 +94,8 @@ class boss_void_reaver : public CreatureScript
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user