fix(Core/ZulGurub): Hazza'rah improvements (#12236)

* fix(Core/ZulGurub): Hazza'rah improvements

* dumb
This commit is contained in:
Nefertumm
2022-07-01 15:22:13 -03:00
committed by GitHub
parent b866c470d6
commit 298b08c9a5
3 changed files with 80 additions and 81 deletions
@@ -0,0 +1,2 @@
--
UPDATE `creature_template` SET `DamageModifier` = 26 WHERE `entry` = 15163;
@@ -4295,6 +4295,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Dispel = DISPEL_NONE; spellInfo->Dispel = DISPEL_NONE;
}); });
// Summon Nightmare Illusions
ApplySpellFix({ 24681, 24728, 24729 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].MiscValueB = 64;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{ {
SpellInfo* spellInfo = mSpellInfoMap[i]; SpellInfo* spellInfo = mSpellInfoMap[i];
@@ -15,13 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* ScriptData
SDName: Boss_Hazzarah
SD%Complete: 100
SDComment:
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "SpellScript.h" #include "SpellScript.h"
@@ -45,100 +38,98 @@ enum Events
EVENT_ILLUSIONS = 4 EVENT_ILLUSIONS = 4
}; };
class boss_hazzarah : public CreatureScript struct boss_hazzarah : public BossAI
{ {
public: boss_hazzarah(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { }
boss_hazzarah() : CreatureScript("boss_hazzarah") { }
struct boss_hazzarahAI : public BossAI void JustSummoned(Creature* summon) override
{ {
boss_hazzarahAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { } summons.Summon(summon);
void JustSummoned(Creature* summon) override summon->SetCorpseDelay(10);
{ summon->SetReactState(REACT_PASSIVE);
summons.Summon(summon); summon->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
summon->SetVisible(false);
summon->SetCorpseDelay(10); summon->m_Events.AddEventAtOffset([summon]()
summon->SetReactState(REACT_PASSIVE);
summon->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
summon->SetVisible(false);
summon->m_Events.AddEventAtOffset([summon]()
{ {
summon->SetVisible(true); summon->SetVisible(true);
}, 2s); }, 2s);
summon->m_Events.AddEventAtOffset([summon]() summon->m_Events.AddEventAtOffset([summon]()
{ {
summon->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); summon->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
summon->SetReactState(REACT_AGGRESSIVE); summon->SetReactState(REACT_AGGRESSIVE);
summon->SetInCombatWithZone(); summon->SetInCombatWithZone();
}, 3500ms); }, 5s);
} }
void EnterCombat(Unit* /*who*/) override void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
{
summons.Despawn(summon);
summon->DespawnOrUnsummon();
}
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
events.ScheduleEvent(EVENT_SLEEP, 12s, 15s);
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s);
}
bool CanAIAttack(Unit const* target) const override
{
if (me->GetThreatMgr().getThreatList().size() > 1 && me->GetThreatMgr().getOnlineContainer().getMostHated()->getTarget() == target)
return !target->HasAura(SPELL_SLEEP);
return true;
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{ {
_EnterCombat(); switch (eventId)
events.ScheduleEvent(EVENT_SLEEP, 12s, 15s);
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s);
}
bool CanAIAttack(Unit const* target) const override
{
if (me->GetThreatMgr().getThreatList().size() > 1 && me->GetThreatMgr().getOnlineContainer().getMostHated()->getTarget() == target)
return !target->HasAura(SPELL_SLEEP);
return true;
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{ {
switch (eventId) case EVENT_SLEEP:
{ DoCastVictim(SPELL_SLEEP, true);
case EVENT_SLEEP: events.ScheduleEvent(EVENT_SLEEP, 24s, 32s);
DoCastVictim(SPELL_SLEEP, true); return;
events.ScheduleEvent(EVENT_SLEEP, 24s, 32s); case EVENT_EARTH_SHOCK:
return; DoCastVictim(SPELL_EARTH_SHOCK);
case EVENT_EARTH_SHOCK: events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
DoCastVictim(SPELL_EARTH_SHOCK); break;
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s); case EVENT_CHAIN_BURN:
break; if (me->GetPowerPct(POWER_MANA) > 5.f) // totally guessed
case EVENT_CHAIN_BURN: {
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA; })) if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA; }))
{ {
DoCast(target, SPELL_CHAIN_BURN, false); DoCast(target, SPELL_CHAIN_BURN);
} }
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s); }
break; events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
case EVENT_ILLUSIONS: break;
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_LEFT, true); case EVENT_ILLUSIONS:
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_BACK, true); DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_LEFT, true);
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_RIGHT, true); DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_BACK, true);
events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s); DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_RIGHT, true);
break; events.ScheduleEvent(EVENT_ILLUSIONS, 15s, 25s);
default: break;
break; default:
} break;
} }
DoMeleeAttackIfReady();
} }
};
CreatureAI* GetAI(Creature* creature) const override DoMeleeAttackIfReady();
{
return GetZulGurubAI<boss_hazzarahAI>(creature);
} }
}; };
@@ -164,6 +155,6 @@ class spell_chain_burn : public SpellScript
void AddSC_boss_hazzarah() void AddSC_boss_hazzarah()
{ {
new boss_hazzarah(); RegisterZulGurubCreatureAI(boss_hazzarah);
RegisterSpellScript(spell_chain_burn); RegisterSpellScript(spell_chain_burn);
} }