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:
Rat
2010-11-05 19:38:43 +01:00
parent 7956bc8c44
commit be25e38144
5 changed files with 29 additions and 11 deletions

View File

@@ -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: