Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AreaTrigger::CalculateRadius(Spell* spell/* = nullptr*/)
- {
- Unit* caster = GetCaster();
- if (atInfo.polygon)
- _radius = CalculateRadiusPolygon();
- else
- {
- bool find = false;
- if (m_spellInfo && m_spellInfo->Id == 227992)
- {
- _radius = m_spellInfo->Effects[EFFECT_1]->BasePoints;
- sLog->outError(LOG_FILTER_SERVER_LOADING, ">_radius %f", _radius);
- find = true;
- }
- if (!find && (atInfo.Radius || atInfo.RadiusTarget))
- {
- if (atInfo.Radius > atInfo.RadiusTarget)
- _radius = atInfo.Radius;
- else
- _radius = atInfo.RadiusTarget;
- find = true;
- }
- if (caster && !find && m_spellInfo)
- {
- for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
- {
- if (m_spellInfo->EffectMask < uint32(1 << j))
- break;
- if (float r = m_spellInfo->Effects[j]->CalcRadius(GetCaster()))
- _radius = r * (spell ? spell->m_spellValue->RadiusMod : 1.0f);
- }
- }
- }
- if (caster && m_spellInfo)
- if (Player* modOwner = caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, _radius, spell);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement