mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Scripts/FollowerAI: Some cleanup:
- FollowerAI properly resumes follow after evading. - Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing - FollowerAI properly assists in combat. - FollowerAI properly despawns if quest is abandoned. - FollowerAI now supports dynamic respawning for escort NPCs.
This commit is contained in:
@@ -161,7 +161,7 @@ public:
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
Talk(SAY_KER_START, player);
|
||||
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
|
||||
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, QUEST_SLEEPER_AWAKENED);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -326,7 +326,7 @@ public:
|
||||
if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
|
||||
{
|
||||
Player* player = GetLeaderForFollower();
|
||||
if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
|
||||
if (player)
|
||||
player->GroupEventHappens(QUEST_TOOGA, me);
|
||||
|
||||
TortaGUID = who->GetGUID();
|
||||
@@ -339,10 +339,7 @@ public:
|
||||
{
|
||||
FollowerAI::MovementInform(MotionType, PointId);
|
||||
|
||||
if (MotionType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (PointId == POINT_ID_TO_WATER)
|
||||
if ((MotionType == POINT_MOTION_TYPE) && (PointId == POINT_ID_TO_WATER))
|
||||
SetFollowComplete();
|
||||
}
|
||||
|
||||
@@ -416,7 +413,7 @@ public:
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TOOGA)
|
||||
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
|
||||
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, QUEST_TOOGA);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
if (quest->GetQuestId() == QUEST_A_LITTLE_HELP)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
|
||||
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, QUEST_A_LITTLE_HELP);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user