Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. case 51: //FM exo
  2. String[] arg;
  3. Objects o;
  4. String exp = "." + command.getName() + " position element ";
  5. String pos = "Liste des positions : cape, coiffe, anneau1, anneau2, amulette, ceinture, bottes, familier, arme";
  6. if(msg.length() <= command.getName().length()+2)
  7. {
  8. SocketManager.GAME_SEND_MESSAGE(_perso, exp, Config.CONFIG_MOTD_COLOR);
  9. break;
  10. }
  11. arg = msg.substring(command.getName().length()+2, msg.length()-1).split(" ");
  12. if(arg.length < 2)
  13. {
  14. SocketManager.GAME_SEND_MESSAGE(_perso, exp, Config.CONFIG_MOTD_COLOR);
  15. break;
  16. }
  17.  
  18. int actualpoints = Util.loadPointsByAccount(_perso.get_compte());
  19. if(actualpoints < 150) {
  20. SocketManager.GAME_SEND_MESSAGE(_perso, "Erreur: vous devez avoir 150 points à fin d'effectuer cette action.", Config.CONFIG_MOTD_COLOR);
  21. break;
  22. }
  23.  
  24. switch(arg[0])
  25. {
  26. case "cape":
  27. o = _perso.getObjetByPos(Constant.ITEM_POS_CAPE);
  28. break;
  29. case "coiffe":
  30. o = _perso.getObjetByPos(Constant.ITEM_POS_COIFFE);
  31. break;
  32. case "anneau1":
  33. o = _perso.getObjetByPos(Constant.ITEM_POS_ANNEAU1);
  34. break;
  35. case "anneau2":
  36. o = _perso.getObjetByPos(Constant.ITEM_POS_ANNEAU2);
  37. break;
  38. case "amulette":
  39. o = _perso.getObjetByPos(Constant.ITEM_POS_AMULETTE);
  40. break;
  41. case "bottes":
  42. o = _perso.getObjetByPos(Constant.ITEM_POS_BOTTES);
  43. break;
  44. case "ceinture":
  45. o = _perso.getObjetByPos(Constant.ITEM_POS_CEINTURE);
  46. break;
  47. case "arme":
  48. o = _perso.getObjetByPos(Constant.ITEM_POS_ARME);
  49. break;
  50. case "familier":
  51. o = _perso.getObjetByPos(Constant.ITEM_POS_FAMILIER);
  52. break;
  53. default:
  54. o = null;
  55. }
  56.  
  57. if(o == null)
  58. {
  59. SocketManager.GAME_SEND_MESSAGE(_perso, pos, Config.CONFIG_MOTD_COLOR);
  60. break;
  61. }
  62.  
  63. int element = -1;
  64. switch(arg[1])
  65. {
  66. case "pa":
  67. element = Constant.STATS_ADD_PA;
  68. break;
  69. case "pm":
  70. element = Constant.STATS_ADD_PM;
  71. break;
  72. case "po":
  73. element = Constant.STATS_ADD_PO;
  74. break;
  75. case "invo":
  76. element = Constant.STATS_CREATURE;
  77. break;
  78. default:
  79. SocketManager.GAME_SEND_MESSAGE(_perso, "L'élément " + arg[1] + " n'existe pas ! Liste des élément : pa, pm, po", Config.CONFIG_MOTD_COLOR);
  80. break;
  81. }
  82. if(o.getStats().getEffect(element) > 0)
  83. {
  84. SocketManager.GAME_SEND_MESSAGE(_perso, "L'élément " + arg[1] + " est déjà dans l'item !", Config.CONFIG_MOTD_COLOR);
  85. break;
  86. }
  87. if(element == -1) break;
  88. o.getStats().addOneStat(element, 1);
  89.  
  90. Util.updatePointsByAccount(_perso.get_compte(), actualpoints-150);
  91. if(actualpoints-150>0)
  92. SocketManager.GAME_SEND_MESSAGE(_perso, "Il vous reste "+ Util.loadPointsByAccount(_perso.get_compte())+" points boutiques !", Config.CONFIG_MOTD_COLOR);
  93. SocketManager.GAME_SEND_STATS_PACKET(_perso);
  94. SocketManager.GAME_SEND_MESSAGE(_perso, "Votre objet <b>" + o.getTemplate().getName() + "</b> a été forgemagé avec succès ! Il a 1 " + arg[1] + " de plus !", Config.CONFIG_MOTD_COLOR);
  95. SocketManager.GAME_SEND_MESSAGE(_perso, "Déconnecter immédiatement pour voir les modifications apportés à votre objet sous peine de perdre l'exo!", Config.CONFIG_MOTD_COLOR);
  96. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement