Implemented broad support for fields min_dist, min_dist_mod, max_dist, max_dist_mod -

Scales spell power based on targets distance from caster.
This implemented in a broad way to function with spells
that would make sense to scale. Some work will still be needed on this.

Be aware if making custom
spells not everything will work and certain effects just
should not be included (use common sense).
This commit is contained in:
KayenEQ
2014-08-02 21:10:44 -04:00
parent e0e473ce06
commit 52d92b7181
10 changed files with 68 additions and 6 deletions
+5 -1
View File
@@ -567,20 +567,24 @@ void HateList::SpellCast(Mob *caster, uint32 spell_id, float range)
//So keep a list of entity ids and look up after
std::list<uint32> id_list;
range = range * range;
float dist_targ = 0;
auto iterator = list.begin();
while (iterator != list.end())
{
tHateEntry *h = (*iterator);
if(range > 0)
{
if(caster->DistNoRoot(*h->ent) <= range)
dist_targ = caster->DistNoRoot(*h->ent);
if(dist_targ <= range)
{
id_list.push_back(h->ent->GetID());
h->ent->CalcSpellPowerDistanceMod(spell_id, dist_targ);
}
}
else
{
id_list.push_back(h->ent->GetID());
h->ent->CalcSpellPowerDistanceMod(spell_id, 0, caster);
}
++iterator;
}