• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[VIP][MOD] Quest VIP rates

slp13at420

Mad Scientist
Rather than cluttering up the VIP release thread I will be instead releasing any external mods in there own threads like this.

This is an external mod dependent on my VIP Engine:
This requires you have installed my VIP Engine Found Here -> VIP Engine
[Minimum required ver. 2.10]

Search you source for these files to edit:
/src/server/game/Entities/Creature/GossipDef.cpp
/src/server/game/Entities/Player/Player.cpp


Modify Quest Reward rates:


/src/server/game/Entities/Creature/GossipDef.cpp

first add:
Code:
[COLOR="#808080"]

#include "Grumboz_VIP_Core.h"

[/COLOR]

with the rest of the includes.



find Function:
Code:
[COLOR="#808080"]

void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGUID, bool activateAccept) const
[/COLOR]

add at the top:
Code:
[COLOR="#808080"]

	float VIP_OFFSET = VIP::GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = VIP::GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);

	Player* player = GetSession()->GetPlayer();

	float rate = (sWorld->getRate(RATE_XP_QUEST) + (sWorld->getRate(RATE_XP_QUEST) * MOD));
[/COLOR]

then find:
Code:
[COLOR="#808080"]

            data << uint32(quest->RewardChoiceItemCount[i]);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

			uint32 Item_Choice_Reward_Count = quest->RewardItemIdCount[i];

			uint32 extra_Item_Choice_Reward_Count = Item_Choice_Reward_Count * MOD;
			
			data << uint32(quest->RewardChoiceItemCount[i] + extra_Item_Choice_Reward_Count);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

			data << uint32(quest->RewardItemIdCount[i]);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

			uint32 Item_Reward_Count = quest->RewardItemIdCount[i];

			uint32 extra_Item_Reward_Count = Item_Reward_Count * MOD;

  		        data << uint32(quest->RewardItemIdCount[i] + extra_Item_Reward_Count);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

		data << uint32(quest->GetRewOrReqMoney() + quest->GetRewOrReqMoney());
		data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST));
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

		uint32 XP = quest->XPValue(player);
		float xp_rate = sWorld->getRate(RATE_XP_QUEST);
		uint32 MONEY = quest->GetRewOrReqMoney();

		uint32 extra_XP = XP * xp_rate + (xp_rate * MOD);
		uint32 extra_MONEY = MONEY + (MONEY * MOD);

		data << uint32(MONEY + extra_MONEY);
		data << uint32(XP + extra_XP);
[/COLOR]



find Function:
Code:
[COLOR="#808080"]

void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
[/COLOR]

add at the top of the function:
Code:
[COLOR="#808080"]

	float VIP_OFFSET = VIP::GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = VIP::GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);

	Player* player = GetSession()->GetPlayer();
[/COLOR]

then find:
Code:
[COLOR="#808080"]

    if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
        data << uint32(0);                                  // Hide money rewarded
    else
        data << uint32(quest->GetRewOrReqMoney());          // reward money (below max lvl)
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	uint32 MONEY = quest->GetRewOrReqMoney();
	uint32 extra_MONEY = MONEY * MOD;

    if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
        data << uint32(0);                                  // Hide money rewarded
    else
		data << uint32(MONEY + extra_MONEY);				// reward money (below max lvl)
[/COLOR]

then find:
Code:
[COLOR="#808080"]

			data << uint32(quest->RewardItemIdCount[i]);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

			uint32 Item_Reward_Count = quest->RewardItemIdCount[i];
			uint32 extra_Item_Reward_Count = Item_Reward_Count * MOD;

			data << uint32(quest->RewardItemIdCount[i] + extra_Item_Reward_Count);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

            data << uint32(quest->RewardChoiceItemCount[i]);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

			uint32 Item_Choice_Reward_Count = quest->RewardItemIdCount[i];
			uint32 extra_Item_Choice_Reward_Count = Item_Choice_Reward_Count * MOD;

			data << uint32(quest->RewardChoiceItemCount[i] + extra_Item_Choice_Reward_Count);// data << uint32(quest->RewardChoiceItemCount[i]);
[/COLOR]



find function:
Code:
[COLOR="#808080"]

void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUID, bool enableNext) const
[/COLOR]

add at the top:
Code:
[COLOR="#808080"]

	float VIP_OFFSET = VIP::GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = VIP::GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);

	Player* player = GetSession()->GetPlayer();
[/COLOR]

then find:
Code:
[COLOR="#808080"]

            data << uint32(quest->RewardChoiceItemCount[i]);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

		uint32 Item_Choice_Reward_Count = quest->RewardItemIdCount[i];
		uint32 extra_Item_Choice_Reward_Count = Item_Choice_Reward_Count * MOD;

		data << uint32(quest->RewardChoiceItemCount[i] + extra_Item_Choice_Reward_Count);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

			data << uint32(quest->RewardItemIdCount[i]);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

		uint32 Item_Reward_Count = quest->RewardItemIdCount[i];
		uint32 extra_Item_Reward_Count = Item_Reward_Count * MOD;

		data << uint32(quest->RewardItemIdCount[i] + extra_Item_Reward_Count);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

    data << uint32(quest->GetRewOrReqMoney());
    data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST));
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	uint32 XP = quest->XPValue(player);
	float xp_rate = sWorld->getRate(RATE_XP_QUEST);
	uint32 MONEY = quest->GetRewOrReqMoney();

	uint32 extra_XP = XP * xp_rate + (xp_rate * MOD);
	uint32 extra_MONEY = MONEY + (MONEY * MOD);

	data << uint32(MONEY + extra_MONEY);
	data << uint32(XP + extra_XP);
[/COLOR]




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

first add:
Code:
[COLOR="#808080"]

#include "Grumboz_VIP_Core.h"

[/COLOR]

with the rest of the includes.



find function
Code:
[COLOR="#808080"]

void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce)
[/COLOR]

add at the top of the function:
Code:
[COLOR="#808080"]

	float VIP_OFFSET = VIP::GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = VIP::GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);

	Player* player = GetSession()->GetPlayer();
[/COLOR]

then find:
Code:
[COLOR="#808080"]

	SendNewItem(item, quest->RewardItemIdCount[i], true, false);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	uint32 RewardItemCount = quest->RewardItemIdCount[i];
	SendNewItem(item, RewardItemCount + (RewardItemCount * MOD), true, false);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

   uint32 XP = rewarded && !quest->IsDFQuest() ? 0 : uint32(quest->XPValue(this)*sWorld->getRate(RATE_XP_QUEST));
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	uint32 XP = rewarded && !quest->IsDFQuest() ? 0 : uint32(quest->XPValue(this)*sWorld->getRate(RATE_XP_QUEST));
	XP = XP + (XP*MOD);
[/COLOR]

then find:
Code:
[COLOR="#808080"]

		moneyRew = int32(quest->GetRewMoneyMaxLevel());
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

		moneyRew = int32(quest->GetRewMoneyMaxLevel() + (quest->GetRewMoneyMaxLevel() * MOD));
[/COLOR]

then find:
Code:
[COLOR="#808080"]

    if (uint32 honor = quest->CalculateHonorGain(getLevel()))
        RewardHonor(NULL, 0, honor);
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	if (uint32 honor = quest->CalculateHonorGain(getLevel()))
	{
		honor = honor + (honor * MOD);
		RewardHonor(NULL, 0, honor);
	}
[/COLOR]

then find:
Code:
[COLOR="#808080"]

    if (quest->GetRewArenaPoints())
        ModifyArenaPoints(quest->GetRewArenaPoints());
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	if (quest->GetRewArenaPoints())
	{
		int32 ArenaPoints = quest->GetRewArenaPoints();
		int32 RewardArenaPoints = ArenaPoints + (ArenaPoints * MOD);
		ModifyArenaPoints(RewardArenaPoints);
	}
[/COLOR]



find function:
Code:
[COLOR="#808080"]

void Player::SendQuestReward(Quest const* quest, uint32 XP)
[/COLOR]

add at the top:
Code:
[COLOR="#808080"]

	float VIP_OFFSET = VIP::GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = VIP::GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);

	Player* player = GetSession()->GetPlayer();
[/COLOR]

then find:
Code:
[COLOR="#808080"]

	if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
    {
        data << uint32(XP);

		data << uint32(ModRewMoney);
    }
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

	int32 RewMoney = quest->GetRewOrReqMoney();
	int32 ModRewMoney = RewMoney + (RewMoney * MOD);
	XP = XP + (XP * MOD);

	if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
    {
        data << uint32(XP);

		data << uint32(ModRewMoney);
    }
[/COLOR]

then find:
Code:
[COLOR="#808080"]

        data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY)));
[/COLOR]

and replace with:
Code:
[COLOR="#808080"]

		float DropMoneyRate = sWorld->getRate(RATE_DROP_MONEY);
		DropMoneyRate = DropMoneyRate + (DropMoneyRate * MOD);

		data << uint32(ModRewMoney + int32(quest->GetRewMoneyMaxLevel() * DropMoneyRate));
[/COLOR]

After you have completed adding these edits and compiling,
players will now see the modified values and receive the modified rewards :D

 
Last edited:

Rochet2

Moderator / Eluna Dev
Protip: make a fork of the core and apply your changes there.
You can automatically generate a diff of the changes which is easier to apply than this and easier to look through and understand.
Additionally you can update the code easily later and everyone can go see for which version you made this for and what changed if you update the code in any way.

And all that for free.
github ftw.
 

slp13at420

Mad Scientist
oh yea I havn't played with making Diff's yet but yea that would be helpful :D

see what I can do this weekend :D
 
Last edited:

Rochet2

Moderator / Eluna Dev
In github it is enough that you have a fork of TC for example and that you make your stuff as a commit to it. Then you can hit the "make a pull request" button and fill .diff to the end of the url to see the diff.
 

Rochet2

Moderator / Eluna Dev
Looks like your repo is ancient :D
http://prntscr.com/9y9slm
http://prntscr.com/9y9t3i
http://prntscr.com/9y9u8f

Aand the result: https://github.com/TrinityCore/TrinityCore/compare/3.3.5...BlackWolfsDen:3.3.5.diff
Code:
https://github.com/TrinityCore/TrinityCore/compare/Rochet2:objscale...BlackWolfsDen:3.3.5.diff
If you look at the url here, you can see that at the end there is REPO:BRANCH...REPO:BRANCH.diff
You can basically just change those around to what you want in the url. But the "GUI" to do so is also nice.
 
Last edited:
Top