Permalink
Browse files

Merge pull request #332 from ak47sigh/master

Added New Limit: Honor & Arena points
  • Loading branch information...
dfighter1985 committed Feb 5, 2013
2 parents 2758314 + 2c822d2 commit 78bb2dc01f1ee420a745881b10d7ddcd893eb7e3
View
@@ -795,6 +795,12 @@
* Mana
* Maximum mana allowed for a player
* Default value: 80000
* Honor
* Maximum honor points allowed for a player
* Default value: 75000
* Arena
* Maximum arena points allowed for a player
* Default value: 5000
* Disconnect
* Disconnect player that exceeds limits above
* Default value: 0 (disabled)
@@ -806,4 +812,4 @@
*
*****************************************************/
<Limits Enable="1" AutoAttackDmg="10000" SpellDmg="30000" Health="100000" Mana="80000" Disconnect="0" BroadcastGMs="1">
<Limits Enable="1" AutoAttackDmg="10000" SpellDmg="30000" Health="100000" Mana="80000" Honor="75000" Arena="5000" Disconnect="0" BroadcastGMs="1">
@@ -42,7 +42,8 @@ void HonorHandler::AddHonorPointsToPlayer(Player* pPlayer, uint32 uAmount)
return;
pPlayer->m_honorPoints += uAmount;
pPlayer->m_honorToday += uAmount;
if(pPlayer->m_honorPoints > 75000) pPlayer->m_honorPoints = 75000;
if(pPlayer->m_honorPoints > sWorld.m_limits.honorpoints)
pPlayer->m_honorPoints = sWorld.m_limits.honorpoints;
RecalculateHonorFields(pPlayer);
}
@@ -3003,7 +3003,29 @@ void Player::LoadFromDBProc(QueryResultVector & results)
m_FirstLogin = get_next_field.GetBool();
rename_pending = get_next_field.GetBool();
m_arenaPoints = get_next_field.GetUInt32();
if(m_arenaPoints > 5000) m_arenaPoints = 5000;
if(m_arenaPoints > sWorld.m_limits.arenapoints)
{
char hlogmsg[256];
snprintf(hlogmsg, 256, "has over %u arena points (%u)", sWorld.m_limits.arenapoints, m_arenaPoints);
sCheatLog.writefromsession(m_session, hlogmsg);
if(sWorld.m_limits.broadcast) // report to online GMs
{
string gm_ann = MSG_COLOR_GREEN;
gm_ann += "|Hplayer:";
gm_ann += GetName();
gm_ann += "|h[";
gm_ann += GetName();
gm_ann += "]|h: ";
gm_ann += MSG_COLOR_YELLOW;
gm_ann += hlogmsg;
sWorld.SendGMWorldText(gm_ann.c_str());
}
if(sWorld.m_limits.disconnect)
{
m_session->Disconnect();
}
m_arenaPoints = sWorld.m_limits.arenapoints;
}
for(uint32 z = 0; z < NUM_CHARTER_TYPES; ++z)
m_charters[z] = objmgr.GetCharterByGuid(GetGUID(), (CharterTypes)z);
for(uint32 z = 0; z < NUM_ARENA_TEAM_TYPES; ++z)
@@ -3149,7 +3171,29 @@ void Player::LoadFromDBProc(QueryResultVector & results)
m_honorToday = get_next_field.GetUInt32();
m_honorYesterday = get_next_field.GetUInt32();
m_honorPoints = get_next_field.GetUInt32();
if(m_honorPoints > 75000) m_honorPoints = 75000;
if(m_honorPoints > sWorld.m_limits.honorpoints)
{
char hlogmsg[256];
snprintf(hlogmsg, 256, "has over %u honor points (%u)", sWorld.m_limits.honorpoints, m_honorPoints);
sCheatLog.writefromsession(m_session, hlogmsg);
if(sWorld.m_limits.broadcast) // report to online GMs
{
string gm_ann = MSG_COLOR_GREEN;
gm_ann += "|Hplayer:";
gm_ann += GetName();
gm_ann += "|h[";
gm_ann += GetName();
gm_ann += "]|h: ";
gm_ann += MSG_COLOR_YELLOW;
gm_ann += hlogmsg;
sWorld.SendGMWorldText(gm_ann.c_str());
}
if(sWorld.m_limits.disconnect)
{
m_session->Disconnect();
}
m_honorPoints = sWorld.m_limits.honorpoints;
}
RolloverHonor();
iInstanceType = get_next_field.GetUInt32();
@@ -13663,4 +13707,4 @@ void Player::AddVehicleComponent( uint32 creature_entry, uint32 vehicleid ){
void Player::RemoveVehicleComponent(){
delete vehicle;
vehicle = NULL;
}
}
@@ -1474,6 +1474,8 @@ void World::Rehash(bool load)
m_limits.spellDamageCap = (uint32)Config.MainConfig.GetIntDefault("Limits", "SpellDmg", 30000);
m_limits.healthCap = (uint32)Config.MainConfig.GetIntDefault("Limits", "Health", 80000);
m_limits.manaCap = (uint32)Config.MainConfig.GetIntDefault("Limits", "Mana", 80000);
m_limits.honorpoints = (uint32)Config.MainConfig.GetIntDefault("Limits", "Honor", 75000);
m_limits.arenapoints = (uint32)Config.MainConfig.GetIntDefault("Limits", "Arena", 5000);
m_limits.disconnect = Config.MainConfig.GetBoolDefault("Limits", "Disconnect", false);
m_limits.broadcast = Config.MainConfig.GetBoolDefault("Limits", "BroadcastGMs", true);
View
@@ -658,6 +658,8 @@ class SERVER_DECL World : public Singleton<World>, public EventableObject
uint32 spellDamageCap;
uint32 healthCap;
uint32 manaCap;
uint32 honorpoints;
uint32 arenapoints;
bool disconnect;
bool broadcast;
} m_limits;

0 comments on commit 78bb2dc

Please sign in to comment.