aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpete318 <pete318@hotmail.com>2014-12-28 18:59:05 +0000
committerNayd <dnpd.dd@gmail.com>2014-12-28 19:01:32 +0000
commit17f6dcb76282523ac43d8a1e6cebbe0043ab44fa (patch)
treeb9665087ebab1b233ad0594ab7325ebc9b407eee /src
parentf2444eedf92fce39f7685eafead61d88d4ad89ef (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp11
1 files changed, 2 insertions, 9 deletions
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;