+/**********************END***************************/
+
+void Player::SetXPRate(uint32 rate)
+{
+ XPRate = rate;
+}
+
+uint32 Player::GetXPRate()
+{
+ return XPRate;
+}
+
+void Player::SetRate(uint32 rate)
+{
+ if (GetXPRate() >= 2)
+ {
+ GetSession()->SendAreaTriggerMessage("You can't set your xp rate more than once!");
+ }
+}
+
+void Player::UpdateXPRate(uint32 rate)
+{
+ CharacterDatabase.PExecute("UPDATE characters set XPRate='%u' where guid='%u';", rate, GetGUIDLow());
+}
+
/*********************************************************/
/*** SAVE SYSTEM ***/
/*********************************************************/
@@ -26320,4 +26350,4 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
//ObjectAccessor::UpdateObjectVisibility(pet);
return pet;
-}
+}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 1c0fa4e..2b7e1ea 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1457,6 +1457,16 @@ class Player : public Unit, public GridObject<Player>
static bool HandleBuffCommand(ChatHandler * handler, const char * args)
{
Player * player = handler->GetSession()->GetPlayer();
if (!*args)
{
handler->PSendSysMessage("You must write a number.");
return false;
}
uint32 newrate = (uint32)atoi((char*)args);
if (newrate > MaxRate || newrate == 0)
{
handler->PSendSysMessage("The value is too high!");
}
else
{
player->SetXPRate(newrate);
player->UpdateXPRate(newrate);
handler->PSendSysMessage("Your XP rate is now set to: %u.", newrate);
}
return true;
}
};
void AddSC_XP_Rate_Load()
{
new XP_Rate_Load();
new XP_Rate_Command();
}