Advertisement
-JRGames-

Equipar Itens na Primeira Classe

Apr 28th, 2024 (edited)
1,203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.37 KB | Source Code | 0 0
  1. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  2. index 828f57e..797e0a3 100644
  3. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  4. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  5. @@ -345,6 +345,14 @@
  6.         {
  7.             showQuestionMark(player);
  8.         }
  9. +
  10. +       // After class change is successful, equip items based on class
  11. +       player.equipItemsBasedOnClass();
  12. +
  13.         return true;
  14.     }
  15.    
  16. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  17. index 4bfbeef..649e2a1 100644
  18. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  19. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  20. @@ -15470,4 +15470,84 @@
  21.         isPVEMode = b;
  22.     }
  23.  
  24. +// Determina quais itens devem equipar com base na classe do personagem
  25. +   public void equipItemsBasedOnClass() {
  26. +       int[] itemIds;
  27. +
  28. +       switch (this.getClassId()) {
  29. +           case warrior:
  30. +               itemIds = new int[]{352, 2378, 2411, 2425, 2449, 2525, 881, 881, 850, 850, 913, 297, 1463, 728, 1539, 736, 9612};
  31. +               break;
  32. +           case knight:
  33. +           case elvenKnight:
  34. +           case palusKnight:
  35. +           case scavenger:
  36. +           case artisan:
  37. +               itemIds = new int[]{352, 2378, 2411, 2425, 2449, 2499, 881, 881, 850, 850, 913, 2493, 159, 1463, 728, 1539, 736, 9612};
  38. +               break;
  39. +           case rogue:
  40. +           case elvenScout:
  41. +           case assassin:
  42. +               itemIds = new int[]{395, 417, 2424, 2448, 2412, 225, 881, 881, 850, 850, 913, 280, 1463, 728, 1539, 736, 9612};
  43. +               break;
  44. +           case wizard:
  45. +           case cleric:
  46. +           case elvenWizard:
  47. +           case oracle:
  48. +           case darkWizard:
  49. +           case shillienOracle:
  50. +           case orcShaman:
  51. +               itemIds = new int[]{437, 470, 2450, 2426, 2412, 189, 881, 881, 850, 850, 913, 629, 1463, 728, 1539, 736, 9613};
  52. +               break;
  53. +           case orcRaider:
  54. +               itemIds = new int[]{352, 2378, 2411, 2425, 2449, 70, 881, 881, 850, 850, 913, 297, 1463, 728, 1539, 736, 9612};
  55. +               break;
  56. +           case orcMonk:
  57. +               itemIds = new int[]{395, 417, 2424, 2448, 2412, 262, 881, 881, 850, 850, 913, 1463, 728, 1539, 736, 9612};
  58. +               break;
  59. +           default:
  60. +               // Classe não encontrada, sair
  61. +               return;
  62. +       }
  63. +
  64. +       equipItems(itemIds);
  65. +
  66. +       // Adicionar itens ao inventário
  67. +       this.getInventory().addItem("Soul Shot Grade D", 1463, 2000, this, null);
  68. +       this.getInventory().addItem("Spirit Shot Grade D", 3948, 2000, this, null);
  69. +       this.getInventory().addItem("Mana Potion", 728, 200, this, null);
  70. +       this.getInventory().addItem("Greater Healing Potion", 1539, 200, this, null);
  71. +       this.getInventory().addItem("Scroll of Scape", 736, 5, this, null);
  72. +   }
  73. +
  74. +   private void equipItems(int... itemIds) {
  75. +       for (int itemId : itemIds) {
  76. +           ItemInstance item = this.getInventory().addItem("Armor", itemId, 1, this, null);
  77. +           // Verificar se o item pode ser equipado
  78. +           if (item.getItem().getBodyPart() != 0) {
  79. +               this.getInventory().equipItemAndRecord(item);
  80. +           }
  81. +       }
  82. +
  83. +       this.getInventory().updateDatabase();
  84. +       this.sendPacket(new ItemList(this, true));
  85. +       MagicSkillUse MSU = new MagicSkillUse(this, this, 2024, 1, 1, 0);
  86. +       this.broadcastPacket(MSU);
  87. +   }
  88.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement