From 18fb6bc5718451b4999f629f2cfea46ad4c83e15 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 28 May 2022 12:24:12 +0000 Subject: [PATCH] More improvements for AdminEditChar. Thanks to nasseka. --- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 2 +- .../admincommandhandlers/AdminEditChar.java | 22 ++++++++++++++++++- .../admincommandhandlers/AdminEditChar.java | 22 ++++++++++++++++++- .../admincommandhandlers/AdminEditChar.java | 22 ++++++++++++++++++- 10 files changed, 70 insertions(+), 10 deletions(-) diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 1766eb69bd..3145055c22 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -443,7 +443,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 581fbcf5f2..1a2260d5d2 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -445,7 +445,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 581fbcf5f2..1a2260d5d2 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -445,7 +445,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 26f1e872b9..c758d7e3f3 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -475,7 +475,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 26f1e872b9..c758d7e3f3 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -475,7 +475,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 87718d20ee..51ed2505d1 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -430,7 +430,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index ac80a0094a..04eb5f5dbe 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -443,7 +443,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index ac80a0094a..b61ad3608c 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -47,6 +47,9 @@ import org.l2jmobius.gameserver.model.actor.Summon; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.html.PageBuilder; import org.l2jmobius.gameserver.model.html.PageResult; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.item.type.WeaponType; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.skill.Skill; import org.l2jmobius.gameserver.model.stats.Stat; import org.l2jmobius.gameserver.network.GameClient; @@ -54,6 +57,7 @@ import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo; import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight; import org.l2jmobius.gameserver.network.serverpackets.GMViewItemList; +import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll; import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll; @@ -414,6 +418,22 @@ public class AdminEditChar implements IAdminCommandHandler } } + // Sylph checks + if (!CategoryData.getInstance().isInCategory(CategoryType.SYLPH_ALL_CLASS, classidval) && (player.getActiveWeaponItem().getItemType() == WeaponType.PISTOLS)) + { + final Item itemToRemove = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); + if (itemToRemove != null) + { + final long slot = player.getInventory().getSlotFromItem(itemToRemove); + player.getInventory().unEquipItemInBodySlot(slot); + + final InventoryUpdate iu = new InventoryUpdate(); + iu.addModifiedItem(itemToRemove); + player.sendInventoryUpdate(iu); + player.broadcastUserInfo(); + } + } + // Death Knight checks. if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval)) { @@ -443,7 +463,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index ac80a0094a..b61ad3608c 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -47,6 +47,9 @@ import org.l2jmobius.gameserver.model.actor.Summon; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.html.PageBuilder; import org.l2jmobius.gameserver.model.html.PageResult; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.item.type.WeaponType; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.skill.Skill; import org.l2jmobius.gameserver.model.stats.Stat; import org.l2jmobius.gameserver.network.GameClient; @@ -54,6 +57,7 @@ import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo; import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight; import org.l2jmobius.gameserver.network.serverpackets.GMViewItemList; +import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll; import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll; @@ -414,6 +418,22 @@ public class AdminEditChar implements IAdminCommandHandler } } + // Sylph checks + if (!CategoryData.getInstance().isInCategory(CategoryType.SYLPH_ALL_CLASS, classidval) && (player.getActiveWeaponItem().getItemType() == WeaponType.PISTOLS)) + { + final Item itemToRemove = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); + if (itemToRemove != null) + { + final long slot = player.getInventory().getSlotFromItem(itemToRemove); + player.getInventory().unEquipItemInBodySlot(slot); + + final InventoryUpdate iu = new InventoryUpdate(); + iu.addModifiedItem(itemToRemove); + player.sendInventoryUpdate(iu); + player.broadcastUserInfo(); + } + } + // Death Knight checks. if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval)) { @@ -443,7 +463,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index e82e818dd6..f452e5e5f9 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -47,6 +47,9 @@ import org.l2jmobius.gameserver.model.actor.Summon; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.html.PageBuilder; import org.l2jmobius.gameserver.model.html.PageResult; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.item.type.WeaponType; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.skill.Skill; import org.l2jmobius.gameserver.model.stats.Stat; import org.l2jmobius.gameserver.network.GameClient; @@ -54,6 +57,7 @@ import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo; import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight; import org.l2jmobius.gameserver.network.serverpackets.GMViewItemList; +import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll; import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll; @@ -414,6 +418,22 @@ public class AdminEditChar implements IAdminCommandHandler } } + // Sylph checks + if (!CategoryData.getInstance().isInCategory(CategoryType.SYLPH_ALL_CLASS, classidval) && (player.getActiveWeaponItem().getItemType() == WeaponType.PISTOLS)) + { + final Item itemToRemove = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); + if (itemToRemove != null) + { + final long slot = player.getInventory().getSlotFromItem(itemToRemove); + player.getInventory().unEquipItemInBodySlot(slot); + + final InventoryUpdate iu = new InventoryUpdate(); + iu.addModifiedItem(itemToRemove); + player.sendInventoryUpdate(iu); + player.broadcastUserInfo(); + } + } + // Death Knight checks. if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval)) { @@ -461,7 +481,7 @@ public class AdminEditChar implements IAdminCommandHandler { AutoUseTaskManager.getInstance().removeAutoBuff(player, oldSkill.getId()); } - player.removeSkill(oldSkill, false, true); + player.removeSkill(oldSkill, true, true); } player.broadcastUserInfo(); player.sendSkillList();