From ba7ce1d7c3e6afab24fccdf73170a15112d32f87 Mon Sep 17 00:00:00 2001 From: zergtmn Date: Sun, 19 Jun 2011 22:00:36 +0600 Subject: [PATCH] [11655] Add script effect of spell 62678 and 62688 Target 91 may require further adjustments. --- src/game/SharedDefines.h | 1 + src/game/Spell.cpp | 3 ++- src/game/SpellEffects.cpp | 21 +++++++++++++++++++++ src/shared/revision_nr.h | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 1956a25e0..349a25fcd 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1254,6 +1254,7 @@ enum Targets TARGET_SELF2 = 87, TARGET_DIRECTLY_FORWARD = 89, TARGET_NONCOMBAT_PET = 90, + TARGET_91 = 91, TARGET_IN_FRONT_OF_CASTER_30 = 104, }; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index e836b2a61..f56cc1633 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1651,6 +1651,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& targetUnitMap.push_back(m_caster); break; } + case TARGET_91: case TARGET_RANDOM_NEARBY_DEST: { radius *= sqrtf(rand_norm_f()); // Get a random point in circle. Use sqrt(rand) to correct distribution when converting polar to Cartesian coordinates. @@ -1661,7 +1662,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& m_caster->UpdateGroundPositionZ(dest_x, dest_y, dest_z); m_targets.setDestination(dest_x, dest_y, dest_z); - if (radius > 0.0f) + if (targetMode == TARGET_RANDOM_NEARBY_DEST && radius > 0.0f) { // caster included here? FillAreaTargets(targetUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ALL); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6479b8ef7..c7a56f1a1 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -7223,6 +7223,27 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) unitTarget->RemoveAuraHolderFromStack(spellId, numStacks); return; } + case 62678: // Summon Allies of Nature + { + const uint32 randSpells[] = + { + 62685, // Summon Wave - 1 Mob + 62686, // Summon Wave - 3 Mob + 62688, // Summon Wave - 10 Mob + }; + + m_caster->CastSpell(m_caster, randSpells[urand(0, countof(randSpells)-1)], true); + return; + } + case 62688: // Summon Wave - 10 Mob + { + uint32 spellId = m_spellInfo->CalculateSimpleValue(eff_idx); + + for (uint32 i = 0; i < 10; ++i) + m_caster->CastSpell(m_caster, spellId, true); + + return; + } case 66477: // Bountiful Feast { if (!unitTarget) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index aa875b0a5..68997904d 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 "11654" + #define REVISION_NR "11655" #endif // __REVISION_NR_H__