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:
Treeston
2019-08-01 18:32:26 +02:00
parent 3ffe570b21
commit 3d4bebd8d9
12 changed files with 77 additions and 145 deletions

View File

@@ -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);
}
}
};

View File

@@ -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);
}
};

View File

@@ -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);
}
}
};