Skip to content

Commit fcdfa6d

Browse files
committed
[3150] Fix quest 1249, the missing diplo_pt11
Sidenote: Due to changes in escortAI, checking for motion-tpye in MovementInform must be checked in every case. Added wrapper for this to be prepared for easier transition Also note that when Reaching the COMBAT_START point for escortAI will no more trigger MovementInform. Thanks to xfurry for researching, as well as zimms in unified-db/Database~74 for reporting and all others who contributed to the problem research!
1 parent e73cd17 commit fcdfa6d

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

base/escort_ai.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,15 @@ void npc_escortAI::UpdateEscortAI(const uint32 /*uiDiff*/)
227227
DoMeleeAttackIfReady();
228228
}
229229

230+
/// Helper function for transition between old Escort Movment and using WaypointMMGen
231+
bool npc_escortAI::IsSD2EscortMovement(uint32 uiMoveType) const
232+
{
233+
return uiMoveType >= EXTERNAL_WAYPOINT_MOVE;
234+
}
235+
230236
void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
231237
{
232-
if (uiMoveType < EXTERNAL_WAYPOINT_MOVE || !HasEscortState(STATE_ESCORT_ESCORTING))
238+
if (!IsSD2EscortMovement(uiMoveType) || !HasEscortState(STATE_ESCORT_ESCORTING))
233239
return;
234240

235241
//uint32 pathId = uiMoveType & 0xFF;

base/escort_ai.h

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct npc_escortAI : public ScriptedAI
5757

5858
protected:
5959
Player* GetPlayerForEscort() { return m_creature->GetMap()->GetPlayer(m_playerGuid); }
60+
bool IsSD2EscortMovement(uint32 uiMoveType) const;
6061
virtual void JustStartedEscort() {}
6162

6263
private:

scripts/eastern_kingdoms/wetlands.cpp

+17-22
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum
4040
SAY_FRIEND_DEFEAT = -1000979,
4141
SAY_SLIM_NOTES = -1000980,
4242

43-
QUEST_MISSING_DIPLO_PT11 = 1249,
43+
QUEST_MISSING_DIPLOMAT11 = 1249,
4444
FACTION_ENEMY = 168, // ToDo: faction needs to be confirmed!
4545

4646
SPELL_STEALTH = 1785,
@@ -54,7 +54,7 @@ static const DialogueEntry aDiplomatDialogue[] =
5454
{
5555
{SAY_SLIM_DEFEAT, NPC_TAPOKE_SLIM_JAHN, 4000},
5656
{SAY_SLIM_NOTES, NPC_TAPOKE_SLIM_JAHN, 7000},
57-
{QUEST_MISSING_DIPLO_PT11, 0, 0},
57+
{QUEST_MISSING_DIPLOMAT11, 0, 0},
5858
{0, 0, 0},
5959
};
6060

@@ -78,6 +78,18 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI, private DialogueHelper
7878
}
7979
}
8080

81+
void JustReachedHome() override
82+
{
83+
// after the npc is defeated, start the dialog right after it reaches the evade point
84+
if (m_bEventComplete)
85+
{
86+
if (Player* pPlayer = GetPlayerForEscort())
87+
m_creature->SetFacingToObject(pPlayer);
88+
89+
StartNextDialogueText(SAY_SLIM_DEFEAT);
90+
}
91+
}
92+
8193
void WaypointReached(uint32 uiPointId) override
8294
{
8395
switch (uiPointId)
@@ -137,23 +149,6 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI, private DialogueHelper
137149
}
138150
}
139151

140-
void MovementInform(uint32 uiMoveType, uint32 uiPointId) override
141-
{
142-
if (uiMoveType != POINT_MOTION_TYPE || !HasEscortState(STATE_ESCORT_ESCORTING))
143-
return;
144-
145-
npc_escortAI::MovementInform(uiMoveType, uiPointId);
146-
147-
// after the npc is defeated, start the dialog right after it reaches the evade point
148-
if (m_bEventComplete)
149-
{
150-
if (Player* pPlayer = GetPlayerForEscort())
151-
m_creature->SetFacingToObject(pPlayer);
152-
153-
StartNextDialogueText(SAY_SLIM_DEFEAT);
154-
}
155-
}
156-
157152
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override
158153
{
159154
// start escort
@@ -163,11 +158,11 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI, private DialogueHelper
163158

164159
void JustDidDialogueStep(int32 iEntry) override
165160
{
166-
if (iEntry == QUEST_MISSING_DIPLO_PT11)
161+
if (iEntry == QUEST_MISSING_DIPLOMAT11)
167162
{
168163
// complete quest
169164
if (Player* pPlayer = GetPlayerForEscort())
170-
pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature);
165+
pPlayer->GroupEventHappens(QUEST_MISSING_DIPLOMAT11, m_creature);
171166

172167
// despawn and respawn at inn
173168
m_creature->ForcedDespawn(1000);
@@ -205,7 +200,7 @@ CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature)
205200

206201
bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
207202
{
208-
if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11)
203+
if (pQuest->GetQuestId() == QUEST_MISSING_DIPLOMAT11)
209204
{
210205
Creature* pSlim = GetClosestCreatureWithEntry(pCreature, NPC_TAPOKE_SLIM_JAHN, 25.0f);
211206
if (!pSlim)

sd2_revision_nr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "3149"
3+
#define SD2_REVISION_NR "3150"
44
#endif // __SD2_REVISION_NR_H__

0 commit comments

Comments
 (0)