mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10507] Extend SCRIPT_COMMAND_TALK with option to set language for text
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
a1fd19b6b3
commit
29a723e41e
5 changed files with 12 additions and 6 deletions
|
|
@ -93,6 +93,7 @@ spell_scripts
|
||||||
* datalong (see enum ChatType for supported CHAT_TYPE_'s)
|
* datalong (see enum ChatType for supported CHAT_TYPE_'s)
|
||||||
* datalong2 = creature entry (searching for a buddy, closest to source)
|
* datalong2 = creature entry (searching for a buddy, closest to source)
|
||||||
* datalong3 = creature search radius
|
* datalong3 = creature search radius
|
||||||
|
* datalong4 = language
|
||||||
* data_flags = flag_target_player_as_source = 0x01
|
* data_flags = flag_target_player_as_source = 0x01
|
||||||
flag_original_source_as_target = 0x02
|
flag_original_source_as_target = 0x02
|
||||||
flag_buddy_as_target = 0x04
|
flag_buddy_as_target = 0x04
|
||||||
|
|
|
||||||
|
|
@ -2279,10 +2279,10 @@ void Map::ScriptsProcess()
|
||||||
switch(step.script->talk.chatType)
|
switch(step.script->talk.chatType)
|
||||||
{
|
{
|
||||||
case CHAT_TYPE_SAY:
|
case CHAT_TYPE_SAY:
|
||||||
pSource->MonsterSay(textId, LANG_UNIVERSAL, unit_target);
|
pSource->MonsterSay(textId, step.script->talk.language, unit_target);
|
||||||
break;
|
break;
|
||||||
case CHAT_TYPE_YELL:
|
case CHAT_TYPE_YELL:
|
||||||
pSource->MonsterYell(textId, LANG_UNIVERSAL, unit_target);
|
pSource->MonsterYell(textId, step.script->talk.language, unit_target);
|
||||||
break;
|
break;
|
||||||
case CHAT_TYPE_TEXT_EMOTE:
|
case CHAT_TYPE_TEXT_EMOTE:
|
||||||
pSource->MonsterTextEmote(textId, unit_target);
|
pSource->MonsterTextEmote(textId, unit_target);
|
||||||
|
|
@ -2307,7 +2307,7 @@ void Map::ScriptsProcess()
|
||||||
pSource->MonsterWhisper(textId, unit_target, true);
|
pSource->MonsterWhisper(textId, unit_target, true);
|
||||||
break;
|
break;
|
||||||
case CHAT_TYPE_ZONE_YELL:
|
case CHAT_TYPE_ZONE_YELL:
|
||||||
pSource->MonsterYellToZone(textId, LANG_UNIVERSAL, unit_target);
|
pSource->MonsterYellToZone(textId, step.script->talk.language, unit_target);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break; // must be already checked at load
|
break; // must be already checked at load
|
||||||
|
|
|
||||||
|
|
@ -4442,6 +4442,11 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||||
sLog.outErrorDb("Table `%s` has datalong2 = %u in SCRIPT_COMMAND_TALK for script id %u, but search radius is too small (datalong3 = %u).", tablename, tmp.talk.creatureEntry, tmp.id, tmp.talk.searchRadius);
|
sLog.outErrorDb("Table `%s` has datalong2 = %u in SCRIPT_COMMAND_TALK for script id %u, but search radius is too small (datalong3 = %u).", tablename, tmp.talk.creatureEntry, tmp.id, tmp.talk.searchRadius);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!GetLanguageDescByID(tmp.talk.language))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `%s` has datalong4 = %u in SCRIPT_COMMAND_TALK for script id %u, but this language does not exist.", tablename, tmp.talk.language, tmp.id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (tmp.talk.textId[0] == 0)
|
if (tmp.talk.textId[0] == 0)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u", tablename, tmp.talk.textId, tmp.id);
|
sLog.outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u", tablename, tmp.talk.textId, tmp.id);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ typedef UNORDERED_MAP<uint32, GameTele > GameTeleMap;
|
||||||
enum eScriptCommand
|
enum eScriptCommand
|
||||||
{
|
{
|
||||||
SCRIPT_COMMAND_TALK = 0, // source = WorldObject, target = any/none, datalong (see enum ChatType for supported CHAT_TYPE_'s)
|
SCRIPT_COMMAND_TALK = 0, // source = WorldObject, target = any/none, datalong (see enum ChatType for supported CHAT_TYPE_'s)
|
||||||
// datalong2 = creature entry (searching for a buddy, closest to source), datalong3 = creature search radius
|
// datalong2 = creature entry (searching for a buddy, closest to source), datalong3 = creature search radius, datalong4 = language
|
||||||
// data_flags = flag_target_player_as_source = 0x01
|
// data_flags = flag_target_player_as_source = 0x01
|
||||||
// flag_original_source_as_target = 0x02
|
// flag_original_source_as_target = 0x02
|
||||||
// flag_buddy_as_target = 0x04
|
// flag_buddy_as_target = 0x04
|
||||||
|
|
@ -132,7 +132,7 @@ struct ScriptInfo
|
||||||
uint32 chatType; // datalong
|
uint32 chatType; // datalong
|
||||||
uint32 creatureEntry; // datalong2
|
uint32 creatureEntry; // datalong2
|
||||||
uint32 searchRadius; // datalong3
|
uint32 searchRadius; // datalong3
|
||||||
uint32 unused1; // datalong4
|
uint32 language; // datalong4
|
||||||
uint32 flags; // data_flags
|
uint32 flags; // data_flags
|
||||||
int32 textId[MAX_TEXT_ID]; // dataint to dataint4
|
int32 textId[MAX_TEXT_ID]; // dataint to dataint4
|
||||||
} talk;
|
} talk;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10506"
|
#define REVISION_NR "10507"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue