mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Entities: remove grid-wide visibility from setActive and implement another method for it
This commit is contained in:
@@ -787,6 +787,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, Position const& pos)
|
||||
// Set creature in world
|
||||
map->AddToMap(creature);
|
||||
creature->setActive(true);
|
||||
creature->SetFarVisible(true);
|
||||
|
||||
return creature;
|
||||
}
|
||||
@@ -812,6 +813,7 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, Position const& pos, G3D:
|
||||
// Add to world
|
||||
map->AddToMap(go);
|
||||
go->setActive(true);
|
||||
go->SetFarVisible(true);
|
||||
|
||||
return go;
|
||||
}
|
||||
|
||||
@@ -1193,8 +1193,8 @@ void MovementInfo::OutDebug()
|
||||
}
|
||||
|
||||
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(), LastUsedScriptID(0),
|
||||
m_name(""), m_isActive(false), m_isWorldObject(isWorldObject), m_zoneScript(NULL),
|
||||
m_transport(NULL), m_zoneId(0), m_areaId(0), m_staticFloorZ(VMAP_INVALID_HEIGHT), m_currMap(NULL), m_InstanceId(0),
|
||||
m_name(""), m_isActive(false), m_isFarVisible(false), m_isWorldObject(isWorldObject), m_zoneScript(nullptr),
|
||||
m_transport(nullptr), m_zoneId(0), m_areaId(0), m_staticFloorZ(VMAP_INVALID_HEIGHT), m_currMap(nullptr), m_InstanceId(0),
|
||||
m_phaseMask(PHASEMASK_NORMAL), _dbPhase(0), m_notifyflags(0), m_executed_notifies(0),
|
||||
m_aiAnimKitId(0), m_movementAnimKitId(0), m_meleeAnimKitId(0)
|
||||
{
|
||||
@@ -1254,6 +1254,14 @@ void WorldObject::setActive(bool on)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldObject::SetFarVisible(bool on)
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
m_isFarVisible = on;
|
||||
}
|
||||
|
||||
void WorldObject::CleanupsBeforeDelete(bool /*finalCleanup*/)
|
||||
{
|
||||
if (IsInWorld())
|
||||
@@ -1704,7 +1712,7 @@ float WorldObject::GetGridActivationRange() const
|
||||
|
||||
float WorldObject::GetVisibilityRange() const
|
||||
{
|
||||
if (isActiveObject() && !ToPlayer())
|
||||
if (IsFarVisible() && !ToPlayer())
|
||||
return MAX_VISIBILITY_DISTANCE;
|
||||
else
|
||||
return GetMap()->GetVisibilityRange();
|
||||
@@ -1716,7 +1724,7 @@ float WorldObject::GetSightRange(const WorldObject* target) const
|
||||
{
|
||||
if (ToPlayer())
|
||||
{
|
||||
if (target && target->isActiveObject() && !target->ToPlayer())
|
||||
if (target && target->IsFarVisible() && !target->ToPlayer())
|
||||
return MAX_VISIBILITY_DISTANCE;
|
||||
else if (ToPlayer()->GetCinematicMgr()->IsOnCinematic())
|
||||
return DEFAULT_VISIBILITY_INSTANCE;
|
||||
|
||||
@@ -632,6 +632,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
|
||||
|
||||
bool isActiveObject() const { return m_isActive; }
|
||||
void setActive(bool isActiveObject);
|
||||
bool IsFarVisible() const { return m_isFarVisible; }
|
||||
void SetFarVisible(bool on);
|
||||
void SetWorldObject(bool apply);
|
||||
bool IsPermanentWorldObject() const { return m_isWorldObject; }
|
||||
bool IsWorldObject() const;
|
||||
@@ -668,6 +670,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
|
||||
protected:
|
||||
std::string m_name;
|
||||
bool m_isActive;
|
||||
bool m_isFarVisible;
|
||||
const bool m_isWorldObject;
|
||||
ZoneScript* m_zoneScript;
|
||||
|
||||
|
||||
@@ -348,6 +348,7 @@ public:
|
||||
if (Creature* nefarian = me->SummonCreature(NPC_NEFARIAN, NefarianLoc[0]))
|
||||
{
|
||||
nefarian->setActive(true);
|
||||
nefarian->SetFarVisible(true);
|
||||
nefarian->SetCanFly(true);
|
||||
nefarian->SetDisableGravity(true);
|
||||
nefarian->CastSpell((Unit*)NULL, SPELL_SHADOWFLAME_INITIAL);
|
||||
|
||||
@@ -252,6 +252,7 @@ public:
|
||||
{
|
||||
nefarius->SetPhaseMask(1, true);
|
||||
nefarius->setActive(true);
|
||||
nefarius->SetFarVisible(true);
|
||||
nefarius->Respawn();
|
||||
nefarius->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
@@ -153,6 +153,7 @@ public:
|
||||
Talk(EMOTE_SUMMON);
|
||||
events.SetPhase(PHASE_INTRO);
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->GetMotionMaster()->MoveAlongSplineChain(POINT_INTRO_START, SPLINE_CHAIN_INTRO_START, false);
|
||||
HandleTerraceDoors(false);
|
||||
|
||||
@@ -558,6 +558,7 @@ public:
|
||||
{
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
|
||||
arca->setActive(true);
|
||||
arca->SetFarVisible(true);
|
||||
arca->InterruptNonMeleeSpells(true);
|
||||
arca->SetSpeedRate(MOVE_FLIGHT, 2.0f);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->SetVisible(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetCanFly(true);
|
||||
|
||||
@@ -151,6 +151,7 @@ public:
|
||||
{
|
||||
Madrigosa->Respawn();
|
||||
Madrigosa->setActive(true);
|
||||
Madrigosa->SetFarVisible(true);
|
||||
IsIntro = true;
|
||||
Madrigosa->SetMaxHealth(me->GetMaxHealth());
|
||||
Madrigosa->SetHealth(me->GetMaxHealth());
|
||||
|
||||
@@ -260,6 +260,7 @@ public:
|
||||
me->SetDisableGravity(true);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (GameObject* pOrb = GetOrb(i))
|
||||
@@ -307,6 +308,7 @@ public:
|
||||
pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
|
||||
pOrb->SetFaction(FACTION_FRIENDLY);
|
||||
pOrb->setActive(true);
|
||||
pOrb->SetFarVisible(true);
|
||||
pOrb->Refresh();
|
||||
}
|
||||
}
|
||||
@@ -319,6 +321,7 @@ public:
|
||||
pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
|
||||
pOrb->SetFaction(FACTION_FRIENDLY);
|
||||
pOrb->setActive(true);
|
||||
pOrb->SetFarVisible(true);
|
||||
pOrb->Refresh();
|
||||
|
||||
OrbsEmpowered = (OrbsEmpowered+1)%4;
|
||||
@@ -350,6 +353,7 @@ public:
|
||||
{
|
||||
pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
|
||||
pOrb->setActive(true);
|
||||
pOrb->SetFarVisible(true);
|
||||
pOrb->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,6 +383,7 @@ void hyjalAI::SummonedCreatureDespawn(Creature* summoned)
|
||||
void hyjalAI::Reset()
|
||||
{
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
|
||||
Initialize();
|
||||
|
||||
@@ -503,6 +504,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||
|
||||
creature->SetWalk(false);
|
||||
creature->setActive(true);
|
||||
creature->SetFarVisible(true);
|
||||
switch (entry)
|
||||
{
|
||||
case NECROMANCER:
|
||||
@@ -1027,6 +1029,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
|
||||
unit->setActive(true);
|
||||
unit->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
for (uint8 i = 0; i < 3; ++i)//summon 3 abominations
|
||||
@@ -1039,6 +1042,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
|
||||
unit->setActive(true);
|
||||
unit->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles
|
||||
@@ -1051,6 +1055,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
|
||||
unit->setActive(true);
|
||||
unit->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1068,6 +1073,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
|
||||
unit->setActive(true);
|
||||
unit->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
|
||||
@@ -1080,6 +1086,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
|
||||
unit->setActive(true);
|
||||
unit->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
for (uint8 i = 0; i < 5; ++i)//summon 5 abominations
|
||||
@@ -1092,6 +1099,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
|
||||
ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
|
||||
unit->setActive(true);
|
||||
unit->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -209,6 +209,7 @@ public:
|
||||
instance = creature->GetInstanceScript();
|
||||
HadMount = false;
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
|
||||
@@ -182,6 +182,7 @@ public:
|
||||
break;
|
||||
case NPC_LAIRGUARD:
|
||||
summoned->setActive(true);
|
||||
summoned->SetFarVisible(true);
|
||||
break;
|
||||
}
|
||||
summons.Summon(summoned);
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
currentEvent = 0;
|
||||
eventProgress = 0;
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,14 +54,17 @@ public:
|
||||
case NPC_TENEBRON:
|
||||
tenebronGUID = creature->GetGUID();
|
||||
creature->setActive(true);
|
||||
creature->SetFarVisible(true);
|
||||
break;
|
||||
case NPC_SHADRON:
|
||||
shadronGUID = creature->GetGUID();
|
||||
creature->setActive(true);
|
||||
creature->SetFarVisible(true);
|
||||
break;
|
||||
case NPC_VESPERON:
|
||||
vesperonGUID = creature->GetGUID();
|
||||
creature->setActive(true);
|
||||
creature->SetFarVisible(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ class boss_baltharus_the_warborn : public CreatureScript
|
||||
{
|
||||
case ACTION_INTRO_BALTHARUS:
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
events.ScheduleEvent(EVENT_INTRO_TALK, Seconds(7), 0, PHASE_INTRO);
|
||||
break;
|
||||
case ACTION_CLONE:
|
||||
|
||||
@@ -1083,6 +1083,7 @@ class npc_meteor_strike : public CreatureScript
|
||||
{
|
||||
DoCastSelf(SPELL_METEOR_STRIKE_FIRE_AURA_2, true);
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
_events.ScheduleEvent(EVENT_SPAWN_METEOR_FLAME, Milliseconds(500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ class npc_xerestrasza : public CreatureScript
|
||||
if (action == ACTION_BALTHARUS_DEATH)
|
||||
{
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
_isIntro = false;
|
||||
|
||||
Talk(SAY_XERESTRASZA_EVENT);
|
||||
@@ -131,6 +132,7 @@ class npc_xerestrasza : public CreatureScript
|
||||
me->SetFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
|
||||
Talk(SAY_XERESTRASZA_EVENT_7);
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -276,6 +276,7 @@ class boss_sindragosa : public CreatureScript
|
||||
instance->SetBossState(DATA_SINDRAGOSA, IN_PROGRESS);
|
||||
me->SetCombatPulseDelay(5);
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
@@ -313,6 +314,7 @@ class boss_sindragosa : public CreatureScript
|
||||
return;
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->SetCanFly(true);
|
||||
me->SetDisableGravity(true);
|
||||
me->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
@@ -347,6 +349,7 @@ class boss_sindragosa : public CreatureScript
|
||||
{
|
||||
case POINT_FROSTWYRM_LAND:
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(true);
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
@@ -701,6 +704,7 @@ class npc_spinestalker : public CreatureScript
|
||||
return;
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->SetSpeedRate(MOVE_FLIGHT, 2.0f);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
float moveTime = me->GetExactDist(&SpinestalkerFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
|
||||
@@ -719,6 +723,7 @@ class npc_spinestalker : public CreatureScript
|
||||
return;
|
||||
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(true);
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
@@ -838,6 +843,7 @@ class npc_rimefang : public CreatureScript
|
||||
return;
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->SetSpeedRate(MOVE_FLIGHT, 2.0f);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
|
||||
@@ -856,6 +862,7 @@ class npc_rimefang : public CreatureScript
|
||||
return;
|
||||
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(true);
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
|
||||
@@ -1053,6 +1053,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
triggers.sort(Trinity::ObjectDistanceOrderPred(terenas, true));
|
||||
Creature* spawner = triggers.front();
|
||||
spawner->setActive(true);
|
||||
spawner->SetFarVisible(true);
|
||||
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly
|
||||
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players
|
||||
spawner->m_Events.AddEvent(new TriggerWickedSpirit(spawner), spawner->m_Events.CalculateTime(3000));
|
||||
@@ -1739,6 +1740,7 @@ class npc_terenas_menethil : public CreatureScript
|
||||
{
|
||||
case ACTION_FROSTMOURNE_INTRO:
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(false);
|
||||
if (!IsHeroic())
|
||||
me->SetHealth(me->GetMaxHealth() / 2);
|
||||
DoCast(me, SPELL_LIGHTS_FAVOR);
|
||||
|
||||
@@ -418,12 +418,16 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
|
||||
if (Creature* factionNPC = me->FindNearestCreature(_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? NPC_SE_HIGH_OVERLORD_SAURFANG : NPC_SE_MURADIN_BRONZEBEARD, 50.0f))
|
||||
{
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
_theLichKing = theLichKing->GetGUID();
|
||||
theLichKing->setActive(true);
|
||||
theLichKing->SetFarVisible(true);
|
||||
_bolvarFordragon = bolvarFordragon->GetGUID();
|
||||
bolvarFordragon->setActive(true);
|
||||
bolvarFordragon->SetFarVisible(true);
|
||||
_factionNPC = factionNPC->GetGUID();
|
||||
factionNPC->setActive(true);
|
||||
factionNPC->SetFarVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,6 +519,7 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
|
||||
{
|
||||
bolvarFordragon->AI()->Talk(SAY_BOLVAR_INTRO_1);
|
||||
bolvarFordragon->setActive(false);
|
||||
bolvarFordragon->SetFarVisible(false);
|
||||
}
|
||||
break;
|
||||
case EVENT_LK_INTRO_5:
|
||||
@@ -522,6 +527,7 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
|
||||
{
|
||||
theLichKing->AI()->Talk(SAY_LK_INTRO_5);
|
||||
theLichKing->setActive(false);
|
||||
theLichKing->SetFarVisible(false);
|
||||
}
|
||||
break;
|
||||
case EVENT_SAURFANG_INTRO_1:
|
||||
@@ -835,6 +841,7 @@ class boss_sister_svalna : public CreatureScript
|
||||
break;
|
||||
case ACTION_START_GAUNTLET:
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
_isEventInProgress = true;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
events.ScheduleEvent(EVENT_SVALNA_START, 25000);
|
||||
@@ -847,6 +854,7 @@ class boss_sister_svalna : public CreatureScript
|
||||
break;
|
||||
case ACTION_RESET_EVENT:
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
Reset();
|
||||
break;
|
||||
default:
|
||||
@@ -870,6 +878,7 @@ class boss_sister_svalna : public CreatureScript
|
||||
|
||||
_isEventInProgress = false;
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
@@ -1001,6 +1010,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_CROK_INTRO_3, 14000);
|
||||
_events.ScheduleEvent(EVENT_START_PATHING, 37000);
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
for (uint32 i = 0; i < 4; ++i)
|
||||
if (Creature* crusader = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_CAPTAIN_ARNATH + i)))
|
||||
crusader->AI()->DoAction(ACTION_START_GAUNTLET);
|
||||
@@ -1010,6 +1020,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
_isEventActive = false;
|
||||
_isEventDone = _instance->GetBossState(DATA_SISTER_SVALNA) == DONE;
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
_aliveTrash.clear();
|
||||
_currentWPid = 0;
|
||||
}
|
||||
@@ -1027,6 +1038,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
{
|
||||
_isEventActive = false;
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
Talk(SAY_CROK_FINAL_WP);
|
||||
if (Creature* svalna = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SISTER_SVALNA)))
|
||||
svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
|
||||
@@ -1056,6 +1068,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
{
|
||||
_isEventActive = false;
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
Talk(SAY_CROK_FINAL_WP);
|
||||
if (Creature* svalna = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SISTER_SVALNA)))
|
||||
svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
|
||||
@@ -1280,6 +1293,7 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
}
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
}
|
||||
else if (action == ACTION_RESET_EVENT)
|
||||
{
|
||||
|
||||
@@ -990,9 +990,10 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
// set the platform as active object to dramatically increase visibility range
|
||||
// note: "active" gameobjects do not block grid unloading
|
||||
if (GameObject* precipice = instance->GetGameObject(ArthasPrecipiceGUID))
|
||||
precipice->setActive(state == IN_PROGRESS);
|
||||
precipice->SetFarVisible(state == IN_PROGRESS);
|
||||
|
||||
if (GameObject* platform = instance->GetGameObject(ArthasPlatformGUID))
|
||||
platform->setActive(state == IN_PROGRESS);
|
||||
platform->SetFarVisible(state == IN_PROGRESS);
|
||||
|
||||
if (instance->IsHeroic())
|
||||
{
|
||||
|
||||
@@ -226,6 +226,7 @@ struct boss_four_horsemen_baseAI : public BossAI
|
||||
cBoss->SetReactState(REACT_PASSIVE);
|
||||
cBoss->AttackStop(); // clear initial target that was set on enter combat
|
||||
cBoss->setActive(true);
|
||||
cBoss->SetFarVisible(true);
|
||||
|
||||
for (Map::PlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
|
||||
@@ -163,6 +163,7 @@ public:
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->setActive(true);
|
||||
summon->SetFarVisible(true);
|
||||
summon->AI()->DoZoneInCombat(nullptr, 250.0f); // specify range to cover entire room - default 50yd is not enough
|
||||
}
|
||||
|
||||
|
||||
@@ -221,10 +221,17 @@ public:
|
||||
{
|
||||
_JustDied();
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG)))
|
||||
{
|
||||
stalagg->setActive(false);
|
||||
stalagg->SetFarVisible(false);
|
||||
}
|
||||
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
|
||||
{
|
||||
feugen->setActive(false);
|
||||
feugen->SetFarVisible(false);
|
||||
}
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
@@ -262,11 +269,18 @@ public:
|
||||
instance->SetBossState(BOSS_THADDIUS, IN_PROGRESS);
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
DoZoneInCombat();
|
||||
if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG)))
|
||||
{
|
||||
stalagg->setActive(true);
|
||||
stalagg->SetFarVisible(true);
|
||||
}
|
||||
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
|
||||
{
|
||||
feugen->setActive(true);
|
||||
feugen->SetFarVisible(true);
|
||||
}
|
||||
break;
|
||||
case ACTION_FEUGEN_DIED:
|
||||
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
|
||||
@@ -335,6 +349,7 @@ public:
|
||||
stalagg->AI()->DoAction(ACTION_BEGIN_RESET_ENCOUNTER);
|
||||
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
}
|
||||
|
||||
void ResetEncounter()
|
||||
@@ -525,6 +540,7 @@ public:
|
||||
coil->SetGoState(GO_STATE_READY);
|
||||
me->DespawnOrUnsummon();
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
}
|
||||
|
||||
void ResetEncounter()
|
||||
@@ -794,6 +810,7 @@ public:
|
||||
coil->SetGoState(GO_STATE_READY);
|
||||
me->DespawnOrUnsummon();
|
||||
me->setActive(false);
|
||||
me->SetFarVisible(false);
|
||||
}
|
||||
|
||||
void ResetEncounter()
|
||||
|
||||
@@ -407,6 +407,7 @@ class boss_algalon_the_observer : public CreatureScript
|
||||
brann->AI()->DoAction(ACTION_FINISH_INTRO);
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
DoZoneInCombat();
|
||||
introDelay = 26000;
|
||||
summons.DespawnEntry(NPC_AZEROTH);
|
||||
|
||||
@@ -1131,6 +1131,7 @@ class npc_thorim_pre_phase : public CreatureScript
|
||||
npc_thorim_pre_phaseAI(Creature* creature) : npc_thorim_trashAI(creature)
|
||||
{
|
||||
me->setActive(true); // prevent grid unload
|
||||
me->SetFarVisible(true);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
|
||||
@@ -361,6 +361,7 @@ public:
|
||||
init.Launch();
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
me->SetCanFly(true);
|
||||
me->SetDisableGravity(true);
|
||||
me->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
|
||||
@@ -191,18 +191,22 @@ class instance_serpent_shrine : public InstanceMapScript
|
||||
case 184568:
|
||||
ControlConsole = go->GetGUID();
|
||||
go->setActive(true);
|
||||
go->SetFarVisible(true);
|
||||
break;
|
||||
case 184203:
|
||||
BridgePart[0] = go->GetGUID();
|
||||
go->setActive(true);
|
||||
go->SetFarVisible(true);
|
||||
break;
|
||||
case 184204:
|
||||
BridgePart[1] = go->GetGUID();
|
||||
go->setActive(true);
|
||||
go->SetFarVisible(true);
|
||||
break;
|
||||
case 184205:
|
||||
BridgePart[2] = go->GetGUID();
|
||||
go->setActive(true);
|
||||
go->SetFarVisible(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user