Scripts/Instances: Fix a bug that would cause the Hodir encounter to never properly begin. Tagging issue #17302.

This commit is contained in:
treeston
2016-06-07 14:17:11 +02:00
committed by Aokromes
parent 5904b4a560
commit 4bf80b2a47
3 changed files with 18 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
-- remove incorrect trigger flag from hodir ice blocks that prevents encounter from starting
UPDATE `creature_template` SET `flags_extra`=(`flags_extra`&~128) WHERE `entry` IN (32938,33353);

View File

@@ -32,6 +32,7 @@ enum Say
enum Spells
{
// @todo orb uses the wrong spell, this needs sniffs
SPELL_MINDCONTROL = 42013,
SPELL_CHANNEL = 45537,
SPELL_EGG_DESTROY = 19873,
@@ -103,7 +104,7 @@ public:
secondPhase = true;
me->RemoveAllAuras();
me->SetHealth(me->GetMaxHealth());
me->SetFullHealth();
}
void DoAction(int32 action) override
@@ -114,6 +115,7 @@ public:
void DamageTaken(Unit* /*who*/, uint32& damage) override
{
// @todo this is wrong - razorgore should still take damage, he should just nuke the whole room and respawn if he dies during P1
if (!secondPhase)
damage = 0;
}
@@ -146,6 +148,7 @@ public:
break;
case EVENT_CONFLAGRATION:
DoCastVictim(SPELL_CONFLAGRATION);
// @todo is this even necessary? pretty sure AI ignores targets with disorient by default
if (me->GetVictim() && me->EnsureVictim()->HasAura(SPELL_CONFLAGRATION))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
me->TauntApply(target);
@@ -175,10 +178,10 @@ public:
{
if (InstanceScript* instance = go->GetInstanceScript())
if (instance->GetData(DATA_EGG_EVENT) != DONE)
if (Creature* razor = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
{
razor->Attack(player, true);
player->CastSpell(razor, SPELL_MINDCONTROL);
razorgore->Attack(player, true);
player->CastSpell(razorgore, SPELL_MINDCONTROL);
}
return true;
}

View File

@@ -30,6 +30,8 @@
Destroying of Toasty Fires
*/
/* @todo Hodir aggro behavior is wonky. He gets set to _PASSIVE, but never to _AGGRESSIVE unless you kill an ice block which doesn't spawn unless you have*/
enum HodirYells
{
SAY_AGGRO = 0,
@@ -375,7 +377,7 @@ class boss_hodir : public CreatureScript
Talk(SAY_SLAY);
}
void DamageTaken(Unit* /*who*/, uint32& damage) override
void DamageTaken(Unit* who, uint32& damage) override
{
if (damage >= me->GetHealth())
{
@@ -403,6 +405,12 @@ class boss_hodir : public CreatureScript
_JustDied();
}
else if (!me->IsInCombat())
{
me->SetReactState(REACT_AGGRESSIVE);
me->AI()->DoZoneInCombat();
me->AI()->AttackStart(who);
}
}
void UpdateAI(uint32 diff) override