Core/Ruby: Minor fixes in Halion encounter

* Some codestyle fixes
* Fixed wrong Halion summon with Hotswap system
* Fixed evade issue
* Fixed emblem frost exploit
This commit is contained in:
sirikfoll
2016-12-24 00:15:00 -03:00
committed by Keader
parent 554c28d56b
commit 0b33a8281f
2 changed files with 32 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

@@ -48,7 +48,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
@@ -138,7 +138,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
@@ -171,7 +172,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
@@ -201,7 +202,8 @@ struct CorporealityEntry
uint32 materialRealmSpell;
};
CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] = {
CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] =
{
{74836, 74831},
{74835, 74830},
{74834, 74829},
@@ -561,7 +563,7 @@ class npc_halion_controller : public CreatureScript
void JustRespawned() override
{
if (_instance->GetGuidData(DATA_HALION))
if (_instance->GetGuidData(DATA_HALION) || _instance->GetBossState(DATA_GENERAL_ZARITHRIAN) != DONE)
return;
Reset();
@@ -596,6 +598,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
@@ -744,12 +747,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)
@@ -1765,6 +1783,13 @@ class spell_halion_twilight_phasing : public SpellScriptLoader
{
PrepareSpellScript(spell_halion_twilight_phasing_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_TWILIGHT_PORTAL))
return false;
return true;
}
void Phase()
{
Unit* caster = GetCaster();