mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-31 06:07:37 +01:00
*Make range check dependent from target.
--HG-- branch : trunk
This commit is contained in:
@@ -385,7 +385,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
|
||||
float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
|
||||
if(!radius) return;
|
||||
float distance = m_caster->GetDistance2d(unitTarget);
|
||||
damage = (distance > radius ) ? 0 : (int32)(m_spellInfo->EffectBasePoints[0]*((radius - distance)/radius));
|
||||
@@ -2798,7 +2798,7 @@ void Spell::EffectCreateItem2(uint32 i)
|
||||
|
||||
void Spell::EffectPersistentAA(uint32 i)
|
||||
{
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
|
||||
|
||||
@@ -3665,7 +3665,7 @@ void Spell::EffectAddFarsight(uint32 i)
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))
|
||||
@@ -3715,7 +3715,7 @@ void Spell::EffectSummonWild(uint32 i)
|
||||
float center_y = m_targets.m_destY;
|
||||
float center_z = m_targets.m_destZ;
|
||||
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
|
||||
int32 amount = damage > 0 ? damage : 1;
|
||||
|
||||
@@ -3804,7 +3804,7 @@ void Spell::EffectSummonGuardian(uint32 i)
|
||||
float center_y = m_targets.m_destY;
|
||||
float center_z = m_targets.m_destZ;
|
||||
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
|
||||
int32 amount = damage > 0 ? damage : 1;
|
||||
|
||||
@@ -3908,7 +3908,7 @@ void Spell::EffectTeleUnitsFaceCaster(uint32 i)
|
||||
return;
|
||||
|
||||
uint32 mapid = m_caster->GetMapId();
|
||||
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
float dis = m_caster->GetSpellRadiusForTarget(unitTarget, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
|
||||
float fx,fy,fz;
|
||||
m_caster->GetClosePoint(fx,fy,fz,unitTarget->GetObjectSize(),dis);
|
||||
@@ -6002,7 +6002,7 @@ void Spell::EffectMomentMove(uint32 i)
|
||||
return;
|
||||
|
||||
uint32 mapid = m_caster->GetMapId();
|
||||
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
float dis = m_caster->GetSpellRadiusForTarget(unitTarget, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
|
||||
// src point
|
||||
float *fx = new float[11], *fy = new float[11], *fz = new float[11];
|
||||
@@ -6520,13 +6520,14 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
//FIXME: this can be better check for most objects but still hack
|
||||
else if(m_spellInfo->EffectRadiusIndex[effIndex] && m_spellInfo->speed==0)
|
||||
{
|
||||
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
|
||||
float dis = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
|
||||
m_caster->GetClosePoint(fx,fy,fz,DEFAULT_WORLD_OBJECT_SIZE, dis);
|
||||
}
|
||||
else
|
||||
{
|
||||
float min_dis = GetSpellMinRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
|
||||
float max_dis = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
|
||||
//GO is always friendly to it's creator, get range for friends
|
||||
float min_dis = GetSpellMinRangeForFriend(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
|
||||
float max_dis = GetSpellMaxRangeForFriend(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
|
||||
float dis = rand_norm() * (max_dis - min_dis) + min_dis;
|
||||
|
||||
m_caster->GetClosePoint(fx,fy,fz,DEFAULT_WORLD_OBJECT_SIZE, dis);
|
||||
|
||||
Reference in New Issue
Block a user