Permalink
Browse files

[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!
  • Loading branch information...
1 parent e73cd17 commit fcdfa6d5c5ee339323f70cd7df09855fc5c4adbb @Schmoozerd Schmoozerd committed Aug 12, 2015
Showing with 26 additions and 24 deletions.
  1. +7 −1 base/escort_ai.cpp
  2. +1 −0 base/escort_ai.h
  3. +17 −22 scripts/eastern_kingdoms/wetlands.cpp
  4. +1 −1 sd2_revision_nr.h
View
@@ -227,9 +227,15 @@ void npc_escortAI::UpdateEscortAI(const uint32 /*uiDiff*/)
DoMeleeAttackIfReady();
}
+/// Helper function for transition between old Escort Movment and using WaypointMMGen
+bool npc_escortAI::IsSD2EscortMovement(uint32 uiMoveType) const
+{
+ return uiMoveType >= EXTERNAL_WAYPOINT_MOVE;
+}
+
void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
{
- if (uiMoveType < EXTERNAL_WAYPOINT_MOVE || !HasEscortState(STATE_ESCORT_ESCORTING))
+ if (!IsSD2EscortMovement(uiMoveType) || !HasEscortState(STATE_ESCORT_ESCORTING))
return;
//uint32 pathId = uiMoveType & 0xFF;
View
@@ -57,6 +57,7 @@ struct npc_escortAI : public ScriptedAI
protected:
Player* GetPlayerForEscort() { return m_creature->GetMap()->GetPlayer(m_playerGuid); }
+ bool IsSD2EscortMovement(uint32 uiMoveType) const;
virtual void JustStartedEscort() {}
private:
@@ -40,7 +40,7 @@ enum
SAY_FRIEND_DEFEAT = -1000979,
SAY_SLIM_NOTES = -1000980,
- QUEST_MISSING_DIPLO_PT11 = 1249,
+ QUEST_MISSING_DIPLOMAT11 = 1249,
FACTION_ENEMY = 168, // ToDo: faction needs to be confirmed!
SPELL_STEALTH = 1785,
@@ -54,7 +54,7 @@ static const DialogueEntry aDiplomatDialogue[] =
{
{SAY_SLIM_DEFEAT, NPC_TAPOKE_SLIM_JAHN, 4000},
{SAY_SLIM_NOTES, NPC_TAPOKE_SLIM_JAHN, 7000},
- {QUEST_MISSING_DIPLO_PT11, 0, 0},
+ {QUEST_MISSING_DIPLOMAT11, 0, 0},
{0, 0, 0},
};
@@ -78,6 +78,18 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI, private DialogueHelper
}
}
+ void JustReachedHome() override
+ {
+ // after the npc is defeated, start the dialog right after it reaches the evade point
+ if (m_bEventComplete)
+ {
+ if (Player* pPlayer = GetPlayerForEscort())
+ m_creature->SetFacingToObject(pPlayer);
+
+ StartNextDialogueText(SAY_SLIM_DEFEAT);
+ }
+ }
+
void WaypointReached(uint32 uiPointId) override
{
switch (uiPointId)
@@ -137,23 +149,6 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI, private DialogueHelper
}
}
- void MovementInform(uint32 uiMoveType, uint32 uiPointId) override
- {
- if (uiMoveType != POINT_MOTION_TYPE || !HasEscortState(STATE_ESCORT_ESCORTING))
- return;
-
- npc_escortAI::MovementInform(uiMoveType, uiPointId);
-
- // after the npc is defeated, start the dialog right after it reaches the evade point
- if (m_bEventComplete)
- {
- if (Player* pPlayer = GetPlayerForEscort())
- m_creature->SetFacingToObject(pPlayer);
-
- StartNextDialogueText(SAY_SLIM_DEFEAT);
- }
- }
-
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override
{
// start escort
@@ -163,11 +158,11 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI, private DialogueHelper
void JustDidDialogueStep(int32 iEntry) override
{
- if (iEntry == QUEST_MISSING_DIPLO_PT11)
+ if (iEntry == QUEST_MISSING_DIPLOMAT11)
{
// complete quest
if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature);
+ pPlayer->GroupEventHappens(QUEST_MISSING_DIPLOMAT11, m_creature);
// despawn and respawn at inn
m_creature->ForcedDespawn(1000);
@@ -205,7 +200,7 @@ CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature)
bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
- if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11)
+ if (pQuest->GetQuestId() == QUEST_MISSING_DIPLOMAT11)
{
Creature* pSlim = GetClosestCreatureWithEntry(pCreature, NPC_TAPOKE_SLIM_JAHN, 25.0f);
if (!pSlim)
View
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
- #define SD2_REVISION_NR "3149"
+ #define SD2_REVISION_NR "3150"
#endif // __SD2_REVISION_NR_H__

0 comments on commit fcdfa6d

Please sign in to comment.