Molten Core fixes (#604)

* Molten Core fixes

* fix indentation

* forgot to adjust 3 lines

* Fixed warning
This commit is contained in:
Gargarensis
2017-10-12 18:00:46 +02:00
committed by Yehonal
parent 4df28fd29c
commit c710122259
7 changed files with 211 additions and 14 deletions

View File

@@ -0,0 +1,36 @@
INSERT INTO version_db_world (`sql_rev`) VALUES ('1504704582101308200');
-- Editing the SmartAI script of [Creature] ENTRY 11663 (name: Flamewaker Healer)
-- Table creature_template
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11663;
-- Table smart_scripts
DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 11663);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(11663, 0, 0, 0, 0, 0, 100, 2, 9000, 9000, 9000, 9000, 11, 20603, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Healer - In Combat - Cast \'Shadow Shock\' (Normal Dungeon)'),
(11663, 0, 1, 0, 0, 0, 100, 2, 2000, 2000, 2000, 2000, 11, 22677, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Healer - In Combat - Cast \'Shadow Bolt\' (Normal Dungeon)'),
(11663, 0, 2, 0, 4, 0, 100, 0, 0, 0, 0, 0, 39, 20, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Healer - On Aggro - Call For Help');
-- Editing the SmartAI script of [Creature] ENTRY 11664 (name: Flamewaker Elite)
-- Table creature_template
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11664;
-- Table smart_scripts
DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 11664);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(11664, 0, 0, 0, 0, 0, 85, 2, 1000, 1000, 8000, 8000, 11, 36711, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Elite - In Combat - Cast \'Fireball\' (Normal Dungeon)'),
(11664, 0, 1, 0, 0, 0, 100, 2, 12000, 12000, 12000, 12000, 11, 20229, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Elite - In Combat - Cast \'Blast Wave\' (Normal Dungeon)'),
(11664, 0, 2, 0, 0, 0, 80, 2, 5000, 5000, 15000, 15000, 11, 20623, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Elite - In Combat - Cast \'Fire Blast\' (Normal Dungeon)'),
(11664, 0, 3, 0, 4, 0, 100, 0, 0, 0, 0, 0, 39, 20, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamewaker Elite - On Aggro - Call For Help');
-- Core Hound scriptname
UPDATE `creature_template` SET `scriptname` = 'npc_magmadar_core_hound' WHERE `entry` = 11671;
-- Core Hound texts
DELETE FROM `creature_text` WHERE entry = 11671;
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `textrange`) VALUES
(11671, 0, 0, "%s collapses and begins to smolder.", 16, 0, 100, 0, 2000, 0),
(11671, 1, 0, "%s reignites from the heat of another Core Hound!", 16, 0, 100, 0, 2000, 0);

View File

@@ -61,6 +61,17 @@ class boss_golemagg : public CreatureScript
{
BossAI::EnterCombat(victim);
events.ScheduleEvent(EVENT_PYROBLAST, 7000);
// The two ragers should join the fight alongside me against my foes.
std::list<Creature *> ragers;
me->GetCreaturesWithEntryInRange(ragers, 100, NPC_CORE_RAGER);
for (Creature * i : ragers)
{
if (i && i->IsAlive() && !i->IsInCombat())
{
i->AI()->AttackStart(victim);
}
}
}
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)

View File

@@ -18,15 +18,18 @@ EndScriptData */
enum Texts
{
EMOTE_FRENZY = 0
EMOTE_FRENZY = 0,
EMOTE_SMOLDERING = 0,
EMOTE_IGNITE = 1,
};
enum Spells
{
SPELL_FRENZY = 19451,
SPELL_MAGMA_SPIT = 19449,
SPELL_PANIC = 19408,
SPELL_LAVA_BOMB = 19428,
SPELL_FRENZY = 19451,
SPELL_MAGMA_SPIT = 19449,
SPELL_PANIC = 19408,
SPELL_LAVA_BOMB = 19428,
SPELL_SERRATED_BITE = 19771,
};
enum Events
@@ -34,6 +37,8 @@ enum Events
EVENT_FRENZY = 1,
EVENT_PANIC = 2,
EVENT_LAVA_BOMB = 3,
EVENT_SERRATED_BITE = 1,
EVENT_IGNITE = 2,
};
class boss_magmadar : public CreatureScript
@@ -104,7 +109,103 @@ class boss_magmadar : public CreatureScript
}
};
// Smoldering animation is an hack, Serrated Bites timer may be wrong
// The original smoldering aura should increase crit chance to 100% and play dead animation
class npc_magmadar_core_hound : public CreatureScript
{
public:
npc_magmadar_core_hound() : CreatureScript("npc_magmadar_core_hound") { }
struct npc_magmadar_core_houndAI : public CreatureAI
{
npc_magmadar_core_houndAI(Creature* creature) : CreatureAI(creature)
{
}
EventMap events;
bool smoldering;
std::list<Creature *> hounds;
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/)
{
if (me->HealthBelowPctDamaged(0, damage))
{
if (!smoldering)
{
events.ScheduleEvent(EVENT_IGNITE, 10000);
me->SetHealth(1);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED|UNIT_FLAG_PACIFIED);
me->AddAura(57626, me); // feign death animation, this is an hack even if the result is good
Talk(EMOTE_SMOLDERING);
}
damage = 0;
smoldering = true;
}
}
void Reset()
{
}
void EnterCombat(Unit* /*victim*/)
{
events.ScheduleEvent(EVENT_SERRATED_BITE, 10000); // timer may be wrong
smoldering = false;
}
void UpdateAI(uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SERRATED_BITE:
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
DoCast(me->GetVictim(), SPELL_SERRATED_BITE);
events.ScheduleEvent(EVENT_SERRATED_BITE, 10000); // again, timer may be wrong
break;
case EVENT_IGNITE:
me->GetCreaturesWithEntryInRange(hounds, 100, NPC_CORE_HOUND);
for (Creature * i : hounds)
{
if (i && i->IsAlive() && i->IsInCombat() && !i->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED|UNIT_FLAG_PACIFIED);
me->RemoveAura(me->GetAura(57626), AURA_REMOVE_BY_DEFAULT);
me->SetFullHealth();
smoldering = false;
Talk(EMOTE_IGNITE);
return;
}
}
Unit::Kill(me, me);
break;
default:
break;
}
}
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_magmadar_core_houndAI(creature);
}
};
void AddSC_boss_magmadar()
{
new boss_magmadar();
new npc_magmadar_core_hound();
}

