Jump to content

[patch][5647] Check If Quest Can Complete When Gaining Reputation


Guest NoFantasy

Recommended Posts

Bug: When reputation with faction is objective of quest, quest will not complete when reaching the required value (example: qId 1385).

Patch: Tested for rev 5491/5538. Patch will check if any quests can be completed when gaining reputation with any faction.

Who: NoFantasy

Info: Unsure if this is correct place to do this check.

Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp        (revision 5538)
+++ src/game/Player.cpp        (working copy)
@@ -5379,7 +5379,34 @@
                itr->second.Flags |= FACTION_FLAG_VISIBLE;
                itr->second.Changed = true;

+                uint32 questid;
+                for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+                {
+                        questid = GetUInt32Value(PLAYER_QUEST_LOG_1_1 + 3*i);
+                        if ( questid != 0 )
+                        {
+                                Quest const* qInfo = objmgr.GetQuestTemplate(questid);
+                                if( qInfo && qInfo->GetRepObjectiveFaction() == factionEntry->ID )
+                                {
+                                        if( mQuestStatus[questid].m_status == QUEST_STATUS_INCOMPLETE )
+                                        {
+                                                if(GetReputation(factionEntry) >= qInfo->GetRepObjectiveValue())
+                                                {
+                                                        if ( CanCompleteQuest( questid ) )
+                                                                CompleteQuest( questid );
+                                                }
+                                        }
+                                        else if( mQuestStatus[questid].m_status == QUEST_STATUS_COMPLETE )
+                                        {
+                                                if(GetReputation(factionEntry) < qInfo->GetRepObjectiveValue())
+                                                        IncompleteQuest( questid );
+                                        }
+                                }
+                        }
+                }
+
                SendSetFactionStanding(&(itr->second));
+
                return true;
        }
        return false;

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use