From ca920613821adcf7b3ec75cf7cade907b6a68a6d Mon Sep 17 00:00:00 2001 From: Brandon Travis Date: Sun, 5 Apr 2026 20:37:00 +1000 Subject: [PATCH] Fear No Evil quest #28812 Made Injured Stormwind Infantry not healable without having Paxton Prayer Book in inventory --- .../EasternKingdoms/zone_elwynn_forest.cpp | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp index 2650ed27498..8973510e841 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -141,6 +141,7 @@ class npc_stormwind_infantry : public CreatureScript #define SPELL_HEAL 93072 #define SPELL_HEAL_VISUAL 93097 +#define PAXTON_PRAYER_BOOK 65733 class npc_stormwind_injured_soldier : public CreatureScript { @@ -160,7 +161,7 @@ class npc_stormwind_injured_soldier : public CreatureScript { _clicker = nullptr; - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); me->SetStandState(UNIT_STAND_STATE_DEAD); } @@ -170,22 +171,45 @@ class npc_stormwind_injured_soldier : public CreatureScript return; _clicker = Clicker; - me->CastSpell(me, SPELL_HEAL_VISUAL, true); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - me->SetStandState(UNIT_STAND_STATE_STAND); - - me->GetScheduler().Schedule(Milliseconds(1000), [this](TaskContext /*task*/) + Player* player = _clicker->ToPlayer(); + if (player->HasItemCount(PAXTON_PRAYER_BOOK, 1, false)) { - if (_clicker) - me->SetFacingToObject(_clicker); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + me->CastSpell(me, SPELL_HEAL_VISUAL, true); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + me->SetStandState(UNIT_STAND_STATE_STAND); + + me->GetScheduler().Schedule(Milliseconds(1000), [this](TaskContext /*task*/) + { + if (_clicker) + me->SetFacingToObject(_clicker); - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - }); + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + }); - me->GetScheduler().Schedule(Milliseconds(3000), [this](TaskContext /*task*/) - { - Start(false, true); - }); + me->GetScheduler().Schedule(Milliseconds(3000), [this](TaskContext /*task*/) + { + Start(false, true); + }); + } + } + + void MoveInLineOfSight(Unit* who) override + { + npc_escortAI::MoveInLineOfSight(who); + + if (!who || !who->IsPlayer()) + return; + + Player* player = who->ToPlayer(); + + if (!player) + return; + + if (player->HasItemCount(PAXTON_PRAYER_BOOK, 1, false)) + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + else + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); } void WaypointReached(uint32 waypointId) override