From fe3772df740b8023c7c047f676f6798c99db8cf8 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 (cherry picked from commit 17f6dcb76282523ac43d8a1e6cebbe0043ab44fa) Conflicts: src/server/game/Entities/Player/Player.cpp --- src/server/game/Entities/Player/Player.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 904600a2481..67ff5377c3e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2640,17 +2640,10 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) if (!creature->GetCharmerGUID().IsEmpty()) 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->ReputationIndex >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) - return NULL; - // not too far if (!creature->IsWithinDistInMap(this, INTERACTION_DISTANCE)) return NULL; -- cgit v1.2.3