diff options
Diffstat (limited to 'src')
12 files changed, 764 insertions, 338 deletions
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index 03e41efdef3..d10d5aa0461 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define EMOTE_SERVICE -1409000 @@ -44,7 +45,11 @@ public: struct boss_baron_geddonAI : public ScriptedAI { - boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {} + boss_baron_geddonAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 Inferno_Timer; uint32 IgniteMana_Timer; @@ -57,6 +62,12 @@ public: LivingBomb_Timer = 35000; } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_GEDDON, 0); + } + void EnterCombat(Unit * /*who*/) { } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp index 3539e97ba55..9c38220bbfd 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" // Garr spells #define SPELL_ANTIMAGICPULSE 19492 @@ -46,7 +47,11 @@ public: struct boss_garrAI : public ScriptedAI { - boss_garrAI(Creature *c) : ScriptedAI(c) {} + boss_garrAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 AntiMagicPulse_Timer; uint32 MagmaShackles_Timer; @@ -61,6 +66,12 @@ public: CheckAdds_Timer = 2000; } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_GARR, 0); + } + void EnterCombat(Unit * /*who*/) { } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp index 3c30ce0d1ca..af40d6c912a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define SPELL_SHADOWBOLT 19728 #define SPELL_RAINOFFIRE 19717 @@ -41,7 +42,11 @@ public: struct boss_gehennasAI : public ScriptedAI { - boss_gehennasAI(Creature *c) : ScriptedAI(c) {} + boss_gehennasAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 ShadowBolt_Timer; uint32 RainOfFire_Timer; @@ -54,6 +59,12 @@ public: GehennasCurse_Timer = 12000; } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_GEHENNAS, 0); + } + void EnterCombat(Unit * /*who*/) {} void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index 516c91c22e7..06170f19a20 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -76,7 +76,7 @@ public: void JustDied(Unit* /*pKiller*/) { if (m_pInstance) - m_pInstance->SetData(DATA_GOLEMAGG_DEATH, 0); + m_pInstance->SetData(DATA_GOLEMAGG, 0); } void UpdateAI(const uint32 uiDiff) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp index 434f0d5e6b3..d3683176f96 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define SPELL_IMPENDINGDOOM 19702 #define SPELL_LUCIFRONCURSE 19703 @@ -41,7 +42,11 @@ public: struct boss_lucifronAI : public ScriptedAI { - boss_lucifronAI(Creature *c) : ScriptedAI(c) {} + boss_lucifronAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 ImpendingDoom_Timer; uint32 LucifronCurse_Timer; @@ -54,6 +59,12 @@ public: ShadowShock_Timer = 6000; //6 seconds } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_LUCIFRON, 0); + } + void EnterCombat(Unit * /*who*/) { } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp index e1b36c775d5..d16dd730629 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define EMOTE_FRENZY -1409001 @@ -45,7 +46,11 @@ public: struct boss_magmadarAI : public ScriptedAI { - boss_magmadarAI(Creature *c) : ScriptedAI(c) {} + boss_magmadarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 Frenzy_Timer; uint32 Panic_Timer; @@ -60,6 +65,12 @@ public: DoCast(me, SPELL_MAGMASPIT, true); } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_MAGMADAR, 0); + } + void EnterCombat(Unit * /*who*/) { } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 9620a0715cf..ef98bc4cb82 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define SAY_AGGRO -1409003 #define SAY_SPAWN -1409004 @@ -37,10 +38,14 @@ EndScriptData */ #define SAY_ARRIVAL3_RAG -1409011 #define SAY_ARRIVAL5_RAG -1409012 -#define SPAWN_RAG_X 838.51 -#define SPAWN_RAG_Y -829.84 -#define SPAWN_RAG_Z -232.00 -#define SPAWN_RAG_O 1.70 +#define ENTRY_RAGNAROS 11502 + +#define EMOTE_EMERGE 449 + +#define TELE_TO_RAG_X 829.159f +#define TELE_TO_RAG_Y -815.773f +#define TELE_TO_RAG_Z -228.972f +#define TELE_TO_RAG_O 5.305f #define SPELL_MAGIC_REFLECTION 20619 #define SPELL_DAMAGE_REFLECTION 21075 @@ -53,6 +58,9 @@ EndScriptData */ #define ENTRY_FLAMEWALKER_HEALER 11663 #define ENTRY_FLAMEWALKER_ELITE 11664 +#define GOSSIP_HELLO 4995 +#define GOSSIP_SELLECT "Tell me more." + class boss_majordomo : public CreatureScript { public: @@ -63,19 +71,49 @@ public: return new boss_majordomoAI (pCreature); } - struct boss_majordomoAI : public ScriptedAI + bool OnGossipHello(Player* pPlayer, Creature* pCreature) { - boss_majordomoAI(Creature *c) : ScriptedAI(c) {} + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELLECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_HELLO, pCreature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) + { + //ScriptedInstance* pInstance = pCreature->GetInstanceData(); + + BossAI* pBossAI = CAST_AI(boss_majordomoAI, pCreature->AI()); + + if (/*pInstance && */pBossAI) + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(boss_majordomoAI, pCreature->AI())->StartRagsEvent(); + } + return true; + } + + struct boss_majordomoAI : public BossAI + { + boss_majordomoAI(Creature *pCreature) : BossAI(pCreature, BOSS_MAJORDOMO) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 MagicReflection_Timer; uint32 DamageReflection_Timer; uint32 Blastwave_Timer; + uint32 Teleport_Timer; + uint32 Phase_Timer; //for teleport and ragnaros's intro + uint8 Phase; void Reset() { MagicReflection_Timer = 30000; //Damage reflection first so we alternate DamageReflection_Timer = 15000; Blastwave_Timer = 10000; + Teleport_Timer = 20000; + Phase = 0; } void KilledUnit(Unit* /*victim*/) @@ -93,41 +131,97 @@ public: void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) - return; - - //Cast Ageis if less than 50% hp - if (HealthBelowPct(50)) + if (Phase == 0) { - DoCast(me, SPELL_AEGIS); + if (!UpdateVictim()) + return; + + if (((!me->FindNearestCreature(ENTRY_FLAMEWALKER_HEALER,100.0f)) && (!me->FindNearestCreature(ENTRY_FLAMEWALKER_ELITE,100.0f))) && (!m_pInstance->GetData(DATA_MAJORDOMOISDEAD))) + { + me->setFaction(35); + me->AI()->EnterEvadeMode(); + DoScriptText(SAY_DEFEAT, me); + //DoCast(SPELL_SUMMON_RAGNAROS); Not working atm ,doing workaround + if (m_pInstance) + m_pInstance->SetData(DATA_MAJORDOMO, DONE); + //m_pInstance->SetBossState(DATA_MAJORDOMO, DONE); + Phase_Timer = 32000; + Phase = 1; + } + + //Cast Ageis if less than 50% hp + if (me->GetHealth()*100 / me->GetMaxHealth() < 50) + if (HealthBelowPct(50)) + { + DoCast(me, SPELL_AEGIS); + } + + if (MagicReflection_Timer <= diff) + { + DoCast(me, SPELL_MAGIC_REFLECTION); + MagicReflection_Timer = 30000; + } else MagicReflection_Timer -= diff; + + if (DamageReflection_Timer <= diff) + { + DoCast(me, SPELL_DAMAGE_REFLECTION); + DamageReflection_Timer = 30000; + } else DamageReflection_Timer -= diff; + + //Blastwave_Timer + if (Blastwave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BLASTWAVE); + Blastwave_Timer = 10000; + } else Blastwave_Timer -= diff; + + if (Teleport_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + DoCast(pTarget, SPELL_TELEPORT); + Teleport_Timer = 20000; + } else Teleport_Timer -= diff; + + DoMeleeAttackIfReady(); } - - //MagicReflection_Timer - // if (MagicReflection_Timer <= diff) - // { - // DoCast(me, SPELL_MAGICREFLECTION); - - //60 seconds until we should cast this agian - // MagicReflection_Timer = 30000; - // } else MagicReflection_Timer -= diff; - - //DamageReflection_Timer - // if (DamageReflection_Timer <= diff) - // { - // DoCast(me, SPELL_DAMAGEREFLECTION); - - //60 seconds until we should cast this agian - // DamageReflection_Timer = 30000; - // } else DamageReflection_Timer -= diff; - - //Blastwave_Timer - if (Blastwave_Timer <= diff) + else { - DoCast(me->getVictim(), SPELL_BLASTWAVE); - Blastwave_Timer = 10000; - } else Blastwave_Timer -= diff; + if (Phase == 1) + { + if (Phase_Timer <= diff) + { + me->NearTeleportTo(TELE_TO_RAG_X, TELE_TO_RAG_Y, TELE_TO_RAG_Z, TELE_TO_RAG_O); + Phase = 2; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } else Phase_Timer -= diff; + } + if (Phase == 3) + { + if (Phase_Timer <= diff) + { + if (m_pInstance) + m_pInstance->SetData(DATA_RAGNAROS, true); + Phase = 4; + Phase_Timer = 16000; + } else Phase_Timer -= diff; + } + if (Phase == 4) + { + if (Phase_Timer <= diff) + { + DoScriptText(SAY_ARRIVAL2_MAJ, me); + Phase = 5; + } else Phase_Timer -= diff; + } + } + } - DoMeleeAttackIfReady(); + void StartRagsEvent() + { + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Phase = 3; + DoScriptText(SAY_SUMMON_MAJ, me); + Phase_Timer = 8000; } }; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index 2581c3add18..564f0aefbbf 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -18,12 +18,13 @@ /* ScriptData SDName: Boss_Ragnaros -SD%Complete: 75 -SDComment: Intro Dialog and event NYI +SD%Complete: 95 +SDComment: missing effects in intro (summon, majordomos tele) annd some spells doesnt work correctly SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define SAY_REINFORCEMENTS1 -1409013 #define SAY_REINFORCEMENTS2 -1409014 @@ -45,6 +46,14 @@ EndScriptData */ #define SPELL_ELEMENTALFIRE 20564 #define SPELL_ERRUPTION 17731 +#define SAY_SUMMON_MAJ -1409008 //intro +#define SAY_ARRIVAL1_RAG -1409009 +#define SAY_ARRIVAL2_MAJ -1409010 +#define SAY_ARRIVAL3_RAG -1409011 +#define SAY_ARRIVAL5_RAG -1409012 + +#define UNIT_DYNFLAG_ROOTED 8 + #define ADD_1X 848.740356 #define ADD_1Y -816.103455 #define ADD_1Z -229.74327 @@ -95,10 +104,14 @@ public: return new boss_ragnarosAI (pCreature); } - struct boss_ragnarosAI : public ScriptedAI + struct boss_ragnarosAI : public BossAI { - boss_ragnarosAI(Creature *c) : ScriptedAI(c) + boss_ragnarosAI(Creature *pCreature) : BossAI(pCreature, BOSS_RAGNAROS) { + Intro_Timer = 0; + Intro = 0; + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); SetCombatMovement(false); } @@ -110,6 +123,8 @@ public: uint32 Erruption_Timer; uint32 Submerge_Timer; uint32 Attack_Timer; + uint32 Intro_Timer; + uint8 Intro; bool HasYelledMagmaBurst; bool HasSubmergedOnce; @@ -132,6 +147,8 @@ public: DoCast(me, SPELL_MELTWEAPON, true); HasAura = true; + + me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); } void KilledUnit(Unit* /*victim*/) @@ -148,155 +165,268 @@ public: void UpdateAI(const uint32 diff) { - if (WasBanished && Attack_Timer <= diff) - { - //Become unbanished again - me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(me, SPELL_RAGEMERGE); - WasBanished = false; - } else if (WasBanished) + if (Intro == 1) + { + if (Intro_Timer <= diff) + { + DoScriptText(SAY_ARRIVAL1_RAG, me); + Intro_Timer = 18000; + Intro = 2; + } else Intro_Timer -= diff; + } + else if (Intro == 2) + { + if (Intro_Timer <= diff) + { + DoScriptText(SAY_ARRIVAL3_RAG, me); + Intro_Timer = 19000; + Intro = 3; + } else Intro_Timer -= diff; + } + else if (Intro == 3) + { + if (Intro_Timer <= diff) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK1H); + Intro_Timer = 1000; + Intro = 4; + } else Intro_Timer -= diff; + } + else if (Intro == 4) + { + if (Intro_Timer <= diff) + { + DoScriptText(SAY_ARRIVAL5_RAG, me); + if (instance) + if (Creature *pMajordomo = me->GetCreature(*me, instance->GetData64(DATA_MAJORDOMO_GUID))) + me->Kill(pMajordomo); + Intro_Timer = 10000; + Intro = 5; + } else Intro_Timer -= diff; + } + else if (Intro == 5) + { + if (Intro_Timer <= diff) + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Intro = 6; + } else Intro_Timer -= diff; + } + else if (Intro == 6) { - Attack_Timer -= diff; - //Do nothing while banished - return; - } + if (instance) + { + if (WasBanished && ((Attack_Timer <= diff) || (instance->GetData(DATA_RAG_ELE_COUNTER)) > 8)) + { + //Become unbanished again + me->SetReactState(REACT_AGGRESSIVE); + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + AttackStart(pTarget); + instance->SetData(DATA_RAG_ELE_COUNTER, 0); + + //DoCast(me, SPELL_RAGEMERGE); //"phase spells" didnt worked correctly so Ive commented them and wrote solution witch doesnt need core support + WasBanished = false; + } + else if (WasBanished) + { + Attack_Timer -= diff; + //Do nothing while banished + return; + } + } - //Return since we have no target - if (!UpdateVictim()) - return; + //Return since we have no target + if (!UpdateVictim()) + return; - //WrathOfRagnaros_Timer - if (WrathOfRagnaros_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS); + //Erruption_Timer + if (LavaBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ERRUPTION); + Erruption_Timer = urand(20000,45000); + } else Erruption_Timer -= diff; - if (urand(0,1)) - DoScriptText(SAY_WRATH, me); + //WrathOfRagnaros_Timer + if (WrathOfRagnaros_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS); - WrathOfRagnaros_Timer = 30000; - } else WrathOfRagnaros_Timer -= diff; + if (urand(0,1)) + DoScriptText(SAY_WRATH, me); - //HandOfRagnaros_Timer - if (HandOfRagnaros_Timer <= diff) - { - DoCast(me, SPELL_HANDOFRAGNAROS); + WrathOfRagnaros_Timer = 25000; + } else WrathOfRagnaros_Timer -= diff; - if (urand(0,1)) - DoScriptText(SAY_HAND, me); + //HandOfRagnaros_Timer + if (HandOfRagnaros_Timer <= diff) + { + DoCast(me, SPELL_HANDOFRAGNAROS); - HandOfRagnaros_Timer = 25000; - } else HandOfRagnaros_Timer -= diff; + if (urand(0,1)) + DoScriptText(SAY_HAND, me); - //LavaBurst_Timer - if (LavaBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LAVABURST); - LavaBurst_Timer = 10000; - } else LavaBurst_Timer -= diff; + HandOfRagnaros_Timer = 20000; + } else HandOfRagnaros_Timer -= diff; - //Erruption_Timer - if (LavaBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ERRUPTION); - Erruption_Timer = urand(20000,45000); - } else Erruption_Timer -= diff; + //LavaBurst_Timer + if (LavaBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LAVABURST); + LavaBurst_Timer = 10000; + } else LavaBurst_Timer -= diff; - //ElementalFire_Timer - if (ElementalFire_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ELEMENTALFIRE); - ElementalFire_Timer = urand(10000,14000); - } else ElementalFire_Timer -= diff; + //ElementalFire_Timer + if (ElementalFire_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ELEMENTALFIRE); + ElementalFire_Timer = urand(10000,14000); + } else ElementalFire_Timer -= diff; - //Submerge_Timer - if (!WasBanished && Submerge_Timer <= diff) - { - //Creature spawning and ragnaros becomming unattackable - //is not very well supported in the core - //so added normaly spawning and banish workaround and attack again after 90 secs. - - me->InterruptNonMeleeSpells(false); - //Root self - DoCast(me, 23973); - me->setFaction(35); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - - if (!HasSubmergedOnce) + //Submerge_Timer + if (!WasBanished && Submerge_Timer <= diff && instance) { - DoScriptText(SAY_REINFORCEMENTS1, me); + //Creature spawning and ragnaros becomming unattackable + //is not very well supported in the core //no it really isnt + //so added normaly spawning and banish workaround and attack again after 90 secs. + + me->AttackStop(); + DoResetThreat(); + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(false); + //Root self + //DoCast(me, 23973); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); + instance->SetData(DATA_RAG_ELE_COUNTER, 0); + + if (!HasSubmergedOnce) + { + DoScriptText(SAY_REINFORCEMENTS1, me); + + // summon 10 elementals + for (uint8 i = 0; i < 9; ++i) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + HasSubmergedOnce = true; + WasBanished = true; + //DoCast(me, SPELL_RAGSUBMERGE); + Attack_Timer = 90000; - // summon 10 elementals - for (uint8 i = 0; i < 9; ++i) + } + else { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoScriptText(SAY_REINFORCEMENTS2, me); + + for (uint8 i = 0; i < 9; ++i) { - if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) pSummoned->AI()->AttackStart(pTarget); + } } + + WasBanished = true; + //DoCast(me, SPELL_RAGSUBMERGE); + Attack_Timer = 90000; } - HasSubmergedOnce = true; - WasBanished = true; - DoCast(me, SPELL_RAGSUBMERGE); - Attack_Timer = 90000; + Submerge_Timer = 180000; + } else Submerge_Timer -= diff; + //If we are within range melee the target + if (me->IsWithinMeleeRange(me->getVictim())) + { + //Make sure our attack is ready and we arn't currently casting + if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) + { + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } } else { - DoScriptText(SAY_REINFORCEMENTS2, me); - - for (uint8 i = 0; i < 9; ++i) + //MagmaBurst_Timer + if (MagmaBurst_Timer <= diff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(me->getVictim(), SPELL_MAGMABURST); + + if (!HasYelledMagmaBurst) { - if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) - pSummoned->AI()->AttackStart(pTarget); + //Say our dialog + DoScriptText(SAY_MAGMABURST, me); + HasYelledMagmaBurst = true; } - } - WasBanished = true; - DoCast(me, SPELL_RAGSUBMERGE); - Attack_Timer = 90000; - } - - Submerge_Timer = 180000; - } else Submerge_Timer -= diff; - - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - //Make sure our attack is ready and we arn't currently casting - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); + MagmaBurst_Timer = 2500; + } else MagmaBurst_Timer -= diff; } } else { - //MagmaBurst_Timer - if (MagmaBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MAGMABURST); + me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); + Intro_Timer = 4000; + Intro = 1; + } + + } +}; - if (!HasYelledMagmaBurst) - { - //Say our dialog - DoScriptText(SAY_MAGMABURST, me); - HasYelledMagmaBurst = true; - } +}; - MagmaBurst_Timer = 2500; - } else MagmaBurst_Timer -= diff; - } + +class mob_SonOfFlame : public CreatureScript +{ +public: + mob_SonOfFlame() : CreatureScript("mob_SonOfFlame") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new mob_SonOfFlameAI(pCreature); + } + + struct mob_SonOfFlameAI : public ScriptedAI //didnt work correctly in EAI for me... + { + mob_SonOfFlameAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceScript(); + } + + InstanceScript* pInstance; + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_RAG_ELE_COUNTER, 1); } - }; + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; }; + + void AddSC_boss_ragnaros() { new boss_ragnaros(); + new mob_SonOfFlame(); } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp index 4ce4ebcda79..6a97a7a55eb 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp @@ -24,6 +24,7 @@ SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" +#include "molten_core.h" #define SPELL_ARCANEEXPLOSION 19712 #define SPELL_SHAZZRAHCURSE 19713 @@ -42,7 +43,12 @@ public: struct boss_shazzrahAI : public ScriptedAI { - boss_shazzrahAI(Creature *c) : ScriptedAI(c) {} + boss_shazzrahAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + + InstanceScript* m_pInstance; uint32 ArcaneExplosion_Timer; uint32 ShazzrahCurse_Timer; @@ -59,6 +65,12 @@ public: Blink_Timer = 30000; } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_SHAZZRAH, 0); + } + void EnterCombat(Unit * /*who*/) { } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index cf8fac79a2b..427db5e3fe3 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -49,7 +49,11 @@ public: struct boss_sulfuronAI : public ScriptedAI { - boss_sulfuronAI(Creature *c) : ScriptedAI(c) {} + boss_sulfuronAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceScript(); + } + InstanceScript* m_pInstance; uint32 Darkstrike_Timer; uint32 DemoralizingShout_Timer; @@ -66,6 +70,12 @@ public: Flamespear_Timer = 2000; } + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_SULFURON, 0); + } + void EnterCombat(Unit * /*who*/) { } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp index b689572569f..e9e5ec9abb8 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp @@ -26,7 +26,7 @@ EndScriptData */ #include "ScriptPCH.h" #include "molten_core.h" -#define MAX_ENCOUNTER 9 +#define MAX_ENCOUNTER 10 #define ID_LUCIFRON 12118 #define ID_MAGMADAR 11982 @@ -39,6 +39,22 @@ EndScriptData */ #define ID_DOMO 12018 #define ID_RAGNAROS 11502 #define ID_FLAMEWAKERPRIEST 11662 +#define ID_FLAMEWAKERHEALER 11663 +#define ID_FLAMEWAKERELITE 11664 + +const Position Pos[10] = +{ + {737.85f,-1145.35f,-120.288f,4.71368f}, + {744.162f,-1151.63f,-119.726f,4.58204f}, + {751.247f,-1152.82f,-119.744f,4.49673f}, + {759.206f,-1155.09f,-120.051f,4.30104f}, + {755.973f,-1152.33f,-120.029f,4.25588f}, + {731.712f,-1147.56f,-120.195f,4.95955f}, + {726.499f,-1149.8f,-120.156f,5.24055f}, + {722.408f,-1152.41f,-120.029f,5.33087f}, + {718.994f,-1156.36f,-119.805f,5.75738f}, + {838.51f,-829.84f,-232.00f,2.00f}, +}; class instance_molten_core : public InstanceMapScript { @@ -54,214 +70,304 @@ public: { instance_molten_core_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();}; - uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest; - uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn, m_uiFirelordCacheGUID; + uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest; + uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn, m_uiFirelordCacheGUID; + uint8 rag_ele_counter; + + //If all Bosses are dead. + bool IsBossDied[9]; + bool summoned; - //If all Bosses are dead. - bool IsBossDied[9]; + bool rag_summoned; - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Lucifron = 0; + Magmadar = 0; + Gehennas = 0; + Garr = 0; + Geddon = 0; + Shazzrah = 0; + Sulfuron = 0; + Golemagg = 0; + Domo = 0; + Ragnaros = 0; + FlamewakerPriest = 0; + + RuneKoro = 0; + RuneZeth = 0; + RuneMazj = 0; + RuneTheri = 0; + RuneBlaz = 0; + RuneKress = 0; + RuneMohn = 0; + + rag_ele_counter = 0; + + m_uiFirelordCacheGUID = 0; + + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; + IsBossDied[3] = false; + IsBossDied[4] = false; + IsBossDied[5] = false; + IsBossDied[6] = false; + IsBossDied[7] = false; + IsBossDied[8] = false; + summoned = false; + rag_summoned = false; + } + + bool IsEncounterInProgress() const + { + return false; + }; - void Initialize() + void OnGameObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Lucifron = 0; - Magmadar = 0; - Gehennas = 0; - Garr = 0; - Geddon = 0; - Shazzrah = 0; - Sulfuron = 0; - Golemagg = 0; - Domo = 0; - Ragnaros = 0; - FlamewakerPriest = 0; - - RuneKoro = 0; - RuneZeth = 0; - RuneMazj = 0; - RuneTheri = 0; - RuneBlaz = 0; - RuneKress = 0; - RuneMohn = 0; - - m_uiFirelordCacheGUID = 0; - - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; - IsBossDied[3] = false; - IsBossDied[4] = false; - IsBossDied[5] = false; - IsBossDied[6] = false; - - IsBossDied[7] = false; - IsBossDied[8] = false; + case 176951: //Sulfuron + RuneKoro = pGo->GetGUID(); + break; + case 176952: //Geddon + RuneZeth = pGo->GetGUID(); + break; + case 176953: //Shazzrah + RuneMazj = pGo->GetGUID(); + break; + case 176954: //Golemagg + RuneTheri = pGo->GetGUID(); + break; + case 176955: //Garr + RuneBlaz = pGo->GetGUID(); + break; + case 176956: //Magmadar + RuneKress = pGo->GetGUID(); + break; + case 176957: //Gehennas + RuneMohn = pGo->GetGUID(); + break; + case 179703: + m_uiFirelordCacheGUID = pGo->GetGUID(); //when majordomo event == DONE DoRespawnGameObject(m_uiFirelordCacheGUID,); + break; } + } - bool IsEncounterInProgress() const + void OnCreatureCreate(Creature* pCreature) + { + switch (pCreature->GetEntry()) { - return false; - }; + case ID_LUCIFRON: + Lucifron = pCreature->GetGUID(); + break; - void OnGameObjectCreate(GameObject* go) - { - switch(go->GetEntry()) - { - case 176951: //Sulfuron - RuneKoro = go->GetGUID(); + case ID_MAGMADAR: + Magmadar = pCreature->GetGUID(); + break; + + case ID_GEHENNAS: + Gehennas = pCreature->GetGUID(); break; - case 176952: //Geddon - RuneZeth = go->GetGUID(); + + case ID_GARR: + Garr = pCreature->GetGUID(); break; - case 176953: //Shazzrah - RuneMazj = go->GetGUID(); + + case ID_GEDDON: + Geddon = pCreature->GetGUID(); break; - case 176954: //Golemagg - RuneTheri = go->GetGUID(); + + case ID_SHAZZRAH: + Shazzrah = pCreature->GetGUID(); break; - case 176955: //Garr - RuneBlaz = go->GetGUID(); + + case ID_SULFURON: + Sulfuron = pCreature->GetGUID(); break; - case 176956: //Magmadar - RuneKress = go->GetGUID(); + + case ID_GOLEMAGG: + Golemagg = pCreature->GetGUID(); break; - case 176957: //Gehennas - RuneMohn = go->GetGUID(); + + case ID_DOMO: + Domo = pCreature->GetGUID(); break; - case 179703: - m_uiFirelordCacheGUID = go->GetGUID(); //when majordomo event == DONE DoRespawnGameObject(m_uiFirelordCacheGUID,); + + case ID_RAGNAROS: + Ragnaros = pCreature->GetGUID(); + break; + + case ID_FLAMEWAKERPRIEST: + FlamewakerPriest = pCreature->GetGUID(); break; - } } + } - void OnCreatureCreate(Creature* creature) + uint64 GetData64 (uint32 identifier) + { + switch(identifier) { - switch (creature->GetEntry()) - { - case ID_LUCIFRON: - Lucifron = creature->GetGUID(); - break; + case DATA_SULFURON: + return Sulfuron; + case DATA_GOLEMAGG: + return Golemagg; + case DATA_MAJORDOMO_GUID: + return Domo; + + case DATA_FLAMEWAKERPRIEST: + return FlamewakerPriest; + } + return 0; + } - case ID_MAGMADAR: - Magmadar = creature->GetGUID(); - break; + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_LUCIFRONISDEAD: + if (IsBossDied[0]) + return 1; + break; - case ID_GEHENNAS: - Gehennas = creature->GetGUID(); - break; + case DATA_MAGMADARISDEAD: + if (IsBossDied[1]) + return 1; + break; - case ID_GARR: - Garr = creature->GetGUID(); - break; + case DATA_GEHENNASISDEAD: + if (IsBossDied[2]) + return 1; + break; - case ID_GEDDON: - Geddon = creature->GetGUID(); - break; + case DATA_GARRISDEAD: + if (IsBossDied[3]) + return 1; + break; - case ID_SHAZZRAH: - Shazzrah = creature->GetGUID(); - break; + case DATA_GEDDONISDEAD: + if (IsBossDied[4]) + return 1; + break; - case ID_SULFURON: - Sulfuron = creature->GetGUID(); - break; + case DATA_SHAZZRAHISDEAD: + if (IsBossDied[5]) + return 1; + break; - case ID_GOLEMAGG: - Golemagg = creature->GetGUID(); - break; + case DATA_SULFURONISDEAD: + if (IsBossDied[6]) + return 1; + break; - case ID_DOMO: - Domo = creature->GetGUID(); - break; + case DATA_GOLEMAGGISDEAD: + if (IsBossDied[7]) + return 1; + break; - case ID_RAGNAROS: - Ragnaros = creature->GetGUID(); - break; + case DATA_MAJORDOMOISDEAD: + if (IsBossDied[8]) + return 1; + break; - case ID_FLAMEWAKERPRIEST: - FlamewakerPriest = creature->GetGUID(); - break; - } + case DATA_RAG_ELE_COUNTER: + return rag_ele_counter; + break; } + return 0; + } - uint64 GetData64 (uint32 identifier) - { - switch(identifier) - { - case DATA_SULFURON: - return Sulfuron; - case DATA_GOLEMAGG: - return Golemagg; + /*bool SetBossState(uint32 id, EncounterState state) + { + if (!InstanceData::SetBossState(id, state)) + return false; - case DATA_FLAMEWAKERPRIEST: - return FlamewakerPriest; + if (id == DATA_MAJORDOMO && state == DONE) + { + if (GameObject *pFirelordCache = instance->GetGameObject(m_uiFirelordCacheGUID)){ + pFirelordCache->SetRespawnTime(pFirelordCache->GetRespawnDelay()); } + instance->SummonCreature(ID_RAGNAROS, Pos[9], TEMPSUMMON_CORPSE_DESPAWN); + } + return true; + } */ - return 0; + void SetData(uint32 type, uint32 data) + { + if (type == DATA_LUCIFRON) + IsBossDied[0] = true; + + if (type == DATA_MAGMADAR) + IsBossDied[1] = true; + + if (type == DATA_GEHENNAS) + IsBossDied[2] = true; + + if (type == DATA_GARR) + IsBossDied[3] = true; + + if (type == DATA_SHAZZRAH) + IsBossDied[4] = true; + + if (type == DATA_GEDDON) + IsBossDied[5] = true; + + if (type == DATA_GOLEMAGG) + IsBossDied[6] = true; + + if (type == DATA_SULFURON) + IsBossDied[7] = true; + + if (type == DATA_RAGNAROS) + { + rag_summoned = true; + instance->SummonCreature(ID_RAGNAROS, Pos[9]); } - uint32 GetData(uint32 type) + if (type == DATA_RAG_ELE_COUNTER) { - switch(type) + if (data == 1) + ++rag_ele_counter; + else if (data == 0) + rag_ele_counter = 0; + } + + if (type == DATA_MAJORDOMO) + { + IsBossDied[8] = true; + if (GameObject *pFirelordCache = instance->GetGameObject(m_uiFirelordCacheGUID)) { - case DATA_LUCIFRONISDEAD: - if (IsBossDied[0]) - return 1; - break; - - case DATA_MAGMADARISDEAD: - if (IsBossDied[1]) - return 1; - break; - - case DATA_GEHENNASISDEAD: - if (IsBossDied[2]) - return 1; - break; - - case DATA_GARRISDEAD: - if (IsBossDied[3]) - return 1; - break; - - case DATA_GEDDONISDEAD: - if (IsBossDied[4]) - return 1; - break; - - case DATA_SHAZZRAHISDEAD: - if (IsBossDied[5]) - return 1; - break; - - case DATA_SULFURONISDEAD: - if (IsBossDied[6]) - return 1; - break; - - case DATA_GOLEMAGGISDEAD: - if (IsBossDied[7]) - return 1; - break; - - case DATA_MAJORDOMOISDEAD: - if (IsBossDied[8]) - return 1; - break; + pFirelordCache->SetRespawnTime(pFirelordCache->GetRespawnDelay()); } - - return 0; } - void SetData(uint32 type, uint32 /*data*/) + if (summoned == false) { - if (type == DATA_GOLEMAGG_DEATH) - IsBossDied[7] = true; + + for(int i=0;i<8;i++) + { + if (IsBossDied[i] == false) + return; + } + + instance->SummonCreature(ID_DOMO, Pos[0]); + instance->SummonCreature(ID_FLAMEWAKERHEALER, Pos[1]); + instance->SummonCreature(ID_FLAMEWAKERHEALER, Pos[2]); + instance->SummonCreature(ID_FLAMEWAKERHEALER, Pos[3]); + instance->SummonCreature(ID_FLAMEWAKERHEALER, Pos[4]); + instance->SummonCreature(ID_FLAMEWAKERELITE, Pos[5]); + instance->SummonCreature(ID_FLAMEWAKERELITE, Pos[6]); + instance->SummonCreature(ID_FLAMEWAKERELITE, Pos[7]); + instance->SummonCreature(ID_FLAMEWAKERELITE, Pos[8]); + summoned = true; } + } }; - }; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h index 28ea8aa6a3a..873fe98dd30 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h @@ -19,18 +19,37 @@ #ifndef DEF_MOLTEN_CORE_H #define DEF_MOLTEN_CORE_H -#define DATA_FLAMEWAKERPRIEST 1 -#define DATA_GARRISDEAD 2 -#define DATA_GEDDONISDEAD 3 -#define DATA_GEHENNASISDEAD 4 -#define DATA_GOLEMAGGISDEAD 5 -#define DATA_GOLEMAGG_DEATH 6 -#define DATA_LUCIFRONISDEAD 7 -#define DATA_MAGMADARISDEAD 8 -#define DATA_MAJORDOMOISDEAD 9 -#define DATA_SHAZZRAHISDEAD 10 -#define DATA_SULFURON 11 -#define DATA_SULFURONISDEAD 12 -#define DATA_GOLEMAGG 13 -#endif +enum eData +{ + DATA_FLAMEWAKERPRIEST, + DATA_GARRISDEAD, + DATA_GEDDONISDEAD, + DATA_GEHENNASISDEAD, + DATA_GOLEMAGGISDEAD, + DATA_GOLEMAGG_DEATH, + DATA_LUCIFRONISDEAD, + DATA_MAGMADARISDEAD, + DATA_MAJORDOMOISDEAD, + DATA_SHAZZRAHISDEAD, + DATA_SULFURON, + DATA_SULFURONISDEAD, + DATA_GOLEMAGG, + DATA_LUCIFRON, + DATA_MAGMADAR, + DATA_GEHENNAS, + DATA_GARR, + DATA_SHAZZRAH, + DATA_GEDDON, + DATA_MAJORDOMO, + DATA_MAJORDOMO_GUID, + DATA_RAGNAROS, + DATA_RAG_ELE_COUNTER, +}; + +enum Encounter +{ + BOSS_MAJORDOMO, + BOSS_RAGNAROS +}; +#endif |