Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jMega_Interlude
- diff --git java/com/l2jmega/Config.java java/com/l2jmega/Config.java
- index 4db31f9..1f32640 100644
- --- java/com/l2jmega/Config.java
- +++ java/com/l2jmega/Config.java
- @@ -119,6 +119,8 @@
- public static boolean ALLOW_DRESS_ME_FOR_PREMIUM;
- public static boolean ALLOW_DRESS_ME_IN_OLY;
- + public static boolean UPGRADE_BOSS_JEWELS_ENCHANT;
- +
- public static int RANDOM_CRAFT_ITEM_ID_CONSUME;
- public static int RANDOM_CRAFT_ITEM_CONSUME_REFRESH;
- public static int RANDOM_CRAFT_ITEM_CONSUME_CREATE;
- @@ -4299,6 +4301,8 @@
- ALLOW_DRESS_ME_FOR_PREMIUM = l2jmega.getProperty("AllowDressMeForPremiumOnly", false);
- ALLOW_DRESS_ME_IN_OLY = l2jmega.getProperty("AllowDressMeInOly", false);
- + UPGRADE_BOSS_JEWELS_ENCHANT = l2jmega.getProperty("UpgradeBossJewels", false);
- +
- RANDOM_CRAFT_ITEM_ID_CONSUME = l2jmega.getProperty("RandomCraftItemId", 57);
- RANDOM_CRAFT_ITEM_CONSUME_REFRESH = l2jmega.getProperty("RandomCraftConsumeRefresh", 50000);
- diff --git java/com/l2jmega/gameserver/handler/admincommandhandlers/AdminEnchant.java java/com/l2jmega/gameserver/handler/admincommandhandlers/AdminEnchant.java
- index 6157e18..add3d43 100644
- --- java/com/l2jmega/gameserver/handler/admincommandhandlers/AdminEnchant.java
- +++ java/com/l2jmega/gameserver/handler/admincommandhandlers/AdminEnchant.java
- @@ -1,8 +1,10 @@
- package com.l2jmega.gameserver.handler.admincommandhandlers;
- +import com.l2jmega.Config;
- import com.l2jmega.gameserver.data.SkillTable;
- import com.l2jmega.gameserver.data.xml.ArmorSetData;
- import com.l2jmega.gameserver.handler.IAdminCommandHandler;
- +import com.l2jmega.gameserver.idfactory.IdFactory;
- import com.l2jmega.gameserver.model.L2Skill;
- import com.l2jmega.gameserver.model.WorldObject;
- import com.l2jmega.gameserver.model.actor.instance.Player;
- @@ -119,6 +121,42 @@
- final int oldEnchant = item.getEnchantLevel();
- item.setEnchantLevel(ench);
- +
- + if(Config.UPGRADE_BOSS_JEWELS_ENCHANT)
- + {
- + if (item.getEnchantLevel() >= 3 && (item.getItemId() == 6660 || item.getItemId() == 6658 || item.getItemId() == 6656 || item.getItemId() == 6659 || item.getItemId() == 8191) || item.getItemId() == 62228 || item.getItemId() == 62227 || item.getItemId() == 62212 || item.getItemId() == 62214 || item.getItemId() == 62216 || item.getItemId() == 62217 || item.getItemId() == 61212 || item.getItemId() == 61214 || item.getItemId() == 61216 || item.getItemId() == 61217) {
- + int nextEnchantLevel2 = item.getEnchantLevel();
- + int newItemId = 0;
- +
- + if (nextEnchantLevel2 == 3) {
- + newItemId = getNewItemIdForEnchant3(item.getItemId());
- + }
- + else if (nextEnchantLevel2 == 4) {
- + newItemId = getNewItemIdForEnchant4(item.getItemId());
- + }
- + else if (nextEnchantLevel2 == 5) {
- + newItemId = getNewItemIdForEnchant5(item.getItemId());
- + }
- +
- + if (newItemId != 0) {
- + activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false); // Eliminar el item actual
- +
- + // Crear el nuevo item con la nueva ID y enchant level
- + ItemInstance newItem = new ItemInstance(IdFactory.getInstance().getNextId(), newItemId);
- + newItem.setEnchantLevel(nextEnchantLevel2);
- + activeChar.addItem("Enchant", newItem, activeChar, true);
- + activeChar.getInventory().equipItemAndRecord(newItem);
- +
- + // Actualizar la base de datos
- + newItem.updateDatabase();
- + }
- + }
- + }
- +
- +
- +
- +
- +
- item.updateDatabase();
- // If item is equipped, verify the skill obtention/drop (+4 duals, +6 armorset).
- @@ -214,6 +252,57 @@
- AdminHelpPage.showHelpPage(activeChar, "enchant.htm");
- }
- + private static int getNewItemIdForEnchant3(int itemId) {
- + switch (itemId) {
- + case 6660:
- + return 61212; // Nueva ID del item para enchant +3
- + case 6658:
- + return 61214; // Nueva ID del item para enchant +3
- + case 6656:
- + return 61217; // Nueva ID del item para enchant +3
- + case 6659:
- + return 61216; // Nueva ID del item para enchant +3
- + case 8191:
- + return 62227; // Nueva ID del item para enchant +3
- + default:
- + return 0; // En caso de no encontrar la ID correspondiente
- + }
- + }
- +
- + private static int getNewItemIdForEnchant4(int itemId) {
- + switch (itemId) {
- + case 61212:
- + return 62212; // Nueva ID del item para enchant +4
- + case 61214:
- + return 62214; // Nueva ID del item para enchant +4
- + case 61217:
- + return 62217; // Nueva ID del item para enchant +4
- + case 61216:
- + return 62216; // Nueva ID del item para enchant +4
- + case 62227:
- + return 62228; // Nueva ID del item para enchant +4
- + default:
- + return 0; // En caso de no encontrar la ID correspondiente
- + }
- + }
- +
- + private static int getNewItemIdForEnchant5(int itemId) {
- + switch (itemId) {
- + case 62212:
- + return 63212; // Nueva ID del item para enchant +5
- + case 62214:
- + return 63214; // Nueva ID del item para enchant +5
- + case 62217:
- + return 63217; // Nueva ID del item para enchant +5
- + case 62216:
- + return 63216; // Nueva ID del item para enchant +5
- + case 62228:
- + return 63227; // Nueva ID del item para enchant +5
- + default:
- + return 0; // En caso de no encontrar la ID correspondiente
- + }
- + }
- +
- @Override
- public String[] getAdminCommandList()
- {
- diff --git java/com/l2jmega/gameserver/network/clientpackets/RequestEnchantItem.java java/com/l2jmega/gameserver/network/clientpackets/RequestEnchantItem.java
- index 5158806..b3b8fc0 100644
- --- java/com/l2jmega/gameserver/network/clientpackets/RequestEnchantItem.java
- +++ java/com/l2jmega/gameserver/network/clientpackets/RequestEnchantItem.java
- @@ -16,6 +16,7 @@
- import com.l2jmega.Config;
- import com.l2jmega.L2DatabaseFactory;
- +import com.l2jmega.gameserver.idfactory.IdFactory;
- import com.l2jmega.gameserver.model.Announcement;
- import com.l2jmega.gameserver.model.World;
- import com.l2jmega.gameserver.model.actor.instance.Player;
- @@ -733,7 +734,46 @@
- }
- +
- +
- +
- item.setEnchantLevel(item.getEnchantLevel() + 1);
- +
- + if(Config.UPGRADE_BOSS_JEWELS_ENCHANT)
- + {
- + if (item.getEnchantLevel() >= 3 && (item.getItemId() == 6660 || item.getItemId() == 6658 || item.getItemId() == 6656 || item.getItemId() == 6659 || item.getItemId() == 8191) || item.getItemId() == 62228 || item.getItemId() == 62227 || item.getItemId() == 62212 || item.getItemId() == 62214 || item.getItemId() == 62216 || item.getItemId() == 62217 || item.getItemId() == 61212 || item.getItemId() == 61214 || item.getItemId() == 61216 || item.getItemId() == 61217) {
- + int nextEnchantLevel2 = item.getEnchantLevel();
- + int newItemId = 0;
- +
- + if (nextEnchantLevel2 == 3) {
- + newItemId = getNewItemIdForEnchant3(item.getItemId());
- + }
- + else if (nextEnchantLevel2 == 4) {
- + newItemId = getNewItemIdForEnchant4(item.getItemId());
- + }
- + else if (nextEnchantLevel2 == 5) {
- + newItemId = getNewItemIdForEnchant5(item.getItemId());
- + }
- +
- + if (newItemId != 0) {
- + activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false); // Eliminar el item actual
- +
- + // Crear el nuevo item con la nueva ID y enchant level
- + ItemInstance newItem = new ItemInstance(IdFactory.getInstance().getNextId(), newItemId);
- + newItem.setEnchantLevel(nextEnchantLevel2);
- + activeChar.addItem("Enchant", newItem, activeChar, true);
- + activeChar.getInventory().equipItemAndRecord(newItem);
- +
- + // Actualizar la base de datos
- + newItem.updateDatabase();
- + }
- + }
- + }
- +
- +
- +
- +
- +
- item.updateDatabase();
- }
- else
- @@ -958,6 +998,59 @@
- }
- }
- + private static int getNewItemIdForEnchant3(int itemId) {
- + switch (itemId) {
- + case 6660:
- + return 61212; // Nueva ID del item para enchant +3
- + case 6658:
- + return 61214; // Nueva ID del item para enchant +3
- + case 6656:
- + return 61217; // Nueva ID del item para enchant +3
- + case 6659:
- + return 61216; // Nueva ID del item para enchant +3
- + case 8191:
- + return 62227; // Nueva ID del item para enchant +3
- + default:
- + return 0; // En caso de no encontrar la ID correspondiente
- + }
- + }
- +
- + private static int getNewItemIdForEnchant4(int itemId) {
- + switch (itemId) {
- + case 61212:
- + return 62212; // Nueva ID del item para enchant +4
- + case 61214:
- + return 62214; // Nueva ID del item para enchant +4
- + case 61217:
- + return 62217; // Nueva ID del item para enchant +4
- + case 61216:
- + return 62216; // Nueva ID del item para enchant +4
- + case 62227:
- + return 62228; // Nueva ID del item para enchant +4
- + default:
- + return 0; // En caso de no encontrar la ID correspondiente
- + }
- + }
- +
- + private static int getNewItemIdForEnchant5(int itemId) {
- + switch (itemId) {
- + case 62212:
- + return 63212; // Nueva ID del item para enchant +5
- + case 62214:
- + return 63214; // Nueva ID del item para enchant +5
- + case 62217:
- + return 63217; // Nueva ID del item para enchant +5
- + case 62216:
- + return 63216; // Nueva ID del item para enchant +5
- + case 62228:
- + return 63228; // Nueva ID del item para enchant +5
- + default:
- + return 0; // En caso de no encontrar la ID correspondiente
- + }
- + }
- +
- +
- +
- @Override
- public String getType()
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement