From 7df5d0964fdd36d5dd9e176c160d36dbea9ad425 Mon Sep 17 00:00:00 2001 From: lineagedr Date: Sun, 8 Oct 2017 18:13:19 +0300 Subject: [PATCH] Add Diminishing_None to Feral Charge. And Add Blizzlike Animations to Flags / Chest Captures. (#664) * Add Diminishing_None to Feral Charge. Closes https://github.com/azerothcore/azerothcore-wotlk/issues/648 Credit: AnonXS @L4G_Core * Update Spell.h * Add blizzlike ecapturing flag / chest animation Code from Nostalrius. * Add missing blizzlike animations. Demonic Circle: Summon, Soul well, Ritual of Summoning. There's probably more. * Update Object.cpp --- src/game/Entities/Object/Object.cpp | 2 ++ src/game/Spells/Spell.cpp | 24 ++++++++++++++++++++++++ src/game/Spells/Spell.h | 2 ++ src/game/Spells/SpellMgr.cpp | 3 +++ 4 files changed, 31 insertions(+) diff --git a/src/game/Entities/Object/Object.cpp b/src/game/Entities/Object/Object.cpp index aadc168ef..f3091758f 100644 --- a/src/game/Entities/Object/Object.cpp +++ b/src/game/Entities/Object/Object.cpp @@ -209,6 +209,8 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c updatetype = UPDATETYPE_CREATE_OBJECT2; break; default: + if (((GameObject*)this)->GetOwner()) + updatetype = UPDATETYPE_CREATE_OBJECT2; break; } } diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index ac6ee95d6..f1aa91af7 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -3341,6 +3341,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered } LoadScripts(); + OnSpellLaunch(); + m_powerCost = m_CastItem ? 0 : m_spellInfo->CalcPowerCost(m_caster, m_spellSchoolMask, this); // Set combo point requirement @@ -8280,6 +8282,28 @@ void Spell::CancelGlobalCooldown() m_caster->ToPlayer()->GetGlobalCooldownMgr().CancelGlobalCooldown(m_spellInfo); } +void Spell::OnSpellLaunch() +{ + if (!m_caster || !m_caster->IsInWorld()) + return; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(24390); + + // Make sure the player is sending a valid GO target and lock ID. SPELL_EFFECT_OPEN_LOCK + // can succeed with a lockId of 0 + if (m_spellInfo->Id == 21651) + { + if (GameObject *go = m_targets.GetGOTarget()) + { + LockEntry const *lockInfo = sLockStore.LookupEntry(go->GetGOInfo()->GetLockId()); + if (lockInfo && lockInfo->Index[1] == LOCKTYPE_SLOW_OPEN) + { + Spell* visual = new Spell(m_caster, spellInfo, TRIGGERED_NONE); + visual->prepare(&m_targets); + } + } + } +} namespace Trinity { diff --git a/src/game/Spells/Spell.h b/src/game/Spells/Spell.h index a2d648f93..dd1241ea1 100644 --- a/src/game/Spells/Spell.h +++ b/src/game/Spells/Spell.h @@ -410,6 +410,8 @@ class Spell // handler helpers void _handle_immediate_phase(); void _handle_finish_phase(); + + void OnSpellLaunch(); SpellCastResult CheckItems(); SpellCastResult CheckSpellFocus(); diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index f7c76a85d..098b5af9c 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -132,6 +132,9 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, // Faerie Fire else if (spellproto->SpellFamilyFlags[0] & 0x400) return DIMINISHING_LIMITONLY; + // Feral Charge Root Effect + else if (spellproto->Id == 45334) + return DIMINISHING_NONE; break; } case SPELLFAMILY_ROGUE: