From 07e78803e26a9f2a5aff0992614b994f08219284 Mon Sep 17 00:00:00 2001 From: devbox Date: Sun, 23 Aug 2026 22:18:44 +1000 Subject: [PATCH] Exiles Reach: rider immune to NPC damage while on the giant boar Some undead still hit the player during the boar ride (mobs that aggro on sight, not via the trample). Set UNIT_FLAG_IMMUNE_TO_NPC on the player for the ride's duration so mob attacks can't reach the rider (IsValidAttackTarget checks target->IsImmuneToNPC); the boar takes the hits and the trample kills the cadavers. --- .../ExilesReach/exiles_reach_darkmaul_plains.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/server/scripts/ExilesReach/exiles_reach_darkmaul_plains.cpp b/src/server/scripts/ExilesReach/exiles_reach_darkmaul_plains.cpp index 74ee61eb0..d686182d5 100644 --- a/src/server/scripts/ExilesReach/exiles_reach_darkmaul_plains.cpp +++ b/src/server/scripts/ExilesReach/exiles_reach_darkmaul_plains.cpp @@ -890,6 +890,18 @@ public: class spell_riding_giant_boar_305068_AuraScript : public AuraScript { + void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* owner = GetUnitOwner(); + if (!owner) + return; + + // Riding the giant boar: the undead chew on the boar, not the rider. + // Block NPC attacks on the player (the trample/charge already pull + // threat onto the boar, so remaining direct hits shouldn't reach us). + owner->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + } + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* owner = GetUnitOwner(); @@ -897,12 +909,14 @@ public: if (!owner || !player) return; + owner->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); player->RemoveAura(SPELL_RIDING_GIANT_BOAR2); player->CastSpell(player, SPELL_KNOCKBACK_FOR_HACKFIX_GIANT_BOAR_LEAVE, true); } void Register() override { + OnEffectApply += AuraEffectApplyFn(spell_riding_giant_boar_305068_AuraScript::HandleApply, EFFECT_1, SPELL_AURA_LINKED_SUMMON, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_riding_giant_boar_305068_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_LINKED_SUMMON, AURA_EFFECT_HANDLE_REAL); } };