aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/scripts/base')
-rw-r--r--src/bindings/scripts/base/escort_ai.cpp24
-rw-r--r--src/bindings/scripts/base/escort_ai.h6
-rw-r--r--src/bindings/scripts/base/guard_ai.cpp5
-rw-r--r--src/bindings/scripts/base/guard_ai.h4
4 files changed, 34 insertions, 5 deletions
diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp
index f4979487d31..2c28aa6b9a6 100644
--- a/src/bindings/scripts/base/escort_ai.cpp
+++ b/src/bindings/scripts/base/escort_ai.cpp
@@ -19,6 +19,25 @@ enum
POINT_HOME = 0xFFFFFE
};
+npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
+ IsBeingEscorted(false),
+ IsOnHold(false),
+ PlayerGUID(0),
+ MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
+ CanMelee(true),
+ m_uiPlayerCheckTimer(1000),
+ m_uiWPWaitTimer(2500),
+ m_bIsReturning(false),
+ m_bIsActiveAttacker(true),
+ m_bIsRunning(false),
+ DespawnAtEnd(true),
+ DespawnAtFar(true),
+ m_pQuestForEscort(NULL),
+ m_bCanInstantRespawn(false),
+ m_bCanReturnToStart(false),
+ ScriptWP(false)
+{}
+
void npc_escortAI::AttackStart(Unit* pWho)
{
if (!pWho)
@@ -159,7 +178,10 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (!IsOnHold)
{
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+
+ WaypointStart(CurrentWP->id);
+
m_uiWPWaitTimer = 0;
}
}
diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h
index 5d27aebfec6..663e11d79f6 100644
--- a/src/bindings/scripts/base/escort_ai.h
+++ b/src/bindings/scripts/base/escort_ai.h
@@ -28,12 +28,12 @@ struct Escort_Waypoint
struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
{
public:
- explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
- IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {}
+ explicit npc_escortAI(Creature* pCreature);
~npc_escortAI() {}
// Pure Virtual Functions
- virtual void WaypointReached(uint32) = 0;
+ virtual void WaypointReached(uint32 uiPointId) = 0;
+ virtual void WaypointStart(uint32 uiPointId) {}
// CreatureAI functions
void AttackStart(Unit* who);
diff --git a/src/bindings/scripts/base/guard_ai.cpp b/src/bindings/scripts/base/guard_ai.cpp
index 7f1daa1e2df..b55eae2dbad 100644
--- a/src/bindings/scripts/base/guard_ai.cpp
+++ b/src/bindings/scripts/base/guard_ai.cpp
@@ -32,6 +32,11 @@ EndScriptData */
#define SAY_GUARD_SIL_AGGRO2 -1070002
#define SAY_GUARD_SIL_AGGRO3 -1070003
+guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature),
+ GlobalCooldown(0),
+ BuffTimer(0)
+{}
+
void guardAI::Reset()
{
GlobalCooldown = 0;
diff --git a/src/bindings/scripts/base/guard_ai.h b/src/bindings/scripts/base/guard_ai.h
index 85baa30fb9d..a7fff32e3ab 100644
--- a/src/bindings/scripts/base/guard_ai.h
+++ b/src/bindings/scripts/base/guard_ai.h
@@ -9,7 +9,9 @@
struct TRINITY_DLL_DECL guardAI : public ScriptedAI
{
- guardAI(Creature *c) : ScriptedAI(c) {}
+ public:
+ explicit guardAI(Creature* pCreature);
+ ~guardAI() {}
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
uint32 BuffTimer; //This variable keeps track of buffs