Skip to content

Instantly share code, notes, and snippets.

@callmephil
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callmephil/9475266 to your computer and use it in GitHub Desktop.
Save callmephil/9475266 to your computer and use it in GitHub Desktop.
[Cata - TC] : Custom Item Rate
# Player.cpp
# Please ADD this file manually my Sources are corrupted
# This is for CATA trinity User
# Don't forget to add worldconfig
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 0625a65..5221cee 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -80,6 +80,7 @@
#include "WorldSession.h"
#include "MovementStructures.h"
#include "GameObjectAI.h"
+#include "Config.h"
@@ -3057,7 +3058,14 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
favored_exp_mult = 0.05f; // Thrallmar's Favor and Honor Hold's Favor
xp = uint32(xp * (1 + favored_exp_mult));
// Favored experience increase END
+
+ // Custom [Philippovitch - AC-Web] Start
+ float premium_account_exp = 0;
+ if(GetItemByEntry(sConfigMgr->GetIntDefault("Rate.Custom.ItemID", 6948)))
+ premium_account_exp = sConfigMgr->GetFloatDefault("Rate.Custom.Item.Xp", 1.0f);
+ xp = uint32(xp * (1 + premium_account_exp)); // Modify also Quest Gain
+ // Custom [Philippovitch - AC-Web] End
+
// XP to money conversion processed in Player::RewardQuest
if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
return;
@@ -7014,6 +7042,11 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
if (source != REPUTATION_SOURCE_SPELL && GetsRecruitAFriendBonus(false))
percent *= 1.0f + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS);
+ // Custom [Philippovitch - AC-Web] Start
+ if (source != REPUTATION_SOURCE_SPELL && GetItemByEntry(sConfigMgr->GetIntDefault("Rate.Custom.ItemID", 6948)))
+ percent *= sConfigMgr->GetFloatDefault("Rate.Custom.Item.Rep", 1.0f);
+ // Custom [Philippovitch - AC-Web] End
+
return CalculatePct(rep, percent);
}
@@ -7246,6 +7279,11 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
AddPct(honor_f, GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN_PCT));
}
+ // Custom [Philippovitch - Ac-Web] Start
+ if(GetItemByEntry(sConfigMgr->GetIntDefault("Rate.Custom.ItemID", 6948)))
+ { honor_f *= sConfigMgr->GetFloatDefault("Rate.Custom.Item.Honor", 1.0f); }
+ // Custom [Philippovitch - Ac-Web] End
+
honor_f *= sWorld->getRate(RATE_HONOR);
// Back to int now
honor = int32(honor_f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment