diff options
author | Brian <runningnak3d@gmail.com> | 2009-12-20 16:51:41 -0700 |
---|---|---|
committer | Brian <runningnak3d@gmail.com> | 2009-12-20 16:51:41 -0700 |
commit | c4ac6323b0bb4eb9f4f1729ce2a63ab1a8ebd523 (patch) | |
tree | dcd9ed61403d11cad7482aac0220b15587411e23 /src/game/Player.cpp | |
parent | 8a5df265c2d3e9e47464f172dd3d79efba748686 (diff) |
* Added support for RepObjectiveFaction2 / RepObjectiveValue2 (opposite
* faction) IE: need to LOSE reputation with that faction.
* Original patch by Brian / Ported to latest rev. by Kudlaty -- THANKS!
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 36 |
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) |