mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Spells: SPELL_EFFECT_CHARGE_DEST will now also use speed values from DBC
*Scripts/GB: General Umbriss will now properly charge to his Blitz target
This commit is contained in:
5
sql/updates/world/4.3.4/custom_2018_02_14_01_world.sql
Normal file
5
sql/updates/world/4.3.4/custom_2018_02_14_01_world.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_umbris_blitz';
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(74670, 'spell_umbriss_blitz'),
|
||||
(90250, 'spell_umbriss_blitz');
|
||||
@@ -4479,6 +4479,7 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
||||
if (m_targets.HasDst())
|
||||
{
|
||||
Position pos = destTarget->GetPosition();
|
||||
float speed = G3D::fuzzyGt(m_spellInfo->Speed, 0.0f) ? m_spellInfo->Speed : SPEED_CHARGE;
|
||||
|
||||
if (!m_caster->IsWithinLOS(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()))
|
||||
{
|
||||
@@ -4487,7 +4488,7 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
||||
pos = m_caster->GetFirstCollisionPosition(dist, angle);
|
||||
}
|
||||
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -429,6 +429,36 @@ class spell_umbriss_bleeding_wound : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_umbriss_blitz : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_umbriss_blitz() : SpellScriptLoader("spell_umbriss_blitz") { }
|
||||
|
||||
class spell_umbriss_blitz_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_umbriss_blitz_SpellScript);
|
||||
|
||||
void HandleCharge(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->ClearUnitState(UNIT_STATE_CANNOT_TURN);
|
||||
caster->ClearUnitState(UNIT_STATE_CASTING);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_umbriss_blitz_SpellScript::HandleCharge, EFFECT_0, SPELL_EFFECT_CHARGE_DEST);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_umbriss_blitz_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_general_umbriss()
|
||||
{
|
||||
new boss_general_umbriss();
|
||||
@@ -436,4 +466,5 @@ void AddSC_boss_general_umbriss()
|
||||
new spell_umbriss_summon_blitz_trigger();
|
||||
new spell_umbriss_summon_ground_siege_trigger();
|
||||
new spell_umbriss_bleeding_wound();
|
||||
new spell_umbriss_blitz();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user