From 17f6dcb76282523ac43d8a1e6cebbe0043ab44fa Mon Sep 17 00:00:00 2001 From: pete318 Date: Sun, 28 Dec 2014 18:59:05 +0000 Subject: Core: NPC Interaction change for unfriendly reputation. For units with unfriendly reputation, check using the normal reaction function, instead of reading faction directly. This allows specific buffs that alter creature reaction to work on the player, this allowing players to complete quests. Closes #13629 --- src/server/game/Entities/Player/Player.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b8abc33f675..d547bf60342 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2765,17 +2765,10 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) if (creature->GetCharmerGUID()) return NULL; - // not enemy - if (creature->IsHostileTo(this)) + // not unfriendly/hostile + if (creature->GetReactionTo(this) <= REP_UNFRIENDLY) return NULL; - // not unfriendly - if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction())) - if (factionTemplate->faction) - if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) - if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) - return NULL; - // not too far if (!creature->IsWithinDistInMap(this, INTERACTION_DISTANCE)) return NULL; -- cgit v1.2.3