mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +01:00
Core/DB: Drop table script_texts
This commit is contained in:
@@ -160,83 +160,7 @@ class ScriptRegistry
|
||||
if (!V) \
|
||||
return R;
|
||||
|
||||
void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
|
||||
{
|
||||
if (!pSource)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i, invalid Source pointer.", iTextEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
if (iTextEntry >= 0)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
const StringTextData* pData = sScriptSystemMgr->GetTextData(iTextEntry);
|
||||
|
||||
if (!pData)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
|
||||
|
||||
if (pData->uiSoundId)
|
||||
{
|
||||
if (sSoundEntriesStore.LookupEntry(pData->uiSoundId))
|
||||
pSource->SendPlaySound(pData->uiSoundId, false);
|
||||
else
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
|
||||
}
|
||||
|
||||
if (pData->uiEmote)
|
||||
{
|
||||
if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
|
||||
((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote);
|
||||
else
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId());
|
||||
}
|
||||
|
||||
switch (pData->uiType)
|
||||
{
|
||||
case CHAT_TYPE_SAY:
|
||||
pSource->MonsterSay(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
|
||||
break;
|
||||
case CHAT_TYPE_YELL:
|
||||
pSource->MonsterYell(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
|
||||
break;
|
||||
case CHAT_TYPE_TEXT_EMOTE:
|
||||
pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0);
|
||||
break;
|
||||
case CHAT_TYPE_BOSS_EMOTE:
|
||||
pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0, true);
|
||||
break;
|
||||
case CHAT_TYPE_WHISPER:
|
||||
{
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
pSource->MonsterWhisper(iTextEntry, target->GetGUID());
|
||||
else
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
|
||||
|
||||
break;
|
||||
}
|
||||
case CHAT_TYPE_BOSS_WHISPER:
|
||||
{
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
pSource->MonsterWhisper(iTextEntry, target->GetGUID(), true);
|
||||
else
|
||||
sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
|
||||
|
||||
break;
|
||||
}
|
||||
case CHAT_TYPE_ZONE_YELL:
|
||||
pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ScriptMgr::ScriptMgr()
|
||||
: _scriptCount(0), _scheduledScripts(0)
|
||||
@@ -299,8 +223,6 @@ void ScriptMgr::Unload()
|
||||
|
||||
void ScriptMgr::LoadDatabase()
|
||||
{
|
||||
sScriptSystemMgr->LoadScriptTexts();
|
||||
sScriptSystemMgr->LoadScriptTextsCustom();
|
||||
sScriptSystemMgr->LoadScriptWaypoints();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user