Mangos Port Add New Field Requiredclasses

The port of mangos commit 10621 (https://github.com/m…b9cd86957af0f82) Credits to NoFantasy for writing this

It’s needed for fixing quests like Junkboxes Needed , It compiles and the SQL works as far as I can tell , currently do not have WoW to test it thoroughly so hoping someone here will do that /emoticons/default_wink.png


diff --git a/sql/updates/world/2011_xx_xx_xx.sql b/sql/updates/world/2011_xx_xx_xx.sql

new file mode 100644

index 0000000..9572762

--- /dev/null

+++ b/sql/updates/world/2011_xx_xx_xx.sql

@@ -0,0 +1,38 @@

+ALTER TABLE quest_template ADD COLUMN RequiredClasses smallint(5) unsigned NOT NULL default '0' AFTER Type;

+

+UPDATE quest_template

+  SET RequiredClasses = RequiredClasses|

+	CASE SkillOrClassMask

+	  WHEN  -1 THEN	1 -- warrior

+	  WHEN  -2 THEN	2 -- paladin

+	  WHEN  -3 THEN	4 -- hunter

+	  WHEN  -4 THEN	8 -- rogue

+	  WHEN  -5 THEN   16 -- priest

+	  WHEN  -6 THEN   32 -- dk

+	  WHEN  -7 THEN   64 -- shaman

+	  WHEN  -8 THEN  128 -- mage

+	  WHEN  -9 THEN  256 -- warlock

+	  WHEN -11 THEN 1024 -- druid

+	  ELSE 0

+	END

+  WHERE SkillOrClassMask < 0;

+

+UPDATE quest_template

+  SET RequiredClasses = RequiredClasses|

+	CASE ZoneOrSort

+	  WHEN  -81 THEN	1 -- warrior

+	  WHEN -141 THEN	2 -- paladin

+	  WHEN -261 THEN	4 -- hunter

+	  WHEN -162 THEN	8 -- rogue

+	  WHEN -262 THEN   16 -- priest

+	  WHEN -372 THEN   32 -- dk

+	  WHEN  -82 THEN   64 -- shaman

+	  WHEN -161 THEN  128 -- mage

+	  WHEN  -61 THEN  256 -- warlock

+	  WHEN -263 THEN 1024 -- druid

+	  ELSE 0

+	END

+  WHERE ZoneOrSort < 0;

+

+UPDATE quest_template SET SkillOrClassMask=0 WHERE SkillOrClassMask<0;

+ALTER TABLE quest_template CHANGE COLUMN SkillOrClassMask RequiredSkill smallint(5) unsigned NOT NULL default '0' AFTER RequiredRaces;

\ No newline at end of file

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp

index 8e75ca4..e050bca 100755

--- a/src/server/game/Entities/Player/Player.cpp

+++ b/src/server/game/Entities/Player/Player.cpp

@@ -14535,7 +14535,7 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* pQuest)


bool Player::CanSeeStartQuest(Quest const* pQuest)

