mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 16:03:45 +00:00
feat(Core/SAI): Implement delay option to SMART_ACTION_TALK (#22918)
This commit is contained in:
@@ -53,9 +53,11 @@ void CreatureAI::Talk(uint8 id, WorldObject const* target /*= nullptr*/, Millise
|
||||
{
|
||||
if (delay > Seconds::zero())
|
||||
{
|
||||
me->m_Events.AddEventAtOffset([this, id, target]()
|
||||
ObjectGuid targetGuid = target->GetGUID();
|
||||
me->m_Events.AddEventAtOffset([this, id, targetGuid]()
|
||||
{
|
||||
sCreatureTextMgr->SendChat(me, id, target);
|
||||
if (Unit* textTarget = ObjectAccessor::GetUnit(*me, targetGuid))
|
||||
sCreatureTextMgr->SendChat(me, id, textTarget);
|
||||
}, delay);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user