All pastes #675964 Raw Edit

MaxRep

public diff v1 · immutable
#675964 ·published 2007-08-30 17:32 UTC
rendered paste body
Index: sql/mangos.sql===================================================================--- sql/mangos.sql	(revision 4416)+++ sql/mangos.sql	(working copy)@@ -9673,8 +9673,10 @@   `Type` int(11) unsigned NOT NULL default '0',   `RequiredRaces` int(11) unsigned NOT NULL default '0',   `RequiredSkillValue` int(11) unsigned NOT NULL default '1',-  `RequiredRepFaction` int(11) unsigned NOT NULL default '0',-  `RequiredRepValue` int(11) unsigned NOT NULL default '0',+  `RequiredMinRepFaction` int(10) unsigned NOT NULL default '0',+  `RequiredMinRepValue` int(10) NOT NULL default '0',+  `RequiredMaxRepFaction` int(10) unsigned NOT NULL default '0',+  `RequiredMaxRepValue` int(10) NOT NULL default '0',   `SuggestedPlayers` int(11) unsigned NOT NULL default '0',   `LimitTime` int(11) unsigned NOT NULL default '0',   `SpecialFlags` int(11) unsigned NOT NULL default '0',Index: sql/updates/4417_quest_template.sql===================================================================--- sql/updates/4417_quest_template.sql	(revision 0)+++ sql/updates/4417_quest_template.sql	(revision 0)@@ -0,0 +1,4 @@+ALTER TABLE `quest_template` CHANGE `RequiredRepFaction` `RequiredMinRepFaction` int(10) unsigned NOT NULL default '0';+ALTER TABLE `quest_template` CHANGE `RequiredRepValue` `RequiredMinRepValue` int(10) NOT NULL default '0';+ALTER TABLE `quest_template` ADD `RequiredMaxRepFaction` int(10) unsigned NOT NULL default '0' AFTER `RequiredMinRepValue` ;+ALTER TABLE `quest_template` ADD `RequiredMaxRepValue` int(10) NOT NULL default '0' AFTER `RequiredMaxRepFaction` ;Index: src/game/GossipDef.cpp===================================================================--- src/game/GossipDef.cpp	(revision 4416)+++ src/game/GossipDef.cpp	(working copy)@@ -379,10 +379,12 @@      data << uint32(pQuest->GetType());     data << uint32(pQuest->GetSuggestedPlayers());-    data << uint32(pQuest->GetRequiredRepFaction());-    data << uint32(pQuest->GetRequiredRepValue());-    data << uint32(0);                                      // reputation related (faction)-    data << uint32(0);                                      // reputation related (value)+    data << uint32(pQuest->GetRequiredMinRepFaction());+    data << uint32(pQuest->GetRequiredMinRepValue());+	   data << uint32(pQuest->GetRequiredMaxRepFaction());+    data << uint32(pQuest->GetRequiredMaxRepValue());+    //data << uint32(0);                                      // reputation related (faction)+    //data << uint32(0);                                      // reputation related (value)      data << uint32(pQuest->GetNextQuestInChain());     data << uint32(pQuest->GetRewOrReqMoney());Index: src/game/ObjectMgr.cpp===================================================================--- src/game/ObjectMgr.cpp	(revision 4416)+++ src/game/ObjectMgr.cpp	(working copy)@@ -1581,33 +1581,33 @@  void ObjectMgr::LoadQuests() {-    //                                            0       1         2          3            4+    //                                              0       1           2             3            4     QueryResult *result = sDatabase.Query("SELECT `entry`,`ZoneOrSort`, `MinLevel`,`QuestLevel`,`Type`,"-    //   5               6                    7                    8                  9                  10-        "`RequiredRaces`,`RequiredSkillValue`,`RequiredRepFaction`,`RequiredRepValue`,`SuggestedPlayers`,`LimitTime`,"-    //   11             12            13            14               15                 16          17             18+    //   5               6                    7                       8                     9                       10                      11                12+        "`RequiredRaces`,`RequiredSkillValue`,`RequiredMinRepFaction`,`RequiredMinRepValue`,`RequiredMaxRepFaction`,`RequiredMaxRepValue`,`SuggestedPlayers`,`LimitTime`,"+    //   13             14            15            16               17                 18          19             20         "`SpecialFlags`,`PrevQuestId`,`NextQuestId`,`ExclusiveGroup`,`NextQuestInChain`,`SrcItemId`,`SrcItemCount`,`SrcSpell`,"-    //   19      20        21           22                23                 24        25               26               27               28+    //   21      22        23           24                25                 26        27               28               29               30         "`Title`,`Details`,`Objectives`,`OfferRewardText`,`RequestItemsText`,`EndText`,`ObjectiveText1`,`ObjectiveText2`,`ObjectiveText3`,`ObjectiveText4`,"-    //   29           30           31           32           33              34              35              36+    //   31           32           33           34           35              36              37              38         "`ReqItemId1`,`ReqItemId2`,`ReqItemId3`,`ReqItemId4`,`ReqItemCount1`,`ReqItemCount2`,`ReqItemCount3`,`ReqItemCount4`,"-    //   37             38             39             40             41                42                43                44                45              46              47              48+    //   39             40             41             42             43                44                45                46                47              48              49              50         "`ReqSourceId1`,`ReqSourceId2`,`ReqSourceId3`,`ReqSourceId4`,`ReqSourceCount1`,`ReqSourceCount2`,`ReqSourceCount3`,`ReqSourceCount4`,`ReqSourceRef1`,`ReqSourceRef2`,`ReqSourceRef3`,`ReqSourceRef4`,"-    //   49                   50                   51                   52                   53                      54                      55                      56+    //   51                   52                   53                   54                   55                      56                      57                      58         "`ReqCreatureOrGOId1`,`ReqCreatureOrGOId2`,`ReqCreatureOrGOId3`,`ReqCreatureOrGOId4`,`ReqCreatureOrGOCount1`,`ReqCreatureOrGOCount2`,`ReqCreatureOrGOCount3`,`ReqCreatureOrGOCount4`,"-    //   57              58              59              60+    //   59              60              61              62         "`ReqSpellCast1`,`ReqSpellCast2`,`ReqSpellCast3`,`ReqSpellCast4`,"-    //   61                 62                 63                 64                 65                 66+    //   63                 64                 65                 66                 67                 68         "`RewChoiceItemId1`,`RewChoiceItemId2`,`RewChoiceItemId3`,`RewChoiceItemId4`,`RewChoiceItemId5`,`RewChoiceItemId6`,"-    //   67                    68                    69                    70                    71                    72+    //   69                    70                    71                    72                    73                    74         "`RewChoiceItemCount1`,`RewChoiceItemCount2`,`RewChoiceItemCount3`,`RewChoiceItemCount4`,`RewChoiceItemCount5`,`RewChoiceItemCount6`,"-    //   73           74           75           76           77              78              79              80+    //   75           76           77           78           79              80              81              82         "`RewItemId1`,`RewItemId2`,`RewItemId3`,`RewItemId4`,`RewItemCount1`,`RewItemCount2`,`RewItemCount3`,`RewItemCount4`,"-    //   81               82               83               84               85               86             87             88             89             90+    //   83               84               85               86               87               88             89             90             91             92         "`RewRepFaction1`,`RewRepFaction2`,`RewRepFaction3`,`RewRepFaction4`,`RewRepFaction5`,`RewRepValue1`,`RewRepValue2`,`RewRepValue3`,`RewRepValue4`,`RewRepValue5`,"-    //   91              92      93         94           95       96       97         98              99              100             101+    //   93              94      95         96           97       98       99         100              101              102             103         "`RewOrReqMoney`,`RewXpOrMoney`,`RewSpell`,`PointMapId`,`PointX`,`PointY`,`PointOpt`,`DetailsEmote1`,`DetailsEmote2`,`DetailsEmote3`,`DetailsEmote4`,"-    //   102               103             104                 105                 106                 107                 108           109          110+    //   104               105             106                 107                 108                 109                 110           111          112         "`IncompleteEmote`,`CompleteEmote`,`OfferRewardEmote1`,`OfferRewardEmote2`,`OfferRewardEmote3`,`OfferRewardEmote4`,`StartScript`,`CompleteScript`,`Repeatable`"         " FROM `quest_template`");     if(result == NULL)@@ -1650,20 +1650,34 @@             // no changes, quest can't be done for this requirement         } -        if(qinfo->RequiredRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredRepFaction))+        if(qinfo->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction))         {-            sLog.outErrorDb("Quest %u has `RequiredRepFaction` = %u but faction template %u doesn't exist, quest can't be done.",-                qinfo->GetQuestId(),qinfo->RequiredRepFaction,qinfo->RequiredRepFaction);+            sLog.outErrorDb("Quest %u has `RequiredMinRepFaction` = %u but faction template %u doesn't exist, quest can't be done.",+                qinfo->GetQuestId(),qinfo->RequiredMinRepFaction,qinfo->RequiredMinRepFaction);             // no changes, quest can't be done for this requirement         } -        if(qinfo->RequiredRepValue && int32(qinfo->RequiredRepValue) > Player::Reputation_Cap)+		if(qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction))         {-            sLog.outErrorDb("Quest %u has `RequiredRepValue` = %u but max reputation is %u, quest can't be done.",-                qinfo->GetQuestId(),qinfo->RequiredRepValue,Player::Reputation_Cap);+            sLog.outErrorDb("Quest %u has `RequiredMaxRepFaction` = %u but faction template %u doesn't exist, quest can't be done.",+                qinfo->GetQuestId(),qinfo->RequiredMaxRepFaction,qinfo->RequiredMaxRepFaction);             // no changes, quest can't be done for this requirement         } +        if(qinfo->RequiredMinRepValue && int32(qinfo->RequiredMinRepValue) > Player::Reputation_Cap)+        {+            sLog.outErrorDb("Quest %u has `RequiredMinRepValue` = %u but max reputation is %u, quest can't be done.",+                qinfo->GetQuestId(),qinfo->RequiredMinRepValue,Player::Reputation_Cap);+            // no changes, quest can't be done for this requirement+        }++		if(qinfo->RequiredMaxRepValue && int32(qinfo->RequiredMaxRepValue) > Player::Reputation_Cap)+        {+            sLog.outErrorDb("Quest %u has `RequiredMaxRepValue` = %u but max reputation is %u, quest can't be done.",+                qinfo->GetQuestId(),qinfo->RequiredMaxRepValue,Player::Reputation_Cap);+            // no changes, quest can't be done for this requirement+        }+         if(qinfo->SrcItemId && !sItemStorage.LookupEntry<ItemPrototype>(qinfo->SrcItemId))         {             sLog.outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u doesn't exist, quest can't be done.",Index: src/game/Player.cpp===================================================================--- src/game/Player.cpp	(revision 4416)+++ src/game/Player.cpp	(working copy)@@ -10844,11 +10844,11 @@     Quest * qInfo = objmgr.mQuestTemplates[quest_id];     if( qInfo )     {-        uint32 faction_id = qInfo->GetRequiredRepFaction();-        if(!faction_id)+        uint32 fIdMin = qInfo->GetRequiredMinRepFaction();  //Min required rep+        uint32 fIdMax = qInfo->GetRequiredMaxRepFaction();  //Max required rep+        if(fIdMin && GetReputation(fIdMin) < int32(qInfo->GetRequiredMinRepValue())) return false;+        if(fIdMax && GetReputation(fIdMax) > int32(qInfo->GetRequiredMaxRepValue())) return false;             return true;--        return GetReputation(faction_id) >= int32(qInfo->GetRequiredRepValue());     }     return false; }Index: src/game/QuestDef.cpp===================================================================--- src/game/QuestDef.cpp	(revision 4416)+++ src/game/QuestDef.cpp	(working copy)@@ -28,90 +28,92 @@     Type = questRecord[4].GetUInt32();     RequiredRaces = questRecord[5].GetUInt32();     RequiredSkillValue = questRecord[6].GetUInt32();-    RequiredRepFaction = questRecord[7].GetUInt32();-    RequiredRepValue = questRecord[8].GetUInt32();-    SuggestedPlayers = questRecord[9].GetUInt32();-    LimitTime = questRecord[10].GetUInt32();-    SpecialFlags = questRecord[11].GetUInt32();-    PrevQuestId = questRecord[12].GetInt32();-    NextQuestId = questRecord[13].GetInt32();-    ExclusiveGroup = questRecord[14].GetUInt32();-    NextQuestInChain = questRecord[15].GetUInt32();-    SrcItemId = questRecord[16].GetUInt32();-    SrcItemCount = questRecord[17].GetUInt32();-    SrcSpell = questRecord[18].GetUInt32();-    Title = questRecord[19].GetCppString();-    Details = questRecord[20].GetCppString();-    Objectives = questRecord[21].GetCppString();-    OfferRewardText = questRecord[22].GetCppString();-    RequestItemsText = questRecord[23].GetCppString();-    EndText = questRecord[24].GetCppString();+    RequiredMinRepFaction = questRecord[7].GetUInt32();+    RequiredMinRepValue = questRecord[8].GetUInt32();+    RequiredMaxRepFaction = questRecord[9].GetUInt32();+    RequiredMaxRepValue = questRecord[10].GetUInt32();+    SuggestedPlayers = questRecord[11].GetUInt32();+    LimitTime = questRecord[12].GetUInt32();+    SpecialFlags = questRecord[13].GetUInt32();+    PrevQuestId = questRecord[14].GetInt32();+    NextQuestId = questRecord[15].GetInt32();+    ExclusiveGroup = questRecord[16].GetUInt32();+    NextQuestInChain = questRecord[17].GetUInt32();+    SrcItemId = questRecord[18].GetUInt32();+    SrcItemCount = questRecord[19].GetUInt32();+    SrcSpell = questRecord[20].GetUInt32();+    Title = questRecord[21].GetCppString();+    Details = questRecord[22].GetCppString();+    Objectives = questRecord[23].GetCppString();+    OfferRewardText = questRecord[24].GetCppString();+    RequestItemsText = questRecord[25].GetCppString();+    EndText = questRecord[26].GetCppString();      for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)-        ObjectiveText[i] = questRecord[25+i].GetCppString();+        ObjectiveText[i] = questRecord[27+i].GetCppString();      for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)-        ReqItemId[i] = questRecord[29+i].GetUInt32();+        ReqItemId[i] = questRecord[31+i].GetUInt32();      for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)-        ReqItemCount[i] = questRecord[33+i].GetUInt32();+        ReqItemCount[i] = questRecord[35+i].GetUInt32();      for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)-        ReqSourceId[i] = questRecord[37+i].GetUInt32();+        ReqSourceId[i] = questRecord[39+i].GetUInt32();      for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)-        ReqSourceCount[i] = questRecord[41+i].GetUInt32();+        ReqSourceCount[i] = questRecord[43+i].GetUInt32();      for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)-        ReqSourceRef[i] = questRecord[45+i].GetUInt32();+        ReqSourceRef[i] = questRecord[47+i].GetUInt32();      for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)-        ReqCreatureOrGOId[i] = questRecord[49+i].GetInt32();+        ReqCreatureOrGOId[i] = questRecord[51+i].GetInt32();      for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)-        ReqCreatureOrGOCount[i] = questRecord[53+i].GetUInt32();+        ReqCreatureOrGOCount[i] = questRecord[55+i].GetUInt32();      for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)-        ReqSpell[i] = questRecord[57+i].GetUInt32();+        ReqSpell[i] = questRecord[59+i].GetUInt32();      for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)-        RewChoiceItemId[i] = questRecord[61+i].GetUInt32();+        RewChoiceItemId[i] = questRecord[63+i].GetUInt32();      for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)-        RewChoiceItemCount[i] = questRecord[67+i].GetUInt32();+        RewChoiceItemCount[i] = questRecord[69+i].GetUInt32();      for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)-        RewItemId[i] = questRecord[73+i].GetUInt32();+        RewItemId[i] = questRecord[75+i].GetUInt32();      for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)-        RewItemCount[i] = questRecord[77+i].GetUInt32();+        RewItemCount[i] = questRecord[79+i].GetUInt32();      for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)-        RewRepFaction[i] = questRecord[81+i].GetUInt32();+        RewRepFaction[i] = questRecord[83+i].GetUInt32();      for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)-        RewRepValue[i] = questRecord[86+i].GetInt32();+        RewRepValue[i] = questRecord[88+i].GetInt32(); -    RewOrReqMoney = questRecord[91].GetInt32();;-    RewXpOrMoney = questRecord[92].GetUInt32();-    RewSpell = questRecord[93].GetUInt32();-    PointMapId = questRecord[94].GetUInt32();-    PointX = questRecord[95].GetFloat();-    PointY = questRecord[96].GetFloat();-    PointOpt = questRecord[97].GetUInt32();+    RewOrReqMoney = questRecord[93].GetInt32();;+    RewXpOrMoney = questRecord[94].GetUInt32();+    RewSpell = questRecord[95].GetUInt32();+    PointMapId = questRecord[96].GetUInt32();+    PointX = questRecord[97].GetFloat();+    PointY = questRecord[98].GetFloat();+    PointOpt = questRecord[99].GetUInt32();      for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)-        DetailsEmote[i] = questRecord[98+i].GetUInt32();+        DetailsEmote[i] = questRecord[100+i].GetUInt32(); -    IncompleteEmote = questRecord[102].GetUInt32();-    CompleteEmote = questRecord[103].GetUInt32();+    IncompleteEmote = questRecord[104].GetUInt32();+    CompleteEmote = questRecord[105].GetUInt32();      for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)-        OfferRewardEmote[i] = questRecord[104+i].GetInt32();+        OfferRewardEmote[i] = questRecord[106+i].GetInt32(); -    QuestStartScript = questRecord[108].GetUInt32();-    QuestCompleteScript = questRecord[109].GetUInt32();-    Repeatable = questRecord[110].GetUInt32();+    QuestStartScript = questRecord[110].GetUInt32();+    QuestCompleteScript = questRecord[111].GetUInt32();+    Repeatable = questRecord[112].GetUInt32();      m_reqitemscount = 0;     m_reqCreatureOrGOcount = 0;Index: src/game/QuestDef.h===================================================================--- src/game/QuestDef.h	(revision 4416)+++ src/game/QuestDef.h	(working copy)@@ -146,8 +146,10 @@         uint32 GetType() { return Type; }         uint32 GetRequiredRaces() { return RequiredRaces; }         uint32 GetRequiredSkillValue() { return RequiredSkillValue; }-        uint32 GetRequiredRepFaction() { return RequiredRepFaction; }-        uint32 GetRequiredRepValue() { return RequiredRepValue; }+        uint32 GetRequiredMinRepFaction() { return RequiredMinRepFaction; }+        uint32 GetRequiredMinRepValue() { return RequiredMinRepValue; }+        uint32 GetRequiredMaxRepFaction() { return RequiredMaxRepFaction; }+        uint32 GetRequiredMaxRepValue() { return RequiredMaxRepValue; }         uint32 GetSuggestedPlayers() { return SuggestedPlayers; }         uint32 GetLimitTime() { return LimitTime; }         int32  GetNextQuestId() { return NextQuestId; }@@ -222,8 +224,10 @@         uint32 Type;         uint32 RequiredRaces;         uint32 RequiredSkillValue;-        uint32 RequiredRepFaction;-        uint32 RequiredRepValue;+        uint32 RequiredMinRepFaction;+        uint32 RequiredMinRepValue;+        uint32 RequiredMaxRepFaction;+        uint32 RequiredMaxRepValue;         uint32 SuggestedPlayers;         uint32 LimitTime;         uint32 SpecialFlags;