diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index e7d98a718..0cd76ecdc 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -2405,7 +2405,7 @@ namespace Game.AI if (playerTarget != null) { Conversation conversation = Conversation.CreateConversation(e.Action.conversation.id, playerTarget, - playerTarget, new List() { playerTarget.GetGUID() }, null); + playerTarget, playerTarget.GetGUID(), null); if (!conversation) Log.outWarn(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_CREATE_CONVERSATION: id {e.Action.conversation.id}, baseObject {baseObject?.GetName()}, target {playerTarget.GetName()} - failed to create"); } diff --git a/Source/Game/Chat/Commands/DebugCommands.cs b/Source/Game/Chat/Commands/DebugCommands.cs index fdee92923..07337b738 100644 --- a/Source/Game/Chat/Commands/DebugCommands.cs +++ b/Source/Game/Chat/Commands/DebugCommands.cs @@ -123,7 +123,7 @@ namespace Game.Chat return false; } - return Conversation.CreateConversation(conversationEntry, target, target, new List() { target.GetGUID() }) != null; + return Conversation.CreateConversation(conversationEntry, target, target, target.GetGUID()) != null; } [Command("entervehicle", RBACPermissions.CommandDebugEntervehicle)] diff --git a/Source/Game/Entities/Conversation.cs b/Source/Game/Entities/Conversation.cs index c93201d70..426a2b6e8 100644 --- a/Source/Game/Entities/Conversation.cs +++ b/Source/Game/Entities/Conversation.cs @@ -59,14 +59,6 @@ namespace Game.Entities } } - public override bool IsNeverVisibleFor(WorldObject seer) - { - if (!_participants.Contains(seer.GetGUID())) - return true; - - return base.IsNeverVisibleFor(seer); - } - public override void Update(uint diff) { if (GetDuration() > diff) @@ -96,7 +88,7 @@ namespace Game.Entities } } - public static Conversation CreateConversation(uint conversationEntry, Unit creator, Position pos, List participants, SpellInfo spellInfo = null) + public static Conversation CreateConversation(uint conversationEntry, Unit creator, Position pos, ObjectGuid privateObjectOwner, SpellInfo spellInfo = null) { ConversationTemplate conversationTemplate = Global.ConversationDataStorage.GetConversationTemplate(conversationEntry); if (conversationTemplate == null) @@ -105,19 +97,19 @@ namespace Game.Entities ulong lowGuid = creator.GetMap().GenerateLowGuid(HighGuid.Conversation); Conversation conversation = new(); - if (!conversation.Create(lowGuid, conversationEntry, creator.GetMap(), creator, pos, participants, spellInfo)) + if (!conversation.Create(lowGuid, conversationEntry, creator.GetMap(), creator, pos, privateObjectOwner, spellInfo)) return null; return conversation; } - bool Create(ulong lowGuid, uint conversationEntry, Map map, Unit creator, Position pos, List participants, SpellInfo spellInfo = null) + bool Create(ulong lowGuid, uint conversationEntry, Map map, Unit creator, Position pos, ObjectGuid privateObjectOwner, SpellInfo spellInfo = null) { ConversationTemplate conversationTemplate = Global.ConversationDataStorage.GetConversationTemplate(conversationEntry); //ASSERT(conversationTemplate); _creatorGuid = creator.GetGUID(); - _participants = participants; + SetPrivateObjectOwner(privateObjectOwner); SetMap(map); Relocate(pos); @@ -212,11 +204,6 @@ namespace Game.Entities SetUpdateFieldValue(ref actorField.Type, ConversationActorType.WorldObjectActor); } - void AddParticipant(ObjectGuid participantGuid) - { - _participants.Add(participantGuid); - } - public uint GetScriptId() { return Global.ConversationDataStorage.GetConversationTemplate(GetEntry()).ScriptId; @@ -303,6 +290,5 @@ namespace Game.Entities ObjectGuid _creatorGuid; uint _duration; uint _textureKitId; - List _participants = new(); } } diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index ee97b6122..f71a5715e 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -5333,7 +5333,7 @@ namespace Game.Spells if (unitCaster == null || !m_targets.HasDst()) return; - Conversation.CreateConversation((uint)effectInfo.MiscValue, unitCaster, destTarget.GetPosition(), new List() { GetCaster().GetGUID() }, GetSpellInfo()); + Conversation.CreateConversation((uint)effectInfo.MiscValue, unitCaster, destTarget.GetPosition(), ObjectGuid.Empty, GetSpellInfo()); } [SpellEffectHandler(SpellEffectName.AddGarrisonFollower)] @@ -5681,7 +5681,7 @@ namespace Game.Spells if (unitCaster == null || unitTarget == null || !unitTarget.IsPlayer()) return; - Conversation.CreateConversation((uint)effectInfo.MiscValue, unitCaster, unitTarget.GetPosition(), new List() { unitTarget.GetGUID() }, GetSpellInfo()); + Conversation.CreateConversation((uint)effectInfo.MiscValue, unitCaster, unitTarget.GetPosition(), unitTarget.GetGUID(), GetSpellInfo()); } [SpellEffectHandler(SpellEffectName.SendChatMessage)]