{

-	if (SatisfyQuestRace(pQuest, false) && SatisfyQuestSkillOrClass(pQuest, false) &&

+	if (SatisfyQuestClass(pQuest, false) && SatisfyQuestRace(pQuest, false) && SatisfyQuestSkill(pQuest, false) &&

		 SatisfyQuestExclusiveGroup(pQuest, false) && SatisfyQuestReputation(pQuest, false) &&

		 SatisfyQuestPreviousQuest(pQuest, false) && SatisfyQuestNextChain(pQuest, false) &&

		 SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) &&

@@ -14550,8 +14550,8 @@ bool Player::CanSeeStartQuest(Quest const* pQuest)

bool Player::CanTakeQuest(Quest const* pQuest, bool msg)

{

	 return SatisfyQuestStatus(pQuest, msg) && SatisfyQuestExclusiveGroup(pQuest, msg)

-		&& SatisfyQuestRace(pQuest, msg) && SatisfyQuestLevel(pQuest, msg)

-		&& SatisfyQuestSkillOrClass(pQuest, msg) && SatisfyQuestReputation(pQuest, msg)

+		&& SatisfyQuestClass(pQuest, msg) && SatisfyQuestRace(pQuest, msg) && SatisfyQuestLevel(pQuest, msg)

+		&& SatisfyQuestSkill(pQuest, msg) && SatisfyQuestReputation(pQuest, msg)

		 && SatisfyQuestPreviousQuest(pQuest, msg) && SatisfyQuestTimed(pQuest, msg)

		 && SatisfyQuestNextChain(pQuest, msg) && SatisfyQuestPrevChain(pQuest, msg)

		 && SatisfyQuestDay(pQuest, msg) && SatisfyQuestWeek(pQuest, msg)

@@ -15085,47 +15085,21 @@ void Player::FailQuest(uint32 questId)

	 }

}


-bool Player::SatisfyQuestSkillOrClass(Quest const* qInfo, bool msg)

+bool Player::SatisfyQuestSkill(Quest const* qInfo, bool msg) const

{

-	int32 zoneOrSort = qInfo->GetZoneOrSort();

-	int32 skillOrClassMask = qInfo->GetSkillOrClassMask();

+	uint32 skill = qInfo->GetRequiredSkill();


-	// skip zone zoneOrSort and 0 case skillOrClass

-	if (zoneOrSort >= 0 && skillOrClassMask == 0)

+	// skip 0 case RequiredSkill

+	if (skill == 0)

		 return true;


-	int32 questSort = -zoneOrSort;

-	uint8 reqSortClass = ClassByQuestSort(questSort);

-

-	// check class sort cases in zoneOrSort

-	if (reqSortClass != 0 && getClass() != reqSortClass)

+	// check skill value

+	if (GetSkillValue(skill) < qInfo->GetRequiredSkillValue())

	 {

		 if (msg)

			 SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);

-		return false;

-	}


-	// check class

-	if (skillOrClassMask < 0)

-	{

-		uint32 reqClassMask = -int32(skillOrClassMask);

-		if (!(reqClassMask & getClassMask()))

-		{

-			if (msg)

-				SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);

-			return false;

-		}

-	}

-	// check skill

-	else if (skillOrClassMask > 0)

-	{

-		uint32 reqSkill = skillOrClassMask;

-		if (GetSkillValue(reqSkill) < qInfo->GetRequiredSkillValue())

-		{

-			if (msg)

-				SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);

-			return false;

-		}

+		return false;

	 }


	 return true;

@@ -15253,6 +15227,24 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)

	 return false;

}


+bool Player::SatisfyQuestClass(Quest const* qInfo, bool msg) const

+{

+	uint32 reqClass = qInfo->GetRequiredClasses();

+

+	if (reqClass == 0)

+		return true;

+

+	if ((reqClass & getClassMask()) == 0)

+	{

+		if (msg)

+			SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);

+

+		return false;

+	}

+

+	return true;

+}

+

bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg)

{

	 uint32 reqraces = qInfo->GetRequiredRaces();

@@ -16224,7 +16216,7 @@ void Player::SendQuestTimerFailed(uint32 quest_id)

	 }

}


-void Player::SendCanTakeQuestResponse(uint32 msg)

+void Player::SendCanTakeQuestResponse(uint32 msg) const

{

	 WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4);

	 data << uint32(msg);

diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h

index 6574604..b84c5d1 100755

--- a/src/server/game/Entities/Player/Player.h

+++ b/src/server/game/Entities/Player/Player.h

@@ -1400,10 +1400,11 @@ class Player : public Unit, public GridObject<Player>

		 void IncompleteQuest(uint32 quest_id);

		 void RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver, bool announce = true);

		 void FailQuest(uint32 quest_id);

-		bool SatisfyQuestSkillOrClass(Quest const* qInfo, bool msg);

+		bool SatisfyQuestSkill(Quest const* qInfo, bool msg) const;

		 bool SatisfyQuestLevel(Quest const* qInfo, bool msg);

		 bool SatisfyQuestLog(bool msg);

		 bool SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg);

