mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-15 04:23:09 -04:00
Core/SmartAI: added SMART_ACTION_SIMPLE_TALK, param1: textID, uses the 'Targets' to say the text,
NOTE: textID is relative to the current target's entry OR if target is a player, text is used with source creature's entry --HG-- branch : trunk
This commit is contained in:
@@ -143,7 +143,24 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
|
||||
mTextGUID = IsPlayer(unit)? unit->GetGUID() : NULL;//invoker, used for $vars in texts
|
||||
mUseTextTimer = true;
|
||||
sCreatureTextMgr.SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SIMPLE_TALK:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (targets)
|
||||
{
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
|
||||
{
|
||||
if (IsCreature((*itr)))
|
||||
{
|
||||
sCreatureTextMgr.SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID));
|
||||
} else if (IsPlayer((*itr)))
|
||||
{
|
||||
sCreatureTextMgr.SendChat(me, uint8(e.action.talk.textGroupID),NULL,CHAT_TYPE_END,LANG_ADDON,TEXT_RANGE_NORMAL,NULL,TEAM_OTHER,false, (*itr)->ToPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_PLAY_EMOTE:
|
||||
|
||||
Reference in New Issue
Block a user