*Merge
--HG-- branch : trunk
This commit is contained in:
@@ -96,7 +96,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_snake_trap_serpents' WHERE `ent
|
|||||||
UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate' WHERE `entry` IN (29519,29520,29565,29566,29567);
|
UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate' WHERE `entry` IN (29519,29520,29565,29566,29567);
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate_anchor' WHERE `entry`=29521;
|
UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate_anchor' WHERE `entry`=29521;
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_kingdom_of_dalaran_quests' WHERE `entry` IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162);
|
UPDATE `creature_template` SET `ScriptName`='npc_kingdom_of_dalaran_quests' WHERE `entry` IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162);
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_taxi' WHERE `entry` IN (17435, 23413, 18725, 19401, 19409, 20235, 25059, 25236, 20903, 20162, 29154, 23415, 27575, 26443, 26949, 23816);
|
UPDATE `creature_template` SET `ScriptName`='npc_taxi' WHERE `entry` IN (17435, 23413, 18725, 19401, 19409, 20235, 25059, 25236, 20903, 20162, 29154, 23415, 27575, 26443, 26949, 23816, 23704);
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_death_knight_initiate' WHERE `entry`=28406;
|
UPDATE `creature_template` SET `ScriptName`='npc_death_knight_initiate' WHERE `entry`=28406;
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_salanar_the_horseman' WHERE `entry` IN (28653, 28788);
|
UPDATE `creature_template` SET `ScriptName`='npc_salanar_the_horseman' WHERE `entry` IN (28653, 28788);
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_dark_rider_of_acherus' WHERE `entry` =28654;
|
UPDATE `creature_template` SET `ScriptName`='npc_dark_rider_of_acherus' WHERE `entry` =28654;
|
||||||
@@ -985,6 +985,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_rotting_forest_rager' WHERE `en
|
|||||||
UPDATE `creature_template` SET `ScriptName`='npc_floon' WHERE `entry`=18588;
|
UPDATE `creature_template` SET `ScriptName`='npc_floon' WHERE `entry`=18588;
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' WHERE `entry`=18760;
|
UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' WHERE `entry`=18760;
|
||||||
UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262;
|
UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262;
|
||||||
|
UPDATE `creature_template` SET `ScriptName`='npc_slim' WHERE `entry`=19679;
|
||||||
|
|
||||||
/* THOUSAND NEEDLES */
|
/* THOUSAND NEEDLES */
|
||||||
UPDATE `creature_template` SET `ScriptName`='npc_swiftmountain' WHERE `entry`=10427;
|
UPDATE `creature_template` SET `ScriptName`='npc_swiftmountain' WHERE `entry`=10427;
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
UPDATE `creature_template` SET `ScriptName`='npc_slim' WHERE `entry`=19679;
|
||||||
|
UPDATE `creature_template` SET `ScriptName`='npc_taxi' WHERE `entry` = 23704;
|
||||||
@@ -20,22 +20,22 @@ void npc_escortAI::AttackStart(Unit *who)
|
|||||||
if (!who)
|
if (!who)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IsBeingEscorted && !Defend)
|
if (IsBeingEscorted && !m_bCanDefendSelf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(m_creature->Attack(who, true) )
|
if(m_creature->Attack(who, true) )
|
||||||
{
|
{
|
||||||
if(CombatMovement)
|
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
|
||||||
{
|
|
||||||
m_creature->GetMotionMaster()->MovementExpired();
|
m_creature->GetMotionMaster()->MovementExpired();
|
||||||
|
|
||||||
|
if(CombatMovement)
|
||||||
m_creature->GetMotionMaster()->MoveChase(who);
|
m_creature->GetMotionMaster()->MoveChase(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void npc_escortAI::MoveInLineOfSight(Unit *who)
|
void npc_escortAI::MoveInLineOfSight(Unit *who)
|
||||||
{
|
{
|
||||||
if (IsBeingEscorted && !Attack)
|
if (IsBeingEscorted && !m_bIsActiveAttacker)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ScriptedAI::MoveInLineOfSight(who);
|
ScriptedAI::MoveInLineOfSight(who);
|
||||||
@@ -47,8 +47,7 @@ void npc_escortAI::JustRespawned()
|
|||||||
IsOnHold = false;
|
IsOnHold = false;
|
||||||
CombatMovement = true;
|
CombatMovement = true;
|
||||||
|
|
||||||
//Re-Enable questgiver flag
|
m_uiWPWaitTimer = 0;
|
||||||
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
@@ -69,7 +68,7 @@ void npc_escortAI::EnterEvadeMode()
|
|||||||
|
|
||||||
if (IsBeingEscorted)
|
if (IsBeingEscorted)
|
||||||
{
|
{
|
||||||
Returning = true;
|
m_bIsReturning = true;
|
||||||
ReturnToLastPoint();
|
ReturnToLastPoint();
|
||||||
debug_log("TSCR: EscortAI has left combat and is now returning to last point");
|
debug_log("TSCR: EscortAI has left combat and is now returning to last point");
|
||||||
}
|
}
|
||||||
@@ -82,35 +81,10 @@ void npc_escortAI::EnterEvadeMode()
|
|||||||
void npc_escortAI::UpdateAI(const uint32 diff)
|
void npc_escortAI::UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
//Waypoint Updating
|
//Waypoint Updating
|
||||||
if (IsBeingEscorted && !m_creature->isInCombat() && WaitTimer && !Returning)
|
if (IsBeingEscorted && !m_creature->getVictim() && m_uiWPWaitTimer && !m_bIsReturning)
|
||||||
{
|
{
|
||||||
if (WaitTimer <= diff)
|
if (m_uiWPWaitTimer <= diff)
|
||||||
{
|
{
|
||||||
if (ReconnectWP)
|
|
||||||
{
|
|
||||||
//Correct movement speed
|
|
||||||
if (bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
|
|
||||||
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
|
||||||
else if (!bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
|
|
||||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
|
||||||
|
|
||||||
//Continue with waypoints
|
|
||||||
if( !IsOnHold )
|
|
||||||
{
|
|
||||||
if (CurrentWP != WaypointList.end())
|
|
||||||
{
|
|
||||||
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
|
|
||||||
debug_log("TSCR: EscortAI Reconnect WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
|
|
||||||
|
|
||||||
WaitTimer = 0;
|
|
||||||
ReconnectWP = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
debug_log("TSCR: EscortAI Reconnected to end of WP list");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//End of the line, Despawn self then immediatly respawn
|
//End of the line, Despawn self then immediatly respawn
|
||||||
if (CurrentWP == WaypointList.end())
|
if (CurrentWP == WaypointList.end())
|
||||||
{
|
{
|
||||||
@@ -119,21 +93,16 @@ void npc_escortAI::UpdateAI(const uint32 diff)
|
|||||||
debug_log("TSCR: EscortAI reached end of waypoints");
|
debug_log("TSCR: EscortAI reached end of waypoints");
|
||||||
|
|
||||||
m_creature->setDeathState(JUST_DIED);
|
m_creature->setDeathState(JUST_DIED);
|
||||||
|
|
||||||
|
//TODO: add option to set instant respawn? Then use db respawn value as default
|
||||||
m_creature->Respawn();
|
m_creature->Respawn();
|
||||||
m_creature->GetMotionMaster()->Clear(true);
|
|
||||||
|
|
||||||
//Restore original NpcFlags
|
|
||||||
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags);
|
|
||||||
|
|
||||||
IsBeingEscorted = false;
|
|
||||||
WaitTimer = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debug_log("TSCR: EscortAI reached end of waypoints with Despawn off");
|
debug_log("TSCR: EscortAI reached end of waypoints with Despawn off");
|
||||||
IsBeingEscorted = false;
|
|
||||||
WaitTimer = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,15 +111,15 @@ void npc_escortAI::UpdateAI(const uint32 diff)
|
|||||||
{
|
{
|
||||||
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
|
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 Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
|
||||||
WaitTimer = 0;
|
m_uiWPWaitTimer = 0;
|
||||||
}
|
}
|
||||||
}else WaitTimer -= diff;
|
}else m_uiWPWaitTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if player or any member of his group is within range
|
//Check if player or any member of his group is within range
|
||||||
if (IsBeingEscorted && PlayerGUID && !m_creature->getVictim() && !m_creature->IsInEvadeMode())
|
if (IsBeingEscorted && PlayerGUID && !m_creature->getVictim() && !m_bIsReturning)
|
||||||
{
|
{
|
||||||
if (PlayerTimer < diff)
|
if (m_uiPlayerCheckTimer < diff)
|
||||||
{
|
{
|
||||||
bool bIsMaxRangeExceeded = true;
|
bool bIsMaxRangeExceeded = true;
|
||||||
|
|
||||||
@@ -178,22 +147,19 @@ void npc_escortAI::UpdateAI(const uint32 diff)
|
|||||||
|
|
||||||
if (DespawnAtFar && bIsMaxRangeExceeded)
|
if (DespawnAtFar && bIsMaxRangeExceeded)
|
||||||
{
|
{
|
||||||
JustDied(m_creature);
|
|
||||||
IsBeingEscorted = false;
|
|
||||||
|
|
||||||
debug_log("TSCR: EscortAI Evaded back to spawn point because player/group was to far away or not found");
|
debug_log("TSCR: EscortAI Evaded back to spawn point because player/group was to far away or not found");
|
||||||
|
|
||||||
|
JustDied(m_creature);
|
||||||
m_creature->setDeathState(JUST_DIED);
|
m_creature->setDeathState(JUST_DIED);
|
||||||
|
|
||||||
//TODO: add option to set instant respawn? Then use db respawn value as default
|
//TODO: add option to set instant respawn? Then use db respawn value as default
|
||||||
m_creature->Respawn();
|
m_creature->Respawn();
|
||||||
|
|
||||||
//Restore original NpcFlags
|
return;
|
||||||
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerTimer = 1000;
|
m_uiPlayerCheckTimer = 1000;
|
||||||
}else PlayerTimer -= diff;
|
}else m_uiPlayerCheckTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CanMelee && UpdateVictim())
|
if(CanMelee && UpdateVictim())
|
||||||
@@ -205,15 +171,20 @@ void npc_escortAI::MovementInform(uint32 type, uint32 id)
|
|||||||
if (type != POINT_MOTION_TYPE || !IsBeingEscorted)
|
if (type != POINT_MOTION_TYPE || !IsBeingEscorted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Original position reached, continue waypoint movement
|
//Combat start position reached, continue waypoint movement
|
||||||
if (id == WP_LAST_POINT)
|
if (id == WP_LAST_POINT)
|
||||||
{
|
{
|
||||||
debug_log("TSCR: EscortAI has returned to original position before combat");
|
debug_log("TSCR: EscortAI has returned to original position before combat");
|
||||||
ReconnectWP = true;
|
|
||||||
Returning = false;
|
|
||||||
|
|
||||||
if(!WaitTimer)
|
if (m_bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
|
||||||
WaitTimer = 1;
|
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
|
else if (!m_bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
|
||||||
|
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
|
|
||||||
|
m_bIsReturning = false;
|
||||||
|
|
||||||
|
if (!m_uiWPWaitTimer)
|
||||||
|
m_uiWPWaitTimer = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -229,7 +200,7 @@ void npc_escortAI::MovementInform(uint32 type, uint32 id)
|
|||||||
//Call WP function
|
//Call WP function
|
||||||
WaypointReached(CurrentWP->id);
|
WaypointReached(CurrentWP->id);
|
||||||
|
|
||||||
WaitTimer = CurrentWP->WaitTimeMs + 1;
|
m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1;
|
||||||
|
|
||||||
++CurrentWP;
|
++CurrentWP;
|
||||||
}
|
}
|
||||||
@@ -281,24 +252,24 @@ void npc_escortAI::SetRun(bool bRun)
|
|||||||
{
|
{
|
||||||
if (bRun)
|
if (bRun)
|
||||||
{
|
{
|
||||||
if (!bIsRunning)
|
if (!m_bIsRunning)
|
||||||
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
else
|
else
|
||||||
debug_log("TSCR: EscortAI attempt to set run mode, but is already running.");
|
debug_log("TSCR: EscortAI attempt to set run mode, but is already running.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bIsRunning)
|
if (m_bIsRunning)
|
||||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
else
|
else
|
||||||
debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking.");
|
debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking.");
|
||||||
}
|
}
|
||||||
bIsRunning = bRun;
|
m_bIsRunning = bRun;
|
||||||
}
|
}
|
||||||
|
|
||||||
void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
|
void npc_escortAI::Start(bool bIsActiveAttacker, bool bCanDefendSelf, bool bRun, uint64 uiPlayerGUID)
|
||||||
{
|
{
|
||||||
if (m_creature->isInCombat())
|
if (m_creature->getVictim())
|
||||||
{
|
{
|
||||||
debug_log("TSCR ERROR: EscortAI attempt to Start while in combat");
|
debug_log("TSCR ERROR: EscortAI attempt to Start while in combat");
|
||||||
return;
|
return;
|
||||||
@@ -323,24 +294,20 @@ void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
|
|||||||
debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
|
debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Attack = bAttack;
|
m_bIsActiveAttacker = bIsActiveAttacker;
|
||||||
Defend = bDefend;
|
m_bCanDefendSelf = bCanDefendSelf;
|
||||||
bIsRunning = bRun;
|
m_bIsRunning = bRun;
|
||||||
PlayerGUID = pGUID;
|
PlayerGUID = uiPlayerGUID;
|
||||||
|
|
||||||
//store original NpcFlags
|
//disable npcflags
|
||||||
m_uiNpcFlags = m_creature->GetUInt32Value(UNIT_NPC_FLAGS);
|
|
||||||
|
|
||||||
//remove them if any
|
|
||||||
if (m_uiNpcFlags)
|
|
||||||
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||||
|
|
||||||
debug_log("TSCR: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, bIsRunning, PlayerGUID);
|
debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bCanDefendSelf, m_bIsRunning, PlayerGUID);
|
||||||
|
|
||||||
CurrentWP = WaypointList.begin();
|
CurrentWP = WaypointList.begin();
|
||||||
|
|
||||||
//Set initial speed
|
//Set initial speed
|
||||||
if (bIsRunning)
|
if (m_bIsRunning)
|
||||||
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
else
|
else
|
||||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
@@ -349,8 +316,4 @@ void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
|
|||||||
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
|
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
|
||||||
debug_log("TSCR: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
|
debug_log("TSCR: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
|
||||||
IsBeingEscorted = true;
|
IsBeingEscorted = true;
|
||||||
ReconnectWP = false;
|
|
||||||
Returning = false;
|
|
||||||
IsOnHold = false;
|
|
||||||
CombatMovement = true;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,14 +30,15 @@ struct Escort_Waypoint
|
|||||||
struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
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(0),
|
||||||
|
m_bIsReturning(false), m_bIsActiveAttacker(true), m_bCanDefendSelf(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true) {}
|
||||||
|
~npc_escortAI() {}
|
||||||
|
|
||||||
// Pure Virtual Functions
|
// Pure Virtual Functions
|
||||||
virtual void WaypointReached(uint32) = 0;
|
virtual void WaypointReached(uint32) = 0;
|
||||||
|
|
||||||
// CreatureAI functions
|
// CreatureAI functions
|
||||||
npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), DespawnAtEnd(true), DespawnAtFar(true)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void AttackStart(Unit* who);
|
void AttackStart(Unit* who);
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit* who);
|
void MoveInLineOfSight(Unit* who);
|
||||||
@@ -57,7 +58,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
|||||||
|
|
||||||
void FillPointMovementListForCreature();
|
void FillPointMovementListForCreature();
|
||||||
|
|
||||||
void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
|
void Start(bool bIsActiveAttacker = true, bool bCanDefendSelf = true, bool bRun = false, uint64 uiPlayerGUID = 0);
|
||||||
void SetRun(bool bRun = true);
|
void SetRun(bool bRun = true);
|
||||||
|
|
||||||
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
|
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
|
||||||
@@ -68,11 +69,11 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
|||||||
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
|
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
|
||||||
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
|
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
|
||||||
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
||||||
bool GetAttack() { return Attack; }//used in EnterEvadeMode override
|
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
|
||||||
bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override
|
bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override
|
||||||
void SetReturning(bool returning) { Returning = returning; }//used in EnterEvadeMode override
|
void SetReturning(bool returning) { m_bIsReturning = returning; }//used in EnterEvadeMode override
|
||||||
void SetCanAttack(bool attack) { Attack = attack; }
|
void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; }
|
||||||
void SetCanDefend(bool defend) { Defend = defend; }
|
void SetCanDefend(bool defend) { m_bCanDefendSelf = defend; }
|
||||||
uint64 GetEventStarterGUID() { return PlayerGUID; }
|
uint64 GetEventStarterGUID() { return PlayerGUID; }
|
||||||
|
|
||||||
// EscortAI variables
|
// EscortAI variables
|
||||||
@@ -82,19 +83,17 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
|||||||
bool IsOnHold;
|
bool IsOnHold;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 WaitTimer;
|
uint32 m_uiWPWaitTimer;
|
||||||
uint32 PlayerTimer;
|
uint32 m_uiPlayerCheckTimer;
|
||||||
uint32 m_uiNpcFlags;
|
|
||||||
float MaxPlayerDistance;
|
float MaxPlayerDistance;
|
||||||
|
|
||||||
std::list<Escort_Waypoint> WaypointList;
|
std::list<Escort_Waypoint> WaypointList;
|
||||||
std::list<Escort_Waypoint>::iterator CurrentWP;
|
std::list<Escort_Waypoint>::iterator CurrentWP;
|
||||||
|
|
||||||
bool Attack;
|
bool m_bIsActiveAttacker; //possible obsolete, and should be determined with db only (civilian)
|
||||||
bool Defend;
|
bool m_bCanDefendSelf; //rarely used, is true in 99%
|
||||||
bool Returning;
|
bool m_bIsReturning; //in use when creature leave combat, and are returning to combat start position
|
||||||
bool ReconnectWP;
|
bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK)
|
||||||
bool bIsRunning;
|
|
||||||
bool CanMelee;
|
bool CanMelee;
|
||||||
bool DespawnAtEnd;
|
bool DespawnAtEnd;
|
||||||
bool DespawnAtFar;
|
bool DespawnAtFar;
|
||||||
|
|||||||
@@ -123,6 +123,10 @@ bool GossipHello_npc_taxi(Player *player, Creature *_Creature)
|
|||||||
if (player->GetQuestStatus(11170) == QUEST_STATUS_INCOMPLETE)
|
if (player->GetQuestStatus(11170) == QUEST_STATUS_INCOMPLETE)
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need to commandeer a riding bat for special assignment for us.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need to commandeer a riding bat for special assignment for us.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
|
||||||
break;
|
break;
|
||||||
|
case 23704: // Dustwallow Marsh - Cassa Crimsonwing
|
||||||
|
if (player->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE)
|
||||||
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,"<Ride the gryphons to Survey Alcaz Island>",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+25);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
|
||||||
@@ -237,6 +241,10 @@ bool GossipSelect_npc_taxi(Player *player, Creature *_Creature, uint32 sender, u
|
|||||||
player->CLOSE_GOSSIP_MENU();
|
player->CLOSE_GOSSIP_MENU();
|
||||||
player->ActivateTaxiPathTo(738);
|
player->ActivateTaxiPathTo(738);
|
||||||
break;
|
break;
|
||||||
|
case GOSSIP_ACTION_INFO_DEF + 25:
|
||||||
|
player->CLOSE_GOSSIP_MENU();
|
||||||
|
player->CastSpell(player,42295,true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ mob_rotting_forest_rager
|
|||||||
mob_netherweb_victim
|
mob_netherweb_victim
|
||||||
npc_floon
|
npc_floon
|
||||||
npc_isla_starmane
|
npc_isla_starmane
|
||||||
|
npc_slim
|
||||||
EndContentData */
|
EndContentData */
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
@@ -582,6 +583,36 @@ bool GossipSelect_go_skull_pile(Player *player, GameObject* _GO, uint32 sender,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*######
|
||||||
|
## npc_slim
|
||||||
|
######*/
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
FACTION_CONSORTIUM = 933
|
||||||
|
};
|
||||||
|
|
||||||
|
bool GossipHello_npc_slim(Player* pPlayer, Creature* pCreature)
|
||||||
|
{
|
||||||
|
if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
|
||||||
|
{
|
||||||
|
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||||
|
pPlayer->SEND_GOSSIP_MENU(9896, pCreature->GetGUID());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pPlayer->SEND_GOSSIP_MENU(9895, pCreature->GetGUID());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GossipSelect_npc_slim(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||||
|
{
|
||||||
|
if (uiAction == GOSSIP_ACTION_TRADE)
|
||||||
|
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void AddSC_terokkar_forest()
|
void AddSC_terokkar_forest()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
@@ -630,5 +661,10 @@ void AddSC_terokkar_forest()
|
|||||||
newscript->GetAI = &GetAI_npc_skywingAI;
|
newscript->GetAI = &GetAI_npc_skywingAI;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
|
newscript = new Script;
|
||||||
|
newscript->Name = "npc_slim";
|
||||||
|
newscript->pGossipHello = &GossipHello_npc_slim;
|
||||||
|
newscript->pGossipSelect = &GossipSelect_npc_slim;
|
||||||
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user