diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Server/WorldSocket.h | 1 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 119 | ||||
-rw-r--r-- | src/server/shared/Packets/ByteBuffer.h | 1 |
4 files changed, 120 insertions, 3 deletions
diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 59975c12f13..d6d29fb2826 100644 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -28,7 +28,6 @@ #include "WorldSession.h" #include <chrono> #include <boost/asio/ip/tcp.hpp> -#include <boost/asio/buffer.hpp> using boost::asio::ip::tcp; struct z_stream_s; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 5e8b5ab8885..5887aded51c 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -912,6 +912,8 @@ class spell_pal_light_s_beacon : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { + if (!eventInfo.GetActionTarget()) + return false; if (eventInfo.GetActionTarget()->HasAura(SPELL_PALADIN_BEACON_OF_LIGHT, eventInfo.GetActor()->GetGUID())) return false; return true; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 2619a5af065..5d686f6aa38 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -62,7 +62,11 @@ enum WarriorSpells SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, SPELL_WARRIOR_VIGILANCE_PROC = 50725, - SPELL_WARRIOR_VENGEANCE = 76691 + SPELL_WARRIOR_VENGEANCE = 76691, + SPELL_WARRIOR_HEROIC_LEAP_JUMP = 178368, + SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP = 159708, + SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP_BUFF = 133278, + SPELL_WARRIOR_IMPROVED_HEROIC_LEAP = 157449, }; enum WarriorSpellIcons @@ -948,6 +952,117 @@ class spell_warr_vigilance_trigger : public SpellScriptLoader } }; +// Heroic leap - 6544 +class spell_warr_heroic_leap : public SpellScriptLoader +{ +public: + spell_warr_heroic_leap() : SpellScriptLoader("spell_warr_heroic_leap") { } + + class spell_warr_heroic_leap_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_heroic_leap_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_HEROIC_LEAP_JUMP)) + return false; + return true; + } + + SpellCastResult CheckElevation() + { + if (WorldLocation const* dest = GetExplTargetDest()) + { + if (GetCaster()->HasUnitMovementFlag(MOVEMENTFLAG_ROOT)) + return SPELL_FAILED_ROOTED; + + if (GetCaster()->GetMap()->Instanceable()) + { + float range = GetSpellInfo()->GetMaxRange(true, GetCaster()) * 1.5f; + + PathGenerator generatedPath(GetCaster()); + generatedPath.SetPathLengthLimit(range); + + bool result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false, true); + if (generatedPath.GetPathType() & PATHFIND_SHORT) + return SPELL_FAILED_OUT_OF_RANGE; + else if (!result || generatedPath.GetPathType() & PATHFIND_NOPATH) + { + result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false, false); + if (generatedPath.GetPathType() & PATHFIND_SHORT) + return SPELL_FAILED_OUT_OF_RANGE; + else if (!result || generatedPath.GetPathType() & PATHFIND_NOPATH) + return SPELL_FAILED_NOPATH; + } + } + else if (dest->GetPositionZ() > GetCaster()->GetPositionZ() + 4.0f) + return SPELL_FAILED_NOPATH; + + return SPELL_CAST_OK; + } + + return SPELL_FAILED_NO_VALID_TARGETS; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (WorldLocation* dest = GetHitDest()) + GetCaster()->CastSpell(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), SPELL_WARRIOR_HEROIC_LEAP_JUMP, true); + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_warr_heroic_leap_SpellScript::CheckElevation); + OnEffectHit += SpellEffectFn(spell_warr_heroic_leap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_warr_heroic_leap_SpellScript(); + } +}; + +// Heroic Leap (triggered by Heroic Leap (6544)) - 178368 +class spell_warr_heroic_leap_jump : public SpellScriptLoader +{ +public: + spell_warr_heroic_leap_jump() : SpellScriptLoader("spell_warr_heroic_leap_jump") { } + + class spell_warr_heroic_leap_jump_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_heroic_leap_jump_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP) || + !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP_BUFF) || + !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_IMPROVED_HEROIC_LEAP) || + !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_TAUNT)) + return false; + return true; + } + + void AfterJump(SpellEffIndex /*effIndex*/) + { + if (GetCaster()->HasAura(SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP)) + GetCaster()->CastSpell(GetCaster(), SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP_BUFF, true); + if (GetCaster()->HasAura(SPELL_WARRIOR_IMPROVED_HEROIC_LEAP)) + GetCaster()->GetSpellHistory()->ResetCooldown(SPELL_WARRIOR_TAUNT, true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_warr_heroic_leap_jump_SpellScript::AfterJump, EFFECT_1, SPELL_EFFECT_JUMP_DEST); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_warr_heroic_leap_jump_SpellScript(); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_bloodthirst(); @@ -972,4 +1087,6 @@ void AddSC_warrior_spell_scripts() new spell_warr_victorious(); new spell_warr_vigilance(); new spell_warr_vigilance_trigger(); + new spell_warr_heroic_leap(); + new spell_warr_heroic_leap_jump(); } diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 1f9fcacb772..b8c6ee1c36e 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -33,7 +33,6 @@ #include <time.h> #include <cmath> #include <type_traits> -#include <boost/asio/buffer.hpp> class MessageBuffer; |