mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10633] Correct behavior for completion of quest objectives.
Rename related function to SendQuestCompleteEvent for clarification of when it's expected to be used. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
8886b86a2b
commit
bf2b256720
3 changed files with 14 additions and 9 deletions
|
|
@ -13574,8 +13574,6 @@ void Player::CompleteQuest(uint32 quest_id)
|
||||||
{
|
{
|
||||||
if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED))
|
if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED))
|
||||||
RewardQuest(qInfo, 0, this, false);
|
RewardQuest(qInfo, 0, this, false);
|
||||||
else
|
|
||||||
SendQuestComplete(quest_id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14312,7 +14310,10 @@ void Player::AreaExploredOrEventHappens( uint32 questId )
|
||||||
|
|
||||||
if(!q_status.m_explored)
|
if(!q_status.m_explored)
|
||||||
{
|
{
|
||||||
|
SetQuestSlotState(log_slot, QUEST_STATE_COMPLETE);
|
||||||
|
SendQuestCompleteEvent(questId);
|
||||||
q_status.m_explored = true;
|
q_status.m_explored = true;
|
||||||
|
|
||||||
if (q_status.uState != QUEST_NEW)
|
if (q_status.uState != QUEST_NEW)
|
||||||
q_status.uState = QUEST_CHANGED;
|
q_status.uState = QUEST_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
@ -14732,14 +14733,15 @@ bool Player::HasQuestForItem( uint32 itemid ) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SendQuestComplete( uint32 quest_id )
|
// Used for quests having some event (explore, escort, "external event") as quest objective.
|
||||||
|
void Player::SendQuestCompleteEvent(uint32 quest_id)
|
||||||
{
|
{
|
||||||
if( quest_id )
|
if (quest_id)
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_QUESTUPDATE_COMPLETE, 4 );
|
WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4);
|
||||||
data << uint32(quest_id);
|
data << uint32(quest_id);
|
||||||
GetSession()->SendPacket( &data );
|
GetSession()->SendPacket(&data);
|
||||||
DEBUG_LOG( "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id );
|
DEBUG_LOG("WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16174,6 +16176,9 @@ void Player::_LoadQuestStatus(QueryResult *result)
|
||||||
{
|
{
|
||||||
SetQuestSlot(slot, quest_id, uint32(quest_time));
|
SetQuestSlot(slot, quest_id, uint32(quest_time));
|
||||||
|
|
||||||
|
if (questStatusData.m_explored)
|
||||||
|
SetQuestSlotState(slot, QUEST_STATE_COMPLETE);
|
||||||
|
|
||||||
if (questStatusData.m_status == QUEST_STATUS_COMPLETE)
|
if (questStatusData.m_status == QUEST_STATUS_COMPLETE)
|
||||||
SetQuestSlotState(slot, QUEST_STATE_COMPLETE);
|
SetQuestSlotState(slot, QUEST_STATE_COMPLETE);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1497,7 +1497,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void UpdateForQuestWorldObjects();
|
void UpdateForQuestWorldObjects();
|
||||||
bool CanShareQuest(uint32 quest_id) const;
|
bool CanShareQuest(uint32 quest_id) const;
|
||||||
|
|
||||||
void SendQuestComplete( uint32 quest_id );
|
void SendQuestCompleteEvent(uint32 quest_id);
|
||||||
void SendQuestReward( Quest const *pQuest, uint32 XP, Object* questGiver );
|
void SendQuestReward( Quest const *pQuest, uint32 XP, Object* questGiver );
|
||||||
void SendQuestFailed( uint32 quest_id );
|
void SendQuestFailed( uint32 quest_id );
|
||||||
void SendQuestTimerFailed( uint32 quest_id );
|
void SendQuestTimerFailed( uint32 quest_id );
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10632"
|
#define REVISION_NR "10633"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue