Core/Spells: Implemented target 105 TARGET_UNIT_CASTER_AND_PASSENGERS
Port From (https://github.com/TrinityCore/TrinityCore/commit/bbdb70ed57887465f5e06a131c8326b71743950c)
This commit is contained in:
@@ -2679,7 +2679,7 @@ namespace Framework.Constants
|
||||
UnitPassenger6 = 102,
|
||||
UnitPassenger7 = 103,
|
||||
UnitConeCasterToDestEnemy = 104,
|
||||
UnitUnk105 = 105, // 1 Spell
|
||||
UnitCasterAndPassengers = 105,
|
||||
DestChannelCaster = 106,
|
||||
UnkDestAreaUnk107 = 107, // Not Enough Info - Only Generic Spells Avalible
|
||||
GameobjectCone_108 = 108,
|
||||
|
||||
+21
-34
@@ -745,58 +745,45 @@ namespace Game.Spells
|
||||
Cypher.Assert(false, "Spell.SelectImplicitAreaTargets: received not implemented target reference type");
|
||||
return;
|
||||
}
|
||||
List<WorldObject> targets = new();
|
||||
|
||||
float radius = spellEffectInfo.CalcRadius(m_caster) * m_spellValue.RadiusMod;
|
||||
List<WorldObject> targets = new();
|
||||
switch (targetType.GetTarget())
|
||||
{
|
||||
case Targets.UnitCasterAndPassengers:
|
||||
targets.Add(m_caster);
|
||||
Unit unit = m_caster.ToUnit();
|
||||
if (unit != null)
|
||||
{
|
||||
Vehicle vehicleKit = unit.GetVehicleKit();
|
||||
if (vehicleKit != null)
|
||||
for (sbyte seat = 0; seat < SharedConst.MaxVehicleSeats; ++seat)
|
||||
{
|
||||
Unit passenger = vehicleKit.GetPassenger(seat);
|
||||
if (passenger != null)
|
||||
targets.Add(passenger);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Targets.UnitTargetAllyOrRaid:
|
||||
Unit targetedUnit = m_targets.GetUnitTarget();
|
||||
if (targetedUnit != null)
|
||||
{
|
||||
if (!m_caster.IsUnit() || !m_caster.ToUnit().IsInRaidWith(targetedUnit))
|
||||
{
|
||||
targets.Add(m_targets.GetUnitTarget());
|
||||
|
||||
CallScriptObjectAreaTargetSelectHandlers(targets, spellEffectInfo.EffectIndex, targetType);
|
||||
|
||||
if (!targets.Empty())
|
||||
{
|
||||
// Other special target selection goes here
|
||||
uint maxTargets = m_spellValue.MaxAffectedTargets;
|
||||
if (maxTargets != 0)
|
||||
targets.RandomResize(maxTargets);
|
||||
|
||||
foreach (WorldObject target in targets)
|
||||
{
|
||||
Unit unit = target.ToUnit();
|
||||
if (unit != null)
|
||||
AddUnitTarget(unit, effMask, false, true, center);
|
||||
else
|
||||
{
|
||||
GameObject gObjTarget = target.ToGameObject();
|
||||
if (gObjTarget != null)
|
||||
AddGOTarget(gObjTarget, effMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
center = targetedUnit;
|
||||
else
|
||||
SearchAreaTargets(targets, radius, targetedUnit, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions);
|
||||
}
|
||||
break;
|
||||
case Targets.UnitCasterAndSummons:
|
||||
targets.Add(m_caster);
|
||||
SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions);
|
||||
break;
|
||||
default:
|
||||
SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions);
|
||||
break;
|
||||
}
|
||||
|
||||
float radius = spellEffectInfo.CalcRadius(m_caster) * m_spellValue.RadiusMod;
|
||||
|
||||
SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions);
|
||||
|
||||
CallScriptObjectAreaTargetSelectHandlers(targets, spellEffectInfo.EffectIndex, targetType);
|
||||
|
||||
if (!targets.Empty())
|
||||
|
||||
@@ -5028,7 +5028,7 @@ namespace Game.Spells
|
||||
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 102 TARGET_UNIT_PASSENGER_6
|
||||
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 103 TARGET_UNIT_PASSENGER_7
|
||||
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Dest, SpellTargetSelectionCategories.Cone, SpellTargetCheckTypes.Enemy, SpellTargetDirectionTypes.Front), // 104 TARGET_UNIT_CONE_CASTER_TO_DEST_ENEMY
|
||||
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 105 TARGET_UNIT_UNK_105
|
||||
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 105 TARGET_UNIT_CASTER_AND_PASSENGERS
|
||||
new StaticData(SpellTargetObjectTypes.Dest, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Channel, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 106 TARGET_DEST_CHANNEL_CASTER
|
||||
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.Dest, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 107 TARGET_UNK_DEST_AREA_UNK_107
|
||||
new StaticData(SpellTargetObjectTypes.Gobj, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Cone, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.Front), // 108 TARGET_GAMEOBJECT_CONE_108
|
||||
|
||||
Reference in New Issue
Block a user