Exiles Reach: implement Giant Boar Trample (305557)
Build (Windows x64) / build (push) Canceled after 0s
Build (Windows x64) / linux-build (push) Canceled after 0s

The trample's Effect 1 is a SPELL_EFFECT_DUMMY (radius 13, targets the
caster) that was never scripted, so it did nothing to the Monstrous
Cadavers (157091) during Ride of the Scientifically Enhanced Boar. Add a
spell script that damages all hostile creatures within the effect radius
(caster->DealDamage, effect value). Registered + spell_script_names row.
This commit is contained in:
devbox
2026-08-23 18:36:53 +10:00
parent b47740c125
commit ffaac9ece6
@@ -22,6 +22,9 @@
*/
#include "exiles_reach.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
class exiles_reach_darkmaul_plains_playerscript : public PlayerScript
{
@@ -982,6 +985,50 @@ public:
}
};
// Giant Boar Trample (305557) — mows down the undead army / Monstrous Cadavers
// (157091) around the boar. The spell's Effect 1 is a DUMMY (radius 13) that
// targets the caster; the actual damage to nearby enemies is scripted here.
class spell_giant_boar_trample_305557 : public SpellScriptLoader
{
public:
spell_giant_boar_trample_305557() : SpellScriptLoader("spell_giant_boar_trample_305557") {}
class spell_giant_boar_trample_305557_SpellScript : public SpellScript
{
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster || !caster->IsInWorld())
return;
float radius = GetEffectInfo().CalcRadius(caster);
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);
for (Creature* target : targets)
{
if (!caster->IsValidAttackTarget(target))
continue;
caster->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL);
}
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_giant_boar_trample_305557_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_giant_boar_trample_305557_SpellScript();
}
};
class LeaveGiantBoarEvent : public BasicEvent
{
public:
@@ -1086,4 +1133,5 @@ void AddSC_exiles_reach_darkmaul_plains()
new spell_ride_vehicle_173426();
new spell_giant_boar_charge_321627();
new spell_giant_boar_ping_vehicle_305559();
new spell_giant_boar_trample_305557();
}