aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-10-03 17:20:22 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-10-03 17:20:22 +0200
commitc1381c22199e4f03c8090aa04c43ad87506b1c31 (patch)
treedf1645bb0b0de3d1f817b3f975972496f49c4dd3 /src
parent9cddbe0b118b56d46a08633da803acad565b8790 (diff)
parent98257b94728223ff027c3696b630462288c85255 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 672671435ca..b57b8b698ea 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -700,6 +700,36 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
switch (e.GetActionType())
{
+ case SMART_ACTION_TALK:
+ {
+ if (e.GetScriptType() == SMART_SCRIPT_TYPE_CREATURE)
+ {
+ uint32 entry = 0;
+ if (e.entryOrGuid >= 0)
+ entry = e.entryOrGuid;
+ else
+ {
+ if (CreatureData const* creatureData = sObjectMgr->GetCreatureData(uint32(abs(e.entryOrGuid))))
+ entry = creatureData->id;
+ }
+
+ CreatureTextMap::const_iterator sList = sCreatureTextMgr->GetTextMap().find(entry);
+ if (sList == sCreatureTextMgr->GetTextMap().end())
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find Text for Creature %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ return false;
+ }
+
+ CreatureTextHolder const& textHolder = sList->second;
+ CreatureTextHolder::const_iterator itr = textHolder.find(e.action.talk.textGroupID);
+ if (itr == textHolder.end())
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find TextGroup %u for Creature %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.talk.textGroupID, entry);
+ return false;
+ }
+ }
+ break;
+ }
case SMART_ACTION_SET_FACTION:
if (e.action.faction.factionID && !sFactionTemplateStore.LookupEntry(e.action.faction.factionID))
{
@@ -1146,7 +1176,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SET_NPC_FLAG:
case SMART_ACTION_ADD_NPC_FLAG:
case SMART_ACTION_REMOVE_NPC_FLAG:
- case SMART_ACTION_TALK:
case SMART_ACTION_SIMPLE_TALK:
case SMART_ACTION_CROSS_CAST:
case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST: