Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case -1://Ouvrir banque
- //Sauvagarde du perso et des item avant.
- SQLManager.SAVE_PERSONNAGE(perso,true);
- if(perso.getDeshonor() >= 1)
- {
- SocketManager.GAME_SEND_Im_PACKET(perso, "183");
- return;
- }
- final int cost = perso.get_compte().getBankCost();
- if(cost > 0)
- {
- final long playerKamas = perso.get_kamas();
- final long kamasRemaining = playerKamas - cost;
- final long bankKamas = perso.get_compte().GetBankKamas();
- final long totalKamas = bankKamas+playerKamas;
- if (kamasRemaining < 0)//Si le joueur n'a pas assez de kamas SUR LUI pour ouvrir la banque
- {
- if(bankKamas >= cost)
- {
- perso.setBankKamas(bankKamas-cost); //On modifie les kamas de la banque
- }
- else if(totalKamas >= cost)
- {
- perso.set_kamas( 0 ); //On puise l'entièreter des kamas du joueurs. Ankalike ?
- perso.setBankKamas(totalKamas-cost); //On modifie les kamas de la banque
- SocketManager.GAME_SEND_STATS_PACKET(perso);
- SocketManager.GAME_SEND_Im_PACKET(perso, "020;"+playerKamas);
- }else
- {
- SocketManager.GAME_SEND_MESSAGE_SERVER(perso, "10|"+cost);
- return;
- }
- } else //Si le joueur a les kamas sur lui on lui retire directement
- {
- perso.set_kamas(kamasRemaining);
- SocketManager.GAME_SEND_STATS_PACKET(perso);
- SocketManager.GAME_SEND_Im_PACKET(perso, "020;"+cost);
- }
- }
- SocketManager.GAME_SEND_ECK_PACKET(perso.get_compte().getGameThread().get_out(), 5, "");
- SocketManager.GAME_SEND_EL_BANK_PACKET(perso);
- perso.set_away(true);
- perso.setInBank(true);
- break;
Advertisement
Add Comment
Please, Sign In to add comment