aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo <sirikfoll@hotmail.com>2017-08-17 12:03:56 -0300
committerShauren <shauren.trinity@gmail.com>2020-08-23 01:20:27 +0200
commite5963fda0ede44600da4624a242ac056cd08f9c4 (patch)
tree4240cc5adb814a2a83ab0d18c020a45681ee5ccd
parentfa762826e9977c53e18e4de7821be2dfc25601f0 (diff)
Core/Scripts: More fixes in boss Lich King (#20147)
* Core/Scripts: More fixes in boss Lich King Fix Valkyr charge spell, they will no longer ignore Z position and become unreachable. Correct height of Spirit Bomb and added the 3 seconds delay on his explosion. Set the Trigger inside frostmourne room as active, to avoid problems with reseting the room, e.g: Spirit Bombs not despawning and Wicked Spirits stuck in evade. Use correct InhabitType for Wicked and Vile Spirits, this avoid a situation where they could spawn falling. (cherry picked from commit 22a7956069c293a3f8eab8adcd84a9f4703f364a)
-rw-r--r--sql/updates/world/master/2020_08_23_00_world_2017_08_17_00_world.sql2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp10
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp29
3 files changed, 30 insertions, 11 deletions
diff --git a/sql/updates/world/master/2020_08_23_00_world_2017_08_17_00_world.sql b/sql/updates/world/master/2020_08_23_00_world_2017_08_17_00_world.sql
new file mode 100644
index 00000000000..01b07f50fba
--- /dev/null
+++ b/sql/updates/world/master/2020_08_23_00_world_2017_08_17_00_world.sql
@@ -0,0 +1,2 @@
+-- Vile Spirit + (1),(2),(3) / Wicked Spirit + (1),(2),(3)
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (39190,39287,39288,39289,37799,39284,39285,39286);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 83a939aef12..c13ea7388e9 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4222,9 +4222,13 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH)
{
Position pos = destTarget->GetPosition();
- float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY());
- float dist = m_caster->GetDistance(pos);
- pos = m_caster->GetFirstCollisionPosition(dist, angle);
+
+ if (!m_caster->IsWithinLOS(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()))
+ {
+ float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY());
+ float dist = m_caster->GetDistance(pos);
+ pos = m_caster->GetFirstCollisionPosition(dist, angle);
+ }
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 1388dccccc9..93d1d6f99a3 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -271,6 +271,9 @@ enum Events
EVENT_TELEPORT,
EVENT_MOVE_TO_LICH_KING,
EVENT_DESPAWN_SELF,
+
+ //Spirit Bomb
+ EVENT_BOMB_EXPLOSION
};
enum EventGroups
@@ -1037,7 +1040,6 @@ class boss_the_lich_king : public CreatureScript
summon->RemoveAurasDueToSpell(SPELL_VILE_SPIRIT_MOVE_SEARCH);
summon->RemoveAurasDueToSpell(SPELL_VILE_SPIRIT_DAMAGE_SEARCH);
summon->GetMotionMaster()->MoveTargetedHome();
- summon->GetMotionMaster()->MoveRandom(10.0f);
}
else if (summon->GetEntry() == NPC_RAGING_SPIRIT)
summon->AI()->DoAction(ACTION_DISABLE_RAGING);
@@ -1054,6 +1056,7 @@ class boss_the_lich_king : public CreatureScript
{
triggers.sort(Trinity::ObjectDistanceOrderPred(terenas, true));
Creature* spawner = triggers.front();
+ spawner->setActive(true);
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players
spawner->m_Events.AddEvent(new TriggerWickedSpirit(spawner), spawner->m_Events.CalculateTime(3000));
@@ -1955,20 +1958,29 @@ class npc_spirit_bomb : public CreatureScript
if (type != POINT_MOTION_TYPE || point != POINT_GROUND)
return;
- me->RemoveAllAuras();
- DoCastAOE(SPELL_EXPLOSION);
- me->DespawnOrUnsummon(1000);
+ _events.ScheduleEvent(EVENT_BOMB_EXPLOSION, 3000);
}
void AttackStart(Unit* /*victim*/) override
{
}
- void UpdateAI(uint32 /*diff*/) override
+ void UpdateAI(uint32 diff) override
{
UpdateVictim();
- // no melee attacks
+
+ _events.Update(diff);
+
+ if (_events.ExecuteEvent() == EVENT_BOMB_EXPLOSION)
+ {
+ me->RemoveAllAuras();
+ DoCastAOE(SPELL_EXPLOSION);
+ me->DespawnOrUnsummon(1000);
+ }
}
+
+ private:
+ EventMap _events;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -2493,8 +2505,9 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader
// spirit bombs get higher
if (GetSpellInfo()->GetEffect(effIndex)->MiscValue == NPC_SPIRIT_BOMB)
{
- dest->RelocateOffset(offset);
- GetHitDest()->RelocateOffset(offset);
+ static Position const offsetExtra = { 0.0f, 0.0f, 5.0f, 0.0f };
+ dest->RelocateOffset(offsetExtra);
+ GetHitDest()->RelocateOffset(offsetExtra);
}
}