Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/cfiles/game/config/main/L2jOrion.ini b/cfiles/game/config/main/L2jOrion.ini
- index bf1867e..eddb8e7 100644
- --- a/cfiles/game/config/main/L2jOrion.ini
- +++ b/cfiles/game/config/main/L2jOrion.ini
- @@ -333,4 +333,7 @@
- NewPlayerEffect = False
- # It shows Castle's Lord clan crest in town nearby npc name
- -ShowNpcCrest = False
- \ No newline at end of file
- +ShowNpcCrest = False
- +
- +TextureSkinPackageName = MAYKE_MENDES_SKIN
- +TextureSkinSuffixName = _f
- \ No newline at end of file
- diff --git a/data/html/SkinManager/Main.htm b/data/html/SkinManager/Main.htm
- new file mode 100644
- index 0000000..c863c08
- --- /dev/null
- +++ b/data/html/SkinManager/Main.htm
- @@ -0,0 +1,31 @@
- +<html>
- + <body>
- + <title>Skin Manager</title>
- + <br>
- + <center>
- + <center><img src="L2UI.SquareWhite" width=200 height=1></center>
- +<table bgcolor=3c3c3c width=204>
- +<tr>
- +<td><center><font color="FFFF00">Skin Test / Buy </font></center></td>
- +</tr>
- +</table></center>
- +<center><img src="L2UI.SquareWhite" width=200 height=1></center>
- +<br>
- + </center>
- + <table width=300>
- + %skins%<br><br>
- + </table>
- + <center>
- +
- +
- + <table width=270 align=center >
- + <tr>
- +
- + %pages%
- +
- + </tr>
- + </table>
- + </center>
- +
- + </body>
- +</html>
- \ No newline at end of file
- diff --git a/data/html/SkinManager/Skin.htm b/data/html/SkinManager/Skin.htm
- new file mode 100644
- index 0000000..fb4d8cb
- --- /dev/null
- +++ b/data/html/SkinManager/Skin.htm
- @@ -0,0 +1,52 @@
- +<html>
- + <body>
- + <title>Skin Manager</title>
- + <br><br>
- + <center>
- + <font color=LEVEL >SKIN DATA</font>
- +
- + </center>
- + <table width=310 bgcolor=000000 height=80>
- + <tr>
- + <td width=50>
- +
- + </td>
- + <td align=left>
- +
- + <font color=LEVEL>- Skin Name: </font>
- + <font color=ff0000> %skiname% </font><br1>
- + <font color=LEVEL>- Skin Price:</font>
- + <font color=ff0000> %skinprice% </font>
- + <font color=87ff26> %skinpriceid% </font>
- +
- +
- + </td>
- +
- + </tr>
- +
- + </table>
- +
- + <center><br><br><br>
- + <font color=LEVEL > FUNCTIONS</font>
- +
- + </center>
- +
- + <table width=301 bgcolor=0000 >
- +
- +
- + %showbutton%
- +
- + </table>
- + <center>
- + <table width=310 align=center>
- + <tr>
- + <td align=center><br><br>
- + <button value="Back" action="bypass -h skinPage 1" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- +
- +
- + </tr>
- + </table>
- + </center>
- + </body>
- +</html>
- \ No newline at end of file
- diff --git a/data/xml/Skins.xml b/data/xml/Skins.xml
- new file mode 100644
- index 0000000..eaeaff8
- --- /dev/null
- +++ b/data/xml/Skins.xml
- @@ -0,0 +1,68 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<list>
- +<!-- Try Skins -->
- +
- + <skin id="1" name="Anakim Suit" utx_name="anakim" chest="10100" legs="0" gloves="0" feet="0" hair="10101" isVip="0" price_id="3470" price="100">
- +
- + </skin>
- +
- + <skin id="2" name="White Knight" utx_name="rei2" chest="10129" legs="0" gloves="0" feet="0" hair="10130" isVip="0" price_id="3470" price="10">
- +
- + </skin>
- +
- + <skin id="3" name="Archer Suit B" utx_name="archer2" chest="10105" legs="0" gloves="0" feet="0" hair="10106" isVip="0" price_id="3470" price="10">
- +
- + </skin>
- +
- + <skin id="4" name="Beleth Suit" utx_name="beleth" chest="10124" legs="0" gloves="0" feet="0" hair="10125" isVip="0" price_id="3470" price="10">
- +
- + </skin>
- +
- + <skin id="5" name="Cat Suit" utx_name="cat" chest="10144" legs="0" gloves="0" feet="0" hair="15017" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="6" name="CowBoy Suit" utx_name="cowboy" chest="10110" legs="0" gloves="0" feet="0" hair="0" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="7" name="Cyborg Suit" utx_name="cyborg" chest="10105" legs="0" gloves="0" feet="0" hair="10106" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="8" name="Dark Assassin Suit" utx_name="dark" chest="10122" legs="0" gloves="0" feet="0" hair="10123" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="9" name="Dragon Born Suit" utx_name="dragon" chest="10156" legs="0" gloves="0" feet="0" hair="15047" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="10" name="Dark Knight Suit" utx_name="knight" chest="10112" legs="0" gloves="0" feet="0" hair="10113" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="11" name="Light Assassin Suit" utx_name="light" chest="10120" legs="0" gloves="0" feet="0" hair="10121" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="12" name="Saxon Guard Suit" utx_name="valkyri" chest="10135" legs="0" gloves="0" feet="0" hair="0" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="13" name="Ninja Suit" utx_name="ninja" chest="10118" legs="0" gloves="0" feet="0" hair="0" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="14" name="Red Zaken Suit" utx_name="pirate" chest="10136" legs="0" gloves="0" feet="0" hair="10137" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="15" name="Blue Zaken Suit" utx_name="pirate_blue" chest="10136" legs="0" gloves="0" feet="0" hair="10137" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="16" name="King Setim Suit" utx_name="rei" chest="10127" legs="0" gloves="0" feet="0" hair="10128" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="17" name="King White Setim Suit" utx_name="rei2" chest="10133" legs="0" gloves="0" feet="0" hair="10134" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="18" name="Priest Suit" utx_name="saint" chest="10140" legs="0" gloves="0" feet="0" hair="10141" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <skin id="19" name="Black Samurai Suit" utx_name="samurai" chest="10142" legs="0" gloves="0" feet="0" hair="10143" isVip="0" price_id="3470" price="10">
- + </skin>
- +
- + <!-- L2 Urban -->
- +
- +</list>
- \ No newline at end of file
- diff --git a/src/Base/SkinBeauty/Skin.java b/src/Base/SkinBeauty/Skin.java
- new file mode 100644
- index 0000000..b69a76d
- --- /dev/null
- +++ b/src/Base/SkinBeauty/Skin.java
- @@ -0,0 +1,110 @@
- +package Base.SkinBeauty;
- +
- +import l2jorion.game.datatables.sql.ItemTable;
- +import l2jorion.game.templates.L2Item;
- +import l2jorion.game.templates.StatsSet;
- +
- +public class Skin
- +{
- + private int id;
- +
- + private StatsSet stats;
- +
- + private boolean released;
- +
- + public Skin(int id, StatsSet stats)
- + {
- + this.id = id;
- + this.stats = stats;
- + }
- +
- + public StatsSet getStats()
- + {
- + return this.stats;
- + }
- +
- + public void setStats(StatsSet stats)
- + {
- + this.stats = stats;
- + }
- +
- + public int getId()
- + {
- + return this.id;
- + }
- +
- + public void setId(int id)
- + {
- + this.id = id;
- + }
- +
- + public boolean isReleased()
- + {
- + return this.released;
- + }
- +
- + public void setReleased(boolean released)
- + {
- + this.released = released;
- + }
- +
- + public int getPrice()
- + {
- + return getStats().getInteger("price");
- + }
- +
- + public int getPriceId()
- + {
- + return getStats().getInteger("price_id");
- + }
- +
- + public String getName()
- + {
- + return getStats().getString("name");
- + }
- +
- + public boolean isVip()
- + {
- + return (getStats().getInteger("isVip") == 1);
- + }
- +
- + public int getHair()
- + {
- + return getStats().getInteger("hair");
- + }
- +
- + public int getChest()
- + {
- + return getStats().getInteger("chest");
- + }
- +
- + public int getGloves()
- + {
- + return getStats().getInteger("gloves");
- + }
- +
- + public int getLegs()
- + {
- + return getStats().getInteger("legs");
- + }
- +
- + public int getFeet()
- + {
- + return getStats().getInteger("feet");
- + }
- +
- + public String getUtxName()
- + {
- + return getStats().getString("utx_name");
- + }
- +
- + public String getPriceItemName()
- + {
- + L2Item i = ItemTable.getInstance().getTemplate(getPriceId());
- + if (i != null)
- + {
- + return i.getName();
- + }
- + return "No Price";
- + }
- +}
- diff --git a/src/Base/SkinBeauty/SkinData.java b/src/Base/SkinBeauty/SkinData.java
- new file mode 100644
- index 0000000..2f0fa39
- --- /dev/null
- +++ b/src/Base/SkinBeauty/SkinData.java
- @@ -0,0 +1,253 @@
- +package Base.SkinBeauty;
- +
- +import java.io.File;
- +import java.util.ArrayList;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +
- +import org.w3c.dom.Document;
- +import org.w3c.dom.NamedNodeMap;
- +import org.w3c.dom.Node;
- +
- +import Base.XML.XMLDocument;
- +import l2jorion.game.templates.StatsSet;
- +
- +public class SkinData extends XMLDocument
- +{
- + public static Map<Skin, StatsSet> skinList = new HashMap<>();
- +
- + public SkinData()
- + {
- + load();
- + }
- +
- + public static SkinData getInstance()
- + {
- + return SingleTonHolder._instance;
- + }
- +
- + private static class SingleTonHolder
- + {
- + protected static final SkinData _instance = new SkinData();
- + }
- +
- + @Override
- + protected void load()
- + {
- + loadDocument("./data/xml/Skins.xml");
- + }
- +
- + @Override
- + protected void parseDocument(Document doc, File f)
- + {
- + try
- + {
- + for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
- + {
- + if ("list".equals(n.getNodeName()))
- + {
- + for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
- + {
- + if (d.getNodeName().equals("skin"))
- + {
- + NamedNodeMap attrs = d.getAttributes();
- + StatsSet stats = new StatsSet();
- + Node att = attrs.getNamedItem("id");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing ID for Skin, skipping.");
- + }
- + else
- + {
- + int id = Integer.parseInt(att.getNodeValue());
- + stats.set("id", id);
- + att = attrs.getNamedItem("name");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing name for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("name", att.getNodeValue());
- + att = attrs.getNamedItem("utx_name");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing name for utx_name id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("utx_name", att.getNodeValue());
- + att = attrs.getNamedItem("chest");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing chest for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("chest", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("gloves");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing gloves for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("gloves", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("legs");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing legs for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("legs", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("feet");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing gloves for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("feet", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("hair");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing hair for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("hair", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("price_id");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing price_id for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("price_id", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("price");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing price for skin id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("price", Integer.parseInt(att.getNodeValue()));
- + att = attrs.getNamedItem("isVip");
- + if (att == null)
- + {
- + LOG.severe("Skin Data: Missing price for isVip id: " + stats.getString("id") + ", skipping.");
- + }
- + else
- + {
- + stats.set("isVip", Integer.parseInt(att.getNodeValue()));
- + for (Node data = d.getFirstChild(); data != null; data = data.getNextSibling())
- + {
- + attrs = data.getAttributes();
- + if (data.getNodeName().equals("conditions"))
- + {
- + for (int i = 0; i < attrs.getLength(); i++)
- + {
- + Node node = attrs.item(i);
- + stats.set(node.getNodeName(), node.getNodeValue());
- + }
- + }
- + }
- + Skin skin = new Skin(id, stats);
- + skinList.put(skin, stats);
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + System.out.println("SkinData: loaded " + skinList.size() + " skins from XML!");
- + }
- + }
- + }
- + catch (Exception e)
- + {
- + LOG.warning("SkinData: Error while creating table: " + e);
- + e.printStackTrace();
- + }
- + }
- +
- + public Map<Skin, StatsSet> getAllSkins()
- + {
- + return skinList;
- + }
- +
- + public void clear()
- + {
- + skinList.clear();
- + skinList = new HashMap<>();
- + }
- +
- + public void reload()
- + {
- + clear();
- + loadDocument("./data/Skins.xml");
- + }
- +
- + public List<Skin> getSkinList()
- + {
- + List<Skin> skins = new ArrayList<>();
- + for (Map.Entry<Skin, StatsSet> map : skinList.entrySet())
- + {
- + skins.add(map.getKey());
- + }
- + return skins;
- + }
- +
- + public Skin[] getSkinVec()
- + {
- + Skin[] vec = new Skin[getSkinList().size()];
- + for (int i = 0; i < getSkinList().size(); i++)
- + {
- + vec[i] = getSkinList().get(i);
- + }
- + return vec;
- + }
- +
- + public Skin getSkinById(int id)
- + {
- + for (Map.Entry<Skin, StatsSet> map : skinList.entrySet())
- + {
- + if (map.getKey().getId() == id)
- + {
- + return map.getKey();
- + }
- + }
- + return null;
- + }
- +
- + public Map<Integer, List<Skin>> getSkinPages()
- + {
- + Map<Integer, List<Skin>> skinPages = new HashMap<>();
- + int page = 0;
- + int counter = 0;
- + for (Skin skin : getInstance().getSkinList())
- + {
- + if (counter >= 10)
- + {
- + page++;
- + counter = 0;
- + }
- + if (skinPages.get(Integer.valueOf(page)) == null)
- + {
- + skinPages.put(Integer.valueOf(page), new ArrayList<>());
- + }
- + skinPages.get(Integer.valueOf(page)).add(skin);
- + counter++;
- + }
- + return skinPages;
- + }
- +}
- diff --git a/src/Base/Util/Mysql.java b/src/Base/Util/Mysql.java
- new file mode 100644
- index 0000000..31aba5f
- --- /dev/null
- +++ b/src/Base/Util/Mysql.java
- @@ -0,0 +1,198 @@
- +package Base.Util;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.sql.SQLException;
- +import java.sql.Statement;
- +import java.util.logging.Logger;
- +
- +import l2jorion.util.database.L2DatabaseFactory;
- +
- +public abstract class Mysql
- +{
- + public static final Logger _log = Logger.getLogger(Mysql.class.getName());
- +
- + /**
- + * Performs a simple sql queries where unnecessary control parameters <BR>
- + * NOTE: In this method, the parameters passed are not valid for SQL-injection!
- + * @param db
- + * @param query
- + * @param vars
- + * @return
- + */
- + public static boolean setEx(L2DatabaseFactory db, String query, Object... vars)
- + {
- + Connection con = null;
- + Statement statement = null;
- + PreparedStatement pstatement = null;
- + boolean successed = true;
- +
- + try
- + {
- + if (db == null)
- + {
- + db = L2DatabaseFactory.getInstance();
- + }
- +
- + con = db.getConnection();
- + if (vars.length == 0)
- + {
- + statement = con.createStatement();
- + statement.executeUpdate(query);
- + statement.close();
- + }
- + else
- + {
- + pstatement = con.prepareStatement(query);
- + setVars(pstatement, vars);
- + pstatement.executeUpdate();
- + pstatement.close();
- + }
- + con.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Could not execute update '" + query + "': " + e);
- + e.printStackTrace();
- + successed = false;
- + }
- + finally
- + {
- + closeQuietly(con, pstatement);
- + closeQuietly(statement);
- + }
- + return successed;
- + }
- +
- + public static void setVars(PreparedStatement statement, Object... vars) throws SQLException
- + {
- + Number n;
- + long long_val;
- + double double_val;
- + for (int i = 0; i < vars.length; i++)
- + {
- + if (vars[i] instanceof Number)
- + {
- + n = (Number) vars[i];
- + long_val = n.longValue();
- + double_val = n.doubleValue();
- + if (long_val == double_val)
- + {
- + statement.setLong(i + 1, long_val);
- + }
- + else
- + {
- + statement.setDouble(i + 1, double_val);
- + }
- + }
- + else if (vars[i] instanceof String)
- + {
- + statement.setString(i + 1, (String) vars[i]);
- + }
- + }
- + }
- +
- + public static boolean set(String query, Object... vars)
- + {
- + return setEx(null, query, vars);
- + }
- +
- + public static boolean set(String query)
- + {
- + return setEx(null, query);
- + }
- +
- + public static void closeQuietly(Connection conn)
- + {
- + try
- + {
- + close(conn);
- + }
- + catch (SQLException e)
- + { // NOPMD
- + // quiet
- + }
- + }
- +
- + public static void closeQuietly(Connection conn, Statement stmt, ResultSet rs)
- + {
- +
- + try
- + {
- + closeQuietly(rs);
- + }
- + finally
- + {
- + try
- + {
- + closeQuietly(stmt);
- + }
- + finally
- + {
- + closeQuietly(conn);
- + }
- + }
- + }
- +
- + public static void closeQuietly(Connection conn, Statement stmt)
- + {
- + try
- + {
- + closeQuietly(stmt);
- + }
- + finally
- + {
- + closeQuietly(conn);
- + }
- + }
- +
- + public static void closeQuietly(ResultSet rs)
- + {
- + try
- + {
- + close(rs);
- + }
- + catch (SQLException e)
- + { // NOPMD
- + // quiet
- + }
- + }
- +
- + public static void closeQuietly(Statement stmt)
- + {
- + try
- + {
- + close(stmt);
- + }
- + catch (SQLException e)
- + { // NOPMD
- + // quiet
- + }
- + }
- +
- + public static void close(Connection conn) throws SQLException
- + {
- + if (conn != null)
- + {
- + conn.close();
- + }
- + }
- +
- + public static void close(ResultSet rs) throws SQLException
- + {
- + if (rs != null)
- + {
- + rs.close();
- + }
- + }
- +
- + public static void close(Statement stmt) throws SQLException
- + {
- + if (stmt != null)
- + {
- + stmt.close();
- + }
- + }
- +
- +}
- \ No newline at end of file
- diff --git a/src/Base/XML/XMLDocument.java b/src/Base/XML/XMLDocument.java
- new file mode 100644
- index 0000000..2e9bb7a
- --- /dev/null
- +++ b/src/Base/XML/XMLDocument.java
- @@ -0,0 +1,137 @@
- +package Base.XML;
- +
- +import java.io.File;
- +import java.util.function.Consumer;
- +import java.util.function.Predicate;
- +import java.util.logging.Level;
- +import java.util.logging.Logger;
- +
- +import javax.xml.parsers.DocumentBuilderFactory;
- +
- +import org.w3c.dom.Document;
- +import org.w3c.dom.NamedNodeMap;
- +import org.w3c.dom.Node;
- +import org.w3c.dom.NodeList;
- +
- +import l2jorion.game.templates.StatsSet;
- +
- +/**
- + * An XML document, relying on a static and single DocumentBuilderFactory.
- + */
- +public abstract class XMLDocument
- +{
- + protected static final Logger LOG = Logger.getLogger(XMLDocument.class.getName());
- +
- + private static final DocumentBuilderFactory BUILDER;
- + static
- + {
- + BUILDER = DocumentBuilderFactory.newInstance();
- + BUILDER.setValidating(false);
- + BUILDER.setIgnoringComments(true);
- + }
- +
- + abstract protected void load();
- +
- + abstract protected void parseDocument(Document doc, File f);
- +
- + public void loadDocument(String filePath)
- + {
- + loadDocument(new File(filePath));
- + }
- +
- + /**
- + * Parse an entire directory or file if found.
- + * @param file
- + */
- + public void loadDocument(File file)
- + {
- + if (!file.exists())
- + {
- + LOG.severe("The following file or directory doesn't exist: " + file.getName());
- + return;
- + }
- +
- + if (file.isDirectory())
- + {
- + for (File f : file.listFiles())
- + {
- + loadDocument(f);
- + }
- + }
- + else if (file.isFile())
- + {
- + try
- + {
- + parseDocument(BUILDER.newDocumentBuilder().parse(file), file);
- + }
- + catch (Exception e)
- + {
- + LOG.log(Level.SEVERE, "Error loading XML file " + file.getName(), e);
- + }
- + }
- + }
- +
- + public void forEach(Node node, Consumer<Node> action)
- + {
- + forEach(node, a -> true, action);
- + }
- +
- + public void forEach(Node node, String nodeName, Consumer<Node> action)
- + {
- + forEach(node, innerNode ->
- + {
- + if (nodeName.contains("|"))
- + {
- + final String[] nodeNames = nodeName.split("\\|");
- + for (String name : nodeNames)
- + {
- + if (!name.isEmpty() && name.equals(innerNode.getNodeName()))
- + {
- + return true;
- + }
- + }
- + return false;
- + }
- + return nodeName.equals(innerNode.getNodeName());
- + }, action);
- + }
- +
- + public void forEach(Node node, Predicate<Node> filter, Consumer<Node> action)
- + {
- + final NodeList list = node.getChildNodes();
- + for (int i = 0; i < list.getLength(); i++)
- + {
- + final Node targetNode = list.item(i);
- + if (filter.test(targetNode))
- + {
- + action.accept(targetNode);
- + }
- + }
- + }
- +
- + public StatsSet parseAttributes(Node node)
- + {
- + final NamedNodeMap attrs = node.getAttributes();
- + final StatsSet map = new StatsSet();
- + for (int i = 0; i < attrs.getLength(); i++)
- + {
- + final Node att = attrs.item(i);
- + map.set(att.getNodeName(), att.getNodeValue());
- + }
- + return map;
- + }
- +
- + /**
- + * This method parses the content of a NamedNodeMap and feed the given StatsSet.
- + * @param attrs : The NamedNodeMap to parse.
- + * @param set : The StatsSet to feed.
- + */
- + public static void parseAndFeed(NamedNodeMap attrs, StatsSet set)
- + {
- + for (int i = 0; i < attrs.getLength(); i++)
- + {
- + final Node attr = attrs.item(i);
- + set.set(attr.getNodeName(), attr.getNodeValue());
- + }
- + }
- +}
- \ No newline at end of file
- diff --git a/src/l2jorion/Config.java b/src/l2jorion/Config.java
- index bbf70a0..a713d3e 100644
- --- a/src/l2jorion/Config.java
- +++ b/src/l2jorion/Config.java
- @@ -2358,6 +2358,10 @@
- public static String PM_TEXT2;
- public static boolean NEW_PLAYER_EFFECT;
- + public static String TEXTURE_SKIN_PACKAGE;
- +
- + public static String ACQUIRED_SKIN_SUFFIX;
- +
- public static void loadL2jOrionConfig()
- {
- final String L2jOrion = ConfigLoader.L2jOrion_CONFIG_FILE;
- @@ -2381,6 +2385,9 @@
- LIST_FAKE_ARMOR_ITEMS.add(Integer.parseInt(id));
- }
- + TEXTURE_SKIN_PACKAGE = L2jOrionSettings.getProperty("TextureSkinPackageName", "MAYKE_MENDES_SKIN");
- + ACQUIRED_SKIN_SUFFIX = L2jOrionSettings.getProperty("TextureSkinSuffixName", "_f");
- +
- FREE_TELEPORT_UNTIL = Integer.parseInt(L2jOrionSettings.getProperty("FreeTeleportUntil", "1"));
- REMOVAL_AUGMENTATION_FREE = Boolean.parseBoolean(L2jOrionSettings.getProperty("RemovalAugmentationFree", "False"));
- ALLOW_FREIGHT_AUGMENTED = Boolean.parseBoolean(L2jOrionSettings.getProperty("AllowFreightAugmentedItem", "False"));
- diff --git a/src/l2jorion/game/GameServer.java b/src/l2jorion/game/GameServer.java
- index 214bbfe..99c3a68 100644
- --- a/src/l2jorion/game/GameServer.java
- +++ b/src/l2jorion/game/GameServer.java
- @@ -30,6 +30,7 @@
- import java.util.Date;
- import java.util.logging.LogManager;
- +import Base.SkinBeauty.SkinData;
- import hwid.hwid;
- import l2jorion.Config;
- import l2jorion.ConfigLoader;
- @@ -467,6 +468,9 @@
- Util.printSection("Scripts");
- QuestManager.getInstance();
- + Util.printSection("Skin Manager");
- + SkinData.getInstance();
- +
- // Donate Items
- TaskItemDonate.getInstance();
- diff --git a/src/l2jorion/game/handler/ItemHandler.java b/src/l2jorion/game/handler/ItemHandler.java
- index 041c584..eedc4e4 100644
- --- a/src/l2jorion/game/handler/ItemHandler.java
- +++ b/src/l2jorion/game/handler/ItemHandler.java
- @@ -65,6 +65,7 @@
- import l2jorion.game.handler.item.Scrolls;
- import l2jorion.game.handler.item.Seed;
- import l2jorion.game.handler.item.SevenSignsRecord;
- +import l2jorion.game.handler.item.Skins;
- import l2jorion.game.handler.item.SoulCrystals;
- import l2jorion.game.handler.item.SoulShots;
- import l2jorion.game.handler.item.SpecialXMas;
- @@ -134,6 +135,7 @@
- registerItemHandler(new ChristmasTree());
- registerItemHandler(new Crystals());
- registerItemHandler(new HsItems());
- + registerItemHandler(new Skins());
- LOG.info("ItemHandler: Loaded " + _datatable.size() + " handlers");
- }
- diff --git a/src/l2jorion/game/handler/item/Skins.java b/src/l2jorion/game/handler/item/Skins.java
- new file mode 100644
- index 0000000..187d84e
- --- /dev/null
- +++ b/src/l2jorion/game/handler/item/Skins.java
- @@ -0,0 +1,222 @@
- +package l2jorion.game.handler.item;
- +
- +import Base.SkinBeauty.Skin;
- +import Base.SkinBeauty.SkinData;
- +
- +import l2jorion.game.handler.IItemHandler;
- +
- +import l2jorion.game.model.actor.instance.L2ItemInstance;
- +import l2jorion.game.model.actor.instance.L2PcInstance;
- +import l2jorion.game.model.actor.instance.L2PlayableInstance;
- +import l2jorion.game.network.serverpackets.MagicSkillUser;
- +import l2jorion.game.thread.ThreadPoolManager;
- +
- +/**
- + * @author Williams and Stinkymadness
- + */
- +public class Skins implements IItemHandler
- +{
- + private static final int ITEM_IDS[] =
- + {
- + 19000,
- + 19001,
- + 19002,
- + 19003,
- + 19004,
- + 19005,
- + 19006,
- + 19007,
- + 19008,
- + 19009,
- + 19010,
- + 19011,
- + 19012,
- + 19013,
- + 19014,
- + 19015,
- + 19016,
- + 19017,
- + 19018,
- + 19019,
- + 19020,
- + 19021,
- + 19022,
- + 19023,
- + 19024,
- + 19025,
- + 19026,
- + 19027,
- + 19028,
- + 19029,
- + 19030,
- + 19031,
- + 19033,
- + 19034,
- + 19035,
- + 19036,
- + 19037,
- + 19038,
- + 19039,
- + 19040,
- + 19041,
- + 19042,
- + 19043,
- + 19044,
- + 19045,
- + 19046,
- + 19047,
- + 19048,
- + 19049,
- + 19050,
- + 19051,
- + 19052,
- + 19053,
- + 19054,
- + 19055,
- + 19056,
- + 19057,
- + 19058,
- + 19059,
- + 19060,
- + 19061,
- + 19062,
- + 19063,
- + 19064,
- + 19065,
- + 19066,
- + 19067,
- + 19068,
- + 19069,
- + 19070,
- + 19071,
- + 19072,
- + 19073,
- + 19074,
- + 19075,
- + 19076,
- + 19077,
- + 19078,
- + 19079,
- + 19080,
- + 19081,
- + 19082,
- + 19083,
- + 19084,
- + 19085,
- + 19086,
- + 19087,
- + 19088,
- + 19089,
- + 19090,
- + 19091,
- + 19092,
- + 19093,
- + 19094,
- + 19095,
- + 19096,
- + 19097,
- + 19098,
- + 19099,
- + 19100,
- + 19101,
- + 19102,
- + 19103,
- + 19104,
- + 19105,
- + 19106,
- + 19107,
- + 19108,
- + 19109,
- + 19110,
- + 19111,
- + 19112,
- + 19113,
- + 19114,
- + 19115,
- + 19116,
- + 19117,
- + 19118,
- + 19119,
- + 19120,
- + 19121,
- + 19122,
- + 19123,
- + 19124,
- + 19125,
- + 19126,
- + 19127,
- + 19128,
- + 19129,
- + 19130,
- + 19131,
- + 19132,
- + 19133,
- + 19134,
- + 19135,
- + 19136,
- + 19137,
- + 19138,
- + 19139,
- + 19140,
- + 19141,
- + 15020,
- + 29142
- +
- + };
- +
- + public static void VisualTeste(L2PcInstance player)
- + {
- + Skin free = SkinData.getInstance().getSkinById(0);
- + player.setActiveSkin(free);
- + player.broadcastUserInfo();
- + }
- +
- + @Override
- + public void useItem(L2PlayableInstance playable, L2ItemInstance item)
- + {
- + final L2PcInstance player = (L2PcInstance) playable;
- +
- + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + playable.setIsImmobileUntilAttacked(false);
- + }
- + }, 1100);
- +
- + if (!(playable instanceof L2PcInstance))
- + {
- + return;
- + }
- +
- + final Skin dress = SkinData.getInstance().getSkinById(item.getItemId());
- +
- + if (dress == null)
- + {
- + return;
- + }
- +
- + if (!player.isDressMeEnabled())
- + {
- + player.setActiveSkin(dress);
- + playable.setIsImmobileUntilAttacked(true);
- + player.broadcastPacket(new MagicSkillUser(player, player, 1047, 1, 1100, 0));
- + player.broadcastUserInfo();
- + }
- + else
- + {
- + player.setActiveSkin(dress);
- + playable.setIsImmobileUntilAttacked(true);
- + player.broadcastPacket(new MagicSkillUser(player, player, 1047, 1, 1100, 0));
- + player.broadcastUserInfo();
- + }
- +
- + }
- +
- + @Override
- + public int[] getItemIds()
- + {
- + return ITEM_IDS;
- + }
- +}
- \ No newline at end of file
- diff --git a/src/l2jorion/game/model/actor/instance/L2BeautyShopInstance.java b/src/l2jorion/game/model/actor/instance/L2BeautyShopInstance.java
- new file mode 100644
- index 0000000..867e34d
- --- /dev/null
- +++ b/src/l2jorion/game/model/actor/instance/L2BeautyShopInstance.java
- @@ -0,0 +1,251 @@
- +package l2jorion.game.model.actor.instance;
- +
- +import java.util.List;
- +import java.util.concurrent.ScheduledFuture;
- +
- +import Base.SkinBeauty.Skin;
- +import Base.SkinBeauty.SkinData;
- +import l2jorion.Config;
- +import l2jorion.game.ai.CtrlIntention;
- +import l2jorion.game.model.PcInventory;
- +import l2jorion.game.network.serverpackets.ActionFailed;
- +import l2jorion.game.network.serverpackets.MoveToPawn;
- +import l2jorion.game.network.serverpackets.MyTargetSelected;
- +import l2jorion.game.network.serverpackets.NpcHtmlMessage;
- +import l2jorion.game.network.serverpackets.ValidateLocation;
- +import l2jorion.game.templates.L2NpcTemplate;
- +
- +public class L2BeautyShopInstance extends L2NpcInstance
- +{
- + ScheduledFuture<?> task;
- +
- + public L2BeautyShopInstance(int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void onAction(L2PcInstance player)
- + {
- + if (this != player.getTarget())
- + {
- + player.setTarget(this);
- + player.sendPacket(new MyTargetSelected(getObjectId(), 0));
- + player.sendPacket(new ValidateLocation(this));
- + }
- + else if (!canInteract(player))
- + {
- + player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
- + }
- + else
- + {
- + player.sendPacket(new MoveToPawn(player, this, 150));
- + if (hasRandomAnimation())
- + {
- + onRandomAnimation();
- + }
- + showMainWindow(player, 0);
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- + }
- +
- + public static String getIconPath(L2PcInstance player, Skin skin)
- + {
- + if (player.containsSkin(skin))
- + {
- + return skin.getUtxName();
- + }
- + return skin.getUtxName() + Config.ACQUIRED_SKIN_SUFFIX;
- + }
- +
- + public static String showButtons(L2PcInstance player, Skin skin)
- + {
- + StringBuilder sb = new StringBuilder();
- + if (!player.getSkins().contains(skin))
- + {
- + sb.append("<tr>");
- + sb.append("<td align=center><button value=\"Buy\" action=\"bypass -h acquireSkin " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td>");
- + sb.append("<td align=center><button value=\"Try\" action=\"bypass -h trySkin " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td>");
- + sb.append("</tr>");
- + sb.append("<tr>");
- + sb.append("<td align=center><button value=\"Equip\" action=\"bypass -h equipSkin " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td>");
- + sb.append("<td align=center><button value=\"Unequip\" action=\"bypass -h unequipSkin " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td>");
- + sb.append("</tr>");
- + }
- + else
- + {
- + sb.append("<tr>");
- + sb.append("<td align=center><button value=\"Equip\" action=\"bypass -h equipSkin " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td>");
- + sb.append("<td align=center><button value=\"Unequip\" action=\"bypass -h unequipSkin " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td>");
- + sb.append("</tr>");
- + }
- + return sb.toString();
- + }
- +
- + public static String generatePagesHtml(L2PcInstance player)
- + {
- + StringBuilder sb = new StringBuilder();
- + for (Integer i : SkinData.getInstance().getSkinPages().keySet())
- + {
- + sb.append("<td>");
- + sb.append("<table width=21 align=left >");
- + sb.append("<tr>");
- + sb.append("<td width=21 align=left><button value=\"Page " + i + "\" action=\"bypass -h skinPage " + i + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
- + sb.append("</tr>");
- + sb.append("</table>");
- + sb.append("</td>");
- + }
- + return sb.toString();
- + }
- +
- + public static String generateSkinsHtml(L2PcInstance player, int page)
- + {
- + StringBuilder sb = new StringBuilder();
- + int i = 0;
- + List<Skin> list = SkinData.getInstance().getSkinPages().get(Integer.valueOf(page));
- + for (Skin skin : list)
- + {
- + sb.append("<tr>");
- + sb.append("<td>");
- + sb.append("<img src=\"L2UI.SquareGray\" width=295 height=1>");
- + if (i % 2 == 0)
- + {
- + sb.append("<table align=center height=40 bgcolor=000000>");
- + }
- + else
- + {
- + sb.append("<table align=center height=40");
- + }
- + sb.append("<tr>");
- + sb.append("<td width=40>");
- + sb.append("<img src=\"" + Config.TEXTURE_SKIN_PACKAGE + "." + getIconPath(player, skin) + "\" width=32 height=32/>");
- + sb.append("</td>");
- + sb.append("<td width=180>");
- + sb.append("<font color=LEVEL>" + getSkinName(skin) + "</font><br1>Price:" + skin.getPrice() + " " + skin.getPriceItemName());
- + if (player.getSkins().contains(skin))
- + {
- + sb.append("<font color=ff0000>(Acquired)</font>");
- + }
- + sb.append("</td>");
- + sb.append("<td align=center width=100 valign=center>");
- + sb.append("<button value=\"Open \" action=\"bypass -h skinhtm " + skin.getId() + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
- + sb.append("</td>");
- + sb.append("</tr>");
- + sb.append("</table>");
- + sb.append("</td>");
- + sb.append("</tr>");
- + i++;
- + }
- + return sb.toString();
- + }
- +
- + public static String getSkinName(Skin skin)
- + {
- + if (skin.isVip())
- + {
- + return skin.getName() + "<font color=\"ff0000\"> (VIP)</font>";
- + }
- + return skin.getName();
- + }
- +
- + public void showMainWindow(L2PcInstance player, int page)
- + {
- + String filename = "data/html/SkinManager/Main.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + html.replace("%npcId%", String.valueOf(getNpcId()));
- + html.replace("%npcname%", getName());
- + html.replace("%hat%", player.isActiveHat() ? "ON" : "OFF");
- + html.replace("%skins%", generateSkinsHtml(player, page));
- + html.replace("%pages%", generatePagesHtml(player));
- + player.sendPacket(html);
- + filename = null;
- + html = null;
- + }
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance activeChar, String _command)
- + {
- + }
- +
- + public static boolean reduceItem(L2PcInstance player, int itemId, int itemPrice)
- + {
- + PcInventory inv = player.getInventory();
- + try
- + {
- + if (inv.getItemByItemId(itemId) == null)
- + {
- + player.sendMessage("You don't have required items!");
- + return false;
- + }
- + if (inv.getItemByItemId(itemId).getCount() < itemPrice)
- + {
- + player.sendMessage("You don't have required items!");
- + return false;
- + }
- + player.destroyItemByItemId("skin buy", itemId, itemPrice, player, true);
- + return true;
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + return false;
- + }
- + }
- +
- + public static boolean equipSkin(L2PcInstance activeChar, int id, boolean trying)
- + {
- + Skin skin = SkinData.getInstance().getSkinById(id);
- +
- + if (activeChar.getSkinId() == 0)
- + {
- + Skin dress = SkinData.getInstance().getSkinById(id);
- + activeChar.setActiveSkin(dress);
- +
- + }
- + if (trying)
- + {
- + Skin dress = SkinData.getInstance().getSkinById(id);
- + activeChar.setActiveSkin(dress);
- + activeChar.setActiveHat(true);
- + activeChar.setDressMeEnabled(true);
- + activeChar.broadcastUserInfo();
- + activeChar.setSkinId(skin.getId());
- + return true;
- + }
- + if (activeChar.isDressMeEnabled() && !trying)
- + {
- + activeChar.sendMessage("First unequip your actual skin!");
- + return false;
- + }
- + if (activeChar.getSkins().contains(skin))
- + {
- + Skin dress = SkinData.getInstance().getSkinById(id);
- + activeChar.setActiveSkin(dress);
- + activeChar.setActiveHat(true);
- + activeChar.setDressMeEnabled(true);
- + activeChar.broadcastUserInfo();
- + activeChar.setSkinId(skin.getId());
- + activeChar.sendMessage("Skin " + skin.getStats().getString("name") + " equiped!");
- + return true;
- + }
- + activeChar.sendMessage("You don't own this skin!");
- + return false;
- + }
- +
- + @Override
- + public String getHtmlPath(L2PcInstance player, int npcId, int val)
- + {
- + String pom = "";
- + if (val == 0)
- + {
- + pom = "" + npcId;
- + }
- + else
- + {
- + pom = npcId + "-" + val;
- + }
- + return "data/html/SkinManager/" + pom + ".htm";
- + }
- +}
- diff --git a/src/l2jorion/game/model/actor/instance/L2PcInstance.java b/src/l2jorion/game/model/actor/instance/L2PcInstance.java
- index 8d9b411..eb7f14f 100644
- --- a/src/l2jorion/game/model/actor/instance/L2PcInstance.java
- +++ b/src/l2jorion/game/model/actor/instance/L2PcInstance.java
- @@ -40,6 +40,9 @@
- import java.util.concurrent.TimeUnit;
- import java.util.concurrent.locks.ReentrantLock;
- +import Base.SkinBeauty.Skin;
- +import Base.SkinBeauty.SkinData;
- +import Base.Util.Mysql;
- import javolution.text.TextBuilder;
- import javolution.util.FastList;
- import javolution.util.FastMap;
- @@ -10027,7 +10030,7 @@
- }
- CursedWeaponsManager.getInstance().checkPlayer(player);
- -
- + player.loadSkins();
- player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally"));
- player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
- @@ -10314,6 +10317,8 @@
- storeCharBase();
- storeCharSub();
- + saveSkins();
- +
- // Dont store effect if the char was on Offline trade
- if (!isStored())
- {
- @@ -21169,6 +21174,134 @@
- _dressed = val;
- }
- + public ScheduledFuture<?> visualTask;
- +
- + public int visualizationTime;
- +
- + private Skin activeSkin;
- +
- + private boolean isActiveHat;
- +
- + private List<Skin> skins;
- +
- + private int skinId;
- +
- + public Skin getActiveSkin()
- + {
- + return this.activeSkin;
- + }
- +
- + public void setActiveSkin(Skin activeSkin)
- + {
- + this.activeSkin = activeSkin;
- + }
- +
- + public int getSkinId()
- + {
- + return this.skinId;
- + }
- +
- + public void setSkinId(int skinId)
- + {
- + this.skinId = skinId;
- + }
- +
- + public boolean isActiveHat()
- + {
- + return this.isActiveHat;
- + }
- +
- + public void setActiveHat(boolean isActiveHat)
- + {
- + this.isActiveHat = isActiveHat;
- + }
- +
- + public List<Skin> getSkins()
- + {
- + return this.skins;
- + }
- +
- + public void setSkins(List<Skin> skins)
- + {
- + this.skins = skins;
- + }
- +
- + public boolean containsSkin(Skin skin)
- + {
- + return getSkins().contains(skin);
- + }
- +
- + public boolean loadSkins()
- + {
- + if (this.skins == null)
- + {
- + this.skins = new ArrayList<>();
- + }
- + Connection con = null;
- + PreparedStatement offline = null;
- + ResultSet rs = null;
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- + PreparedStatement statement = con.prepareStatement("SELECT skin_id FROM player_skins WHERE char_id=?");
- + statement.setInt(1, getObjectId());
- + ResultSet rset = statement.executeQuery();
- + while (rset.next())
- + {
- + this.skins.add(SkinData.getInstance().getSkinById(rset.getInt("skin_id")));
- + }
- + con.close();
- + return true;
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + return false;
- + }
- + finally
- + {
- + Mysql.closeQuietly(con, offline, rs);
- + }
- + }
- +
- + public boolean saveSkins()
- + {
- + Connection con = null;
- + PreparedStatement offline = null;
- + ResultSet rs = null;
- +
- + if (skins == null)
- + {
- + skins = new ArrayList<>();
- + }
- +
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- + PreparedStatement statement = con.prepareStatement("DELETE FROM player_skins WHERE char_id=?");
- + statement.setInt(1, getObjectId());
- + statement.execute();
- + statement = con.prepareStatement("INSERT INTO player_skins (char_id,skin_id) VALUES (?,?)");
- + for (Skin skin : getSkins())
- + {
- + statement.setInt(1, getObjectId());
- + statement.setInt(2, skin.getId());
- + statement.execute();
- + }
- + con.close();
- + return true;
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + return false;
- + }
- + finally
- + {
- + Mysql.closeQuietly(con, offline, rs);
- + }
- + }
- +
- public void setFakeArmorObjectId(int objectId)
- {
- _fakeArmorObjectId = objectId;
- diff --git a/src/l2jorion/game/network/clientpackets/RequestBypassToServer.java b/src/l2jorion/game/network/clientpackets/RequestBypassToServer.java
- index 7bb0cf1..54d3fd4 100644
- --- a/src/l2jorion/game/network/clientpackets/RequestBypassToServer.java
- +++ b/src/l2jorion/game/network/clientpackets/RequestBypassToServer.java
- @@ -23,7 +23,10 @@
- import java.sql.ResultSet;
- import java.text.NumberFormat;
- import java.util.StringTokenizer;
- +import java.util.concurrent.ScheduledFuture;
- +import Base.SkinBeauty.Skin;
- +import Base.SkinBeauty.SkinData;
- import javolution.text.TextBuilder;
- import l2jorion.Config;
- import l2jorion.game.community.CommunityBoard;
- @@ -47,6 +50,7 @@
- import l2jorion.game.model.L2Object;
- import l2jorion.game.model.L2Skill;
- import l2jorion.game.model.L2World;
- +import l2jorion.game.model.actor.instance.L2BeautyShopInstance;
- import l2jorion.game.model.actor.instance.L2ClassMasterInstance;
- import l2jorion.game.model.actor.instance.L2GrandBossInstance;
- import l2jorion.game.model.actor.instance.L2ItemInstance;
- @@ -71,6 +75,7 @@
- import l2jorion.game.network.serverpackets.PlaySound;
- import l2jorion.game.network.serverpackets.SystemMessage;
- import l2jorion.game.templates.L2Item;
- +import l2jorion.game.thread.ThreadPoolManager;
- import l2jorion.game.util.GMAudit;
- import l2jorion.game.util.Util;
- import l2jorion.log.Log;
- @@ -107,6 +112,9 @@
- return;
- }
- + StringTokenizer stSkin = new StringTokenizer(this._command, " ");
- + stSkin.nextToken();
- +
- try
- {
- if (_command.startsWith("admin_"))
- @@ -572,6 +580,123 @@
- }
- }
- +
- + else if (this._command.startsWith("skinPage"))
- + {
- + int page = Integer.parseInt(stSkin.nextToken());
- + showMainWindow(activeChar, page);
- + }
- + else if (this._command.startsWith("skinHat"))
- + {
- + if (activeChar.isActiveHat())
- + {
- + activeChar.setActiveHat(false);
- + }
- + }
- + else if (this._command.startsWith("acquireSkin"))
- + {
- + int id = Integer.parseInt(stSkin.nextToken());
- + Skin skin = SkinData.getInstance().getSkinById(id);
- + if (skin != null)
- + {
- + if (activeChar.getSkins().contains(skin))
- + {
- + activeChar.sendMessage("Skin " + skin.getName() + " already acquired. Try other!");
- + showSkinWindow(activeChar, skin);
- + return;
- + }
- + if (skin.isVip())
- + {
- + if (activeChar.isDonator())
- + {
- + if (L2BeautyShopInstance.reduceItem(activeChar, skin.getPriceId(), skin.getPrice()) && activeChar.getSkins().add(skin))
- + {
- + activeChar.sendMessage("Skin " + skin.getStats().getString("name") + " acquired!");
- + showSkinWindow(activeChar, skin);
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This skin is only for Vip Players!");
- + showSkinWindow(activeChar, skin);
- + return;
- + }
- + }
- + else if (L2BeautyShopInstance.reduceItem(activeChar, skin.getPriceId(), skin.getPrice()) && activeChar.getSkins().add(skin))
- + {
- + activeChar.sendMessage("Skin " + skin.getName() + " acquired!");
- + showSkinWindow(activeChar, skin);
- + }
- + }
- + }
- + else if (this._command.startsWith("trySkin"))
- + {
- + if (activeChar.visualizationTime > 0)
- + {
- + activeChar.sendMessage("You already Trying a Skin!");
- + return;
- + }
- + activeChar.visualizationTime = 5;
- + int id = Integer.parseInt(stSkin.nextToken());
- + L2BeautyShopInstance.equipSkin(activeChar, id, true);
- + activeChar.visualTask = startCounter(activeChar);
- + }
- + else if (this._command.startsWith("skinhtm"))
- + {
- + int id = Integer.parseInt(stSkin.nextToken());
- + Skin skin = SkinData.getInstance().getSkinById(id);
- + showSkinWindow(activeChar, skin);
- + }
- + else if (this._command.startsWith("equipSkin"))
- + {
- + int id = Integer.parseInt(stSkin.nextToken());
- + L2BeautyShopInstance.equipSkin(activeChar, id, false);
- + showSkinWindow(activeChar, SkinData.getInstance().getSkinById(id));
- + }
- + else if (this._command.startsWith("unequipSkin"))
- + {
- + int id = Integer.parseInt(stSkin.nextToken());
- + if (activeChar.isDressMeEnabled())
- + {
- + Skin dress = SkinData.getInstance().getSkinById(0);
- + activeChar.setActiveHat(false);
- + activeChar.setDressMeEnabled(false);
- + activeChar.broadcastUserInfo();
- + activeChar.setSkinId(0);
- + activeChar.setActiveSkin(dress);
- + activeChar.sendMessage("Skin unequiped!");
- + showSkinWindow(activeChar, SkinData.getInstance().getSkinById(id));
- + }
- + else
- + {
- + activeChar.sendMessage("You don't have any skin equiped!");
- + showMainWindow(activeChar, 0);
- + return;
- + }
- + }
- + else if (this._command.startsWith("activeHat"))
- + {
- + if (!activeChar.isDressMeEnabled())
- + {
- + activeChar.sendMessage("You don't have any skin equiped! First Equip a Skin!");
- + showMainWindow(activeChar, 0);
- + return;
- + }
- + if (activeChar.isActiveHat())
- + {
- + activeChar.setActiveHat(false);
- + activeChar.setDressMeEnabled(true);
- + activeChar.broadcastUserInfo();
- + }
- + else
- + {
- + activeChar.setActiveHat(true);
- + activeChar.setDressMeEnabled(true);
- + activeChar.broadcastUserInfo();
- + }
- + showMainWindow(activeChar, 0);
- + }
- +
- // Draw a Symbol
- else if (_command.equals("Draw"))
- {
- @@ -1278,6 +1403,83 @@
- sendEditWindow(p, part);
- }
- + public static void showSkinWindow(L2PcInstance player, Skin skin)
- + {
- + String filename = "data/html/SkinManager/Skin.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile(filename);
- + html.replace("%hat%", player.isActiveHat() ? "<font color=\"00ff00\">ON</font>" : "<font color=\"ff0000\">OFF</font>");
- + html.replace("%showbutton%", L2BeautyShopInstance.showButtons(player, skin));
- + html.replace("%skinprice%", skin.getPrice());
- + html.replace("%skinpriceid%", skin.getPriceItemName());
- + html.replace("%skiname%", skin.getName());
- + html.replace("%icon%", "<img src=\"MAYKE_MENDES_SKIN" + L2BeautyShopInstance.getIconPath(player, skin) + "\" width=32 height=32/>");
- + html.replace("%skinstatus%", player.containsSkin(skin) ? "<font color=\"LEVEL\">Already Acquired</font>" : "Not Acquired");
- + html.replace("%skinvip%", skin.isVip() ? "<font color=\"00ff00\">TRUE</font>" : "<font color=\"ff0000\">FALSE</font>");
- + player.sendPacket(html);
- + }
- +
- + public void showMainWindow(L2PcInstance player, int page)
- + {
- + String filename = "data/html/SkinManager/Main.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile(filename);
- + html.replace("%hat%", player.isActiveHat() ? "ON" : "OFF");
- + html.replace("%skins%", L2BeautyShopInstance.generateSkinsHtml(player, page));
- + html.replace("%pages%", L2BeautyShopInstance.generatePagesHtml(player));
- + player.sendPacket(html);
- + filename = null;
- + html = null;
- + }
- +
- + class Counter implements Runnable
- + {
- + L2PcInstance p;
- +
- + int id;
- +
- + Counter(L2PcInstance p)
- + {
- + this.p = p;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (this.p.visualizationTime >= 0)
- + {
- + this.p.sendPacket(new ExShowScreenMessage("Current skin visualization will end in: " + this.p.visualizationTime, 1100));
- + }
- + else
- + {
- + if (p.getSkinId() == 0)
- + {
- + Skin dress = SkinData.getInstance().getSkinById(id);
- + p.setActiveSkin(dress);
- + }
- + this.p.setSkinId(0);
- + Skin dress = SkinData.getInstance().getSkinById(0);
- + p.setActiveSkin(dress);
- + this.p.setDressMeEnabled(false);
- + this.p.broadcastUserInfo();
- + this.p.sendPacket(new ExShowScreenMessage("Current skin visualization time it's over!", 2000));
- + RequestBypassToServer.stopCounter(this.p.visualTask);
- + }
- + this.p.visualizationTime--;
- + }
- + }
- +
- + public static void stopCounter(ScheduledFuture<?> task)
- + {
- + task.cancel(true);
- + task = null;
- + }
- +
- + public ScheduledFuture<?> startCounter(L2PcInstance player)
- + {
- + return ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new Counter(player), 1000L, 1000L);
- + }
- +
- public void sendEditWindow(L2PcInstance p, String part)
- {
- NpcHtmlMessage htm = new NpcHtmlMessage(0);
- diff --git a/src/l2jorion/game/network/serverpackets/CharInfo.java b/src/l2jorion/game/network/serverpackets/CharInfo.java
- index a8bf3be..c7eda05 100644
- --- a/src/l2jorion/game/network/serverpackets/CharInfo.java
- +++ b/src/l2jorion/game/network/serverpackets/CharInfo.java
- @@ -23,6 +23,7 @@
- import java.util.Map;
- import java.util.Set;
- +import Base.SkinBeauty.Skin;
- import l2jorion.Config;
- import l2jorion.game.datatables.sql.NpcTable;
- import l2jorion.game.managers.CursedWeaponsManager;
- @@ -182,18 +183,38 @@
- writeD(_activeChar.getBaseClass());
- }
- - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
- - 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_RHAND));
- - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
- - writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_FACE));
- + final Skin dress = _activeChar.getActiveSkin();
- +
- + if (!_activeChar.isDressMeEnabled())
- + {
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
- + 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_RHAND));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_FACE));
- + }
- + else
- + {
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
- + writeD(dress != null ? dress.getGloves() : _inv.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
- + writeD(dress != null ? dress.getChest() : _inv.getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
- + writeD(dress != null ? dress.getLegs() : _inv.getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
- + writeD(dress != null ? dress.getFeet() : _inv.getPaperdollItemId(Inventory.PAPERDOLL_FEET));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_BACK));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- + writeD(dress != null ? dress.getHair() : _inv.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
- + writeD(_inv.getPaperdollItemId(Inventory.PAPERDOLL_FACE));
- + }
- // c6 new h's
- writeH(0x00);
- diff --git a/src/l2jorion/game/network/serverpackets/UserInfo.java b/src/l2jorion/game/network/serverpackets/UserInfo.java
- index 7ec8b56..a04983d 100644
- --- a/src/l2jorion/game/network/serverpackets/UserInfo.java
- +++ b/src/l2jorion/game/network/serverpackets/UserInfo.java
- @@ -20,6 +20,7 @@
- */
- package l2jorion.game.network.serverpackets;
- +import Base.SkinBeauty.Skin;
- import l2jorion.Config;
- import l2jorion.game.datatables.sql.NpcTable;
- import l2jorion.game.managers.CursedWeaponsManager;
- @@ -114,42 +115,84 @@
- writeD(_activeChar.getMaxLoad());
- writeD(_activeChar.getActiveWeaponItem() != null ? 40 : 20); // 20 no weapon, 40 weapon equippe
- + final Skin dress = _activeChar.getActiveSkin();
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DHAIR));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
- - writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE));
- -
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
- - writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FACE));
- + if (!_activeChar.isDressMeEnabled())
- + {
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DHAIR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE));
- +
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FACE));
- + }
- + else
- + {
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DHAIR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND));
- + writeD(dress != null ? dress.getGloves() : _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES));
- + writeD(dress != null ? dress.getChest() : _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST));
- + writeD(dress != null ? dress.getLegs() : _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS));
- + writeD(dress != null ? dress.getFeet() : _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
- + writeD(dress != null ? dress.getHair() : _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
- + writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE));
- +
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
- + writeD(dress != null ? dress.getGloves() : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
- + writeD(dress != null ? dress.getChest() : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
- + writeD(dress != null ? dress.getLegs() : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
- + writeD(dress != null ? dress.getFeet() : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
- + writeD(dress != null ? dress.getHair() : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
- + writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FACE));
- + }
- writeH(0x00);
- writeH(0x00);
Add Comment
Please, Sign In to add comment