Scripts/DB_Scripts: enable DB scripts to use CHAT_MSG_RAID_BOSS_WHISPER (42) as chat type

--HG--
branch : trunk
This commit is contained in:
Rat
2010-09-20 21:58:14 +02:00
parent f69c252f1d
commit cf93313316
2 changed files with 10 additions and 2 deletions

View File

@@ -4745,7 +4745,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
case SCRIPT_COMMAND_TALK:
{
if (tmp.datalong > CHAT_TYPE_WHISPER)
if (tmp.datalong > CHAT_TYPE_WHISPER && tmp.datalong != CHAT_MSG_RAID_BOSS_WHISPER)
{
sLog.outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(),tmp.datalong,tmp.id);

View File

@@ -3030,7 +3030,7 @@ void Map::ScriptsProcess()
switch (step.script->command)
{
case SCRIPT_COMMAND_TALK:
if (step.script->datalong > CHAT_TYPE_WHISPER)
if (step.script->datalong > CHAT_TYPE_WHISPER && step.script->datalong != CHAT_MSG_RAID_BOSS_WHISPER)
{
sLog.outError("%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->datalong);
break;
@@ -3096,6 +3096,14 @@ void Map::ScriptsProcess()
}
cSource->Whisper(step.script->dataint, targetGUID);
break;
case CHAT_MSG_RAID_BOSS_WHISPER: //42
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
{
sLog.outError("%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
break;
}
cSource->MonsterWhisper(step.script->dataint, targetGUID, true);
break;
default:
break; // must be already checked at load
}