+		bool SatisfyQuestClass(Quest const* qInfo, bool msg) const;

		 bool SatisfyQuestRace(Quest const* qInfo, bool msg);

		 bool SatisfyQuestReputation(Quest const* qInfo, bool msg);

		 bool SatisfyQuestStatus(Quest const* qInfo, bool msg);

@@ -1483,7 +1484,7 @@ class Player : public Unit, public GridObject<Player>

		 void SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver);

		 void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);

		 void SendQuestTimerFailed(uint32 quest_id);

-		void SendCanTakeQuestResponse(uint32 msg);

+		void SendCanTakeQuestResponse(uint32 msg) const;

		 void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver);

		 void SendPushToPartyResponse(Player* pPlayer, uint32 msg);

		 void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint16 count);

diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp

index 8d0751e..c39cd53 100755

--- a/src/server/game/Globals/ObjectMgr.cpp

+++ b/src/server/game/Globals/ObjectMgr.cpp

@@ -3691,41 +3691,41 @@ void ObjectMgr::LoadQuests()


	 mExclusiveQuestGroups.clear();


-	//													   0	  1	   2		   3				 4		 5		 6		   7	 8			  9

-	QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClassMask, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue, "

-	//   10				   11				 12					13				  14					 15				   16					 17				   18				19

+	//											   0	  1	   2		   3		 4		 5		   6		   7		  8			  9			  10

+	QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, MinLevel, MaxLevel, QuestLevel, Type, RequiredClasses, RequiredRaces, RequiredSkill, RequiredSkillValue, "

+	//   11				   12				 13					14				  15					 16				   17					 18				   19				20

		 "RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime, "

-	//   20		  21			22		   23			24			25				  26		   27		  28			  29				30	   31		 32			33

+	//   21		  22			23		   24			25			26				  27		   28		  29			  30				31	   32		 33			34

		 "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, RewardArenaPoints, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell, "

-	//   34	 35	   36		  37			   38				39	   40			  41			  42			  43			  44

+	//   35	 36	   37		  38			   39				40	   41			  42			  43			  44			  45

		 "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText,  ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, "

-	//   45		  46		  47		  48		  49		  50		  51			 52			 53			 54			 55			 56

+	//   46		  47		  48		  49		  50		  51		  52			 53			 54			 55			 56			 57

		 "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6, "

-	//   57			58			59			60			61			   62			   63			   64

+	//   58			59			60			61			62			   63			   64			   65

		 "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, "

-	//   65				  66				  67				  68				  69					 70					 71					 72

+	//   66				  67				  68				  69				  70					 71					 72					 73

		 "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4, "

-	//   73			 74			 75			 76

+	//   74			 75			 76			 77

		 "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4, "

-	//   77				78				79				80				81				82

+	//   78				79				80				81				82				83

		 "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6, "

-	//   83				   84				   85				   86				   87				   88

+	//   84				   85				   86				   87				   88				   89

		 "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6, "

-	//   89		  90		  91		  92		  93			 94			 95			 96

+	//   90		  91		  92		  93		  94			 95			 96			 97

		 "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4, "

-	//   97			  98			  99			  100			 101			 102			 103			 104			 105			 106

+	//   98			  99			  100			  101			 102			 103			 104			 105			 106			 107

		 "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5, "

-	//   107		   108		   109		   110		   111

+	//   108		   109		   110		   111		   112

		 "RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5, "

-	//   112			   113				 114			115			   116	   117		   118				119			   120		 121	 122	 123

+	//   113			   114				 115			116			   117	   118		   119				120			   121		 122	 123	 124

		 "RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt, "

-	//   124			125			126			127			128				 129				 130				 131

+	//   125			126			127			128			129				 130				 131				 132

		 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, "

-	//   132			  133			134				135				136				137

+	//   133			  134			135				136				137				138

		 "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, "

-	//   138					 139					 140					 141

+	//   139					 140					 141					 142

		 "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "

-	//   142		  143

+	//   143		  144

		 "StartScript, CompleteScript"

		 " FROM quest_template");

	 if (!result)

