Advertisement
-JRGames-

Equipar Itens na Primeira Classe Acis 401

Jul 6th, 2024
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.49 KB | None | 0 0
  1. diff --git a/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java b/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  2. index 023516a..0fef0f9 100644
  3. --- a/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  4. +++ b/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  5.         return gms;
  6.     }
  7. +
  8. +   // Determina quais itens devem equipar com base na classe do personagem
  9. +   public void equipItemsBasedOnClass() {
  10. +       int[] itemIds;
  11. +
  12. +       switch (this.getClassId()) {
  13. +       case WARRIOR:
  14. +           itemIds = new int[] { 352, 2378, 2411, 2425, 2449, 2525, 881, 881, 850, 850, 913, 297, 1463, 728, 1539, 736,
  15. +                   9612 };
  16. +           break;
  17. +       case KNIGHT:
  18. +       case TEMPLE_KNIGHT:
  19. +       case PALUS_KNIGHT:
  20. +       case SCAVENGER:
  21. +       case ARTISAN:
  22. +           itemIds = new int[] { 352, 2378, 2411, 2425, 2449, 2499, 881, 881, 850, 850, 913, 2493, 159, 1463, 728,
  23. +                   1539, 736, 9612 };
  24. +           break;
  25. +       case ROGUE:
  26. +       case ELVEN_SCOUT:
  27. +       case ASSASSIN:
  28. +           itemIds = new int[] { 395, 417, 2424, 2448, 2412, 225, 881, 881, 850, 850, 913, 280, 1463, 728, 1539, 736,
  29. +                   9612 };
  30. +           break;
  31. +       case HUMAN_WIZARD:
  32. +       case CLERIC:
  33. +       case ELVEN_WIZARD:
  34. +       case ELVEN_ORACLE:
  35. +       case DARK_WIZARD:
  36. +       case SHILLIEN_ORACLE:
  37. +       case ORC_SHAMAN:
  38. +           itemIds = new int[] { 437, 470, 2450, 2426, 2412, 189, 881, 881, 850, 850, 913, 629, 1463, 728, 1539, 736,
  39. +                   9613 };
  40. +           break;
  41. +       case ORC_RAIDER:
  42. +           itemIds = new int[] { 352, 2378, 2411, 2425, 2449, 70, 881, 881, 850, 850, 913, 297, 1463, 728, 1539, 736,
  43. +                   9612 };
  44. +           break;
  45. +       case MONK:
  46. +           itemIds = new int[] { 395, 417, 2424, 2448, 2412, 262, 881, 881, 850, 850, 913, 1463, 728, 1539, 736,
  47. +                   9612 };
  48. +           break;
  49. +       default:
  50. +           // Classe não encontrada, sair
  51. +           return;
  52. +       }
  53. +
  54. +       equipItems(itemIds);
  55. +
  56. +       // Adicionar itens ao inventário
  57. +       this.getInventory().addItem("Soul Shot Grade D", 1463, 2000, this, null);
  58. +       this.getInventory().addItem("Spirit Shot Grade D", 3948, 2000, this, null);
  59. +       this.getInventory().addItem("Mana Potion", 728, 200, this, null);
  60. +       this.getInventory().addItem("Greater Healing Potion", 1539, 200, this, null);
  61. +       this.getInventory().addItem("Scroll of Scape", 736, 5, this, null);
  62. +   }
  63. +
  64. +   private void equipItems(int... itemIds) {
  65. +       for (int itemId : itemIds) {
  66. +           ItemInstance item = this.getInventory().addItem("Armor", itemId, 1, this, null);
  67. +           // Verificar se o item pode ser equipado
  68. +           if (item.getItem().getBodyPart() != 0) {
  69. +               this.getInventory().equipItemAndRecord(item);
  70. +           }
  71. +       }
  72. +
  73. +       this.getInventory().updateDatabase();
  74. +       this.sendPacket(new ItemList(this, true));
  75. +       MagicSkillUse MSU = new MagicSkillUse(this, this, 2024, 1, 1, 0);
  76. +       this.broadcastPacket(MSU);
  77. +   }
  78.  }
  79. \ No newline at end of file
  80. diff --git a/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/ClassMaster.java b/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/ClassMaster.java
  81. index 766a843..36f3ee4 100644
  82. --- a/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/ClassMaster.java
  83. +++ b/acis_public-master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/ClassMaster.java
  84.         player.refreshHennaList();
  85.         player.broadcastUserInfo();
  86. +
  87. +       // After class change is successful, equip items based on class
  88. +       player.equipItemsBasedOnClass();
  89. +
  90.         return true;
  91.     }
  92.  
  93. \ No newline at end of file
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement