From 4aa0ab7c40a1550b3e22ecfb369a7e17fba6e5fd Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Thu, 9 Dec 2010 10:58:22 +0100 Subject: [PATCH] [10845] Add dummy effect of spell 49634 and dummy aura of spell 56511 note* spell will need data in spell_script_target to work properly. note* the effect of 56511 does not work, see comment in code for details (code added in any case, to not forget the problem) Signed-off-by: NoFantasy --- src/game/SpellAuras.cpp | 8 ++++++++ src/game/SpellEffects.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/game/SpellMgr.cpp | 1 + src/shared/revision_nr.h | 2 +- 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 62e14f4fe..6ddaa9b2d 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2301,6 +2301,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real) return; } + case 56511: // Towers of Certain Doom: Tower Bunny Smoke Flare Effect + { + // Towers of Certain Doom: Skorn Cannonfire + if (m_removeMode == AURA_REMOVE_BY_DEFAULT) + target->CastSpell(target, 43069, true); + + return; + } case 58600: // Restricted Flight Area { AreaTableEntry const* area = GetAreaEntryByAreaID(target->GetAreaId()); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d553575b7..bbe52dc0d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1202,6 +1202,12 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) unitTarget->CastSpell(unitTarget, 43059, true); return; } + case 43069: // Towers of Certain Doom: Skorn Cannonfire + { + // Towers of Certain Doom: Tower Caster Instakill + m_caster->CastSpell(m_caster, 43072, true); + return; + } // Demon Broiled Surprise /* FIX ME: Required for correct work implementing implicit target 7 (in pair (22,7)) case 43723: @@ -1435,6 +1441,37 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) } return; } + case 49634: // Sergeant's Flare + { + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) + return; + + // Towers of Certain Doom: Tower Bunny Smoke Flare Effect + // TODO: MaNGOS::DynamicObjectUpdater::VisitHelper prevent aura to be applied to dummy creature (see HandleAuraDummy for effect of aura) + m_caster->CastSpell(unitTarget, 56511, true); + + static uint32 const spellCredit[4] = + { + 43077, // E Kill Credit + 43067, // NW Kill Credit + 43087, // SE Kill Credit + 43086, // SW Kill Credit + }; + + // for sizeof(spellCredit) + for (int i = 0; i < 4; ++i) + { + const SpellEntry *pSpell = sSpellStore.LookupEntry(spellCredit[i]); + + if (pSpell->EffectMiscValue[EFFECT_INDEX_0] == unitTarget->GetEntry()) + { + m_caster->CastSpell(m_caster, spellCredit[i], true); + break; + } + } + + return; + } case 50133: // Scourging Crystal Controller { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 05486d2d4..ba56157ab 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -637,6 +637,7 @@ bool IsPositiveEffect(uint32 spellId, SpellEffectIndex effIndex) { case 28441: // AB Effect 000 return false; + case 49634: // Sergeant's Flare case 54530: // Opening return true; default: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1ce3000ee..5127551eb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10844" + #define REVISION_NR "10845" #endif // __REVISION_NR_H__