Merge [SD2]

r1314 Correct some spellId's and apply SD2 code style
r1315 Correct more spells and apply SD2 code style
r1316 Replace magic number with enum type name UNIT_DYNFLAG_DEAD
r1317 Add support for quest 1249. Patch by jotapdiez
r1318 Move AI's implementation from headers. Original patch/idea by DasBlub
r1319 Convert script related to quest 938 to use followerAI
r1320 Add new virtual function WaypointStart() to escortAI.

--HG--
branch : trunk
This commit is contained in:
Kudlaty committed 2009-08-16 21:46:31 +02:00
1 parent 81ee07fa2a
commit 91f3d69edf
20 files changed
+332 -153

No files matched your search

+23 -1
View File
@@ -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;
}
}
+3 -3
View File
@@ -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);
+5
View File
@@ -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;
+3 -1
View File
@@ -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