@Override
 public void parse(GameClient client, String packet) {
   if (World.data.isMarchandMap(client.getPlayer().getMap().getId())) {
     SocketManager.GAME_SEND_Im_PACKET(client.getPlayer(), "113");
     return;
   }
   if (client.getPlayer().getMap().getId() == 33
       || client.getPlayer().getMap().getId() == 38
       || client.getPlayer().getMap().getId() == 4601
       || client.getPlayer().getMap().getId() == 4259
       || client.getPlayer().getMap().getId() == 8036
       || client.getPlayer().getMap().getId() == 10301) {
     if (client.getPlayer().getMap().getStoreCount() >= 25) {
       SocketManager.GAME_SEND_Im_PACKET(client.getPlayer(), "125;25");
       return;
     }
   } else if (client.getPlayer().getMap().getStoreCount() >= 6) {
     SocketManager.GAME_SEND_Im_PACKET(client.getPlayer(), "125;6");
     return;
   }
   long Apayer2 = client.getPlayer().storeAllBuy() / 1000;
   if (client.getPlayer().getKamas() < Apayer2) {
     SocketManager.GAME_SEND_Im_PACKET(client.getPlayer(), "176");
     return;
   }
   if (Apayer2 < 0) {
     SocketManager.GAME_SEND_MESSAGE(
         client.getPlayer(),
         "Erreur de mode marchand, la somme est n�gatif.",
         Server.config.getMotdColor());
     return;
   }
   int orientation = Formulas.getRandomValue(1, 3);
   client.getPlayer().setKamas(client.getPlayer().getKamas() - Apayer2);
   client.getPlayer().setOrientation(orientation);
   Maps map = client.getPlayer().getMap();
   client.getPlayer().setSeeSeller(true);
   World.data.addSeller(client.getPlayer().getId(), client.getPlayer().getMap().getId());
   client.kick();
   for (Player z : map.getPlayers())
     if (z != null && z.isOnline()) SocketManager.GAME_SEND_MERCHANT_LIST(z, z.getMap().getId());
 }
예제 #2
0
 /**
  * Creer une creature sur la Map donnee
  *
  * @param id id de la creature
  * @param name nom de la creature
  * @param map map de la creature
  * @param cell cellule de la creature
  * @param orientation orientation initiale
  */
 public Creature(int id, String name, Maps map, Case cell, int orientation) {
   super(id, name);
   this.map = map;
   this.cell = (cell != null) ? cell : map.getCases().get(map.getRandomFreeCell());
   this.orientation = orientation % 8;
 }