mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[9876] Fixed TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER work
TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER expected seelction friendly targets for spell caster around spell caster (so ignore original caster faction). This meaning that for begative spell also selected friendly targets for spell caster object.
This commit is contained in:
parent
5a572b9991
commit
d04dd4e5bf
5 changed files with 25 additions and 10 deletions
|
|
@ -1862,7 +1862,8 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
FillRaidOrPartyManaPriorityTargets(targetUnitMap, m_caster, m_caster, radius, 3, true, false, false);
|
||||
break;
|
||||
default:
|
||||
FillAreaTargets(targetUnitMap, m_targets.m_destX, m_targets.m_destY, radius, PUSH_SELF_CENTER, SPELL_TARGETS_FRIENDLY);
|
||||
// selected friendly units (for casting objects) around casting object
|
||||
FillAreaTargets(targetUnitMap, m_targets.m_destX, m_targets.m_destY, radius, PUSH_SELF_CENTER, SPELL_TARGETS_FRIENDLY, GetCastingObject());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
@ -6401,13 +6402,24 @@ SpellCastResult Spell::CanOpenLock(SpellEffectIndex effIndex, uint32 lockId, Ski
|
|||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Spell::FillAreaTargets(UnitList &targetUnitMap, float x, float y, float radius, SpellNotifyPushType pushType, SpellTargets spellTargets)
|
||||
/*
|
||||
* Fill target list by units around (x,y) points at radius distance
|
||||
|
||||
* @param targetUnitMap Reference to target list that filled by function
|
||||
* @param x X coordinates of center point for target search
|
||||
* @param y Y coordinates of center point for target search
|
||||
* @param radius Radius around (x,y) for target search
|
||||
* @param pushType Additional rules for target area selection (in front, angle, etc)
|
||||
* @param spellTargets Additional rules for target selection base at hostile/friendly state to original spell caster
|
||||
* @param originalCaster If provided set alternative original caster, if =NULL then used Spell::GetAffectiveObject() return
|
||||
*/
|
||||
void Spell::FillAreaTargets(UnitList &targetUnitMap, float x, float y, float radius, SpellNotifyPushType pushType, SpellTargets spellTargets, WorldObject* originalCaster /*=NULL*/)
|
||||
{
|
||||
CellPair p(MaNGOS::ComputeCellPair(x, y));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, targetUnitMap, radius, pushType, spellTargets);
|
||||
MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, targetUnitMap, radius, pushType, spellTargets, originalCaster);
|
||||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
|
||||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
|
||||
cell.Visit(p, world_notifier, *m_caster->GetMap(), *m_caster, radius);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue