mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[sql/updates/2008_11_11_01_mangos_db_script_string.sql sql/updates/2008_11_11_02_mangos_scripts.sql] Implement localization support for db script command SCRIPT_COMMAND_TALK.
Now db script command strings stored in `db_script_string (mangos_string like table). Text field `datatext` replace by int field `dataint` that store index in `db_script_string` table. Indexes must be 2000000000+ (for avoid conflicts with mangos_string indexes). Changes required DB support and SCRIPT_COMMAND_TALK will not work with old data until fixing in DB.
This commit is contained in:
parent
b24ace11cf
commit
c9fd3705d7
11 changed files with 184 additions and 28 deletions
|
|
@ -1141,6 +1141,9 @@ void World::SetInitialWorldSettings()
|
|||
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
|
||||
sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls
|
||||
objmgr.LoadDbScriptStrings();
|
||||
|
||||
sLog.outString( "Initializing Scripts..." );
|
||||
if(!LoadScriptingModule())
|
||||
exit(1);
|
||||
|
|
@ -1561,11 +1564,6 @@ void World::ScriptsProcess()
|
|||
sLog.outError("SCRIPT_COMMAND_TALK call for non-creature (TypeId: %u), skipping.",source->GetTypeId());
|
||||
break;
|
||||
}
|
||||
if(step.script->datalong > 3)
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_TALK invalid chat type (%u), skipping.",step.script->datalong);
|
||||
break;
|
||||
}
|
||||
|
||||
uint64 unit_target = target ? target->GetGUID() : 0;
|
||||
|
||||
|
|
@ -1573,7 +1571,7 @@ void World::ScriptsProcess()
|
|||
switch(step.script->datalong)
|
||||
{
|
||||
case 0: // Say
|
||||
((Creature *)source)->Say(step.script->datatext.c_str(), LANG_UNIVERSAL, unit_target);
|
||||
((Creature *)source)->Say(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
break;
|
||||
case 1: // Whisper
|
||||
if(!unit_target)
|
||||
|
|
@ -1581,13 +1579,13 @@ void World::ScriptsProcess()
|
|||
sLog.outError("SCRIPT_COMMAND_TALK attempt to whisper (%u) NULL, skipping.",step.script->datalong);
|
||||
break;
|
||||
}
|
||||
((Creature *)source)->Whisper(step.script->datatext.c_str(),unit_target);
|
||||
((Creature *)source)->Whisper(step.script->dataint,unit_target);
|
||||
break;
|
||||
case 2: // Yell
|
||||
((Creature *)source)->Yell(step.script->datatext.c_str(), LANG_UNIVERSAL, unit_target);
|
||||
((Creature *)source)->Yell(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||
break;
|
||||
case 3: // Emote text
|
||||
((Creature *)source)->TextEmote(step.script->datatext.c_str(), unit_target);
|
||||
((Creature *)source)->TextEmote(step.script->dataint, unit_target);
|
||||
break;
|
||||
default:
|
||||
break; // must be already checked at load
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue