Core/Spells: Implemented SPELL_EFFECT_CANCEL_CONVERSATION

Port From (https://github.com/TrinityCore/TrinityCore/commit/1673b6e2ff69b9a59522892280e91cc5085a5ec0)
This commit is contained in:
hondacrx
2021-10-11 19:49:26 -04:00
parent d2bcc321f5
commit 58550514e6
3 changed files with 41 additions and 1 deletions
+22
View File
@@ -5336,6 +5336,28 @@ namespace Game.Spells
Conversation.CreateConversation((uint)effectInfo.MiscValue, unitCaster, destTarget.GetPosition(), ObjectGuid.Empty, GetSpellInfo());
}
[SpellEffectHandler(SpellEffectName.CancelConversation)]
void EffectCancelConversation()
{
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
if (!unitTarget)
return;
List<WorldObject> objs = new();
ObjectEntryAndPrivateOwnerIfExistsCheck check = new(unitTarget.GetGUID(), (uint)effectInfo.MiscValue);
WorldObjectListSearcher checker = new(unitTarget, objs, check, GridMapTypeMask.Conversation);
Cell.VisitGridObjects(unitTarget, checker, 100.0f);
foreach (WorldObject obj in objs)
{
Conversation convo = obj.ToConversation();
if (convo != null)
convo.Remove();
}
}
[SpellEffectHandler(SpellEffectName.AddGarrisonFollower)]
void EffectAddGarrisonFollower()
{