[11655] Add script effect of spell 62678 and 62688

Target 91 may require further adjustments.
This commit is contained in:
zergtmn 2011-06-19 22:00:36 +06:00
parent 0ebfe92e41
commit ba7ce1d7c3
4 changed files with 25 additions and 2 deletions

View file

@ -1254,6 +1254,7 @@ enum Targets
TARGET_SELF2 = 87, TARGET_SELF2 = 87,
TARGET_DIRECTLY_FORWARD = 89, TARGET_DIRECTLY_FORWARD = 89,
TARGET_NONCOMBAT_PET = 90, TARGET_NONCOMBAT_PET = 90,
TARGET_91 = 91,
TARGET_IN_FRONT_OF_CASTER_30 = 104, TARGET_IN_FRONT_OF_CASTER_30 = 104,
}; };

View file

@ -1651,6 +1651,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
targetUnitMap.push_back(m_caster); targetUnitMap.push_back(m_caster);
break; break;
} }
case TARGET_91:
case TARGET_RANDOM_NEARBY_DEST: 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. 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_caster->UpdateGroundPositionZ(dest_x, dest_y, dest_z);
m_targets.setDestination(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? // caster included here?
FillAreaTargets(targetUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ALL); FillAreaTargets(targetUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ALL);

View file

@ -7223,6 +7223,27 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->RemoveAuraHolderFromStack(spellId, numStacks); unitTarget->RemoveAuraHolderFromStack(spellId, numStacks);
return; 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 case 66477: // Bountiful Feast
{ {
if (!unitTarget) if (!unitTarget)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11654" #define REVISION_NR "11655"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__