Jump to content

heladito92

Membro
  • Content Count

    122
  • Joined

  • Last visited

Community Reputation

7 Normal

About heladito92

  • Rank
    Muito Noob
  • Birthday 05/13/2001

Recent Profile Visitors

913 profile views
  1. Olá amigos. Eu queria saber se alguém pode me ajudar a criar um item que, ao clicar duas vezes, me dá spawn protection por 15 segundos. para frozen 1132
  2. Olá amigos. Alguém poderia me ajudar a colocar esse código nas configurações com True / False? @Tayran.JavaDev compartilhou case 728: // mana_potion, xml: 2005 + if (activeChar.getPvpFlag() > 0) + break; usePotion(activeChar, 2005, 1); break;
  3. alguem para frozen?
  4. amigo! obrigado por responder e o que estou procurando é o sistema de skin com o item de 2 cliques
  5. Olá amigos. Adapte o código do sistema de pele lisvus para tudo frozen e bom. Mas ao fazer login, o personagem se parece com a foto e no servidor de jogos ele não comete erros. alguém pode ajudar? use este código de lisvus pastebin
  6. mas eu não tenho o sistema de pele, apenas o frozen. Você poderia compartilhar o sistema de pele frozen? Eu tenho esse skin + 2 click system, mas é para acis e não sei como adaptá-lo ou ativá-lo Dressme-com-item.rar
  7. alguém tem o skin + click system para jfrozen? Eu já tenho o .dressme
  8. pero ese no viene con el pacote de skin. o me puede decir como incluirlo?
  9. Olá amigos. Alguém poderia adaptar este sistema de pele para jfrozen rev 1132? por favor. Pastebin: https://pastebin.com/4GtswGNn ### Eclipse Workspace Patch 1.0 #P Lisvus_GameServer Index: java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java (revision 683) +++ java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java (working copy) @@ -102,43 +102,82 @@ writeD(_cha.getActiveWeaponItem() != null ? 40 : 20); // 20 no weapon, 40 weapon equipped - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_UNDER)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER)); + if (!_cha.isDressMeEnabled()) + { + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_UNDER)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD)); + + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LRHAND)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR)); + + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_UNDER)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER)); + + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR)); + } + else + { + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_UNDER)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER)); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD)); + + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND) : (_cha.getDressMeData().getWeapId() == 0 ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND) : _cha.getDressMeData().getWeapId())); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES) : (_cha.getDressMeData().getGlovesId() == 0 ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES) : _cha.getDressMeData().getGlovesId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST) : (_cha.getDressMeData().getChestId() == 0 ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST) : _cha.getDressMeData().getChestId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS) : (_cha.getDressMeData().getLegsId() == 0 ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS) : _cha.getDressMeData().getLegsId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET) : (_cha.getDressMeData().getBootsId() == 0 ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET) : _cha.getDressMeData().getBootsId())); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LRHAND) : (_cha.getDressMeData().getWeapId() == 0 ? _cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LRHAND) : _cha.getDressMeData().getWeapId())); + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR)); + + writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_UNDER)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER)); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) : (_cha.getDressMeData().getWeapId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) : _cha.getDressMeData().getWeapId())); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES) : (_cha.getDressMeData().getGlovesId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES) : _cha.getDressMeData().getGlovesId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST) : (_cha.getDressMeData().getChestId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST) : _cha.getDressMeData().getChestId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS) : (_cha.getDressMeData().getLegsId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS) : _cha.getDressMeData().getLegsId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET) : (_cha.getDressMeData().getBootsId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET) : _cha.getDressMeData().getBootsId())); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND) : (_cha.getDressMeData().getWeapId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND) : _cha.getDressMeData().getWeapId())); + writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR)); + } - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD)); - - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LRHAND)); - writeD(_cha.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR)); - - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_UNDER)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER)); - - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND)); - writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR)); - writeD(_cha.getPAtk(null)); writeD(_cha.getPAtkSpd()); writeD(_cha.getPDef(null)); Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin14.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin14.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin14.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin14 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME14); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME14); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME14); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME14); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME14 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_14 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/DressMe.java =================================================================== --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/DressMe.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/DressMe.java (working copy) @@ -0,0 +1,59 @@ +package net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.datatables.ItemTable; +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; + +/** + * @author Anarchy + * @adaptação Tayran.JavaDev + * + */ +public class DressMe implements IVoicedCommandHandler +{ + private static final String[] VOICED_COMMANDS = { "dressme" }; + + + @Override + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) + { + if (command.equals("dressme")) + { + sendMainWindow(activeChar); + } + + return true; + } + + public static void sendMainWindow(L2PcInstance activeChar) + { + NpcHtmlMessage htm = new NpcHtmlMessage(0); + htm.setFile("./data/html/custom/dressme/main.htm"); + htm.replace("%enabled%", activeChar.isDressMeEnabled() ? "enabled" : "disabled"); + if (activeChar.getDressMeData() == null) + { + htm.replace("%chestinfo%", "You have no custom chest."); + htm.replace("%legsinfo%", "You have no custom legs."); + htm.replace("%bootsinfo%", "You have no custom boots."); + htm.replace("%glovesinfo%", "You have no custom gloves."); + htm.replace("%weapinfo%", "You have no custom weapon."); + } + else + { + htm.replace("%chestinfo%", activeChar.getDressMeData().getChestId() == 0 ? "You have no custom chest." : ItemTable.getInstance().getTemplate(activeChar.getDressMeData().getChestId()).getName()); + htm.replace("%legsinfo%", activeChar.getDressMeData().getLegsId() == 0 ? "You have no custom legs." : ItemTable.getInstance().getTemplate(activeChar.getDressMeData().getLegsId()).getName()); + htm.replace("%bootsinfo%", activeChar.getDressMeData().getBootsId() == 0 ? "You have no custom boots." : ItemTable.getInstance().getTemplate(activeChar.getDressMeData().getBootsId()).getName()); + htm.replace("%glovesinfo%", activeChar.getDressMeData().getGlovesId() == 0 ? "You have no custom gloves." : ItemTable.getInstance().getTemplate(activeChar.getDressMeData().getGlovesId()).getName()); + htm.replace("%weapinfo%", activeChar.getDressMeData().getWeapId() == 0 ? "You have no custom weapon." : ItemTable.getInstance().getTemplate(activeChar.getDressMeData().getWeapId()).getName()); + } + + activeChar.sendPacket(htm); + } + + @Override + public String[] getVoicedCommandList() + { + return VOICED_COMMANDS; + } +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin12.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin12.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin12.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin12 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME12); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME12); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME12); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME12); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME12 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_12 + }; +} \ No newline at end of file Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 683) +++ java/net/sf/l2j/Config.java (working copy) @@ -764,6 +764,45 @@ public static boolean OFFLINE_SET_NAME_COLOR; /** Color for offline mode */ public static int OFFLINE_NAME_COLOR; + + public static boolean ALLOW_DRESS_ME_SYSTEM; + public static Map<String, Integer> DRESS_ME_CHESTS = new HashMap<>(); + public static Map<String, Integer> DRESS_ME_LEGS = new HashMap<>(); + public static Map<String, Integer> DRESS_ME_BOOTS = new HashMap<>(); + public static Map<String, Integer> DRESS_ME_GLOVES = new HashMap<>(); + public static Map<String, Integer> DRESS_ME_WEAPONS = new HashMap<>(); + public static String SKIN_NAME1; + public static String SKIN_NAME2; + public static String SKIN_NAME3; + public static String SKIN_NAME4; + public static String SKIN_NAME5; + public static String SKIN_NAME6; + public static String SKIN_NAME7; + public static String SKIN_NAME8; + public static String SKIN_NAME9; + public static String SKIN_NAME10; + public static String SKIN_NAME11; + public static String SKIN_NAME12; + public static String SKIN_NAME13; + public static String SKIN_NAME14; + public static String SKIN_NAME15; + public static int SKIN_ITEM_1; + public static int SKIN_ITEM_2; + public static int SKIN_ITEM_3; + public static int SKIN_ITEM_4; + public static int SKIN_ITEM_5; + public static int SKIN_ITEM_6; + public static int SKIN_ITEM_7; + public static int SKIN_ITEM_8; + public static int SKIN_ITEM_9; + public static int SKIN_ITEM_10; + public static int SKIN_ITEM_11; + public static int SKIN_ITEM_12; + public static int SKIN_ITEM_13; + public static int SKIN_ITEM_14; + public static int SKIN_ITEM_15; + + /** Allow teleporting to towns that are under siege ? */ public static boolean ALLOW_SIEGE_TELEPORT; @@ -2089,11 +2128,78 @@ OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(customSettings.getProperty("OfflineDisconnectFinished", "True")); OFFLINE_SET_NAME_COLOR = Boolean.valueOf(customSettings.getProperty("OfflineSetNameColor", "False")); OFFLINE_NAME_COLOR = Integer.decode("0x" + customSettings.getProperty("OfflineNameColor", "808080")); + ALLOW_DRESS_ME_SYSTEM = Boolean.parseBoolean(customSettings.getProperty("AllowDressMeSystem", "false")); + SKIN_NAME1 = String.valueOf(customSettings.getProperty("SkinName1", "SkinName")); + SKIN_NAME2 = String.valueOf(customSettings.getProperty("SkinName2", "SkinName")); + SKIN_NAME3 = String.valueOf(customSettings.getProperty("SkinName3", "SkinName")); + SKIN_NAME4 = String.valueOf(customSettings.getProperty("SkinName4", "SkinName")); + SKIN_NAME5 = String.valueOf(customSettings.getProperty("SkinName5", "SkinName")); + SKIN_NAME6 = String.valueOf(customSettings.getProperty("SkinName6", "SkinName")); + SKIN_NAME7 = String.valueOf(customSettings.getProperty("SkinName7", "SkinName")); + SKIN_NAME8 = String.valueOf(customSettings.getProperty("SkinName8", "SkinName")); + SKIN_NAME9 = String.valueOf(customSettings.getProperty("SkinName9", "SkinName")); + SKIN_NAME10 = String.valueOf(customSettings.getProperty("SkinName10", "SkinName")); + SKIN_NAME11 = String.valueOf(customSettings.getProperty("SkinName11", "SkinName")); + SKIN_NAME12 = String.valueOf(customSettings.getProperty("SkinName12", "SkinName")); + SKIN_NAME13 = String.valueOf(customSettings.getProperty("SkinName13", "SkinName")); + SKIN_NAME14 = String.valueOf(customSettings.getProperty("SkinName14", "SkinName")); + SKIN_NAME15 = String.valueOf(customSettings.getProperty("SkinName15", "SkinName")); + SKIN_ITEM_1 = Integer.parseInt(customSettings.getProperty("SkinItem1", "0")); + SKIN_ITEM_2 = Integer.parseInt(customSettings.getProperty("SkinItem2", "0")); + SKIN_ITEM_3 = Integer.parseInt(customSettings.getProperty("SkinItem3", "0")); + SKIN_ITEM_4 = Integer.parseInt(customSettings.getProperty("SkinItem4", "0")); + SKIN_ITEM_5 = Integer.parseInt(customSettings.getProperty("SkinItem5", "0")); + SKIN_ITEM_6 = Integer.parseInt(customSettings.getProperty("SkinItem6", "0")); + SKIN_ITEM_7 = Integer.parseInt(customSettings.getProperty("SkinItem7", "0")); + SKIN_ITEM_8 = Integer.parseInt(customSettings.getProperty("SkinItem8", "0")); + SKIN_ITEM_9 = Integer.parseInt(customSettings.getProperty("SkinItem9", "0")); + SKIN_ITEM_10 = Integer.parseInt(customSettings.getProperty("SkinItem10", "0")); + SKIN_ITEM_11 = Integer.parseInt(customSettings.getProperty("SkinItem11", "0")); + SKIN_ITEM_12 = Integer.parseInt(customSettings.getProperty("SkinItem12", "0")); + SKIN_ITEM_13 = Integer.parseInt(customSettings.getProperty("SkinItem13", "0")); + SKIN_ITEM_14 = Integer.parseInt(customSettings.getProperty("SkinItem14", "0")); + SKIN_ITEM_15 = Integer.parseInt(customSettings.getProperty("SkinItem15", "0")); + String temp = customSettings.getProperty("DressMeChests", ""); + String[] temp2 = temp.split(";"); + for (String s : temp2) + { + String[] t = s.split(","); + DRESS_ME_CHESTS.put(t[0], Integer.parseInt(t[1])); + } + temp = customSettings.getProperty("DressMeLegs", ""); + temp2 = temp.split(";"); + for (String s : temp2) + { + String[] t = s.split(","); + DRESS_ME_LEGS.put(t[0], Integer.parseInt(t[1])); + } + temp = customSettings.getProperty("DressMeBoots", ""); + temp2 = temp.split(";"); + for (String s : temp2) + { + String[] t = s.split(","); + DRESS_ME_BOOTS.put(t[0], Integer.parseInt(t[1])); + } + temp = customSettings.getProperty("DressMeGloves", ""); + temp2 = temp.split(";"); + for (String s : temp2) + { + String[] t = s.split(","); + DRESS_ME_GLOVES.put(t[0], Integer.parseInt(t[1])); + } + temp = customSettings.getProperty("DressMeWeapons", ""); + temp2 = temp.split(";"); + for (String s : temp2) + { + String[] t = s.split(","); + DRESS_ME_WEAPONS.put(t[0], Integer.parseInt(t[1])); + } ALLOW_SIEGE_TELEPORT = Boolean.valueOf(customSettings.getProperty("AllowSiegeTeleport", "False")); KEEP_SUBCLASS_SKILLS = Boolean.valueOf(customSettings.getProperty("KeepSubClassSkills", "False")); ALLOW_CLASS_MASTERS = Boolean.valueOf(customSettings.getProperty("AllowClassMasters", "False")); ALLOW_ENTIRE_TREE = Boolean.valueOf(customSettings.getProperty("AllowEntireTree", "False")); ALTERNATE_CLASS_MASTER = Boolean.valueOf(customSettings.getProperty("AlternateClassMaster", "False")); if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER) { CLASS_MASTER_SETTINGS = new ClassMasterSettings(String.valueOf(customSettings.getProperty("ConfigClassMaster"))); Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java =================================================================== --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 683) +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy) @@ -23,6 +23,7 @@ import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvTCommand; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceExperience; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.DressMe; /** * This class ... @@ -51,8 +52,10 @@ registerVoicedCommandHandler(new ChangePassword()); registerVoicedCommandHandler(new TvTCommand()); registerVoicedCommandHandler(new VoiceExperience()); - registerVoicedCommandHandler(new Wedding()); - + registerVoicedCommandHandler(new Wedding()); + if (Config.ALLOW_DRESS_ME_SYSTEM) + registerVoicedCommandHandler(new DressMe()); + _log.config("VoicedCommandHandler: Loaded " + _dataTable.size() + " handlers."); } Index: java/net/sf/l2j/gameserver/handler/custom/DressMeData.java =================================================================== --- java/net/sf/l2j/gameserver/handler/custom/DressMeData.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/custom/DressMeData.java (working copy) @@ -0,0 +1,74 @@ +package net.sf.l2j.gameserver.handler.custom; + +/** + * @author Anarchy + * @adaptação Tayran.JavaDev + * + */ +public class DressMeData +{ + private int chestId, + legsId, + glovesId, + feetId, + weapId; + + public DressMeData() + { + chestId = 0; + legsId = 0; + glovesId = 0; + feetId = 0; + weapId = 0; + } + + public int getChestId() + { + return chestId; + } + + public int getLegsId() + { + return legsId; + } + + public int getGlovesId() + { + return glovesId; + } + + public int getBootsId() + { + return feetId; + } + + public int getWeapId() + { + return weapId; + } + + public void setChestId(int val) + { + chestId = val; + } + + public void setLegsId(int val) + { + legsId = val; + } + + public void setGlovesId(int val) + { + glovesId = val; + } + + public void setBootsId(int val) + { + feetId = val; + } + + public void setWeapId(int val) + { + weapId = val; + } +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin10.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin10.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin10.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin10 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME10); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME10); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME10); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME10); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME10 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_10 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/ItemHandler.java =================================================================== --- java/net/sf/l2j/gameserver/handler/ItemHandler.java (revision 683) +++ java/net/sf/l2j/gameserver/handler/ItemHandler.java (working copy) @@ -49,6 +49,21 @@ import net.sf.l2j.gameserver.handler.itemhandlers.SpiritShot; import net.sf.l2j.gameserver.handler.itemhandlers.SummonItems; import net.sf.l2j.gameserver.handler.itemhandlers.WorldMap; +import net.sf.l2j.gameserver.handler.itemhandlers.skin1; +import net.sf.l2j.gameserver.handler.itemhandlers.skin2; +import net.sf.l2j.gameserver.handler.itemhandlers.skin3; +import net.sf.l2j.gameserver.handler.itemhandlers.skin4; +import net.sf.l2j.gameserver.handler.itemhandlers.skin5; +import net.sf.l2j.gameserver.handler.itemhandlers.skin6; +import net.sf.l2j.gameserver.handler.itemhandlers.skin7; +import net.sf.l2j.gameserver.handler.itemhandlers.skin8; +import net.sf.l2j.gameserver.handler.itemhandlers.skin9; +import net.sf.l2j.gameserver.handler.itemhandlers.skin10; +import net.sf.l2j.gameserver.handler.itemhandlers.skin11; +import net.sf.l2j.gameserver.handler.itemhandlers.skin12; +import net.sf.l2j.gameserver.handler.itemhandlers.skin13; +import net.sf.l2j.gameserver.handler.itemhandlers.skin14; +import net.sf.l2j.gameserver.handler.itemhandlers.skin15; /** * This class manages handlers of items @@ -109,7 +124,23 @@ registerItemHandler(new ExtractableItems()); registerItemHandler(new SummonItems()); registerItemHandler(new BeastSpice()); + registerItemHandler(new skin1()); + registerItemHandler(new skin2()); + registerItemHandler(new skin3()); + registerItemHandler(new skin4()); + registerItemHandler(new skin5()); + registerItemHandler(new skin6()); + registerItemHandler(new skin7()); + registerItemHandler(new skin8()); + registerItemHandler(new skin9()); + registerItemHandler(new skin10()); + registerItemHandler(new skin11()); + registerItemHandler(new skin12()); + registerItemHandler(new skin13()); + registerItemHandler(new skin14()); + registerItemHandler(new skin15()); + _log.config("ItemHandler: Loaded " + _dataTable.size() + " handlers."); } Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin8.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin8.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin8.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin8 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME8); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME8); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME8); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME8); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME8 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_8 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 683) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -202,6 +202,7 @@ import net.sf.l2j.gameserver.util.Util; import net.sf.l2j.util.Point3D; import net.sf.l2j.util.Rnd; +import net.sf.l2j.gameserver.handler.custom.DressMeData; /** * This class represents all player characters in the world. @@ -367,6 +368,31 @@ private int _curWeightPenalty = 0; + private DressMeData _dressmedata = null; + private boolean _dressed = false; + + + public DressMeData getDressMeData() + { + return _dressmedata; + } + + public void setDressMeData(DressMeData val) + { + _dressmedata = val; + } + + public boolean isDressMeEnabled() + { + return _dressed; + } + + public void setDressMeEnabled(boolean val) + { + _dressed = val; + } + + /** The Siege state of the L2PcInstance */ private byte _siegeState = 0; Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 683) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy) @@ -18,6 +18,7 @@ import java.util.logging.Level; import java.util.logging.Logger; +import net.sf.l2j.Config; import net.sf.l2j.gameserver.ai.CtrlIntention; import net.sf.l2j.gameserver.communitybbs.CommunityBoard; import net.sf.l2j.gameserver.datatables.AdminCommandRightsData; @@ -35,6 +36,10 @@ import net.sf.l2j.gameserver.model.olympiad.Olympiad; import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; +import net.sf.l2j.gameserver.datatables.ItemTable; +import net.sf.l2j.gameserver.handler.custom.DressMeData; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.DressMe; +import net.sf.l2j.gameserver.model.itemcontainer.Inventory; /** * This class ... @@ -46,7 +51,7 @@ private static Logger _log = Logger.getLogger(RequestBypassToServer.class.getName()); // S - private String _command; + public static String _command; @Override protected void readImpl() @@ -95,6 +100,51 @@ ach.useAdminCommand(_command, activeChar); } + else if (_command.equals("bp_changedressmestatus")) + { + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + } + + DressMe.sendMainWindow(activeChar); + } + else if (_command.startsWith("bp_editWindow")) + { + String bp = _command.substring(14); + StringTokenizer st = new StringTokenizer(bp); + + sendEditWindow(activeChar, st.nextToken()); + } + else if (_command.startsWith("bp_setpart")) + { + String bp = _command.substring(11); + StringTokenizer st = new StringTokenizer(bp); + + String part = st.nextToken(); + String type = st.nextToken(); + + setPart(activeChar, part, type); + } + else if (_command.startsWith("bp_gettarget")) + { + String bp = _command.substring(13); + StringTokenizer st = new StringTokenizer(bp); + + String part = st.nextToken(); + + stealTarget(activeChar, part); + } + else if (_command.equals("bp_main")) + { + DressMe.sendMainWindow(activeChar); + } else if (_command.startsWith("voice ")) { String text = _command.substring(5); @@ -249,6 +299,303 @@ activeChar.sendPacket(html); } + public void stealTarget(L2PcInstance p, String part) + { + if (p.getTarget() == null || !(p.getTarget() instanceof L2PcInstance)) + { + p.sendMessage("Invalid target."); + return; + } + + L2PcInstance t = (L2PcInstance)p.getTarget(); + + if (p.getDressMeData() == null) + { + DressMeData dmd = new DressMeData(); + p.setDressMeData(dmd); + } + + boolean returnMain = false; + + switch (part) + { + case "chest": + { + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) == null) + { + p.getDressMeData().setChestId(0); + } + else + { + p.getDressMeData().setChestId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST).getItemId()); + } + break; + } + case "legs": + { + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) == null) + { + p.getDressMeData().setLegsId(0); + } + else + { + p.getDressMeData().setLegsId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS).getItemId()); + } + break; + } + case "gloves": + { + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) == null) + { + p.getDressMeData().setGlovesId(0); + } + else + { + p.getDressMeData().setGlovesId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES).getItemId()); + } + break; + } + case "boots": + { + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) == null) + { + p.getDressMeData().setBootsId(0); + } + else + { + p.getDressMeData().setBootsId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET).getItemId()); + } + break; + } + case "weap": + { + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null) + { + p.getDressMeData().setWeapId(0); + } + else + { + p.getDressMeData().setWeapId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).getItemId()); + } + break; + } + case "all": + { + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) == null) + { + p.getDressMeData().setChestId(0); + } + else + { + p.getDressMeData().setChestId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST).getItemId()); + } + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) == null) + { + p.getDressMeData().setLegsId(0); + } + else + { + p.getDressMeData().setLegsId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS).getItemId()); + } + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) == null) + { + p.getDressMeData().setGlovesId(0); + } + else + { + p.getDressMeData().setGlovesId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES).getItemId()); + } + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) == null) + { + p.getDressMeData().setBootsId(0); + } + else + { + p.getDressMeData().setBootsId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET).getItemId()); + } + if (t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null) + { + p.getDressMeData().setWeapId(0); + } + else + { + p.getDressMeData().setWeapId(t.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).getItemId()); + } + returnMain = true; + break; + } + } + + p.broadcastUserInfo(); + if (!returnMain) + sendEditWindow(p, part); + else + DressMe.sendMainWindow(p); + } + + public static void setPart(L2PcInstance p, String part, String type) + { + if (p.getDressMeData() == null) + { + DressMeData dmd = new DressMeData(); + p.setDressMeData(dmd); + } + + switch (part) + { + case "chest": + { + if (Config.DRESS_ME_CHESTS.keySet().contains(type)) + { + p.getDressMeData().setChestId(Config.DRESS_ME_CHESTS.get(type)); + } + + break; + } + case "legs": + { + if (Config.DRESS_ME_LEGS.keySet().contains(type)) + { + p.getDressMeData().setLegsId(Config.DRESS_ME_LEGS.get(type)); + } + + break; + } + case "gloves": + { + if (Config.DRESS_ME_GLOVES.keySet().contains(type)) + { + p.getDressMeData().setGlovesId(Config.DRESS_ME_GLOVES.get(type)); + } + + break; + } + case "boots": + { + if (Config.DRESS_ME_BOOTS.keySet().contains(type)) + { + p.getDressMeData().setBootsId(Config.DRESS_ME_BOOTS.get(type)); + } + + break; + } + case "weap": + { + if (Config.DRESS_ME_WEAPONS.keySet().contains(type)) + { + p.getDressMeData().setWeapId(Config.DRESS_ME_WEAPONS.get(type)); + } + + break; + } + } + + p.broadcastUserInfo(); +// sendEditWindow(p, part); + } + + public static void sendEditWindow(L2PcInstance p, String part) + { + NpcHtmlMessage htm = new NpcHtmlMessage(0); + htm.setFile("./data/html/custom/dressme/edit.htm"); + htm.replace("%part%", part); + switch (part) + { + case "chest": + { + if (p.getDressMeData() == null) + { + htm.replace("%partinfo%", "You have no custom chest."); + } + else + { + htm.replace("%partinfo%", p.getDressMeData().getChestId() == 0 ? "You have no custom chest." : ItemTable.getInstance().getTemplate(p.getDressMeData().getChestId()).getName()); + } + String temp = ""; + for (String s : Config.DRESS_ME_CHESTS.keySet()) + { + temp += s+";"; + } + htm.replace("%dropboxdata%", temp); + break; + } + case "legs": + { + if (p.getDressMeData() == null) + { + htm.replace("%partinfo%", "You have no custom legs."); + } + else + { + htm.replace("%partinfo%", p.getDressMeData().getLegsId() == 0 ? "You have no custom legs." : ItemTable.getInstance().getTemplate(p.getDressMeData().getLegsId()).getName()); + } + String temp = ""; + for (String s : Config.DRESS_ME_LEGS.keySet()) + { + temp += s+";"; + } + htm.replace("%dropboxdata%", temp); + break; + } + case "gloves": + { + if (p.getDressMeData() == null) + { + htm.replace("%partinfo%", "You have no custom gloves."); + } + else + { + htm.replace("%partinfo%", p.getDressMeData().getGlovesId() == 0 ? "You have no custom gloves." : ItemTable.getInstance().getTemplate(p.getDressMeData().getGlovesId()).getName()); + } + String temp = ""; + for (String s : Config.DRESS_ME_GLOVES.keySet()) + { + temp += s+";"; + } + htm.replace("%dropboxdata%", temp); + break; + } + case "boots": + { + if (p.getDressMeData() == null) + { + htm.replace("%partinfo%", "You have no custom boots."); + } + else + { + htm.replace("%partinfo%", p.getDressMeData().getBootsId() == 0 ? "You have no custom boots." : ItemTable.getInstance().getTemplate(p.getDressMeData().getBootsId()).getName()); + } + String temp = ""; + for (String s : Config.DRESS_ME_BOOTS.keySet()) + { + temp += s+";"; + } + htm.replace("%dropboxdata%", temp); + break; + } + case "weap": + { + if (p.getDressMeData() == null) + { + htm.replace("%partinfo%", "You have no custom weapon."); + } + else + { + htm.replace("%partinfo%", p.getDressMeData().getWeapId() == 0 ? "You have no custom weapon." : ItemTable.getInstance().getTemplate(p.getDressMeData().getWeapId()).getName()); + } + String temp = ""; + for (String s : Config.DRESS_ME_WEAPONS.keySet()) + { + temp += s+";"; + } + htm.replace("%dropboxdata%", temp); + break; + } + } + + p.sendPacket(htm); + } + /* * (non-Javadoc) * @see net.sf.l2j.gameserver.clientpackets.L2GameClientPacket#getType() Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin15.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin15.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin15.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin15 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME15); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME15); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME15); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME15); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME15 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_15 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin13.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin13.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin13.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin13 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME13); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME13); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME13); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME13); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME13 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_13 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin11.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin11.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin11.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin11 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME11); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME11); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME11); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME11); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME11 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_11 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin9.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin9.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin9.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin9 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME9); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME9); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME9); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME9); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME9 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_9 + }; +} \ No newline at end of file Index: java/config/Custom.properties =================================================================== --- java/config/Custom.properties (revision 683) +++ java/config/Custom.properties (working copy) @@ -331,4 +331,53 @@ OfflineSetNameColor = False # Color of the name in offline mode (if OfflineSetNameColor = True) -OfflineNameColor = 808080 \ No newline at end of file +OfflineNameColor = 808080 + +# ----------------------------------------- +# DressMe system - +# ----------------------------------------- +# +AllowDressMeSystem = False + +# DressMe values. +# Skin name (Example: "Draconic") +SkinName1 = Draconic +SkinName2 = Imperial +SkinName3 = Arcana +SkinName4 = SkinName4 +SkinName5 = SkinName5 +SkinName6 = SkinName6 +SkinName7 = SkinName7 +SkinName8 = SkinName8 +SkinName9 = SkinName9 +SkinName10 = SkinName10 +SkinName11 = SkinName11 +SkinName12 = SkinName12 +SkinName13 = SkinName13 +SkinName14 = SkinName14 +SkinName15 = SkinName15 + +# Skin item id (Example: "6673") +SkinItem1 = 0 +SkinItem2 = 0 +SkinItem3 = 0 +SkinItem4 = 0 +SkinItem5 = 0 +SkinItem6 = 0 +SkinItem7 = 0 +SkinItem8 = 0 +SkinItem9 = 0 +SkinItem10 = 0 +SkinItem11 = 0 +SkinItem12 = 0 +SkinItem13 = 0 +SkinItem14 = 0 +SkinItem15 = 0 + +# Note: It works like name,id;name,id +# WARNING: No spaces on names, use _ instead of space. +DressMeChests = Draconic,6379;Imperial,6373;Arcana,6383 +DressMeLegs = Imperial,6374 +DressMeBoots = Draconic,6381;Imperial,6376;Arcana,6385 +DressMeGloves = Draconic,6380;Imperial,6375;Arcana,6384 +DressMeWeapons = Draconic_Bow,7577;Shining_Bow,6594;Arcana_Mace,6608 \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin7.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin7.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin7.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin7 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME7); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME7); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME7); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME7); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME7 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_7 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin6.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin6.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin6.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin6 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME6); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME6); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME6); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME6); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME6 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_6 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin5.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin5.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin5.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin5 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME5); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME5); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME5); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME5); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME5 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_5 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin4.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin4.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin4.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin4 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME4); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME4); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME4); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME4); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME4 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_4 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/custom/DressMeData.java =================================================================== --- java/net/sf/l2j/gameserver/handler/custom/DressMeData.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/custom/DressMeData.java (working copy) @@ -0,0 +1,74 @@ +package net.sf.l2j.gameserver.handler.custom; + +/** + * @author Anarchy + * @adaptação Tayran.JavaDev + * + */ +public class DressMeData +{ + private int chestId, + legsId, + glovesId, + feetId, + weapId; + + public DressMeData() + { + chestId = 0; + legsId = 0; + glovesId = 0; + feetId = 0; + weapId = 0; + } + + public int getChestId() + { + return chestId; + } + + public int getLegsId() + { + return legsId; + } + + public int getGlovesId() + { + return glovesId; + } + + public int getBootsId() + { + return feetId; + } + + public int getWeapId() + { + return weapId; + } + + public void setChestId(int val) + { + chestId = val; + } + + public void setLegsId(int val) + { + legsId = val; + } + + public void setGlovesId(int val) + { + glovesId = val; + } + + public void setBootsId(int val) + { + feetId = val; + } + + public void setWeapId(int val) + { + weapId = val; + } +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin3.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin3.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin3.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin3 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME3); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME3); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME3); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME3); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME3 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_3 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin2.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin2.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin2.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin2 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME2); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME2); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME2); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME2); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME2 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_2 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/handler/itemhandlers/skin1.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/skin1.java (nonexistent) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/skin1.java (working copy) @@ -0,0 +1,52 @@ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; +import net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer; + +public class skin1 implements IItemHandler +{ + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(Config.ALLOW_DRESS_ME_SYSTEM) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + RequestBypassToServer.setPart(activeChar, "chest", Config.SKIN_NAME1); + RequestBypassToServer.setPart(activeChar, "legs", Config.SKIN_NAME1); + RequestBypassToServer.setPart(activeChar, "gloves", Config.SKIN_NAME1); + RequestBypassToServer.setPart(activeChar, "boots", Config.SKIN_NAME1); + + if (activeChar.isDressMeEnabled()) + { + activeChar.setDressMeEnabled(false); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have disabled skin."); + } + else + { + activeChar.setDressMeEnabled(true); + activeChar.broadcastUserInfo(); + activeChar.sendMessage("You have activated " + Config.SKIN_NAME1 + " skin."); + } + } + else + playable.sendMessage("Sorry, admin has disabled skins."); + } + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private static final int ITEM_IDS[] = { + Config.SKIN_ITEM_1 + }; +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (revision 683) +++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (working copy) @@ -210,16 +210,32 @@ } writeD(0); // Hair All, but there are no such items in C4 - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_CHEST)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LEGS)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_FEET)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_BACK)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LRHAND)); - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HAIR)); + if (!_cha.isDressMeEnabled()) + { + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_CHEST)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LEGS)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_FEET)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_BACK)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LRHAND)); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HAIR)); + } + else + { + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) : (_cha.getDressMeData().getWeapId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) : _cha.getDressMeData().getWeapId())); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES) : (_cha.getDressMeData().getGlovesId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES) : _cha.getDressMeData().getGlovesId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST) : (_cha.getDressMeData().getChestId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST) : _cha.getDressMeData().getChestId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS) : (_cha.getDressMeData().getLegsId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS) : _cha.getDressMeData().getLegsId())); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET) : (_cha.getDressMeData().getBootsId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET) : _cha.getDressMeData().getBootsId())); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_BACK)); + writeD(_cha.getDressMeData() == null ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) : (_cha.getDressMeData().getWeapId() == 0 ? _cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) : _cha.getDressMeData().getWeapId())); + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HAIR)); + } writeD(_cha.getPvpFlag()); writeD(_cha.getKarma());
  10. alguen adapto para frozen?
×
×
  • Create New...