/// <summary>
        /// Called when the player wins a battle.
        /// </summary>
        internal static void WinBattle(this LogicClientAvatar avatar, int trophies = 30)
        {
            LogicLeagueData league = (LogicLeagueData)CSV.Tables.Get(Gamefile.Leagues).GetDataWithID(avatar.League);

            avatar.AddGold(league.PVPGoldReward);
            avatar.AddXP(league.PVPXpReward);
            avatar.AddTrophies(trophies);

            avatar.Variables.AddItem(LogicVariables.Wins.GlobalID, 1);
            avatar.Variables.AddItem(LogicVariables.WinStreak.GlobalID, 1);
            avatar.Variables.AddItem(LogicVariables.Matches.GlobalID, 1);

            avatar.Variables.AddItem(LogicVariables.ChestProgress.GlobalID, 1);
            avatar.Variables.AddItem(LogicVariables.ChestProgressUpdated.GlobalID, 1);

            if (avatar.Variables.Get(LogicVariables.ChestProgress.GlobalID).Count == 5 && avatar.Variables.Get(LogicVariables.ChestProgressUpdated.GlobalID).Count == 5)
            {
                avatar.Variables.Set(LogicVariables.ChestProgress.GlobalID, 0);
                avatar.Variables.Set(LogicVariables.ChestProgressUpdated.GlobalID, 0);

                LogicChest chest = new LogicChest(avatar);
                chest.CreateMegaChest();
            }
        }