@@ -3829,45 +3829,43 @@ void ObjectMgr::LoadQuests()

					 qinfo->GetQuestId(), qinfo->ZoneOrSort);

				 // no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check)

			 }

-			//check SkillOrClass value (class case).

-			if (ClassByQuestSort(-int32(qinfo->ZoneOrSort)))

-			{

-				// SkillOrClass should not have class case when class case already set in ZoneOrSort.

-				if (qinfo->SkillOrClassMask < 0)

-				{

-					sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (class sort case) and `SkillOrClassMask` = %i (class case), redundant.",

-						qinfo->GetQuestId(), qinfo->ZoneOrSort, qinfo->SkillOrClassMask);

-				}

-			}

-			//check for proper SkillOrClass value (skill case)

+			//check for proper RequiredSkill value (skill case)

			 if (int32 skill_id =  SkillByQuestSort(-int32(qinfo->ZoneOrSort)))

			 {

-				// skill is positive value in SkillOrClass

-				if (qinfo->SkillOrClassMask != skill_id)

+				if (qinfo->RequiredSkill != skill_id)

				 {

-					sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (skill sort case) but `SkillOrClassMask` does not have a corresponding value (%i).",

+					sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%i).",

						 qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id);

					 //override, and force proper value here?

				 }

			 }

		 }


-		// SkillOrClassMask (class case)

-		if (qinfo->SkillOrClassMask < 0)

+		// RequiredClasses, can be 0/CLASSMASK_ALL_PLAYABLE to allow any class

+		if (qinfo->RequiredClasses)

		 {

-			if (!(-int32(qinfo->SkillOrClassMask) & CLASSMASK_ALL_PLAYABLE))

+			if (!(qinfo->RequiredClasses & CLASSMASK_ALL_PLAYABLE))

			 {

-				sLog->outErrorDb("Quest %u has `SkillOrClassMask` = %i (class case) but classmask does not have valid class",

-					qinfo->GetQuestId(), qinfo->SkillOrClassMask);

+				sLog->outErrorDb("Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses);

+					qinfo->RequiredClasses = 0;

			 }

		 }

-		// SkillOrClassMask (skill case)

-		if (qinfo->SkillOrClassMask > 0)

+		// RequiredRaces, can be 0/RACEMASK_ALL_PLAYABLE to allow any race

+		if (qinfo->RequiredRaces)

+			{

+			if (!(qinfo->RequiredRaces & RACEMASK_ALL_PLAYABLE))

+				{

+					sLog->outErrorDb("Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces);

+					qinfo->RequiredRaces = 0;

+				}

+			}

+		// RequiredSkill, can be 0

+		if (qinfo->RequiredSkill)

		 {

-			if (!sSkillLineStore.LookupEntry(qinfo->SkillOrClassMask))

+			if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkill))

			 {

-				sLog->outErrorDb("Quest %u has `SkillOrClass` = %u (skill case) but skill (%i) does not exist",

-					qinfo->GetQuestId(), qinfo->SkillOrClassMask, qinfo->SkillOrClassMask);

+				sLog->outErrorDb("Quest %u has `RequiredSkill` = %u but this skill does not exist",

+					qinfo->GetQuestId(), qinfo->RequiredSkill);

			 }

		 }


@@ -3879,13 +3877,6 @@ void ObjectMgr::LoadQuests()

					 qinfo->GetQuestId(), qinfo->RequiredSkillValue, sWorld->GetConfigMaxSkillValue());

				 // no changes, quest can't be done for this requirement

			 }

-

-			if (qinfo->SkillOrClassMask <= 0)

-			{

-				sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but `SkillOrClass` = %i (class case), value ignored.",

-					qinfo->GetQuestId(), qinfo->RequiredSkillValue, qinfo->SkillOrClassMask);

-				// no changes, quest can't be done for this requirement (fail at wrong skill id)

-			}

		 }

		 // else Skill quests can have 0 skill level, this is ok


diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp

index 22251ac..8fc4aed 100755

--- a/src/server/game/Quests/QuestDef.cpp

