mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
fix(Scripts/Dragonblight): Fix Rescue Villager cast conditions (#23822)
This commit is contained in:
@@ -789,7 +789,11 @@ class spell_q12237_rescue_villager : public SpellScript
|
||||
result = SPELL_FAILED_CUSTOM_ERROR;
|
||||
}
|
||||
|
||||
if (!GetCaster()->FindNearestCreature(NPC_HELPLESS_VILLAGER_A, 5.0f) && !GetCaster()->FindNearestCreature(NPC_HELPLESS_VILLAGER_B, 5.0f))
|
||||
std::list<Creature*> villagers;
|
||||
GetCaster()->GetCreatureListWithEntryInGrid(villagers, { NPC_HELPLESS_VILLAGER_A, NPC_HELPLESS_VILLAGER_B }, 5.0f);
|
||||
villagers.remove_if([](Creature* c) { return !c->IsAlive() || c->HasAura(SPELL_RIDE_VEHICLE); });
|
||||
|
||||
if (villagers.empty())
|
||||
{
|
||||
extension = SPELL_CUSTOM_ERROR_MUST_BE_NEAR_HELPLESS_VILLAGER;
|
||||
result = SPELL_FAILED_CUSTOM_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user