Guest User

Untitled

a guest
Jul 5th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. case -1://Ouvrir banque
  2.                 //Sauvagarde du perso et des item avant.
  3.                 SQLManager.SAVE_PERSONNAGE(perso,true);
  4.                 if(perso.getDeshonor() >= 1)
  5.                 {
  6.                     SocketManager.GAME_SEND_Im_PACKET(perso, "183");
  7.                     return;
  8.                 }
  9.                 int cost = perso.getBankCost();
  10.                 if(cost > 0)
  11.                 {
  12.                     long nKamas = perso.get_kamas() - cost;
  13.                    
  14.                     if (nKamas < 0)//Si le joueur n'a pas assez de kamas pour ouvrir la banque
  15.                     {
  16.                           long bankKamas = perso.getBankKamas();
  17.                           if(bankKamas >= nKamas)
  18.                           {
  19.                                perso.set_kamas( 0 ); //On puise l'entièreter des kamas du joueurs. Ankalike ?
  20.                                perso.setBankKamas(bankKamas-nKamas); //On modifie les kamas de la banque
  21.                                nKamas = 0; //How todo more crap? xd
  22.                           }else
  23.                           {
  24.                                SocketManager.GAME_SEND_MESSAGE_SERVER(perso, "10|"+cost);
  25.                                return;
  26.                           }
  27.                     }
  28.                     perso.set_kamas(nKamas);
  29.                     SocketManager.GAME_SEND_STATS_PACKET(perso);
  30.                     SocketManager.GAME_SEND_Im_PACKET(perso, "020;"+cost);
  31.                 }
  32.                 SocketManager.GAME_SEND_ECK_PACKET(perso.get_compte().getGameThread().get_out(), 5, "");
  33.                 SocketManager.GAME_SEND_EL_BANK_PACKET(perso);
  34.                 perso.set_away(true);
  35.                 perso.setInBank(true);
  36.             break;
Advertisement
Add Comment
Please, Sign In to add comment