aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp9
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp9
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h4
3 files changed, 20 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index d8477eb7d92..ce1a4f9e307 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1138,6 +1138,15 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
SetScript9(e, urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2));
break;
}
+ case SMART_ACTION_ACTIVATE_TAXI:
+ {
+ ObjectList* targets = GetTargets(e, unit);
+ if (!targets) return;
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
+ if (IsPlayer((*itr)))
+ (*itr)->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id);
+ break;
+ }
default:
sLog.outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType());
break;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 996dafe13c0..710bf9f3c34 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -541,6 +541,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
case SMART_ACTION_ADD_QUEST:
if (e.action.quest.quest && !IsQuestValid(e, e.action.quest.quest)) return false;
break;
+ case SMART_ACTION_ACTIVATE_TAXI:
+ {
+ if (!sTaxiPathStore.LookupEntry(e.action.taxi.id))
+ {
+ sLog.outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Taxi path ID %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
+ return false;
+ }
+ break;
+ }
case SMART_ACTION_RANDOM_EMOTE:
if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1)) return false;
if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2)) return false;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index b9fb02c42c6..ba16aef8c1f 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -404,7 +404,7 @@ enum SMART_ACTION
SMART_ACTION_ATTACK_START = 49, //
SMART_ACTION_SUMMON_GO = 50, // GameObjectID, DespawnTime in ms,
SMART_ACTION_KILL_UNIT = 51, //
- //SMART_ACTION_WP_LOAD = 52, // pathID
+ SMART_ACTION_ACTIVATE_TAXI = 52, // TaxiID
SMART_ACTION_WP_START = 53, // run/walk, pathID, canRepeat, quest, despawntime, reactState
SMART_ACTION_WP_PAUSE = 54, // time
SMART_ACTION_WP_STOP = 55, // despawnTime, quest, fail?
@@ -682,7 +682,7 @@ struct SmartAction
struct
{
uint32 id;
- } wpLoad;
+ } taxi;
struct