PDA

View Full Version : [TrinityCore] [VIP][MOD] Quest VIP rates



Wise
14-02-16, 11:42 PM
CREDITS : slp13at420


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 (http://www.mmopro.org/forums/c-scripts-and-patches/21038-grumboz-vip-system.html)

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


The .DIFF patch (https://github.com/BlackWolfsDen/DIFFS/blob/master/VIP/Quest_Rewards_MOD.diff)

Modify Quest Reward rates:


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

first add:





#include "Grumboz_VIP_Core.h"




with the rest of the includes.



find Function:




void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGUID, bool activateAccept) const



add at the top:




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

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

float rate = (sWorld->getRate(RATE_XP_QUEST) + (sWorld->getRate(RATE_XP_QUEST) * MOD));



then find:




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



and replace with:




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);



then find:




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



and replace with:




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);



then find:




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



and replace with:




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);





find Function:




void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const



add at the top of the function:




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

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



then find:




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



and replace with:




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)



then find:




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



and replace with:




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);



then find:




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



and replace with:




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]);





find function:




void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUID, bool enableNext) const



add at the top:




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

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



then find:




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



and replace with:




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);



then find:




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



and replace with:




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);



then find:




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



and replace with:




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);






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

first add:





#include "Grumboz_VIP_Core.h"




with the rest of the includes.



find function




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



add at the top of the function:




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

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



then find:




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



and replace with:




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



then find:




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



and replace with:




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



then find:




moneyRew = int32(quest->GetRewMoneyMaxLevel());



and replace with:




moneyRew = int32(quest->GetRewMoneyMaxLevel() + (quest->GetRewMoneyMaxLevel() * MOD));



then find:




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



and replace with:




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



then find:




if (quest->GetRewArenaPoints())
ModifyArenaPoints(quest->GetRewArenaPoints());



and replace with:




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





find function:




void Player::SendQuestReward(Quest const* quest, uint32 XP)



add at the top:




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

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



then find:




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

data << uint32(ModRewMoney);
}



and replace with:




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);
}



then find:




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



and replace with:




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

data << uint32(ModRewMoney + int32(quest->GetRewMoneyMaxLevel() * DropMoneyRate));



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


The .DIFF patch (https://github.com/BlackWolfsDen/DIFFS/blob/master/VIP/Quest_Rewards_MOD.diff)