Core/Creatures: Implemented UNIT_NPC_FLAG_GOSSIP as viewer dependent and update npcflags on quest changes
Port From (https://github.com/TrinityCore/TrinityCore/commit/dd15d763cc0529afc9b7f077817645d875608626)
This commit is contained in:
@@ -2332,8 +2332,18 @@ namespace Game.Entities
|
||||
uint GetViewerDependentNpcFlags(UnitData unitData, int i, Unit unit, Player receiver)
|
||||
{
|
||||
uint npcFlag = unitData.NpcFlags[i];
|
||||
if (i == 0 && unit.IsCreature() && !receiver.CanSeeSpellClickOn(unit.ToCreature()))
|
||||
npcFlag &= ~(uint)NPCFlags.SpellClick;
|
||||
if (i == 0)
|
||||
{
|
||||
Creature creature = unit.ToCreature();
|
||||
if (creature != null)
|
||||
{
|
||||
if (!receiver.CanSeeGossipOn(creature))
|
||||
npcFlag &= ~(uint)(NPCFlags.Gossip | NPCFlags.QuestGiver);
|
||||
|
||||
if (!receiver.CanSeeSpellClickOn(creature))
|
||||
npcFlag &= ~(uint)NPCFlags.SpellClick;
|
||||
}
|
||||
}
|
||||
|
||||
return npcFlag;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user