mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Spells: move some spells so spellscripts
This commit is contained in:
@@ -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 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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (ground + 0.75 > liquidLevel)
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_TOO_SHALLOW);
|
||||
SendChannelUpdate(0);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
|
||||
dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());
|
||||
break;
|
||||
dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user