Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/scripts/src/Common/Base.cpp
- ===================================================================
- --- src/scripts/src/Common/Base.cpp (revision 4203)
- +++ src/scripts/src/Common/Base.cpp (working copy)
- @@ -19,6 +19,60 @@
- #include "Setup.h"
- +void MoonScriptCreatureAI::DoScriptText(uint32 TextId, bool UseEvent, EventType pEventType)
- +{
- + QueryResult* ScriptTextData = WorldDatabase.Query( "SELECT `Text`, `TextType`, `SoundId`, `EmoteId` FROM `script_texts` WHERE `id`='%u'", TextId);
- +
- + if(!ScriptTextData)
- + return;
- +
- + Field* CurrentField = NULL;
- + CurrentField = ScriptTextData->Fetch();
- +
- + // Setting data types
- + const char * pText; // In table text should'nt be NULL
- + uint8 pTextType; // Default: Text_Say
- + uint32 pSoundId;
- + uint8 pEmote;
- +
- + // Setting gathered data from table
- + pText = CurrentField[0].GetString();
- + pTextType = CurrentField[1].GetUInt8();
- + pSoundId = CurrentField[2].GetUInt32();
- + pEmote = CurrentField[3].GetUInt8();
- +
- + if(pText == NULL)
- + {
- + sLog.outDebug("ArcScripts2: Text entry %u hasn't text, skipping...", TextId);
- + return;
- + }else if(pText == NULL || pEmote)
- + {
- + sLog.outDebug("ArcScripts2: Text entry %u hasn't text, but has EmoteId, skipping...", TextId);
- + return;
- + }else if(UseEvent==true || pEventType==Event_None)
- + {
- + sLog.outDebug("ArcScripts2: Text entry %u has wrong event type, check it in scripts, skipping...", TextId);
- + return;
- + }
- +
- + if(UseEvent==false)
- + {
- + Emote(pText, (TextType)pTextType, pSoundId);
- + if(pEmote!=0)
- + {
- + _unit->SetEmoteState(pEmote);
- + }
- + }else
- + {
- + AddEmote(pEventType, pText, (TextType)pTextType, pSoundId);
- +
- + if(pEmote!=0)
- + {
- + _unit->SetEmoteState(pEmote);
- + }
- + }
- +};
- +
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //Class TargetType
- TargetType::TargetType( uint32 pTargetGen, TargetFilter pTargetFilter, uint32 pMinTargetNumber, uint32 pMaxTargetNumber )
- Index: src/scripts/src/Common/Base.h
- ===================================================================
- --- src/scripts/src/Common/Base.h (revision 4203)
- +++ src/scripts/src/Common/Base.h (working copy)
- @@ -54,6 +54,7 @@
- enum EventType
- {
- + Event_None = -1,
- Event_OnCombatStart,
- Event_OnTargetDied,
- Event_OnDied,
- @@ -392,6 +393,7 @@
- //Emotes
- EmoteDesc* AddEmote(EventType pEventType, const char* pText, TextType pType, uint32 pSoundId=0);
- + void DoScriptText(uint32 TextId, bool Event = false, EventType pEventType=Event_None);
- void RemoveEmote(EventType pEventType, EmoteDesc* pEmote);
- void RemoveAllEmotes(EventType pEventType);
- void Emote(EmoteDesc* pEmote);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement