aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts/ScriptMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-31 10:03:07 -0600
committermegamage <none@none>2008-12-31 10:03:07 -0600
commitba58ddac9c302953fc15987bc84d5f858a011e56 (patch)
tree5bafa1aa17b64d7e325a347f4538eb8402b222a3 /src/bindings/scripts/ScriptMgr.cpp
parentaa3b89d7764c093ba87ee2cf99775e3aedc37637 (diff)
parent3885ce94d9be86616bb01e660a70087fcbfc6ffd (diff)
*Update to HG 730.
--HG-- branch : trunk
Diffstat (limited to 'src/bindings/scripts/ScriptMgr.cpp')
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 5d78d40030d..0dc71482df8 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -29,6 +29,7 @@ struct StringTextData
uint32 SoundId;
uint8 Type;
uint32 Language;
+ uint32 Emote;
};
// Enums used by StringTextData::Type
@@ -654,7 +655,7 @@ void LoadDatabase()
LoadTrinityStrings(TScriptDB,"eventai_texts",-1,1+(TEXT_SOURCE_RANGE));
// Gather Additional data from EventAI Texts
- result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM eventai_texts");
+ result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM eventai_texts");
outstring_log("TSCR: Loading EventAI Texts additional data...");
if (result)
@@ -672,6 +673,7 @@ void LoadDatabase()
temp.SoundId = fields[1].GetInt32();
temp.Type = fields[2].GetInt32();
temp.Language = fields[3].GetInt32();
+ temp.Emote = fields[4].GetInt32();
if (i >= 0)
{
@@ -736,6 +738,7 @@ void LoadDatabase()
temp.SoundId = fields[1].GetInt32();
temp.Type = fields[2].GetInt32();
temp.Language = fields[3].GetInt32();
+ temp.Emote = fields[4].GetInt32();
if (i >= 0)
{
@@ -782,7 +785,7 @@ void LoadDatabase()
LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3));
// Gather Additional data from Custom Texts
- result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM custom_texts");
+ result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM custom_texts");
outstring_log("TSCR: Loading Custom Texts additional data...");
if (result)
@@ -800,6 +803,7 @@ void LoadDatabase()
temp.SoundId = fields[1].GetInt32();
temp.Type = fields[2].GetInt32();
temp.Language = fields[3].GetInt32();
+ temp.Emote = fields[4].GetInt32();
if (i >= 0)
{
@@ -1838,7 +1842,7 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target)
return;
}
- debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language);
+ debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote);
if((*i).second.SoundId)
{
@@ -1850,6 +1854,16 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target)
error_log("TSCR: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId);
}
+ if((*i).second.Emote)
+ {
+ if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote);
+ }
+ else
+ error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId());
+ }
+
switch((*i).second.Type)
{
case CHAT_TYPE_SAY: