aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorjoschiwald <joschiwald@online.de>2014-01-26 01:02:20 +0100
committerjoschiwald <joschiwald@online.de>2014-01-26 01:02:20 +0100
commit96060bf0078441e779c4cfcaa80f66ac5e97a3ff (patch)
tree534c908bea32b02ac918eab1264e750851da4708 /src/server/game/Spells/Spell.cpp
parent3c0b906a864911ca1ce41e13ce0fc776952f478c (diff)
Core/Spells: move some spells so spellscripts
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp81
1 files changed, 27 insertions, 54 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 08e0323b491..3c2e06bb631 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1276,17 +1276,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
maxSize = m_spellInfo->MaxAffectedTargets;
power = POWER_HEALTH;
break;
- case 57669: // Replenishment
- // In arenas Replenishment may only affect the caster
- if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->InArena())
- {
- unitTargets.clear();
- unitTargets.push_back(m_caster);
- break;
- }
- maxSize = 10;
- power = POWER_MANA;
- break;
default:
break;
}
@@ -1319,22 +1308,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
++itr;
}
break;
- case SPELLFAMILY_DRUID:
- if (m_spellInfo->SpellFamilyFlags[1] == 0x04000000) // Wild Growth
- {
- maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth
- power = POWER_HEALTH;
- }
- else
- break;
-
- // Remove targets outside caster's raid
- for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
- if (!(*itr)->IsInRaidWith(m_caster))
- itr = unitTargets.erase(itr);
- else
- ++itr;
- break;
default:
break;
}
@@ -1427,33 +1400,33 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
break;
case TARGET_DEST_CASTER_FISHING:
{
- float min_dis = m_spellInfo->GetMinRange(true);
- float max_dis = m_spellInfo->GetMaxRange(true);
- float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis;
- float x, y, z, angle;
- angle = (float)rand_norm() * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
- m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle);
-
- float ground = z;
- float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground);
- if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level
- {
- SendCastResult(SPELL_FAILED_NOT_HERE);
- SendChannelUpdate(0);
- finish(false);
- return;
- }
-
- if (ground + 0.75 > liquidLevel)
- {
- SendCastResult(SPELL_FAILED_TOO_SHALLOW);
- SendChannelUpdate(0);
- finish(false);
- return;
- }
-
- dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());
- break;
+ float minDist = m_spellInfo->GetMinRange(true);
+ float maxDist = m_spellInfo->GetMaxRange(true);
+ float dist = frand(minDist, maxDist);
+ float x, y, z, angle;
+ float angle = float(rand_norm()) * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
+ m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle);
+
+ float ground = z;
+ float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground);
+ if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level
+ {
+ SendCastResult(SPELL_FAILED_NOT_HERE);
+ SendChannelUpdate(0);
+ finish(false);
+ return;
+ }
+
+ if (ground + 0.75 > liquidLevel)
+ {
+ SendCastResult(SPELL_FAILED_TOO_SHALLOW);
+ SendChannelUpdate(0);
+ finish(false);
+ return;
+ }
+
+ dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());
+ break;
}
default:
{