All pastes #881505 Raw Edit

Mine

public text v1 · immutable
#881505 ·published 2008-01-29 23:27 UTC
rendered paste body
Index: src/game/GossipDef.cpp
===================================================================
--- src/game/GossipDef.cpp	(revision 5102)
+++ src/game/GossipDef.cpp	(working copy)
@@ -482,11 +482,21 @@
 
     data << uint32(pQuest->GetType());
     data << uint32(pQuest->GetSuggestedPlayers());
-    data << uint32(pQuest->GetRequiredMinRepFaction());
-    data << uint32(pQuest->GetRequiredMinRepValue());
-    data << uint32(pQuest->GetRequiredMaxRepFaction());
-    data << uint32(pQuest->GetRequiredMaxRepValue());
 
+    if(pQuest->HasFlag(QUEST_MANGOS_FLAGS_REPUTATION_REQ))  // don't send data to client when it's a server side restriction only
+    {
+        data << uint32(0);
+        data << uint32(0);
+    }
+    else                                                    // ok to send to client when part of quest objective
+    {
+        data << uint32(pQuest->GetRequiredMinRepFaction());
+        data << uint32(pQuest->GetRequiredMinRepValue());
+    }
+
+    data << uint32(pQuest->GetRequiredMaxRepFaction());     // why do we send this?
+    data << uint32(pQuest->GetRequiredMaxRepValue());       // why do we send this?
+
     data << uint32(pQuest->GetNextQuestInChain());
     data << uint32(pQuest->GetRewOrReqMoney());
     data << uint32(pQuest->GetRewMoneyMaxLevel());
Index: src/game/ObjectMgr.cpp
===================================================================
--- src/game/ObjectMgr.cpp	(revision 5102)
+++ src/game/ObjectMgr.cpp	(working copy)
@@ -2221,7 +2221,7 @@
 
         if (qinfo->QuestFlags & ~QUEST_MANGOS_FLAGS_DB_ALLOWED)
         {
-            sLog.outErrorDb("Quest %u has `QuestFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
+            sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
                 qinfo->GetQuestId(),qinfo->QuestFlags,QUEST_MANGOS_FLAGS_DB_ALLOWED >> 16);
             qinfo->QuestFlags &= QUEST_MANGOS_FLAGS_DB_ALLOWED;
         }
@@ -2300,6 +2300,20 @@
             // no changes, quest can't be done for this requirement
         }
 
+        if(!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue > 0 )
+        {
+            sLog.outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
+                qinfo->GetQuestId(),qinfo->RequiredMinRepValue);
+            // warning
+        }
+
+        if(!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue > 0 )
+        {
+            sLog.outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
+                qinfo->GetQuestId(),qinfo->RequiredMaxRepValue);
+            // warning
+        }
+
         if(qinfo->SrcItemId)
         {
             if(!sItemStorage.LookupEntry<ItemPrototype>(qinfo->SrcItemId))
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp	(revision 5102)
+++ src/game/Player.cpp	(working copy)
@@ -11488,7 +11488,7 @@
 bool Player::SatisfyQuestReputation( Quest const* qInfo, bool msg )
 {
     uint32 fIdMin = qInfo->GetRequiredMinRepFaction();      //Min required rep
-    if(fIdMin && GetReputation(fIdMin) < qInfo->GetRequiredMinRepValue())
+    if(fIdMin && GetReputation(fIdMin) < qInfo->GetRequiredMinRepValue() && qInfo->HasFlag(QUEST_MANGOS_FLAGS_REPUTATION_REQ))
     {
         if( msg )
             SendCanTakeQuestResponse( INVALIDREASON_DONT_HAVE_REQ );
Index: src/game/QuestDef.h
===================================================================
--- src/game/QuestDef.h	(revision 5102)
+++ src/game/QuestDef.h	(working copy)
@@ -132,13 +132,15 @@
     // Mangos flags for set SpecialFlags in DB if required but used only at server
     QUEST_MANGOS_FLAGS_REPEATABLE           = 0x010000,     // Set by 1 in SpecialFlags from DB
     QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x020000,     // Set by 2 in SpecialFlags from DB (if reequired area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL)
-    QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT,
 
     // Mangos flags for internal use only
     QUEST_MANGOS_FLAGS_DELIVER              = 0x040000,     // Internal flag computed only
     QUEST_MANGOS_FLAGS_SPEAKTO              = 0x080000,     // Internal flag computed only
     QUEST_MANGOS_FLAGS_KILL_OR_CAST         = 0x100000,     // Internal flag computed only
     QUEST_MANGOS_FLAGS_TIMED                = 0x200000,     // Internal flag computed only
+    QUEST_MANGOS_FLAGS_REPUTATION_REQ       = 0x400000,     // Set by 64 in SpecialFlags (NOT objective of quest, if objective, no flag is set and data are sent to client)
+
+    QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT | QUEST_MANGOS_FLAGS_REPUTATION_REQ,
 };
 
 struct QuestLocale