Autor Tema: problema adaptando mod dressme acis  (Leído 53 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado hardcore

  • No Grade
  • *
  • Topic Author
  • Mensajes: 24
  • ar
  • Agradecimientos: 1
  • Cronica: : interlude
  • Revision: 370
  • S.O: Windows 10
  • Serverpack : ACIS
problema adaptando mod dressme acis
« en: Abril 02, 2019, 04:42:40 pm »
gracias
Este post tiene 0 agradecimientos
  • Añade a tus favoritos
  • buenas queridos amigos estoy tratando de adaptar un comando  pero tengo unos problemas en una parte y no se como solucionarlo , este mod era de una rev vieja de acis y yo actualmente estoy usando la 374.

    el problema me lo da en RequestBypassToServer.java
    en estas partes que agrege


    Código: [Seleccionar]
    +	
    + public static 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);
    + }

    mas precisamente en estas lineas


    Código: [Seleccionar]
    public static void stealTarget(Player p, String part)

    y aca


    Código: [Seleccionar]
    sendEditWindow(p, part);





     ;D

    Desconectado hardcore

    • No Grade
    • *
    • Topic Author
    • Mensajes: 24
    • ar
    • Agradecimientos: 1
    • Cronica: : interlude
    • Revision: 370
    • S.O: Windows 10
    • Serverpack : ACIS
    Re:problema adaptando mod dressme acis
    « Respuesta #1 en: Abril 03, 2019, 05:19:47 pm »
    gracias
    Este post tiene 0 agradecimientos
  • Añade a tus favoritos
    bueno ya lo solucione un amigo de otro foro me paso su diff para la rev 381 mas actualizado , lo dejo por si a alguien le hace falta

    https://pastebin.com/FYKaXBLA

    TEMA RESUELTO !!