mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9883] Change SCRIPT_COMMAND_TALK to support CHAT_TYPE_* using enum ChatType
Making data consistent with other, similar tables like EventAI's text tables. This convert existing data and also adds support for all chat types. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
41c58f3be9
commit
b208effca6
8 changed files with 57 additions and 17 deletions
|
|
@ -2860,7 +2860,7 @@ void Map::ScriptsProcess()
|
|||
break;
|
||||
}
|
||||
|
||||
if (source->GetTypeId()!=TYPEID_UNIT)
|
||||
if (source->GetTypeId() != TYPEID_UNIT)
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_TALK (script id %u) call for non-creature (TypeId: %u), skipping.", step.script->id, source->GetTypeId());
|
||||
break;
|
||||
|
|
@ -2868,25 +2868,38 @@ void Map::ScriptsProcess()
|
|||
|
||||
uint64 unit_target = target ? target->GetGUID() : 0;
|
||||
|
||||
//datalong 0=normal say, 1=whisper, 2=yell, 3=emote text
|
||||
switch(step.script->datalong)
|
||||
{
|
||||
case 0: // Say
|
||||
((Creature *)source)->Say(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
case CHAT_TYPE_SAY:
|
||||
((Creature*)source)->Say(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
break;
|
||||
case 1: // Whisper
|
||||
case CHAT_TYPE_YELL:
|
||||
((Creature*)source)->Yell(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
break;
|
||||
case CHAT_TYPE_TEXT_EMOTE:
|
||||
((Creature*)source)->TextEmote(step.script->dataint, unit_target);
|
||||
break;
|
||||
case CHAT_TYPE_BOSS_EMOTE:
|
||||
((Creature*)source)->TextEmote(step.script->dataint, unit_target, true);
|
||||
break;
|
||||
case CHAT_TYPE_WHISPER:
|
||||
if (!unit_target)
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_TALK (script id %u) attempt to whisper (%u) NULL, skipping.", step.script->id, step.script->datalong);
|
||||
sLog.outError("SCRIPT_COMMAND_TALK (script id %u) attempt to whisper (%u) 0-guid, skipping.", step.script->id, step.script->datalong);
|
||||
break;
|
||||
}
|
||||
((Creature *)source)->Whisper(step.script->dataint, unit_target);
|
||||
((Creature*)source)->Whisper(step.script->dataint, unit_target);
|
||||
break;
|
||||
case 2: // Yell
|
||||
((Creature *)source)->Yell(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
case CHAT_TYPE_BOSS_WHISPER:
|
||||
if (!unit_target)
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_TALK (script id %u) attempt to whisper (%u) 0-guid, skipping.", step.script->id, step.script->datalong);
|
||||
break;
|
||||
}
|
||||
((Creature*)source)->Whisper(step.script->dataint, unit_target, true);
|
||||
break;
|
||||
case 3: // Emote text
|
||||
((Creature *)source)->TextEmote(step.script->dataint, unit_target);
|
||||
case CHAT_TYPE_ZONE_YELL:
|
||||
((Creature*)source)->YellToZone(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
break;
|
||||
default:
|
||||
break; // must be already checked at load
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue