aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index fdcc92703eb..c7cbcbd05c3 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13422,6 +13422,10 @@ bool Player::CanCompleteQuest( uint32 quest_id )
if ( repFacId && GetReputationMgr().GetReputation(repFacId) < qInfo->GetRepObjectiveValue() )
return false;
+ uint32 repFacId2 = qInfo->GetRepObjectiveFaction2();
+ if ( repFacId2 && GetReputationMgr().GetReputation(repFacId) < qInfo->GetRepObjectiveValue2() )
+ return false;
+
return true;
}
}
@@ -13556,6 +13560,10 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
if(FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->GetRepObjectiveFaction()))
GetReputationMgr().SetVisible(factionEntry);
+ if( pQuest->GetRepObjectiveFaction2() )
+ if(FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->GetRepObjectiveFaction2()))
+ GetReputationMgr().SetVisible(factionEntry);
+
uint32 qtime = 0;
if( pQuest->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) )
{
@@ -14716,6 +14724,34 @@ void Player::ReputationChanged(FactionEntry const* factionEntry)
}
}
+void Player::ReputationChanged2(FactionEntry const* factionEntry)
+{
+ for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
+ {
+ if(uint32 questid = GetQuestSlotQuestId(i))
+ {
+ if (Quest const* qInfo = objmgr.GetQuestTemplate(questid))
+ {
+ if (qInfo->GetRepObjectiveFaction2() == factionEntry->ID)
+ {
+ QuestStatusData& q_status = mQuestStatus[questid];
+ if (q_status.m_status == QUEST_STATUS_INCOMPLETE)
+ {
+ if (GetReputationMgr().GetReputation(factionEntry) >= qInfo->GetRepObjectiveValue2())
+ if (CanCompleteQuest(questid))
+ CompleteQuest(questid);
+ }
+ else if(q_status.m_status == QUEST_STATUS_COMPLETE)
+ {
+ if (GetReputationMgr().GetReputation(factionEntry) < qInfo->GetRepObjectiveValue2())
+ IncompleteQuest(questid);
+ }
+ }
+ }
+ }
+ }
+}
+
bool Player::HasQuestForItem(uint32 itemid) const
{
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)