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
This commit is contained in:
1 parent
f2444eedf9
commit
17f6dcb762
1 file changed
+2
-9
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user