Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. void AreaTrigger::CalculateRadius(Spell* spell/* = nullptr*/)
  2. {
  3. Unit* caster = GetCaster();
  4.  
  5. if (atInfo.polygon)
  6. _radius = CalculateRadiusPolygon();
  7. else
  8. {
  9. bool find = false;
  10.  
  11. if (m_spellInfo && m_spellInfo->Id == 227992)
  12. {
  13. _radius = m_spellInfo->Effects[EFFECT_1]->BasePoints;
  14. sLog->outError(LOG_FILTER_SERVER_LOADING, ">_radius %f", _radius);
  15. find = true;
  16. }
  17.  
  18. if (!find && (atInfo.Radius || atInfo.RadiusTarget))
  19. {
  20. if (atInfo.Radius > atInfo.RadiusTarget)
  21. _radius = atInfo.Radius;
  22. else
  23. _radius = atInfo.RadiusTarget;
  24. find = true;
  25. }
  26.  
  27. if (caster && !find && m_spellInfo)
  28. {
  29. for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
  30. {
  31. if (m_spellInfo->EffectMask < uint32(1 << j))
  32. break;
  33.  
  34. if (float r = m_spellInfo->Effects[j]->CalcRadius(GetCaster()))
  35. _radius = r * (spell ? spell->m_spellValue->RadiusMod : 1.0f);
  36. }
  37. }
  38. }
  39.  
  40. if (caster && m_spellInfo)
  41. if (Player* modOwner = caster->GetSpellModOwner())
  42. modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, _radius, spell);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement