From 46e869a4546a6041e42c6161a88028ba67ee1c3e Mon Sep 17 00:00:00 2001 From: Xfurry Date: Thu, 22 Sep 2011 15:59:45 +0200 Subject: [PATCH] [11801] Implement spell 43498 Signed-off-by: Schmoozerd --- src/game/SpellEffects.cpp | 24 ++++++++++++++++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index ec27c0ad9..c7e64154d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1430,6 +1430,30 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) unitTarget->RemoveAurasDueToSpell(6606); return; } + case 43498: // Siphon Soul + { + // This spell should cast the next spell only for one (player)target, however it should hit multiple targets, hence this kind of implementation + if (!unitTarget || m_UniqueTargetInfo.rbegin()->targetGUID != unitTarget->GetObjectGuid()) + return; + + std::vector possibleTargets; + possibleTargets.reserve(m_UniqueTargetInfo.size()); + for (std::list::const_iterator itr = m_UniqueTargetInfo.begin(); itr != m_UniqueTargetInfo.end(); itr++) + { + // Skip Non-Players + if (!itr->targetGUID.IsPlayer()) + continue; + + if (Unit* target = m_caster->GetMap()->GetPlayer(itr->targetGUID)) + possibleTargets.push_back(target); + } + + // Cast Siphon Soul channeling spell + if (!possibleTargets.empty()) + m_caster->CastSpell(possibleTargets[urand(0, possibleTargets.size()-1)], 43501, false); + + return; + } case 43572: // Send Them Packing: On /Raise Emote Dummy to Player { if (!unitTarget) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0e160a376..2d4548a83 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 "11800" + #define REVISION_NR "11801" #endif // __REVISION_NR_H__