Esempio n. 1
0
 public void CalculateBattleResult(Account ac)
 {
     for (int i = 0; i < 16; i++)
     {
         Account playerBySlot = this.getPlayerBySlot(i);
         bool    flag         = playerBySlot != null;
         if (flag)
         {
             bool trainigExpEnable = Config.TrainigExpEnable;
             int  num;
             int  num2;
             if (trainigExpEnable)
             {
                 num  = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 25;
                 num2 = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 50;
             }
             else
             {
                 num  = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 10;
                 num2 = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 8;
             }
             this.updateFights(i,playerBySlot);
             playerBySlot.setExp(playerBySlot.getExp() + num2 + Config.BonusXP);
             playerBySlot.setGP(playerBySlot.getGP() + num);
             playerBySlot.setMoney(playerBySlot.getMoney() + 100);
             this.getSlot(i).gp  = num;
             this.getSlot(i).exp = num2;
             playerBySlot._statistic.setHeadShotKilled(playerBySlot.getRoom().getSlot(playerBySlot.getSlot()).headshotsInPlay);
             for (int j = 0; j < playerBySlot.getRoom().getSlot(playerBySlot.getSlot()).headshotsInPlay; j++)
             {
                 SLOT slot = playerBySlot.getRoom().getSlot(playerBySlot.getSlot());
                 slot.allKills--;
             }
             playerBySlot._statistic.setKills(playerBySlot.getRoom().getSlot(playerBySlot.getSlot()).allKills);
             playerBySlot._statistic.setDeaths(playerBySlot.getRoom().getSlot(playerBySlot.getSlot()).allDeaths);
             int  onNextLevel = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._onNextLevel;
             int  onAllExp    = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._onAllExp;
             int  onGPUp      = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._onGPUp;
             int  itemid      = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._itemid;
             bool flag2       = playerBySlot.getExp() >= onNextLevel && playerBySlot.getRank() < 50;
             if (flag2)
             {
                 int exp = playerBySlot.getExp() - onNextLevel;
                 playerBySlot.setExp(exp);
                 playerBySlot.setRank(playerBySlot.getRank() + 1);
                 playerBySlot.setGP(playerBySlot.getGP() + onGPUp);
                 playerBySlot.sendPacket(new SM_PLAYER_UP_LEVEL(playerBySlot.getRank(),itemid));
                 CLogger.getInstance().extra_info("[Player] " + playerBySlot.getPlayerName() + " up level");
             }
             AccountManager.getInstance().updatePlayer(playerBySlot);
         }
     }
     this.updateInfo();
 }
Esempio n. 2
0
 public void CalculateBattleResult(Account ac)
 {
     for (int index = 0; index < 16; ++index)
     {
         Account playerBySlot = this.getPlayerBySlot(index);
         if (playerBySlot != null)
         {
             int num1;
             int num2;
             if (Config.TrainigExpEnable)
             {
                 num1 = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 25;
                 num2 = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 50;
             }
             else
             {
                 num1 = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills * 8;
                 num2 = playerBySlot.getRoom().getSlots()[playerBySlot.getSlot()].allKills;
             }
             playerBySlot.setExp(playerBySlot.getExp() + num2);
             playerBySlot.setGP(playerBySlot.getGP() + num1);
             this.getSlot(index).gp  = num1;
             this.getSlot(index).exp = num2;
             playerBySlot._statistic.setKills(playerBySlot.getRoom().getSlot(playerBySlot.getSlot()).allKills,true);
             playerBySlot._statistic.setDeaths(playerBySlot.getRoom().getSlot(playerBySlot.getSlot()).allDeaths,true);
             int num3   = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._onAllExp;
             int num4   = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._onGPUp;
             int itemid = RankExpInfoHolder.getRankExpInfo(playerBySlot.getRank())._itemid;
             if (playerBySlot.getExp() >= num3 && playerBySlot.getRank() < 51)
             {
                 playerBySlot.setRank(playerBySlot.getRank() + 1);
                 playerBySlot.setGP(playerBySlot.getGP() + num4);
                 playerBySlot.sendPacket((SendBaseGamePacket) new opcode_2614_ACK(playerBySlot.getRank(),itemid));
                 CLogger.getInstance().extra_info("O jogador " + playerBySlot.getPlayerName() + " upou de nível!");
             }
             AccountManager.getInstance().updatePlayer(playerBySlot);
         }
     }
     this.updateInfo();
 }