Implemented spell Target Type (45) 'Target Rings' on Underfoot.

Thanks to Lecht for figuring out op code side of it.
This commit is contained in:
KayenEQ
2014-11-09 22:37:12 -05:00
parent d8a8b8e6dc
commit d656db843a
11 changed files with 62 additions and 6 deletions
+11 -3
View File
@@ -764,8 +764,14 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
continue;
if (curmob == caster && !affect_caster) //watch for caster too
continue;
dist_targ = center->DistNoRoot(*curmob);
if (spells[spell_id].targettype == ST_Ring){
dist_targ = curmob->DistNoRoot(caster->GetTargetRingX(), caster->GetTargetRingY(),caster->GetTargetRingZ());
}
else if (center){
dist_targ = center->DistNoRoot(*curmob);
}
if (dist_targ > dist2) //make sure they are in range
continue;
if (dist_targ < min_range2) //make sure they are in range
@@ -787,7 +793,9 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
if (bad) {
if (!caster->IsAttackAllowed(curmob, true))
continue;
if (!center->CheckLosFN(curmob))
if (center && !center->CheckLosFN(curmob))
continue;
if (!center && !caster->CheckLosFN(caster->GetTargetRingX(), caster->GetTargetRingY(),caster->GetTargetRingZ(), curmob->GetSize()))
continue;
} else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// This does not check faction for beneficial AE buffs..only agro and attackable.