+++ b/src/server/game/Quests/QuestDef.cpp

@@ -25,120 +25,121 @@ Quest::Quest(Field* questRecord)

	 QuestId = questRecord[0].GetUInt32();

	 QuestMethod = questRecord[1].GetUInt32();

	 ZoneOrSort = questRecord[2].GetInt32();

-	SkillOrClassMask = questRecord[3].GetInt32();

-	MinLevel = questRecord[4].GetUInt32();

-	MaxLevel = questRecord[5].GetUInt32();

-	QuestLevel = questRecord[6].GetInt32();

-	Type = questRecord[7].GetUInt32();

+	MinLevel = questRecord[3].GetUInt32();

+	MaxLevel = questRecord[4].GetUInt32();

+	QuestLevel = questRecord[5].GetInt32();

+	Type = questRecord[6].GetUInt32();

+	RequiredClasses = questRecord[7].GetUInt32();

	 RequiredRaces = questRecord[8].GetUInt32();

-	RequiredSkillValue = questRecord[9].GetUInt32();

-	RepObjectiveFaction = questRecord[10].GetUInt32();

-	RepObjectiveValue = questRecord[11].GetInt32();

-	RepObjectiveFaction2 = questRecord[12].GetUInt32();

-	RepObjectiveValue2 = questRecord[13].GetInt32();

-	RequiredMinRepFaction = questRecord[14].GetUInt32();

-	RequiredMinRepValue = questRecord[15].GetInt32();

-	RequiredMaxRepFaction = questRecord[16].GetUInt32();

-	RequiredMaxRepValue = questRecord[17].GetInt32();

-	SuggestedPlayers = questRecord[18].GetUInt32();

-	LimitTime = questRecord[19].GetUInt32();

-	QuestFlags = questRecord[20].GetUInt32();

-	uint32 SpecialFlags = questRecord[21].GetUInt16();

-	CharTitleId = questRecord[22].GetUInt32();

-	PlayersSlain = questRecord[23].GetUInt32();

-	BonusTalents = questRecord[24].GetUInt32();

-	RewArenaPoints = questRecord[25].GetInt32();

-	PrevQuestId = questRecord[26].GetInt32();

-	NextQuestId = questRecord[27].GetInt32();

-	ExclusiveGroup = questRecord[28].GetInt32();

-	NextQuestInChain = questRecord[29].GetUInt32();

-	XPId = questRecord[30].GetUInt32();

-	SrcItemId = questRecord[31].GetUInt32();

-	SrcItemCount = questRecord[32].GetUInt32();

-	SrcSpell = questRecord[33].GetUInt32();

-	Title = questRecord[34].GetString();

-	Details = questRecord[35].GetString();

-	Objectives = questRecord[36].GetString();

-	OfferRewardText = questRecord[37].GetString();

-	RequestItemsText = questRecord[38].GetString();

-	EndText = questRecord[39].GetString();

-	CompletedText = questRecord[40].GetString();

+	RequiredSkill = questRecord[9].GetUInt32();

+	RequiredSkillValue = questRecord[10].GetUInt32();

+	RepObjectiveFaction = questRecord[11].GetUInt32();

+	RepObjectiveValue = questRecord[12].GetInt32();

+	RepObjectiveFaction2 = questRecord[13].GetUInt32();

+	RepObjectiveValue2 = questRecord[14].GetInt32();

+	RequiredMinRepFaction = questRecord[15].GetUInt32();

+	RequiredMinRepValue = questRecord[16].GetInt32();

+	RequiredMaxRepFaction = questRecord[17].GetUInt32();

+	RequiredMaxRepValue = questRecord[18].GetInt32();

+	SuggestedPlayers = questRecord[19].GetUInt32();

+	LimitTime = questRecord[20].GetUInt32();

+	QuestFlags = questRecord[21].GetUInt32();

+	uint32 SpecialFlags = questRecord[22].GetUInt16();

+	CharTitleId = questRecord[23].GetUInt32();

+	PlayersSlain = questRecord[24].GetUInt32();

