Core/Ruby: Minor fixes in Halion encounter

* Some codestyle fixes
* Fixed wrong Halion summon with Hotswap system
* Fixed evade issue
* Fixed emblem frost exploit

(cherry picked from commit 0b33a8281f)
This commit is contained in:
sirikfoll
2016-12-24 00:15:00 -03:00
committed by DoctorKraft
parent 7a1f2bf873
commit ab3a4bde4e
2 changed files with 30 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
-- Fix emblem frost exploit in Ruby Sanctum
UPDATE `creature_template` SET `flags_extra`=`flags_extra` | 1 WHERE `entry`IN(39823,39920,39805);

View File

@@ -53,7 +53,7 @@ enum Texts
EMOTE_CORPOREALITY_TIT = 3, // Your companions' efforts force %s further into the twilight realm!
EMOTE_CORPOREALITY_TOT = 4, // Your efforts force %s further out of the twilight realm!
EMOTE_WARN_LASER = 0, // The orbiting spheres pulse with dark energy!
EMOTE_WARN_LASER = 0 // The orbiting spheres pulse with dark energy!
};
enum Spells
@@ -143,7 +143,8 @@ enum Events
EVENT_SHADOW_PULSARS_SHOOT = 14,
EVENT_TRIGGER_BERSERK = 15,
EVENT_TWILIGHT_MENDING = 16,
EVENT_ACTIVATE_EMBERS = 17
EVENT_ACTIVATE_EMBERS = 17,
EVENT_EVADE_CHECK = 18
};
enum Actions
@@ -176,7 +177,7 @@ enum Misc
DATA_MATERIAL_DAMAGE_TAKEN = 2,
DATA_STACKS_DISPELLED = 3,
DATA_FIGHT_PHASE = 4,
DATA_SPAWNED_FLAMES = 5,
DATA_SPAWNED_FLAMES = 5
};
enum OrbCarrierSeats
@@ -206,7 +207,8 @@ struct CorporealityEntry
uint32 materialRealmSpell;
};
CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] = {
CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] =
{
{74836, 74831},
{74835, 74830},
{74834, 74829},
@@ -566,7 +568,7 @@ class npc_halion_controller : public CreatureScript
void JustRespawned() override
{
if (!_instance->GetGuidData(DATA_HALION).IsEmpty())
if (!_instance->GetGuidData(DATA_HALION).IsEmpty() || _instance->GetBossState(DATA_GENERAL_ZARITHRIAN) != DONE)
return;
Reset();
@@ -601,6 +603,7 @@ class npc_halion_controller : public CreatureScript
_materialDamageTaken = 0;
_events.ScheduleEvent(EVENT_TRIGGER_BERSERK, Minutes(8));
_events.ScheduleEvent(EVENT_EVADE_CHECK, Seconds(5));
}
void EnterEvadeMode(EvadeReason /*why*/) override
@@ -749,12 +752,27 @@ class npc_halion_controller : public CreatureScript
case EVENT_ACTIVATE_EMBERS:
_summons.DoZoneInCombat(NPC_LIVING_EMBER);
break;
case EVENT_EVADE_CHECK:
DoCheckEvade();
_events.Repeat(Seconds(5));
break;
default:
break;
}
}
}
void DoCheckEvade()
{
Map::PlayerList const &players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
if (player->IsAlive() && CheckBoundary(player) && !player->IsGameMaster())
return;
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
}
void SetData(uint32 id, uint32 value) override
{
switch (id)
@@ -1768,6 +1786,11 @@ class spell_halion_twilight_phasing : public SpellScriptLoader
{
PrepareSpellScript(spell_halion_twilight_phasing_SpellScript);
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_TWILIGHT_PORTAL });
}
void Phase()
{
Unit* caster = GetCaster();