Exiles Reach: trample damage from the boar, not the rider
Build (Windows x64) / build (push) Canceled after 0s
Build (Windows x64) / linux-build (push) Canceled after 0s

The trample script dealt damage from the player (GetCaster), so the undead
aggro'd the rider and chewed through the player's health during the boar
ride. Attribute the trample damage to the boar vehicle (GetVehicleBase) so
the mobs attack the boar instead.
This commit is contained in:
devbox
2026-08-23 22:09:06 +10:00
parent 371e06dab9
commit 23dc67639f
@@ -1001,19 +1001,27 @@ public:
if (!caster || !caster->IsInWorld())
return;
float radius = GetEffectInfo().CalcRadius(caster).Max;
// Damage comes from the boar vehicle so the undead aggro the boar,
// not the rider (a player-cast trample would pull threat onto the
// player and the mobs would chew through the rider's health).
Unit* source = caster;
if (Player* player = caster->ToPlayer())
if (Unit* boar = player->GetVehicleBase())
source = boar;
float radius = GetEffectInfo().CalcRadius(source).Max;
int32 damage = GetEffectValue();
std::list<Creature*> targets;
Trinity::AnyUnitInObjectRangeCheck u_check(caster, radius);
Trinity::CreatureListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(caster, targets, u_check);
Cell::VisitGridObjects(caster, searcher, radius);
Trinity::AnyUnitInObjectRangeCheck u_check(source, radius);
Trinity::CreatureListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(source, targets, u_check);
Cell::VisitGridObjects(source, searcher, radius);
for (Creature* target : targets)
{
if (!caster->IsValidAttackTarget(target))
if (!source->IsValidAttackTarget(target))
continue;
Unit::DealDamage(caster, target, uint32(damage), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL);
Unit::DealDamage(source, target, uint32(damage), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL);
}
}