+	BonusTalents = questRecord[25].GetUInt32();

+	RewArenaPoints = questRecord[26].GetInt32();

+	PrevQuestId = questRecord[27].GetInt32();

+	NextQuestId = questRecord[28].GetInt32();

+	ExclusiveGroup = questRecord[29].GetInt32();

+	NextQuestInChain = questRecord[30].GetUInt32();

+	XPId = questRecord[31].GetUInt32();

+	SrcItemId = questRecord[32].GetUInt32();

+	SrcItemCount = questRecord[33].GetUInt32();

+	SrcSpell = questRecord[34].GetUInt32();

+	Title = questRecord[35].GetString();

+	Details = questRecord[36].GetString();

+	Objectives = questRecord[37].GetString();

+	OfferRewardText = questRecord[38].GetString();

+	RequestItemsText = questRecord[39].GetString();

+	EndText = questRecord[40].GetString();

+	CompletedText = questRecord[41].GetString();


	 for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)

-		ObjectiveText[i] = questRecord[41+i].GetString();

+		ObjectiveText[i] = questRecord[42+i].GetString();


	 for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)

-		ReqItemId[i] = questRecord[45+i].GetUInt32();

+		ReqItemId[i] = questRecord[46+i].GetUInt32();


	 for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)

-		ReqItemCount[i] = questRecord[51+i].GetUInt32();

+		ReqItemCount[i] = questRecord[52+i].GetUInt32();


	 for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)

-		ReqSourceId[i] = questRecord[57+i].GetUInt32();

+		ReqSourceId[i] = questRecord[58+i].GetUInt32();


	 for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)

-		ReqSourceCount[i] = questRecord[61+i].GetUInt32();

+		ReqSourceCount[i] = questRecord[62+i].GetUInt32();


	 for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)

-		ReqCreatureOrGOId[i] = questRecord[65+i].GetInt32();

+		ReqCreatureOrGOId[i] = questRecord[66+i].GetInt32();


	 for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)

-		ReqCreatureOrGOCount[i] = questRecord[69+i].GetUInt32();

+		ReqCreatureOrGOCount[i] = questRecord[70+i].GetUInt32();


	 for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)

-		ReqSpell[i] = questRecord[73+i].GetUInt32();

+		ReqSpell[i] = questRecord[74+i].GetUInt32();


	 for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)

-		RewChoiceItemId[i] = questRecord[77+i].GetUInt32();

+		RewChoiceItemId[i] = questRecord[78+i].GetUInt32();


	 for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)

-		RewChoiceItemCount[i] = questRecord[83+i].GetUInt32();

+		RewChoiceItemCount[i] = questRecord[84+i].GetUInt32();


	 for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)

-		RewItemId[i] = questRecord[89+i].GetUInt32();

+		RewItemId[i] = questRecord[90+i].GetUInt32();


	 for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)

-		RewItemCount[i] = questRecord[93+i].GetUInt32();

+		RewItemCount[i] = questRecord[94+i].GetUInt32();


	 for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)

-		RewRepFaction[i] = questRecord[97+i].GetUInt32();

+		RewRepFaction[i] = questRecord[98+i].GetUInt32();


	 for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)

-		RewRepValueId[i] = questRecord[102+i].GetInt32();

+		RewRepValueId[i] = questRecord[103+i].GetInt32();


	 for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)

-		RewRepValue[i] = questRecord[107+i].GetInt32();

-

-	RewHonorAddition = questRecord[112].GetUInt32();

-	RewHonorMultiplier = questRecord[113].GetFloat();

-	RewOrReqMoney = questRecord[114].GetInt32();

-	RewMoneyMaxLevel = questRecord[115].GetUInt32();

-	RewSpell = questRecord[116].GetUInt32();

-	RewSpellCast = questRecord[117].GetInt32();

-	RewMailTemplateId = questRecord[118].GetUInt32();

-	RewMailDelaySecs = questRecord[119].GetUInt32();

-	PointMapId = questRecord[120].GetUInt32();

-	PointX = questRecord[121].GetFloat();