View File

@@ -80,6 +80,8 @@ class boss_majordomo : public CreatureScript
events.ScheduleEvent(EVENT_DAMAGE_REFLECTION, 15000);
events.ScheduleEvent(EVENT_BLAST_WAVE, 10000);
events.ScheduleEvent(EVENT_TELEPORT, 20000);
// Call every flamewaker around him
me->CallForHelp(30);
}
void UpdateAI(uint32 diff)

View File

@@ -61,6 +61,7 @@ enum Events
EVENT_INTRO_5 = 12
};
class boss_ragnaros : public CreatureScript
{
public:
@@ -83,6 +84,7 @@ class boss_ragnaros : public CreatureScript
_hasSubmergedOnce = false;
_isBanished = false;
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->SetOrientation(0.8f);
}
void EnterCombat(Unit* victim)

View File

@@ -20,15 +20,15 @@ EndScriptData */
Position const SummonPositions[10] =
{
{737.850f, -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.80f, -120.156f, 5.24055f},
{722.408f, -1152.41f, -120.029f, 5.33087f},
{718.994f, -1156.36f, -119.805f, 5.75738f},
{759.542f, -1173.43f, -118.974f, 3.3048f},
{761.652f, -1164.30f, -119.533f, 3.3919f},
{747.323f, -1149.24f, -120.060f, 3.6629f},
{766.734f, -1183.16f, -119.292f, 2.9889f},
{757.364f, -1198.31f, -118.652f, 2.3095f},
{752.349f, -1159.19f, -119.261f, 3.6032f},
{738.015f, -1152.22f, -119.512f, 4.0792f},
{757.246f, -1189.79f, -118.633f, 2.5333f},
{745.916f, -1199.35f, -118.119f, 1.8932f},
{838.510f, -829.840f, -232.000f, 2.00000f},
};
@@ -89,6 +89,27 @@ class instance_molten_core : public InstanceMapScript
case GO_CACHE_OF_THE_FIRELORD:
_cacheOfTheFirelordGUID = go->GetGUID();
break;
case GO_CIRCLE_BARON:
_circlesGUIDs[5] = go->GetGUID();
break;
case GO_CIRCLE_GARR:
_circlesGUIDs[3] = go->GetGUID();
break;
case GO_CIRCLE_GEHENNAS:
_circlesGUIDs[2] = go->GetGUID();
break;
case GO_CIRCLE_GOLEMAGG:
_circlesGUIDs[7] = go->GetGUID();
break;
case GO_CIRCLE_MAGMADAR:
_circlesGUIDs[1] = go->GetGUID();
break;
case GO_CIRCLE_SHAZZRAH:
_circlesGUIDs[4] = go->GetGUID();
break;
case GO_CIRCLE_SULFURON:
_circlesGUIDs[6] = go->GetGUID();
break;
default:
break;
}
@@ -137,6 +158,20 @@ class instance_molten_core : public InstanceMapScript
if (state == DONE && bossId < BOSS_MAJORDOMO_EXECUTUS)
++_deadBossCount;
if (state == DONE && bossId < BOSS_MAJORDOMO_EXECUTUS && _circlesGUIDs[bossId])
{
GameObject * circle = instance->GetGameObject(_circlesGUIDs[bossId]);
if (circle && circle->isSpawned())
circle->Delete();
circle->SetRespawnTime(7 * DAY);
_circlesGUIDs[bossId] = 0;
}
if (state == DONE && bossId == BOSS_MAGMADAR)
{
}
if (_isLoading)
return true;
@@ -238,6 +273,7 @@ class instance_molten_core : public InstanceMapScript
uint8 _ragnarosAddDeaths;
bool _isLoading;
bool _summonedExecutus;
std::unordered_map<uint8, uint64> _circlesGUIDs;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const

View File

@@ -47,11 +47,20 @@ enum Creatures
NPC_RAGNAROS = 11502,
NPC_FLAMEWAKER_HEALER = 11663,
NPC_FLAMEWAKER_ELITE = 11664,
NPC_CORE_RAGER = 11672,
NPC_CORE_HOUND = 11671,
};
enum GameObjects
{
GO_CACHE_OF_THE_FIRELORD = 179703,
GO_CIRCLE_SULFURON = 178187,
GO_CIRCLE_BARON = 178188,
GO_CIRCLE_SHAZZRAH = 178189,
GO_CIRCLE_GOLEMAGG = 178190,
GO_CIRCLE_GARR = 178191,
GO_CIRCLE_MAGMADAR = 178192,
GO_CIRCLE_GEHENNAS = 178193,
};
enum Data