-	PointY = questRecord[122].GetFloat();

-	PointOpt = questRecord[123].GetUInt32();

+		RewRepValue[i] = questRecord[108+i].GetInt32();

+

+	RewHonorAddition = questRecord[113].GetUInt32();

+	RewHonorMultiplier = questRecord[114].GetFloat();

+	RewOrReqMoney = questRecord[115].GetInt32();

+	RewMoneyMaxLevel = questRecord[116].GetUInt32();

+	RewSpell = questRecord[117].GetUInt32();

+	RewSpellCast = questRecord[118].GetInt32();

+	RewMailTemplateId = questRecord[119].GetUInt32();

+	RewMailDelaySecs = questRecord[120].GetUInt32();

+	PointMapId = questRecord[121].GetUInt32();

+	PointX = questRecord[122].GetFloat();

+	PointY = questRecord[123].GetFloat();

+	PointOpt = questRecord[124].GetUInt32();


	 for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)

-		DetailsEmote[i] = questRecord[124+i].GetUInt32();

+		DetailsEmote[i] = questRecord[125+i].GetUInt32();


	 for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)

-		DetailsEmoteDelay[i] = questRecord[128+i].GetUInt32();

+		DetailsEmoteDelay[i] = questRecord[129+i].GetUInt32();


-	IncompleteEmote = questRecord[132].GetUInt32();

-	CompleteEmote = questRecord[133].GetUInt32();

+	IncompleteEmote = questRecord[133].GetUInt32();

+	CompleteEmote = questRecord[134].GetUInt32();


	 for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)

-		OfferRewardEmote[i] = questRecord[134+i].GetInt32();

+		OfferRewardEmote[i] = questRecord[135+i].GetInt32();


	 for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)

-		OfferRewardEmoteDelay[i] = questRecord[138+i].GetInt32();

+		OfferRewardEmoteDelay[i] = questRecord[139+i].GetInt32();


-	QuestStartScript = questRecord[142].GetUInt32();

-	QuestCompleteScript = questRecord[143].GetUInt32();

+	QuestStartScript = questRecord[143].GetUInt32();

+	QuestCompleteScript = questRecord[144].GetUInt32();


	 QuestFlags |= SpecialFlags << 20;

	 if (QuestFlags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT)

diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h

index 8c41574..3a6702f 100755

--- a/src/server/game/Quests/QuestDef.h

+++ b/src/server/game/Quests/QuestDef.h

@@ -197,7 +197,9 @@ class Quest

		 uint32 GetMaxLevel() const { return MaxLevel; }

		 uint32 GetQuestLevel() const { return QuestLevel; }

		 uint32 GetType() const { return Type; }

+		uint32 GetRequiredClasses() const { return RequiredClasses; }

		 uint32 GetRequiredRaces() const { return RequiredRaces; }

+		uint32 GetRequiredSkill() const { return RequiredSkill; }

		 uint32 GetRequiredSkillValue() const { return RequiredSkillValue; }

		 uint32 GetRepObjectiveFaction() const { return RepObjectiveFaction; }

		 int32  GetRepObjectiveValue() const { return RepObjectiveValue; }

@@ -305,7 +307,9 @@ class Quest

		 uint32 MaxLevel;

		 int32  QuestLevel;

		 uint32 Type;

-		uint32 RequiredRaces;

+		uint32 RequiredClasses;

+		uint32 RequiredRaces;

+		uint32 RequiredSkill;

		 uint32 RequiredSkillValue;

		 uint32 RepObjectiveFaction;

		 int32  RepObjectiveValue;

PS : Not sure if right place to post this don’t get mad /emoticons/default_smile.png

patch0.patch

This may need approval from db devs.

I have been testing it for the last three weeks, there is no major issue about this. I’ll continue testing further, but for now I see no reason why we wouldn’t port it /emoticons/default_smile.png

i think we discussed this change somewhere before, dont know why it wasnt ported or what the exact claim was… WDB maybe?

http://www.trinitycore.org/f/topic/58-wdb-fields/

Can’t see this field on the WDB fields list.