SHOW:
|
|
- or go back to the newest paste.
| 1 | ### Eclipse Workspace Patch 1.0 | |
| 2 | - | #P aCis_gameserver405 |
| 2 | + | #P aCis_gameserver |
| 3 | - | diff --git config/players.properties config/players.properties |
| 3 | + | |
| 4 | - | index c645204..99e7087 100644 |
| 4 | + | |
| 5 | - | --- config/players.properties |
| 5 | + | index 0000000..f46a2bd |
| 6 | - | +++ config/players.properties |
| 6 | + | |
| 7 | - | @@ -257,4 +257,16 @@ |
| 7 | + | |
| 8 | - | MaxBuffsAmount = 20 |
| 8 | + | |
| 9 | +<html> | |
| 10 | - | # Store buffs/debuffs on user logout. Default: True |
| 10 | + | |
| 11 | - | -StoreSkillCooltime = True |
| 11 | + | |
| 12 | +<table width=300 border=0 cellspacing=0 cellpadding=1 bgcolor=000000 height=15> | |
| 13 | - | +StoreSkillCooltime = True |
| 13 | + | |
| 14 | +<td width=36 align=center></td> | |
| 15 | +<td width=120 align=left>Name</td> | |
| 16 | +<td width=65 align=left>Actions</td> | |
| 17 | +</tr> | |
| 18 | +</table> | |
| 19 | +<img src="L2UI.Squaregray" width="300" height="1"> | |
| 20 | + | |
| 21 | +%showList% | |
| 22 | - | +AllowDressMeForPremiumOnly = False |
| 22 | + | |
| 23 | +<center> | |
| 24 | +<button value="Back" action="bypass -h custom_dressme_back" width=65 height=19 back="L2UI_ch3.smallbutton2_over" fore="L2UI_ch3.smallbutton2"> | |
| 25 | +</center> | |
| 26 | + | |
| 27 | +</body> | |
| 28 | +</html> | |
| 29 | \ No newline at end of file | |
| 30 | diff --git server/gameserver/data/html/dressme/index.htm server/gameserver/data/html/dressme/index.htm | |
| 31 | new file mode 100644 | |
| 32 | index 0000000..1175fed | |
| 33 | --- /dev/null | |
| 34 | +++ server/gameserver/data/html/dressme/index.htm | |
| 35 | @@ -0,0 +1,26 @@ | |
| 36 | +<html> | |
| 37 | +<title>Skins Shop</title> | |
| 38 | +<body> | |
| 39 | +<br> | |
| 40 | +<center>Skins:</center> | |
| 41 | + | |
| 42 | +<table width=300> | |
| 43 | +<tr> | |
| 44 | +<td align=center><button value="Armor buy/try" action="bypass -h dressme 1 skinlist armor" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 45 | +</tr> | |
| 46 | +<tr> | |
| 47 | +<td align=center><button value="Weapon buy/try" action="bypass -h dressme 1 skinlist weapon" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 48 | +</tr> | |
| 49 | +<tr> | |
| 50 | +<td align=center><button value="Hair buy/try" action="bypass -h dressme 1 skinlist hair" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 51 | +</tr> | |
| 52 | +<tr> | |
| 53 | +<td align=center><button value="Face buy/try" action="bypass -h dressme 1 skinlist face" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 54 | +</tr> | |
| 55 | +<tr> | |
| 56 | +<td align=center><button value="Shield buy/try" action="bypass -h dressme 1 skinlist shield" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 57 | +</tr> | |
| 58 | +<tr> | |
| 59 | +<td align=center><button value="My skins" action="bypass -h dressme 1 myskinlist" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 60 | +</tr> | |
| 61 | +</table> | |
| 62 | + | |
| 63 | +</body> | |
| 64 | +</html> | |
| 65 | \ No newline at end of file | |
| 66 | diff --git server/gameserver/data/html/dressme/myskins.htm server/gameserver/data/html/dressme/myskins.htm | |
| 67 | new file mode 100644 | |
| 68 | index 0000000..381164c | |
| 69 | --- /dev/null | |
| 70 | +++ server/gameserver/data/html/dressme/myskins.htm | |
| 71 | @@ -0,0 +1,21 @@ | |
| 72 | +<html> | |
| 73 | +<body> | |
| 74 | +<img src="L2UI.Squaregray" width="300" height="1"> | |
| 75 | +<table border=0 cellspacing=0 cellpadding=2 bgcolor=000000 height=20> | |
| 76 | +<tr> | |
| 77 | +<td width=32 align=center></td> | |
| 78 | +<td width=203 align=left>Name</td> | |
| 79 | +<td width=65 align=left>Actions</td> | |
| 80 | +</tr> | |
| 81 | +</table> | |
| 82 | +<img src="L2UI.Squaregray" width="300" height="1"> | |
| 83 | + | |
| 84 | +%showList% | |
| 85 | + | |
| 86 | +<br> | |
| 87 | +<br> | |
| 88 | +<center> | |
| 89 | +<button value="Back" action="bypass -h custom_dressme_back" width=65 height=19 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> | |
| 90 | +</center> | |
| 91 | +</body> | |
| 92 | +</html> | |
| 93 | \ No newline at end of file | |
| 94 | diff --git server/gameserver/data/xml/dressme.xml server/gameserver/data/xml/dressme.xml | |
| 95 | new file mode 100644 | |
| 96 | index 0000000..b8c5ef5 | |
| 97 | --- /dev/null | |
| 98 | +++ server/gameserver/data/xml/dressme.xml | |
| 99 | @@ -0,0 +1,18 @@ | |
| 100 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 101 | +<list> | |
| 102 | + <skin type="armor"> <!-- Armors --> | |
| 103 | + <type id="1" name="Draconic Armor" chestId="6379" legsId="0" glovesId="6380" feetId="6381" priceId="57" priceCount="100"/> | |
| 104 | + <type id="2" name="Blue Wolf Leather Armor" chestId="2391" legsId="0" glovesId="0" feetId="0" priceId="57" priceCount="100"/> | |
| 105 | + </skin> | |
| 106 | + <skin type="weapon"> <!-- Weapons --> | |
| 107 | + <type id="1" name="Draconic Bow" weaponId="7575" priceId="57" priceCount="100"/> | |
| 108 | + <type id="2" name="Arcana Mace" weaponId="6608" priceId="57" priceCount="100"/> | |
| 109 | + <type id="3" name="Keshanberk*Keshanberk" weaponId="5704" priceId="57" priceCount="100"/> | |
| 110 | + </skin> | |
| 111 | + <skin type="hair"> <!-- Hairs --> | |
| 112 | + <type id="1" name="Cat Ear" hairId="6843" priceId="57" priceCount="100"/> | |
| 113 | + </skin> | |
| 114 | + <skin type="face"> <!-- Faces --> | |
| 115 | + <type id="1" name="Party Mask" faceId="5808" priceId="57" priceCount="100"/> | |
| 116 | + </skin> | |
| 117 | + <skin type="shield"> <!-- Shields --> | |
| 118 | + <type id="1" name="Shield of Night" shieldId="2498" priceId="57" priceCount="100"/> | |
| 119 | + <type id="2" name="Imperial Shield" shieldId="6377" priceId="57" priceCount="100"/> | |
| 120 | + </skin> | |
| 121 | +</list> | |
| 122 | \ No newline at end of file | |
| 123 | ||
| 124 | ||
| 125 | diff --git server/gameserver/config/players.properties server/gameserver/config/players.properties | |
| 126 | index a3e8e08..c1da93b 100644 | |
| 127 | --- server/gameserver/config/players.properties | |
| 128 | +++ server/gameserver/config/players.properties | |
| 129 | @@ -14,6 +14,22 @@ | |
| 130 | MpRegenMultiplier = 1. | |
| 131 | CpRegenMultiplier = 1. | |
| 132 | ||
| 133 | + | |
| 134 | +# DressMe system. | |
| 135 | +AllowDressMeSystem = True | |
| 136 | + | |
| 137 | +# DressMe Command | |
| 138 | +DressMeCommand = dressme | |
| 139 | + | |
| 140 | +# Only for premium account | |
| 141 | +AllowDressMeForPremiumOnly = True | |
| 142 | + | |
| 143 | + | |
| 144 | +# Players won't see the skins in Olympiad | |
| 145 | +AllowDressMeInOly = True | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | diff --git java/Base/Skin/DressMeData.java java/Base/Skin/DressMeData.java | |
| 150 | new file mode 100644 | |
| 151 | index 0000000..cdf1053 | |
| 152 | --- /dev/null | |
| 153 | +++ java/Base/Skin/DressMeData.java | |
| 154 | @@ -0,0 +1,216 @@ | |
| 155 | +package Base.Skin; | |
| 156 | + | |
| 157 | +import java.util.HashMap; | |
| 158 | +import java.util.Map; | |
| 159 | +import java.util.logging.Logger; | |
| 160 | + | |
| 161 | +import net.sf.l2j.commons.data.StatSet; | |
| 162 | + | |
| 163 | +import org.w3c.dom.Document; | |
| 164 | +import org.w3c.dom.NamedNodeMap; | |
| 165 | +import org.w3c.dom.Node; | |
| 166 | + | |
| 167 | +import Base.Xml.IXmlReader; | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | +public class DressMeData implements IXmlReader | |
| 172 | +{
| |
| 173 | + private static final Logger LOG = Logger.getLogger(DressMeData.class.getName()); | |
| 174 | + | |
| 175 | + private final static Map<Integer, SkinPackage> _armorSkins = new HashMap<>(); | |
| 176 | + private final static Map<Integer, SkinPackage> _weaponSkins = new HashMap<>(); | |
| 177 | + private final static Map<Integer, SkinPackage> _hairSkins = new HashMap<>(); | |
| 178 | + private final static Map<Integer, SkinPackage> _faceSkins = new HashMap<>(); | |
| 179 | + private final static Map<Integer, SkinPackage> _shieldSkins = new HashMap<>(); | |
| 180 | + | |
| 181 | + public DressMeData() | |
| 182 | + {
| |
| 183 | + load(); | |
| 184 | + } | |
| 185 | + | |
| 186 | + public void reload() | |
| 187 | + {
| |
| 188 | + _armorSkins.clear(); | |
| 189 | + _weaponSkins.clear(); | |
| 190 | + _hairSkins.clear(); | |
| 191 | + _faceSkins.clear(); | |
| 192 | + _shieldSkins.clear(); | |
| 193 | + | |
| 194 | + load(); | |
| 195 | + } | |
| 196 | + | |
| 197 | + @Override | |
| 198 | + public void load() | |
| 199 | + {
| |
| 200 | + parseDatapackFile("./data/xml/dressme.xml");
| |
| 201 | + LOG.info(getClass().getSimpleName() + ": Loaded " + _armorSkins.size() + " armor skins"); | |
| 202 | + LOG.info(getClass().getSimpleName() + ": Loaded " + _weaponSkins.size() + " weapon skins"); | |
| 203 | + LOG.info(getClass().getSimpleName() + ": Loaded " + _hairSkins.size() + " hair skins"); | |
| 204 | + LOG.info(getClass().getSimpleName() + ": Loaded " + _faceSkins.size() + " face skins"); | |
| 205 | + LOG.info(getClass().getSimpleName() + ": Loaded " + _shieldSkins.size() + " shield skins"); | |
| 206 | + } | |
| 207 | + | |
| 208 | + @Override | |
| 209 | + public void parseDocument(Document doc) | |
| 210 | + {
| |
| 211 | + for (Node list = doc.getFirstChild(); list != null; list = list.getNextSibling()) | |
| 212 | + {
| |
| 213 | + if ("list".equalsIgnoreCase(list.getNodeName()))
| |
| 214 | + {
| |
| 215 | + for (Node skin = list.getFirstChild(); skin != null; skin = skin.getNextSibling()) | |
| 216 | + {
| |
| 217 | + if ("skin".equalsIgnoreCase(skin.getNodeName()))
| |
| 218 | + {
| |
| 219 | + final NamedNodeMap attrs = skin.getAttributes(); | |
| 220 | + | |
| 221 | + String type = parseString(attrs, "type"); | |
| 222 | + | |
| 223 | + final StatSet set = new StatSet(); | |
| 224 | + | |
| 225 | + for (Node typeN = skin.getFirstChild(); typeN != null; typeN = typeN.getNextSibling()) | |
| 226 | + {
| |
| 227 | + if ("type".equalsIgnoreCase(typeN.getNodeName()))
| |
| 228 | + {
| |
| 229 | + final NamedNodeMap attrs2 = typeN.getAttributes(); | |
| 230 | + | |
| 231 | + int id = parseInteger(attrs2, "id"); | |
| 232 | + String name = parseString(attrs2, "name"); | |
| 233 | + int weaponId = parseInteger(attrs2, "weaponId", 0); | |
| 234 | + int shieldId = parseInteger(attrs2, "shieldId", 0); | |
| 235 | + int chestId = parseInteger(attrs2, "chestId", 0); | |
| 236 | + int hairId = parseInteger(attrs2, "hairId", 0); | |
| 237 | + int faceId = parseInteger(attrs2, "faceId", 0); | |
| 238 | + int legsId = parseInteger(attrs2, "legsId", 0); | |
| 239 | + int glovesId = parseInteger(attrs2, "glovesId", 0); | |
| 240 | + int feetId = parseInteger(attrs2, "feetId", 0); | |
| 241 | + int priceId = parseInteger(attrs2, "priceId", 0); | |
| 242 | + int priceCount = parseInteger(attrs2, "priceCount", 0); | |
| 243 | + | |
| 244 | + set.set("type", type);
| |
| 245 | + | |
| 246 | + set.set("id", id);
| |
| 247 | + set.set("name", name);
| |
| 248 | + set.set("weaponId", weaponId);
| |
| 249 | + set.set("shieldId", shieldId);
| |
| 250 | + set.set("chestId", chestId);
| |
| 251 | + set.set("hairId", hairId);
| |
| 252 | + set.set("faceId", faceId);
| |
| 253 | + set.set("legsId", legsId);
| |
| 254 | + set.set("glovesId", glovesId);
| |
| 255 | + set.set("feetId", feetId);
| |
| 256 | + set.set("priceId", priceId);
| |
| 257 | + set.set("priceCount", priceCount);
| |
| 258 | + | |
| 259 | + switch (type.toLowerCase()) | |
| 260 | + {
| |
| 261 | + case "armor": | |
| 262 | + _armorSkins.put(id, new SkinPackage(set)); | |
| 263 | + break; | |
| 264 | + case "weapon": | |
| 265 | + _weaponSkins.put(id, new SkinPackage(set)); | |
| 266 | + break; | |
| 267 | + case "hair": | |
| 268 | + _hairSkins.put(id, new SkinPackage(set)); | |
| 269 | + break; | |
| 270 | + case "face": | |
| 271 | + _faceSkins.put(id, new SkinPackage(set)); | |
| 272 | + break; | |
| 273 | + case "shield": | |
| 274 | + _shieldSkins.put(id, new SkinPackage(set)); | |
| 275 | + break; | |
| 276 | + } | |
| 277 | + } | |
| 278 | + } | |
| 279 | + } | |
| 280 | + } | |
| 281 | + } | |
| 282 | + } | |
| 283 | + | |
| 284 | + } | |
| 285 | + | |
| 286 | + public SkinPackage getArmorSkinsPackage(int id) | |
| 287 | + {
| |
| 288 | + if (!_armorSkins.containsKey(id)) | |
| 289 | + {
| |
| 290 | + return null; | |
| 291 | + } | |
| 292 | + | |
| 293 | + return _armorSkins.get(id); | |
| 294 | + } | |
| 295 | + | |
| 296 | + public Map<Integer, SkinPackage> getArmorSkinOptions() | |
| 297 | + {
| |
| 298 | + return _armorSkins; | |
| 299 | + } | |
| 300 | + | |
| 301 | + public SkinPackage getWeaponSkinsPackage(int id) | |
| 302 | + {
| |
| 303 | + if (!_weaponSkins.containsKey(id)) | |
| 304 | + {
| |
| 305 | + return null; | |
| 306 | + } | |
| 307 | + | |
| 308 | + return _weaponSkins.get(id); | |
| 309 | + } | |
| 310 | + | |
| 311 | + public Map<Integer, SkinPackage> getWeaponSkinOptions() | |
| 312 | + {
| |
| 313 | + return _weaponSkins; | |
| 314 | + } | |
| 315 | + | |
| 316 | + public SkinPackage getHairSkinsPackage(int id) | |
| 317 | + {
| |
| 318 | + if (!_hairSkins.containsKey(id)) | |
| 319 | + {
| |
| 320 | + return null; | |
| 321 | + } | |
| 322 | + | |
| 323 | + return _hairSkins.get(id); | |
| 324 | + } | |
| 325 | + | |
| 326 | + public Map<Integer, SkinPackage> getHairSkinOptions() | |
| 327 | + {
| |
| 328 | + return _hairSkins; | |
| 329 | + } | |
| 330 | + | |
| 331 | + public SkinPackage getFaceSkinsPackage(int id) | |
| 332 | + {
| |
| 333 | + if (!_faceSkins.containsKey(id)) | |
| 334 | + {
| |
| 335 | + return null; | |
| 336 | + } | |
| 337 | + | |
| 338 | + return _faceSkins.get(id); | |
| 339 | + } | |
| 340 | + | |
| 341 | + public Map<Integer, SkinPackage> getFaceSkinOptions() | |
| 342 | + {
| |
| 343 | + return _faceSkins; | |
| 344 | + } | |
| 345 | + | |
| 346 | + public SkinPackage getShieldSkinsPackage(int id) | |
| 347 | + {
| |
| 348 | + if (!_shieldSkins.containsKey(id)) | |
| 349 | + {
| |
| 350 | + return null; | |
| 351 | + } | |
| 352 | + | |
| 353 | + return _shieldSkins.get(id); | |
| 354 | + } | |
| 355 | + | |
| 356 | + public Map<Integer, SkinPackage> getShieldSkinOptions() | |
| 357 | + {
| |
| 358 | + return _shieldSkins; | |
| 359 | + } | |
| 360 | + | |
| 361 | + public static DressMeData getInstance() | |
| 362 | + {
| |
| 363 | + return SingletonHolder._instance; | |
| 364 | + } | |
| 365 | + | |
| 366 | + private static class SingletonHolder | |
| 367 | + {
| |
| 368 | + protected static final DressMeData _instance = new DressMeData(); | |
| 369 | + } | |
| 370 | +} | |
| 371 | \ No newline at end of file | |
| 372 | diff --git java/Base/Skin/SkinPackage.java java/Base/Skin/SkinPackage.java | |
| 373 | new file mode 100644 | |
| 374 | index 0000000..ff40f74 | |
| 375 | --- /dev/null | |
| 376 | +++ java/Base/Skin/SkinPackage.java | |
| 377 | @@ -0,0 +1,104 @@ | |
| 378 | +package Base.Skin; | |
| 379 | + | |
| 380 | +import net.sf.l2j.commons.data.StatSet; | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | +public class SkinPackage | |
| 385 | +{
| |
| 386 | + private String _type; | |
| 387 | + private String _name; | |
| 388 | + private int _id; | |
| 389 | + private int _weaponId; | |
| 390 | + private int _shieldId; | |
| 391 | + private int _chestId; | |
| 392 | + private int _hairId; | |
| 393 | + private int _faceId; | |
| 394 | + private int _legsId; | |
| 395 | + private int _glovesId; | |
| 396 | + private int _feetId; | |
| 397 | + private int _priceId; | |
| 398 | + private int _priceCount; | |
| 399 | + | |
| 400 | + public SkinPackage(StatSet set) | |
| 401 | + {
| |
| 402 | + _type = set.getString("type", "default");
| |
| 403 | + _name = set.getString("name", "NoName");
| |
| 404 | + _id = set.getInteger("id", 0);
| |
| 405 | + _weaponId = set.getInteger("weaponId", 0);
| |
| 406 | + _shieldId = set.getInteger("shieldId", 0);
| |
| 407 | + _chestId = set.getInteger("chestId", 0);
| |
| 408 | + _hairId = set.getInteger("hairId", 0);
| |
| 409 | + _faceId = set.getInteger("faceId", 0);
| |
| 410 | + _legsId = set.getInteger("legsId", 0);
| |
| 411 | + _glovesId = set.getInteger("glovesId", 0);
| |
| 412 | + _feetId = set.getInteger("feetId", 0);
| |
| 413 | + _priceId = set.getInteger("priceId", 0);
| |
| 414 | + _priceCount = set.getInteger("priceCount", 0);
| |
| 415 | + } | |
| 416 | + | |
| 417 | + public int getId() | |
| 418 | + {
| |
| 419 | + return _id; | |
| 420 | + } | |
| 421 | + | |
| 422 | + public String getType() | |
| 423 | + {
| |
| 424 | + return _type; | |
| 425 | + } | |
| 426 | + | |
| 427 | + public String getName() | |
| 428 | + {
| |
| 429 | + return _name; | |
| 430 | + } | |
| 431 | + | |
| 432 | + public int getWeaponId() | |
| 433 | + {
| |
| 434 | + return _weaponId; | |
| 435 | + } | |
| 436 | + | |
| 437 | + public int getShieldId() | |
| 438 | + {
| |
| 439 | + return _shieldId; | |
| 440 | + } | |
| 441 | + | |
| 442 | + public int getChestId() | |
| 443 | + {
| |
| 444 | + return _chestId; | |
| 445 | + } | |
| 446 | + | |
| 447 | + public int getHairId() | |
| 448 | + {
| |
| 449 | + return _hairId; | |
| 450 | + } | |
| 451 | + | |
| 452 | + public int getFaceId() | |
| 453 | + {
| |
| 454 | + return _faceId; | |
| 455 | + } | |
| 456 | + | |
| 457 | + public int getLegsId() | |
| 458 | + {
| |
| 459 | + return _legsId; | |
| 460 | + } | |
| 461 | + | |
| 462 | + public int getGlovesId() | |
| 463 | + {
| |
| 464 | + return _glovesId; | |
| 465 | + } | |
| 466 | + | |
| 467 | + public int getFeetId() | |
| 468 | + {
| |
| 469 | + return _feetId; | |
| 470 | + } | |
| 471 | + | |
| 472 | + public int getPriceId() | |
| 473 | + {
| |
| 474 | + return _priceId; | |
| 475 | + } | |
| 476 | + | |
| 477 | + public int getPriceCount() | |
| 478 | + {
| |
| 479 | + return _priceCount; | |
| 480 | + } | |
| 481 | +} | |
| 482 | \ No newline at end of file | |
| 483 | diff --git java/Base/Xml/IXmlReader.java java/Base/Xml/IXmlReader.java | |
| 484 | new file mode 100644 | |
| 485 | index 0000000..044830c | |
| 486 | --- /dev/null | |
| 487 | +++ java/Base/Xml/IXmlReader.java | |
| 488 | @@ -0,0 +1,577 @@ | |
| 489 | + | |
| 490 | +package Base.Xml; | |
| 491 | + | |
| 492 | +import java.io.File; | |
| 493 | +import java.io.FileFilter; | |
| 494 | +import java.util.logging.Logger; | |
| 495 | + | |
| 496 | +import javax.xml.parsers.DocumentBuilder; | |
| 497 | +import javax.xml.parsers.DocumentBuilderFactory; | |
| 498 | + | |
| 499 | +import net.sf.l2j.commons.data.StatSet; | |
| 500 | + | |
| 501 | +import net.sf.l2j.gameserver.GameServer; | |
| 502 | + | |
| 503 | + | |
| 504 | +import org.w3c.dom.Document; | |
| 505 | +import org.w3c.dom.NamedNodeMap; | |
| 506 | +import org.w3c.dom.Node; | |
| 507 | +import org.xml.sax.ErrorHandler; | |
| 508 | +import org.xml.sax.SAXParseException; | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | +public interface IXmlReader | |
| 513 | +{
| |
| 514 | + static final Logger LOG = Logger.getLogger(GameServer.class.getName()); | |
| 515 | + | |
| 516 | + static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; | |
| 517 | + static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; | |
| 518 | + | |
| 519 | + static final XMLFilter XML_FILTER = new XMLFilter(); | |
| 520 | + | |
| 521 | + public void load(); | |
| 522 | + | |
| 523 | + default void parseDatapackFile(String path) | |
| 524 | + {
| |
| 525 | + parseFile(new File(".", path));
| |
| 526 | + } | |
| 527 | + | |
| 528 | + default void parseFile(File f) | |
| 529 | + {
| |
| 530 | + if (!getCurrentFileFilter().accept(f)) | |
| 531 | + {
| |
| 532 | + LOG.warning("{}: Could not parse {} is not a file or it doesn't exist!");
| |
| 533 | + return; | |
| 534 | + } | |
| 535 | + | |
| 536 | + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | |
| 537 | + dbf.setNamespaceAware(true); | |
| 538 | + dbf.setValidating(false); | |
| 539 | + dbf.setIgnoringComments(true); | |
| 540 | + | |
| 541 | + try | |
| 542 | + {
| |
| 543 | + dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); | |
| 544 | + final DocumentBuilder db = dbf.newDocumentBuilder(); | |
| 545 | + db.setErrorHandler(new XMLErrorHandler()); | |
| 546 | + parseDocument(db.parse(f), f); | |
| 547 | + } | |
| 548 | + catch (SAXParseException e) | |
| 549 | + {
| |
| 550 | + LOG.warning("{}: Could not parse file {} at line {}, column {}");
| |
| 551 | + return; | |
| 552 | + } | |
| 553 | + catch (Exception e) | |
| 554 | + {
| |
| 555 | + LOG.warning("{}: Could not parse file {}");
| |
| 556 | + return; | |
| 557 | + } | |
| 558 | + } | |
| 559 | + | |
| 560 | + default boolean parseDirectory(File file) | |
| 561 | + {
| |
| 562 | + return parseDirectory(file, false); | |
| 563 | + } | |
| 564 | + | |
| 565 | + default boolean parseDirectory(String path) | |
| 566 | + {
| |
| 567 | + return parseDirectory(new File(path), false); | |
| 568 | + } | |
| 569 | + | |
| 570 | + default boolean parseDirectory(String path, boolean recursive) | |
| 571 | + {
| |
| 572 | + return parseDirectory(new File(path), recursive); | |
| 573 | + } | |
| 574 | + | |
| 575 | + default boolean parseDirectory(File dir, boolean recursive) | |
| 576 | + {
| |
| 577 | + if (!dir.exists()) | |
| 578 | + {
| |
| 579 | + LOG.warning("{}: Folder {} doesn't exist!");
| |
| 580 | + return false; | |
| 581 | + } | |
| 582 | + | |
| 583 | + final File[] files = dir.listFiles(); | |
| 584 | + if (files != null) | |
| 585 | + {
| |
| 586 | + for (File f : files) | |
| 587 | + {
| |
| 588 | + if (recursive && f.isDirectory()) | |
| 589 | + {
| |
| 590 | + parseDirectory(f, recursive); | |
| 591 | + } | |
| 592 | + else if (getCurrentFileFilter().accept(f)) | |
| 593 | + {
| |
| 594 | + parseFile(f); | |
| 595 | + } | |
| 596 | + } | |
| 597 | + } | |
| 598 | + return true; | |
| 599 | + } | |
| 600 | + | |
| 601 | + default boolean parseDatapackDirectory(String path, boolean recursive) | |
| 602 | + {
| |
| 603 | + return parseDirectory(new File(".", path), recursive);
| |
| 604 | + } | |
| 605 | + | |
| 606 | + default void parseDocument(Document doc, File f) | |
| 607 | + {
| |
| 608 | + parseDocument(doc); | |
| 609 | + } | |
| 610 | + | |
| 611 | + default void parseDocument(Document doc) | |
| 612 | + {
| |
| 613 | + LOG.warning("{}: Parser not implemented!");
| |
| 614 | + } | |
| 615 | + | |
| 616 | + default Boolean parseBoolean(Node node, Boolean defaultValue) | |
| 617 | + {
| |
| 618 | + return node != null ? Boolean.valueOf(node.getNodeValue()) : defaultValue; | |
| 619 | + } | |
| 620 | + | |
| 621 | + default Boolean parseBoolean(Node node) | |
| 622 | + {
| |
| 623 | + return parseBoolean(node, null); | |
| 624 | + } | |
| 625 | + | |
| 626 | + default Boolean parseBoolean(NamedNodeMap attrs, String name) | |
| 627 | + {
| |
| 628 | + return parseBoolean(attrs.getNamedItem(name)); | |
| 629 | + } | |
| 630 | + | |
| 631 | + default Boolean parseBoolean(NamedNodeMap attrs, String name, Boolean defaultValue) | |
| 632 | + {
| |
| 633 | + return parseBoolean(attrs.getNamedItem(name), defaultValue); | |
| 634 | + } | |
| 635 | + | |
| 636 | + default Byte parseByte(Node node, Byte defaultValue) | |
| 637 | + {
| |
| 638 | + return node != null ? Byte.valueOf(node.getNodeValue()) : defaultValue; | |
| 639 | + } | |
| 640 | + | |
| 641 | + default StatSet parseAttributes(Node node) | |
| 642 | + {
| |
| 643 | + final NamedNodeMap attrs = node.getAttributes(); | |
| 644 | + final StatSet map = new StatSet(); | |
| 645 | + for (int i = 0; i < attrs.getLength(); i++) | |
| 646 | + {
| |
| 647 | + final Node att = attrs.item(i); | |
| 648 | + map.set(att.getNodeName(), att.getNodeValue()); | |
| 649 | + } | |
| 650 | + return map; | |
| 651 | + } | |
| 652 | + | |
| 653 | + /** | |
| 654 | + * Parses a byte value. | |
| 655 | + * @param node the node to parse | |
| 656 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 657 | + */ | |
| 658 | + default Byte parseByte(Node node) | |
| 659 | + {
| |
| 660 | + return parseByte(node, null); | |
| 661 | + } | |
| 662 | + | |
| 663 | + /** | |
| 664 | + * Parses a byte value. | |
| 665 | + * @param attrs the attributes | |
| 666 | + * @param name the name of the attribute to parse | |
| 667 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 668 | + */ | |
| 669 | + default Byte parseByte(NamedNodeMap attrs, String name) | |
| 670 | + {
| |
| 671 | + return parseByte(attrs.getNamedItem(name)); | |
| 672 | + } | |
| 673 | + | |
| 674 | + /** | |
| 675 | + * Parses a byte value. | |
| 676 | + * @param attrs the attributes | |
| 677 | + * @param name the name of the attribute to parse | |
| 678 | + * @param defaultValue the default value | |
| 679 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 680 | + */ | |
| 681 | + default Byte parseByte(NamedNodeMap attrs, String name, Byte defaultValue) | |
| 682 | + {
| |
| 683 | + return parseByte(attrs.getNamedItem(name), defaultValue); | |
| 684 | + } | |
| 685 | + | |
| 686 | + /** | |
| 687 | + * Parses a short value. | |
| 688 | + * @param node the node to parse | |
| 689 | + * @param defaultValue the default value | |
| 690 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 691 | + */ | |
| 692 | + default Short parseShort(Node node, Short defaultValue) | |
| 693 | + {
| |
| 694 | + return node != null ? Short.valueOf(node.getNodeValue()) : defaultValue; | |
| 695 | + } | |
| 696 | + | |
| 697 | + /** | |
| 698 | + * Parses a short value. | |
| 699 | + * @param node the node to parse | |
| 700 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 701 | + */ | |
| 702 | + default Short parseShort(Node node) | |
| 703 | + {
| |
| 704 | + return parseShort(node, null); | |
| 705 | + } | |
| 706 | + | |
| 707 | + /** | |
| 708 | + * Parses a short value. | |
| 709 | + * @param attrs the attributes | |
| 710 | + * @param name the name of the attribute to parse | |
| 711 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 712 | + */ | |
| 713 | + default Short parseShort(NamedNodeMap attrs, String name) | |
| 714 | + {
| |
| 715 | + return parseShort(attrs.getNamedItem(name)); | |
| 716 | + } | |
| 717 | + | |
| 718 | + /** | |
| 719 | + * Parses a short value. | |
| 720 | + * @param attrs the attributes | |
| 721 | + * @param name the name of the attribute to parse | |
| 722 | + * @param defaultValue the default value | |
| 723 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 724 | + */ | |
| 725 | + default Short parseShort(NamedNodeMap attrs, String name, Short defaultValue) | |
| 726 | + {
| |
| 727 | + return parseShort(attrs.getNamedItem(name), defaultValue); | |
| 728 | + } | |
| 729 | + | |
| 730 | + /** | |
| 731 | + * Parses an int value. | |
| 732 | + * @param node the node to parse | |
| 733 | + * @param defaultValue the default value | |
| 734 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 735 | + */ | |
| 736 | + default int parseInt(Node node, Integer defaultValue) | |
| 737 | + {
| |
| 738 | + return node != null ? Integer.parseInt(node.getNodeValue()) : defaultValue; | |
| 739 | + } | |
| 740 | + | |
| 741 | + /** | |
| 742 | + * Parses an int value. | |
| 743 | + * @param node the node to parse | |
| 744 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 745 | + */ | |
| 746 | + default int parseInt(Node node) | |
| 747 | + {
| |
| 748 | + return parseInt(node, -1); | |
| 749 | + } | |
| 750 | + | |
| 751 | + /** | |
| 752 | + * Parses an integer value. | |
| 753 | + * @param node the node to parse | |
| 754 | + * @param defaultValue the default value | |
| 755 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 756 | + */ | |
| 757 | + default Integer parseInteger(Node node, Integer defaultValue) | |
| 758 | + {
| |
| 759 | + return node != null ? Integer.valueOf(node.getNodeValue()) : defaultValue; | |
| 760 | + } | |
| 761 | + | |
| 762 | + /** | |
| 763 | + * Parses an integer value. | |
| 764 | + * @param node the node to parse | |
| 765 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 766 | + */ | |
| 767 | + default Integer parseInteger(Node node) | |
| 768 | + {
| |
| 769 | + return parseInteger(node, null); | |
| 770 | + } | |
| 771 | + | |
| 772 | + /** | |
| 773 | + * Parses an integer value. | |
| 774 | + * @param attrs the attributes | |
| 775 | + * @param name the name of the attribute to parse | |
| 776 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 777 | + */ | |
| 778 | + default Integer parseInteger(NamedNodeMap attrs, String name) | |
| 779 | + {
| |
| 780 | + return parseInteger(attrs.getNamedItem(name)); | |
| 781 | + } | |
| 782 | + | |
| 783 | + /** | |
| 784 | + * Parses an integer value. | |
| 785 | + * @param attrs the attributes | |
| 786 | + * @param name the name of the attribute to parse | |
| 787 | + * @param defaultValue the default value | |
| 788 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 789 | + */ | |
| 790 | + default Integer parseInteger(NamedNodeMap attrs, String name, Integer defaultValue) | |
| 791 | + {
| |
| 792 | + return parseInteger(attrs.getNamedItem(name), defaultValue); | |
| 793 | + } | |
| 794 | + | |
| 795 | + /** | |
| 796 | + * Parses a long value. | |
| 797 | + * @param node the node to parse | |
| 798 | + * @param defaultValue the default value | |
| 799 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 800 | + */ | |
| 801 | + default Long parseLong(Node node, Long defaultValue) | |
| 802 | + {
| |
| 803 | + return node != null ? Long.valueOf(node.getNodeValue()) : defaultValue; | |
| 804 | + } | |
| 805 | + | |
| 806 | + /** | |
| 807 | + * Parses a long value. | |
| 808 | + * @param node the node to parse | |
| 809 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 810 | + */ | |
| 811 | + default Long parseLong(Node node) | |
| 812 | + {
| |
| 813 | + return parseLong(node, null); | |
| 814 | + } | |
| 815 | + | |
| 816 | + /** | |
| 817 | + * Parses a long value. | |
| 818 | + * @param attrs the attributes | |
| 819 | + * @param name the name of the attribute to parse | |
| 820 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 821 | + */ | |
| 822 | + default Long parseLong(NamedNodeMap attrs, String name) | |
| 823 | + {
| |
| 824 | + return parseLong(attrs.getNamedItem(name)); | |
| 825 | + } | |
| 826 | + | |
| 827 | + /** | |
| 828 | + * Parses a long value. | |
| 829 | + * @param attrs the attributes | |
| 830 | + * @param name the name of the attribute to parse | |
| 831 | + * @param defaultValue the default value | |
| 832 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 833 | + */ | |
| 834 | + default Long parseLong(NamedNodeMap attrs, String name, Long defaultValue) | |
| 835 | + {
| |
| 836 | + return parseLong(attrs.getNamedItem(name), defaultValue); | |
| 837 | + } | |
| 838 | + | |
| 839 | + /** | |
| 840 | + * Parses a float value. | |
| 841 | + * @param node the node to parse | |
| 842 | + * @param defaultValue the default value | |
| 843 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 844 | + */ | |
| 845 | + default Float parseFloat(Node node, Float defaultValue) | |
| 846 | + {
| |
| 847 | + return node != null ? Float.valueOf(node.getNodeValue()) : defaultValue; | |
| 848 | + } | |
| 849 | + | |
| 850 | + /** | |
| 851 | + * Parses a float value. | |
| 852 | + * @param node the node to parse | |
| 853 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 854 | + */ | |
| 855 | + default Float parseFloat(Node node) | |
| 856 | + {
| |
| 857 | + return parseFloat(node, null); | |
| 858 | + } | |
| 859 | + | |
| 860 | + /** | |
| 861 | + * Parses a float value. | |
| 862 | + * @param attrs the attributes | |
| 863 | + * @param name the name of the attribute to parse | |
| 864 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 865 | + */ | |
| 866 | + default Float parseFloat(NamedNodeMap attrs, String name) | |
| 867 | + {
| |
| 868 | + return parseFloat(attrs.getNamedItem(name)); | |
| 869 | + } | |
| 870 | + | |
| 871 | + /** | |
| 872 | + * Parses a float value. | |
| 873 | + * @param attrs the attributes | |
| 874 | + * @param name the name of the attribute to parse | |
| 875 | + * @param defaultValue the default value | |
| 876 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 877 | + */ | |
| 878 | + default Float parseFloat(NamedNodeMap attrs, String name, Float defaultValue) | |
| 879 | + {
| |
| 880 | + return parseFloat(attrs.getNamedItem(name), defaultValue); | |
| 881 | + } | |
| 882 | + | |
| 883 | + /** | |
| 884 | + * Parses a double value. | |
| 885 | + * @param node the node to parse | |
| 886 | + * @param defaultValue the default value | |
| 887 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 888 | + */ | |
| 889 | + default Double parseDouble(Node node, Double defaultValue) | |
| 890 | + {
| |
| 891 | + return node != null ? Double.valueOf(node.getNodeValue()) : defaultValue; | |
| 892 | + } | |
| 893 | + | |
| 894 | + /** | |
| 895 | + * Parses a double value. | |
| 896 | + * @param node the node to parse | |
| 897 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 898 | + */ | |
| 899 | + default Double parseDouble(Node node) | |
| 900 | + {
| |
| 901 | + return parseDouble(node, null); | |
| 902 | + } | |
| 903 | + | |
| 904 | + /** | |
| 905 | + * Parses a double value. | |
| 906 | + * @param attrs the attributes | |
| 907 | + * @param name the name of the attribute to parse | |
| 908 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 909 | + */ | |
| 910 | + default Double parseDouble(NamedNodeMap attrs, String name) | |
| 911 | + {
| |
| 912 | + return parseDouble(attrs.getNamedItem(name)); | |
| 913 | + } | |
| 914 | + | |
| 915 | + /** | |
| 916 | + * Parses a double value. | |
| 917 | + * @param attrs the attributes | |
| 918 | + * @param name the name of the attribute to parse | |
| 919 | + * @param defaultValue the default value | |
| 920 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 921 | + */ | |
| 922 | + default Double parseDouble(NamedNodeMap attrs, String name, Double defaultValue) | |
| 923 | + {
| |
| 924 | + return parseDouble(attrs.getNamedItem(name), defaultValue); | |
| 925 | + } | |
| 926 | + | |
| 927 | + /** | |
| 928 | + * Parses a string value. | |
| 929 | + * @param node the node to parse | |
| 930 | + * @param defaultValue the default value | |
| 931 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 932 | + */ | |
| 933 | + default String parseString(Node node, String defaultValue) | |
| 934 | + {
| |
| 935 | + return node != null ? node.getNodeValue() : defaultValue; | |
| 936 | + } | |
| 937 | + | |
| 938 | + /** | |
| 939 | + * Parses a string value. | |
| 940 | + * @param node the node to parse | |
| 941 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 942 | + */ | |
| 943 | + default String parseString(Node node) | |
| 944 | + {
| |
| 945 | + return parseString(node, null); | |
| 946 | + } | |
| 947 | + | |
| 948 | + /** | |
| 949 | + * Parses a string value. | |
| 950 | + * @param attrs the attributes | |
| 951 | + * @param name the name of the attribute to parse | |
| 952 | + * @return if the node is not null, the value of the parsed node, otherwise null | |
| 953 | + */ | |
| 954 | + default String parseString(NamedNodeMap attrs, String name) | |
| 955 | + {
| |
| 956 | + return parseString(attrs.getNamedItem(name)); | |
| 957 | + } | |
| 958 | + | |
| 959 | + /** | |
| 960 | + * Parses a string value. | |
| 961 | + * @param attrs the attributes | |
| 962 | + * @param name the name of the attribute to parse | |
| 963 | + * @param defaultValue the default value | |
| 964 | + * @return if the node is not null, the value of the parsed node, otherwise the default value | |
| 965 | + */ | |
| 966 | + default String parseString(NamedNodeMap attrs, String name, String defaultValue) | |
| 967 | + {
| |
| 968 | + return parseString(attrs.getNamedItem(name), defaultValue); | |
| 969 | - | index 5fb661c..a0fde2e 100644 |
| 969 | + | |
| 970 | + | |
| 971 | + /** | |
| 972 | - | @@ -36,6 +36,15 @@ |
| 972 | + | |
| 973 | - | public static final String SERVER_FILE = "./config/server.properties"; |
| 973 | + | |
| 974 | - | public static final String SIEGE_FILE = "./config/siege.properties"; |
| 974 | + | |
| 975 | + * @param clazz the class of the enumerated | |
| 976 | + * @param defaultValue the default value | |
| 977 | + * @return if the node is not null and the node value is valid the parsed value, otherwise the default value | |
| 978 | - | + public static boolean ALLOW_DRESS_ME_SYSTEM; |
| 978 | + | |
| 979 | - | + public static String DRESS_ME_COMMAND; |
| 979 | + | |
| 980 | - | + public static boolean ALLOW_DRESS_ME_FOR_PREMIUM; |
| 980 | + | |
| 981 | - | + public static boolean ALLOW_DRESS_ME_IN_OLY; |
| 981 | + | |
| 982 | + {
| |
| 983 | + return defaultValue; | |
| 984 | + } | |
| 985 | - | // -------------------------------------------------- |
| 985 | + | |
| 986 | - | // Clans settings |
| 986 | + | |
| 987 | - | // -------------------------------------------------- |
| 987 | + | |
| 988 | - | @@ -943,6 +952,14 @@ |
| 988 | + | |
| 989 | - | final ExProperties players = initProperties(PLAYERS_FILE); |
| 989 | + | |
| 990 | + catch (IllegalArgumentException e) | |
| 991 | - | EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
|
| 991 | + | |
| 992 | + LOG.warning("Invalid value specified for node: {} specified value: {} should be enum value of \"{}\" using default value: {}");
| |
| 993 | - | + ALLOW_DRESS_ME_SYSTEM = players.getProperty("AllowDressMeSystem", false);
|
| 993 | + | |
| 994 | - | + DRESS_ME_COMMAND = players.getProperty("DressMeCommand", "dressme");
|
| 994 | + | |
| 995 | - | + ALLOW_DRESS_ME_FOR_PREMIUM = players.getProperty("AllowDressMeForPremiumOnly", false);
|
| 995 | + | |
| 996 | - | + ALLOW_DRESS_ME_IN_OLY = players.getProperty("AllowDressMeInOly", false);
|
| 996 | + | |
| 997 | + /** | |
| 998 | + * Parses an enumerated value. | |
| 999 | + * @param <T> the enumerated type | |
| 1000 | - | HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
|
| 1000 | + | |
| 1001 | - | MP_REGEN_MULTIPLIER = players.getProperty("MpRegenMultiplier", 1.);
|
| 1001 | + | |
| 1002 | - | CP_REGEN_MULTIPLIER = players.getProperty("CpRegenMultiplier", 1.);
|
| 1002 | + | |
| 1003 | + */ | |
| 1004 | + default <T extends Enum<T>> T parseEnum(Node node, Class<T> clazz) | |
| 1005 | + {
| |
| 1006 | + return parseEnum(node, clazz, null); | |
| 1007 | + } | |
| 1008 | + | |
| 1009 | + /** | |
| 1010 | + * Parses an enumerated value. | |
| 1011 | + * @param <T> the enumerated type | |
| 1012 | + * @param attrs the attributes | |
| 1013 | + * @param clazz the class of the enumerated | |
| 1014 | + * @param name the name of the attribute to parse | |
| 1015 | + * @return if the node is not null and the node value is valid the parsed value, otherwise null | |
| 1016 | + */ | |
| 1017 | + default <T extends Enum<T>> T parseEnum(NamedNodeMap attrs, Class<T> clazz, String name) | |
| 1018 | + {
| |
| 1019 | + return parseEnum(attrs.getNamedItem(name), clazz); | |
| 1020 | + } | |
| 1021 | + | |
| 1022 | + /** | |
| 1023 | + * Parses an enumerated value. | |
| 1024 | + * @param <T> the enumerated type | |
| 1025 | + * @param attrs the attributes | |
| 1026 | + * @param clazz the class of the enumerated | |
| 1027 | + * @param name the name of the attribute to parse | |
| 1028 | + * @param defaultValue the default value | |
| 1029 | + * @return if the node is not null and the node value is valid the parsed value, otherwise the default value | |
| 1030 | + */ | |
| 1031 | + default <T extends Enum<T>> T parseEnum(NamedNodeMap attrs, Class<T> clazz, String name, T defaultValue) | |
| 1032 | + {
| |
| 1033 | + return parseEnum(attrs.getNamedItem(name), clazz, defaultValue); | |
| 1034 | + } | |
| 1035 | + | |
| 1036 | + /** | |
| 1037 | + * Gets the current file filter. | |
| 1038 | + * @return the current file filter | |
| 1039 | + */ | |
| 1040 | + default FileFilter getCurrentFileFilter() | |
| 1041 | + {
| |
| 1042 | + return XML_FILTER; | |
| 1043 | + } | |
| 1044 | + | |
| 1045 | + static class XMLErrorHandler implements ErrorHandler | |
| 1046 | + {
| |
| 1047 | + @Override | |
| 1048 | + public void warning(SAXParseException e) throws SAXParseException | |
| 1049 | + {
| |
| 1050 | + throw e; | |
| 1051 | + } | |
| 1052 | + | |
| 1053 | + @Override | |
| 1054 | + public void error(SAXParseException e) throws SAXParseException | |
| 1055 | + {
| |
| 1056 | + throw e; | |
| 1057 | + } | |
| 1058 | + | |
| 1059 | + @Override | |
| 1060 | + public void fatalError(SAXParseException e) throws SAXParseException | |
| 1061 | + {
| |
| 1062 | + throw e; | |
| 1063 | + } | |
| 1064 | + } | |
| 1065 | +} | |
| 1066 | diff --git java/Base/Xml/XMLFilter.java java/Base/Xml/XMLFilter.java | |
| 1067 | new file mode 100644 | |
| 1068 | index 0000000..faa1805 | |
| 1069 | --- /dev/null | |
| 1070 | +++ java/Base/Xml/XMLFilter.java | |
| 1071 | @@ -0,0 +1,17 @@ | |
| 1072 | +package Base.Xml; | |
| 1073 | + | |
| 1074 | +import java.io.File; | |
| 1075 | +import java.io.FileFilter; | |
| 1076 | + | |
| 1077 | +public class XMLFilter implements FileFilter | |
| 1078 | +{
| |
| 1079 | + @Override | |
| 1080 | + public boolean accept(File f) | |
| 1081 | + {
| |
| 1082 | + if ((f == null) || !f.isFile()) | |
| 1083 | + {
| |
| 1084 | + return false; | |
| 1085 | + } | |
| 1086 | + return f.getName().toLowerCase().endsWith(".xml");
| |
| 1087 | + } | |
| 1088 | +} | |
| 1089 | diff --git java/net/sf/l2j/Config.java java/net/sf/l2j/Config.java | |
| 1090 | index 82dbd87..f2e16db 100644 | |
| 1091 | --- java/net/sf/l2j/Config.java | |
| 1092 | +++ java/net/sf/l2j/Config.java | |
| 1093 | @@ -337,6 +337,25 @@ | |
| 1094 | public static int DEATH_PENALTY_CHANCE; | |
| 1095 | ||
| 1096 | ||
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + public static boolean ALLOW_DRESS_ME_SYSTEM; | |
| 1101 | + public static String DRESS_ME_COMMAND; | |
| 1102 | + public static boolean ALLOW_DRESS_ME_FOR_PREMIUM; | |
| 1103 | + public static boolean ALLOW_DRESS_ME_IN_OLY; | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | public static int SMS_ITEMID; | |
| 1117 | ||
| 1118 | public static int SMS_ENCHANTWEAPON; | |
| 1119 | @@ -349,6 +368,15 @@ | |
| 1120 | ||
| 1121 | ||
| 1122 | ||
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | /** Inventory & WH */ | |
| 1133 | public static int INVENTORY_MAXIMUM_NO_DWARF; | |
| 1134 | public static int INVENTORY_MAXIMUM_DWARF; | |
| 1135 | @@ -968,6 +996,17 @@ | |
| 1136 | ALLOW_DELEVEL = players.getProperty("AllowDelevel", true);
| |
| 1137 | DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20);
| |
| 1138 | ||
| 1139 | + | |
| 1140 | + ALLOW_DRESS_ME_SYSTEM = players.getProperty("AllowDressMeSystem", false);
| |
| 1141 | + DRESS_ME_COMMAND = players.getProperty("DressMeCommand", "dressme");
| |
| 1142 | + ALLOW_DRESS_ME_FOR_PREMIUM = players.getProperty("AllowDressMeForPremiumOnly", false);
| |
| 1143 | + ALLOW_DRESS_ME_IN_OLY = players.getProperty("AllowDressMeInOly", false);
| |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | SMS_ITEMID = players.getProperty("SMSItemID", 9494);
| |
| 1151 | SMS_ENCHANTWEAPON = players.getProperty("SMSEnchantWeapon", 35);
| |
| 1152 | SMS_ENCHANTHEROWEAPON = players.getProperty("SMSEnchantHeroWeapon", 30);
| |
| 1153 | diff --git java/net/sf/l2j/gameserver/GameServer.java java/net/sf/l2j/gameserver/GameServer.java | |
| 1154 | index 2d0b8e7..29763e0 100644 | |
| 1155 | --- java/net/sf/l2j/gameserver/GameServer.java | |
| 1156 | +++ java/net/sf/l2j/gameserver/GameServer.java | |
| 1157 | @@ -78,6 +78,7 @@ | |
| 1158 | import net.sf.l2j.gameserver.handler.SkillHandler; | |
| 1159 | import net.sf.l2j.gameserver.handler.TargetHandler; | |
| 1160 | import net.sf.l2j.gameserver.handler.UserCommandHandler; | |
| 1161 | +import net.sf.l2j.gameserver.handler.VoicedCommandHandler; | |
| 1162 | import net.sf.l2j.gameserver.idfactory.IdFactory; | |
| 1163 | import net.sf.l2j.gameserver.model.World; | |
| 1164 | import net.sf.l2j.gameserver.model.boat.BoatGiranTalking; | |
| 1165 | @@ -85,6 +86,7 @@ | |
| 1166 | import net.sf.l2j.gameserver.model.boat.BoatInnadrilTour; | |
| 1167 | import net.sf.l2j.gameserver.model.boat.BoatRunePrimeval; | |
| 1168 | import net.sf.l2j.gameserver.model.boat.BoatTalkingGludin; | |
| 1169 | +import net.sf.l2j.gameserver.model.item.kind.Item; | |
| 1170 | import net.sf.l2j.gameserver.model.olympiad.Olympiad; | |
| 1171 | import net.sf.l2j.gameserver.model.olympiad.OlympiadGameManager; | |
| 1172 | import net.sf.l2j.gameserver.network.GameClient; | |
| 1173 | @@ -100,6 +102,8 @@ | |
| 1174 | import net.sf.l2j.util.DeadLockDetector; | |
| 1175 | import net.sf.l2j.util.IPv4Filter; | |
| 1176 | ||
| 1177 | +import Base.Skin.DressMeData; | |
| 1178 | + | |
| 1179 | public class GameServer | |
| 1180 | {
| |
| 1181 | private static final CLogger LOGGER = new CLogger(GameServer.class.getName()); | |
| 1182 | @@ -269,10 +273,26 @@ | |
| 1183 | LOGGER.info("Loaded {} skill handlers.", SkillHandler.getInstance().size());
| |
| 1184 | LOGGER.info("Loaded {} target handlers.", TargetHandler.getInstance().size());
| |
| 1185 | LOGGER.info("Loaded {} user command handlers.", UserCommandHandler.getInstance().size());
| |
| 1186 | - | |
| 1187 | + LOGGER.info("Loaded {} user VoicedCommandHandler handlers.", VoicedCommandHandler.getInstance().size());
| |
| 1188 | StringUtil.printSection("System");
| |
| 1189 | Runtime.getRuntime().addShutdownHook(Shutdown.getInstance()); | |
| 1190 | ||
| 1191 | + | |
| 1192 | + Item.LoadAllIcons(); | |
| 1193 | + | |
| 1194 | + if (Config.ALLOW_DRESS_ME_SYSTEM) | |
| 1195 | + {
| |
| 1196 | + StringUtil.printSection("Dress Me / Skins");
| |
| 1197 | + DressMeData.getInstance(); | |
| 1198 | + } | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | if (Config.DEADLOCK_DETECTOR) | |
| 1208 | {
| |
| 1209 | LOGGER.info("Deadlock detector is enabled. Timer: {}s.", Config.DEADLOCK_CHECK_INTERVAL);
| |
| 1210 | diff --git java/net/sf/l2j/gameserver/data/xml/ItemData.java java/net/sf/l2j/gameserver/data/xml/ItemData.java | |
| 1211 | index 4cadc26..15ef358 100644 | |
| 1212 | --- java/net/sf/l2j/gameserver/data/xml/ItemData.java | |
| 1213 | +++ java/net/sf/l2j/gameserver/data/xml/ItemData.java | |
| 1214 | @@ -3,10 +3,13 @@ | |
| 1215 | import java.io.File; | |
| 1216 | import java.util.HashMap; | |
| 1217 | import java.util.Map; | |
| 1218 | +import java.util.logging.Level; | |
| 1219 | ||
| 1220 | import net.sf.l2j.commons.logging.CLogger; | |
| 1221 | ||
| 1222 | + | |
| 1223 | import net.sf.l2j.gameserver.data.DocumentItem; | |
| 1224 | +import net.sf.l2j.gameserver.model.item.instance.ItemInstance; | |
| 1225 | import net.sf.l2j.gameserver.model.item.kind.Armor; | |
| 1226 | import net.sf.l2j.gameserver.model.item.kind.EtcItem; | |
| 1227 | import net.sf.l2j.gameserver.model.item.kind.Item; | |
| 1228 | @@ -88,6 +91,47 @@ | |
| 1229 | return SingletonHolder.INSTANCE; | |
| 1230 | } | |
| 1231 | ||
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + public ItemInstance createDummyItem(final int itemId) | |
| 1237 | + {
| |
| 1238 | + final Item item = getTemplate(itemId); | |
| 1239 | + | |
| 1240 | + if (item == null) | |
| 1241 | + {
| |
| 1242 | + return null; | |
| 1243 | + } | |
| 1244 | + | |
| 1245 | + ItemInstance temp = new ItemInstance(0, item); | |
| 1246 | + | |
| 1247 | + try | |
| 1248 | + {
| |
| 1249 | + temp = new ItemInstance(0, itemId); | |
| 1250 | + } | |
| 1251 | + catch (final ArrayIndexOutOfBoundsException e) | |
| 1252 | + {
| |
| 1253 | + | |
| 1254 | + e.printStackTrace(); | |
| 1255 | + | |
| 1256 | + } | |
| 1257 | + | |
| 1258 | + if (temp.getItem() == null) | |
| 1259 | + {
| |
| 1260 | + LOGGER.warn(Level.WARNING, "ItemTable: Item Template missing for Id: {}" + " " + itemId);
| |
| 1261 | + } | |
| 1262 | + | |
| 1263 | + return temp; | |
| 1264 | + } | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | private static class SingletonHolder | |
| 1274 | {
| |
| 1275 | protected static final ItemData INSTANCE = new ItemData(); | |
| 1276 | diff --git java/net/sf/l2j/gameserver/handler/BypassHandler.java java/net/sf/l2j/gameserver/handler/BypassHandler.java | |
| 1277 | new file mode 100644 | |
| 1278 | index 0000000..ad2fbd4 | |
| 1279 | --- /dev/null | |
| 1280 | +++ java/net/sf/l2j/gameserver/handler/BypassHandler.java | |
| 1281 | @@ -0,0 +1,69 @@ | |
| 1282 | +package net.sf.l2j.gameserver.handler; | |
| 1283 | + | |
| 1284 | +import java.util.HashMap; | |
| 1285 | +import java.util.Map; | |
| 1286 | +import java.util.logging.Logger; | |
| 1287 | + | |
| 1288 | +import net.sf.l2j.Config; | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | +/** | |
| 1293 | + * @author Dwight | |
| 1294 | + */ | |
| 1295 | +public class BypassHandler | |
| 1296 | +{
| |
| 1297 | + private static Logger _log = Logger.getLogger(BypassHandler.class.getName()); | |
| 1298 | + private final Map<Integer, IBypassHandler> _datatable = new HashMap<>(); | |
| 1299 | + | |
| 1300 | + public static BypassHandler getInstance() | |
| 1301 | + {
| |
| 1302 | + return SingletonHolder._instance; | |
| 1303 | + } | |
| 1304 | + | |
| 1305 | + private BypassHandler() | |
| 1306 | + {
| |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + } | |
| 1311 | + | |
| 1312 | + public void registerBypassHandler(IBypassHandler handler) | |
| 1313 | + {
| |
| 1314 | + String[] ids = handler.getBypassHandlersList(); | |
| 1315 | + for (int i = 0; i < ids.length; i++) | |
| 1316 | + {
| |
| 1317 | + if (Config.PACKET_HANDLER_DEBUG) | |
| 1318 | + {
| |
| 1319 | + _log.fine("Adding handler for command " + ids[i]);
| |
| 1320 | + } | |
| 1321 | + _datatable.put(ids[i].hashCode(), handler); | |
| 1322 | + } | |
| 1323 | + } | |
| 1324 | + | |
| 1325 | + public IBypassHandler getBypassHandler(String bypass) | |
| 1326 | + {
| |
| 1327 | + String command = bypass; | |
| 1328 | + | |
| 1329 | + if (bypass.indexOf(" ") != -1)
| |
| 1330 | + {
| |
| 1331 | + command = bypass.substring(0, bypass.indexOf(" "));
| |
| 1332 | + } | |
| 1333 | + | |
| 1334 | + if (Config.PACKET_HANDLER_DEBUG) | |
| 1335 | + {
| |
| 1336 | + _log.fine("getting handler for command: " + command + " -> " + (_datatable.get(command.hashCode()) != null));
| |
| 1337 | + } | |
| 1338 | + return _datatable.get(command.hashCode()); | |
| 1339 | + } | |
| 1340 | + | |
| 1341 | + public int size() | |
| 1342 | + {
| |
| 1343 | + return _datatable.size(); | |
| 1344 | + } | |
| 1345 | + | |
| 1346 | + private static class SingletonHolder | |
| 1347 | + {
| |
| 1348 | + protected static final BypassHandler _instance = new BypassHandler(); | |
| 1349 | + } | |
| 1350 | +} | |
| 1351 | diff --git java/net/sf/l2j/gameserver/handler/CustomBypassHandler.java java/net/sf/l2j/gameserver/handler/CustomBypassHandler.java | |
| 1352 | new file mode 100644 | |
| 1353 | index 0000000..e07fdff | |
| 1354 | --- /dev/null | |
| 1355 | +++ java/net/sf/l2j/gameserver/handler/CustomBypassHandler.java | |
| 1356 | @@ -0,0 +1,70 @@ | |
| 1357 | + | |
| 1358 | +package net.sf.l2j.gameserver.handler; | |
| 1359 | + | |
| 1360 | +import java.util.HashMap; | |
| 1361 | +import java.util.Map; | |
| 1362 | + | |
| 1363 | +import net.sf.l2j.gameserver.handler.usercommandhandlers.DressMe; | |
| 1364 | +import net.sf.l2j.gameserver.model.actor.Player; | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | +public class CustomBypassHandler | |
| 1370 | +{
| |
| 1371 | + | |
| 1372 | + | |
| 1373 | + private static CustomBypassHandler _instance = null; | |
| 1374 | + private final Map<String, ICustomByPassHandler> _handlers; | |
| 1375 | + | |
| 1376 | + private CustomBypassHandler() | |
| 1377 | + {
| |
| 1378 | + _handlers = new HashMap<>(); | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + registerCustomBypassHandler(new DressMe()); | |
| 1382 | + } | |
| 1383 | + | |
| 1384 | + public static CustomBypassHandler getInstance() | |
| 1385 | + {
| |
| 1386 | + if (_instance == null) | |
| 1387 | + {
| |
| 1388 | + _instance = new CustomBypassHandler(); | |
| 1389 | + } | |
| 1390 | + | |
| 1391 | + return _instance; | |
| 1392 | + } | |
| 1393 | + | |
| 1394 | + public void registerCustomBypassHandler(final ICustomByPassHandler handler) | |
| 1395 | + {
| |
| 1396 | + for (final String s : handler.getByPassCommands()) | |
| 1397 | + {
| |
| 1398 | + _handlers.put(s, handler); | |
| 1399 | + } | |
| 1400 | + } | |
| 1401 | + | |
| 1402 | + public void handleBypass(final Player player, final String command) | |
| 1403 | + {
| |
| 1404 | + String cmd = ""; | |
| 1405 | + String params = ""; | |
| 1406 | + final int iPos = command.indexOf(" ");
| |
| 1407 | + if (iPos != -1) | |
| 1408 | + {
| |
| 1409 | + cmd = command.substring(7, iPos); | |
| 1410 | + params = command.substring(iPos + 1); | |
| 1411 | + } | |
| 1412 | + else | |
| 1413 | + {
| |
| 1414 | + cmd = command.substring(7); | |
| 1415 | + } | |
| 1416 | + final ICustomByPassHandler ch = _handlers.get(cmd); | |
| 1417 | + if (ch != null) | |
| 1418 | + {
| |
| 1419 | + ch.handleCommand(cmd, player, params); | |
| 1420 | + } | |
| 1421 | + else | |
| 1422 | + {
| |
| 1423 | + | |
| 1424 | + } | |
| 1425 | + } | |
| 1426 | +} | |
| 1427 | \ No newline at end of file | |
| 1428 | diff --git java/net/sf/l2j/gameserver/handler/IBypassHandler.java java/net/sf/l2j/gameserver/handler/IBypassHandler.java | |
| 1429 | new file mode 100644 | |
| 1430 | index 0000000..a942b63 | |
| 1431 | --- /dev/null | |
| 1432 | +++ java/net/sf/l2j/gameserver/handler/IBypassHandler.java | |
| 1433 | @@ -0,0 +1,13 @@ | |
| 1434 | +package net.sf.l2j.gameserver.handler; | |
| 1435 | + | |
| 1436 | +import net.sf.l2j.gameserver.model.actor.Player; | |
| 1437 | + | |
| 1438 | +/** | |
| 1439 | + * @author Dwight | |
| 1440 | + */ | |
| 1441 | +public interface IBypassHandler | |
| 1442 | +{
| |
| 1443 | + public boolean handleBypass(String bypass, Player activeChar); | |
| 1444 | + | |
| 1445 | + public String[] getBypassHandlersList(); | |
| 1446 | +} | |
| 1447 | diff --git java/net/sf/l2j/gameserver/handler/ICustomByPassHandler.java java/net/sf/l2j/gameserver/handler/ICustomByPassHandler.java | |
| 1448 | new file mode 100644 | |
| 1449 | index 0000000..6b4c1b4 | |
| 1450 | --- /dev/null | |
| 1451 | +++ java/net/sf/l2j/gameserver/handler/ICustomByPassHandler.java | |
| 1452 | @@ -0,0 +1,10 @@ | |
| 1453 | +package net.sf.l2j.gameserver.handler; | |
| 1454 | + | |
| 1455 | +import net.sf.l2j.gameserver.model.actor.Player; | |
| 1456 | + | |
| 1457 | +public interface ICustomByPassHandler | |
| 1458 | +{
| |
| 1459 | + public String[] getByPassCommands(); | |
| 1460 | + | |
| 1461 | + public void handleCommand(String command, Player player, String parameters); | |
| 1462 | +} | |
| 1463 | diff --git java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java | |
| 1464 | new file mode 100644 | |
| 1465 | index 0000000..3b0f12a | |
| 1466 | --- /dev/null | |
| 1467 | +++ java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java | |
| 1468 | @@ -0,0 +1,10 @@ | |
| 1469 | +package net.sf.l2j.gameserver.handler; | |
| 1470 | + | |
| 1471 | +import net.sf.l2j.gameserver.model.actor.Player; | |
| 1472 | + | |
| 1473 | +public interface IVoicedCommandHandler | |
| 1474 | +{
| |
| 1475 | + public boolean useVoicedCommand(String command, Player activeChar, String params); | |
| 1476 | + | |
| 1477 | + public String[] getVoicedCommandList(); | |
| 1478 | +} | |
| 1479 | \ No newline at end of file | |
| 1480 | diff --git java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java | |
| 1481 | new file mode 100644 | |
| 1482 | index 0000000..35df73c | |
| 1483 | --- /dev/null | |
| 1484 | +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java | |
| 1485 | @@ -0,0 +1,51 @@ | |
| 1486 | +package net.sf.l2j.gameserver.handler; | |
| 1487 | + | |
| 1488 | +import java.util.HashMap; | |
| 1489 | +import java.util.Map; | |
| 1490 | + | |
| 1491 | +import net.sf.l2j.gameserver.handler.usercommandhandlers.DressMe; | |
| 1492 | + | |
| 1493 | +public class VoicedCommandHandler | |
| 1494 | +{
| |
| 1495 | + private final Map<Integer, IVoicedCommandHandler> _datatable = new HashMap<>(); | |
| 1496 | + | |
| 1497 | + public static VoicedCommandHandler getInstance() | |
| 1498 | + {
| |
| 1499 | + return SingletonHolder._instance; | |
| 1500 | + } | |
| 1501 | + | |
| 1502 | + protected VoicedCommandHandler() | |
| 1503 | + {
| |
| 1504 | + //Codigos para colocar aqui dentro | |
| 1505 | + registerHandler(new DressMe()); | |
| 1506 | + | |
| 1507 | + } | |
| 1508 | + | |
| 1509 | + public void registerHandler(IVoicedCommandHandler handler) | |
| 1510 | + {
| |
| 1511 | + String[] ids = handler.getVoicedCommandList(); | |
| 1512 | + | |
| 1513 | + for (int i = 0; i < ids.length; i++) | |
| 1514 | + _datatable.put(ids[i].hashCode(), handler); | |
| 1515 | + } | |
| 1516 | + | |
| 1517 | + public IVoicedCommandHandler getHandler(String voicedCommand) | |
| 1518 | + {
| |
| 1519 | + String command = voicedCommand; | |
| 1520 | + | |
| 1521 | + if (voicedCommand.indexOf(" ") != -1)
| |
| 1522 | + command = voicedCommand.substring(0, voicedCommand.indexOf(" "));
| |
| 1523 | + | |
| 1524 | + return _datatable.get(command.hashCode()); | |
| 1525 | + } | |
| 1526 | + | |
| 1527 | + public int size() | |
| 1528 | + {
| |
| 1529 | + return _datatable.size(); | |
| 1530 | + } | |
| 1531 | + | |
| 1532 | + private static class SingletonHolder | |
| 1533 | + {
| |
| 1534 | + protected static final VoicedCommandHandler _instance = new VoicedCommandHandler(); | |
| 1535 | + } | |
| 1536 | +} | |
| 1537 | \ No newline at end of file | |
| 1538 | diff --git java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java | |
| 1539 | index ac326e9..2bcda59 100644 | |
| 1540 | --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java | |
| 1541 | +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java | |
| 1542 | @@ -1,8 +1,12 @@ | |
| 1543 | package net.sf.l2j.gameserver.handler.chathandlers; | |
| 1544 | ||
| 1545 | +import java.util.StringTokenizer; | |
| 1546 | + | |
| 1547 | import net.sf.l2j.gameserver.enums.FloodProtector; | |
| 1548 | import net.sf.l2j.gameserver.enums.SayType; | |
| 1549 | import net.sf.l2j.gameserver.handler.IChatHandler; | |
| 1550 | +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; | |
| 1551 | +import net.sf.l2j.gameserver.handler.VoicedCommandHandler; | |
| 1552 | import net.sf.l2j.gameserver.model.actor.Player; | |
| 1553 | import net.sf.l2j.gameserver.network.serverpackets.CreatureSay; | |
| 1554 | ||
| 1555 | @@ -19,11 +23,39 @@ | |
| 1556 | if (!player.getClient().performAction(FloodProtector.GLOBAL_CHAT)) | |
| 1557 | return; | |
| 1558 | ||
| 1559 | - final CreatureSay cs = new CreatureSay(player, type, text); | |
| 1560 | - for (Player knownPlayer : player.getKnownTypeInRadius(Player.class, 1250)) | |
| 1561 | - knownPlayer.sendPacket(cs); | |
| 1562 | + boolean vcd_used = false; | |
| 1563 | + if (text.startsWith("."))
| |
| 1564 | + {
| |
| 1565 | + StringTokenizer st = new StringTokenizer(text); | |
| 1566 | + IVoicedCommandHandler vch; | |
| 1567 | + String command = ""; | |
| 1568 | + if (st.countTokens() > 1) | |
| 1569 | + {
| |
| 1570 | + command = st.nextToken().substring(1); | |
| 1571 | + target = text.substring(command.length() + 2); | |
| 1572 | + vch = VoicedCommandHandler.getInstance().getHandler(command); | |
| 1573 | + } | |
| 1574 | + else | |
| 1575 | + {
| |
| 1576 | + command = text.substring(1); | |
| 1577 | + vch = VoicedCommandHandler.getInstance().getHandler(command); | |
| 1578 | + } | |
| 1579 | ||
| 1580 | - player.sendPacket(cs); | |
| 1581 | + if (vch != null) | |
| 1582 | + {
| |
| 1583 | + vch.useVoicedCommand(command, player, text); | |
| 1584 | + vcd_used = true; | |
| 1585 | + | |
| 1586 | + } | |
| 1587 | + } | |
| 1588 | + if (!vcd_used) | |
| 1589 | + {
| |
| 1590 | + final CreatureSay cs = new CreatureSay(player, type, text); | |
| 1591 | + for (Player knownPlayer : player.getKnownTypeInRadius(Player.class, 1250)) | |
| 1592 | + knownPlayer.sendPacket(cs); | |
| 1593 | + | |
| 1594 | + player.sendPacket(cs); | |
| 1595 | + } | |
| 1596 | } | |
| 1597 | ||
| 1598 | @Override | |
| 1599 | diff --git java/net/sf/l2j/gameserver/handler/usercommandhandlers/DressMe.java java/net/sf/l2j/gameserver/handler/usercommandhandlers/DressMe.java | |
| 1600 | new file mode 100644 | |
| 1601 | index 0000000..56c1309 | |
| 1602 | --- /dev/null | |
| 1603 | +++ java/net/sf/l2j/gameserver/handler/usercommandhandlers/DressMe.java | |
| 1604 | @@ -0,0 +1,93 @@ | |
| 1605 | +package net.sf.l2j.gameserver.handler.usercommandhandlers; | |
| 1606 | + | |
| 1607 | +import java.text.SimpleDateFormat; | |
| 1608 | +import java.util.Date; | |
| 1609 | + | |
| 1610 | +import net.sf.l2j.Config; | |
| 1611 | +import net.sf.l2j.gameserver.data.cache.HtmCache; | |
| 1612 | +import net.sf.l2j.gameserver.handler.ICustomByPassHandler; | |
| 1613 | +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; | |
| 1614 | +import net.sf.l2j.gameserver.model.actor.Player; | |
| 1615 | +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | +public class DressMe implements IVoicedCommandHandler, ICustomByPassHandler | |
| 1620 | +{
| |
| 1621 | + private static String[] _voicedCommands = | |
| 1622 | + {
| |
| 1623 | + Config.DRESS_ME_COMMAND | |
| 1624 | + }; | |
| 1625 | + | |
| 1626 | + @Override | |
| 1627 | + public boolean useVoicedCommand(String command, Player activeChar, String target) | |
| 1628 | + {
| |
| 1629 | + | |
| 1630 | + | |
| 1631 | + if (command.startsWith(Config.DRESS_ME_COMMAND)) | |
| 1632 | + {
| |
| 1633 | + showHtm(activeChar); | |
| 1634 | + } | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + return true; | |
| 1638 | + } | |
| 1639 | + | |
| 1640 | + private static void showHtm(Player player) | |
| 1641 | + {
| |
| 1642 | + NpcHtmlMessage htm = new NpcHtmlMessage(1); | |
| 1643 | + String text = HtmCache.getInstance().getHtm("data/html/dressme/index.htm");
| |
| 1644 | + | |
| 1645 | + htm.setHtml(text); | |
| 1646 | + | |
| 1647 | + {
| |
| 1648 | + htm.replace("%time%", sdf.format(new Date(System.currentTimeMillis())));
| |
| 1649 | + htm.replace("%dat%", (new SimpleDateFormat("dd/MM/yyyy")).format(new Date(System.currentTimeMillis())));
| |
| 1650 | + | |
| 1651 | + } | |
| 1652 | + | |
| 1653 | + player.sendPacket(htm); | |
| 1654 | + } | |
| 1655 | + | |
| 1656 | + static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
| |
| 1657 | + | |
| 1658 | + @Override | |
| 1659 | + public String[] getVoicedCommandList() | |
| 1660 | + {
| |
| 1661 | + return _voicedCommands; | |
| 1662 | + } | |
| 1663 | + | |
| 1664 | + @Override | |
| 1665 | + public String[] getByPassCommands() | |
| 1666 | + {
| |
| 1667 | + return new String[] | |
| 1668 | + {
| |
| 1669 | + "dressme_back" | |
| 1670 | + }; | |
| 1671 | + } | |
| 1672 | + | |
| 1673 | + private enum CommandEnum | |
| 1674 | + {
| |
| 1675 | + dressme_back, | |
| 1676 | + } | |
| 1677 | + | |
| 1678 | + @Override | |
| 1679 | + public void handleCommand(String command, Player player, String parameters) | |
| 1680 | + {
| |
| 1681 | + CommandEnum comm = CommandEnum.valueOf(command); | |
| 1682 | + | |
| 1683 | + if (comm == null) | |
| 1684 | + {
| |
| 1685 | + return; | |
| 1686 | + } | |
| 1687 | + | |
| 1688 | + switch (comm) | |
| 1689 | + {
| |
| 1690 | + case dressme_back: | |
| 1691 | + {
| |
| 1692 | + showHtm(player); | |
| 1693 | + } | |
| 1694 | + break; | |
| 1695 | + } | |
| 1696 | + } | |
| 1697 | +} | |
| 1698 | \ No newline at end of file | |
| 1699 | diff --git java/net/sf/l2j/gameserver/model/actor/Player.java java/net/sf/l2j/gameserver/model/actor/Player.java | |
| 1700 | - | + try (Connection con = ConnectionPool.getConnection(); |
| 1700 | + | |
| 1701 | - | + PreparedStatement statement = con.prepareStatement(INSERT_OR_UPDATE_CHARACTER_DRESSME_DATA)) |
| 1701 | + | |
| 1702 | +++ java/net/sf/l2j/gameserver/model/actor/Player.java | |
| 1703 | @@ -14,6 +14,7 @@ | |
| 1704 | import java.util.Set; | |
| 1705 | import java.util.concurrent.ConcurrentHashMap; | |
| 1706 | import java.util.concurrent.ConcurrentSkipListMap; | |
| 1707 | +import java.util.concurrent.CopyOnWriteArrayList; | |
| 1708 | import java.util.concurrent.Future; | |
| 1709 | import java.util.concurrent.ScheduledFuture; | |
| 1710 | import java.util.concurrent.atomic.AtomicInteger; | |
| 1711 | @@ -163,6 +164,7 @@ | |
| 1712 | import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadMode; | |
| 1713 | import net.sf.l2j.gameserver.network.serverpackets.ExServerPrimitive; | |
| 1714 | import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode; | |
| 1715 | +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage; | |
| 1716 | import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount; | |
| 1717 | import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle; | |
| 1718 | import net.sf.l2j.gameserver.network.serverpackets.HennaInfo; | |
| 1719 | @@ -177,6 +179,7 @@ | |
| 1720 | import net.sf.l2j.gameserver.network.serverpackets.ObserverStart; | |
| 1721 | import net.sf.l2j.gameserver.network.serverpackets.PartySmallWindowUpdate; | |
| 1722 | import net.sf.l2j.gameserver.network.serverpackets.PetInventoryUpdate; | |
| 1723 | +import net.sf.l2j.gameserver.network.serverpackets.PlaySound; | |
| 1724 | import net.sf.l2j.gameserver.network.serverpackets.PledgeShowMemberListDelete; | |
| 1725 | import net.sf.l2j.gameserver.network.serverpackets.PledgeShowMemberListUpdate; | |
| 1726 | import net.sf.l2j.gameserver.network.serverpackets.PrivateStoreListBuy; | |
| 1727 | @@ -225,12 +228,48 @@ | |
| 1728 | import net.sf.l2j.gameserver.taskmanager.ShadowItemTaskManager; | |
| 1729 | import net.sf.l2j.gameserver.taskmanager.WaterTaskManager; | |
| 1730 | ||
| 1731 | +import Base.Skin.DressMeData; | |
| 1732 | + | |
| 1733 | /** | |
| 1734 | * This class represents a player in the world.<br> | |
| 1735 | * There is always a client-thread connected to this (except if a player-store is activated upon logout). | |
| 1736 | */ | |
| 1737 | public final class Player extends Playable | |
| 1738 | {
| |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + private int _armorSkinOption = 0; | |
| 1744 | + private int _weaponSkinOption = 0; | |
| 1745 | + private int _hairSkinOption = 0; | |
| 1746 | + private int _faceSkinOption = 0; | |
| 1747 | + private int _shieldSkinOption = 0; | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + private boolean isTryingSkin = false; | |
| 1751 | + private boolean isTryingSkinPremium = false; | |
| 1752 | + private List<Integer> _armorSkins = new CopyOnWriteArrayList<>(); | |
| 1753 | + private List<Integer> _weaponSkins = new CopyOnWriteArrayList<>(); | |
| 1754 | + private List<Integer> _hairSkins = new CopyOnWriteArrayList<>(); | |
| 1755 | + private List<Integer> _faceSkins = new CopyOnWriteArrayList<>(); | |
| 1756 | + private List<Integer> _shieldSkins = new CopyOnWriteArrayList<>(); | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + private static final String INSERT_OR_UPDATE_CHARACTER_DRESSME_DATA = "INSERT INTO characters_dressme_data (obj_Id, armor_skins, armor_skin_option, weapon_skins, weapon_skin_option, hair_skins, hair_skin_option, face_skins, face_skin_option) VALUES (?,?,?,?,?,?,?,?,?) " | |
| 1760 | + + "ON DUPLICATE KEY UPDATE obj_Id=?, armor_skins=?, armor_skin_option=?, weapon_skins=?, weapon_skin_option=?, hair_skins=?, hair_skin_option=?, face_skins=?, face_skin_option=?, shield_skins=?, shield_skin_option=?"; | |
| 1761 | + private static final String RESTORE_CHARACTER_DRESSME_DATA = "SELECT obj_Id, armor_skins, armor_skin_option, weapon_skins, weapon_skin_option, hair_skins, hair_skin_option, face_skins, face_skin_option, shield_skins, shield_skin_option FROM characters_dressme_data WHERE obj_id=?"; | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | private static final String RESTORE_SKILLS_FOR_CHAR = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? AND class_index=?"; | |
| 1774 | private static final String ADD_OR_UPDATE_SKILL = "INSERT INTO character_skills (char_obj_id,skill_id,skill_level,class_index) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE skill_level=VALUES(skill_level)"; | |
| 1775 | private static final String DELETE_SKILL_FROM_CHAR = "DELETE FROM character_skills WHERE skill_id=? AND char_obj_id=? AND class_index=?"; | |
| 1776 | @@ -1225,6 +1264,28 @@ | |
| 1777 | if (item.getItem() instanceof Weapon) | |
| 1778 | item.unChargeAllShots(); | |
| 1779 | ||
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + if (getWeaponSkinOption() > 0 && DressMeData.getInstance().getWeaponSkinsPackage(getWeaponSkinOption()) != null) | |
| 1784 | + {
| |
| 1785 | + sendMessage("At first you must to remove a skin of weapon.");
| |
| 1786 | + sendPacket(new ExShowScreenMessage("At first you must to remove a skin of weapon.", 2000));
| |
| 1787 | + sendPacket(new PlaySound("ItemSound3.sys_impossible"));
| |
| 1788 | + return; | |
| 1789 | + } | |
| 1790 | + | |
| 1791 | + if (getShieldSkinOption() > 0 && DressMeData.getInstance().getShieldSkinsPackage(getShieldSkinOption()) != null) | |
| 1792 | + {
| |
| 1793 | + sendMessage("At first you must to remove a skin of weapon.");
| |
| 1794 | + sendPacket(new ExShowScreenMessage("At first you must to remove a skin of weapon.", 2000));
| |
| 1795 | + sendPacket(new PlaySound("ItemSound3.sys_impossible"));
| |
| 1796 | + return; | |
| 1797 | + } | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | if (isEquipped) | |
| 1803 | {
| |
| 1804 | if (item.getEnchantLevel() > 0) | |
| 1805 | @@ -4379,7 +4440,7 @@ | |
| 1806 | player.refreshHennaList(); | |
| 1807 | ||
| 1808 | player.restoreFriendList(); | |
| 1809 | - | |
| 1810 | + player.restoreDressMeData(); | |
| 1811 | player.setOnlineStatus(true, false); | |
| 1812 | player.setRunning(true); | |
| 1813 | player.setStanding(true); | |
| 1814 | @@ -4484,6 +4545,20 @@ | |
| 1815 | */ | |
| 1816 | public synchronized void store(boolean storeActiveEffects) | |
| 1817 | {
| |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + if (!isTryingSkin() || !isTryingSkinPremium()) | |
| 1823 | + {
| |
| 1824 | + storeDressMeData(); | |
| 1825 | + } | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | storeCharBase(); | |
| 1833 | storeCharSub(); | |
| 1834 | storeEffect(storeActiveEffects); | |
| 1835 | @@ -7444,4 +7519,473 @@ | |
| 1836 | ||
| 1837 | return gms; | |
| 1838 | } | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + @SuppressWarnings("resource")
| |
| 1848 | + private synchronized void storeDressMeData() | |
| 1849 | + {
| |
| 1850 | + | |
| 1851 | + Connection con = null; | |
| 1852 | + try | |
| 1853 | + {
| |
| 1854 | + con = ConnectionPool.getConnection(); | |
| 1855 | + PreparedStatement statement = con.prepareStatement(INSERT_OR_UPDATE_CHARACTER_DRESSME_DATA); | |
| 1856 | + | |
| 1857 | + statement.setInt(1, getObjectId()); | |
| 1858 | + if (_armorSkins.isEmpty()) | |
| 1859 | + {
| |
| 1860 | + statement.setString(2, ""); | |
| 1861 | + } | |
| 1862 | + else | |
| 1863 | + {
| |
| 1864 | - | + LOGGER.warn("Could not store storeDressMeData():");
|
| 1864 | + | |
| 1865 | + for (int i : _armorSkins) | |
| 1866 | + {
| |
| 1867 | + s += String.valueOf(i) + ","; | |
| 1868 | + } | |
| 1869 | + statement.setString(2, s); | |
| 1870 | + } | |
| 1871 | + statement.setInt(3, getArmorSkinOption()); | |
| 1872 | + | |
| 1873 | - | + try (Connection con = ConnectionPool.getConnection(); |
| 1873 | + | |
| 1874 | - | + PreparedStatement statement = con.prepareStatement(RESTORE_CHARACTER_DRESSME_DATA)) |
| 1874 | + | |
| 1875 | + statement.setString(4, ""); | |
| 1876 | + } | |
| 1877 | - | + statement.setInt(1, getObjectId()); // Establecer el parámetro objectId |
| 1877 | + | |
| 1878 | + {
| |
| 1879 | - | + try (ResultSet rset = statement.executeQuery()) |
| 1879 | + | |
| 1880 | + for (int i : _weaponSkins) | |
| 1881 | - | + while (rset.next()) |
| 1881 | + | |
| 1882 | + s += String.valueOf(i) + ","; | |
| 1883 | - | + String armorskinIds = rset.getString("armor_skins");
|
| 1883 | + | |
| 1884 | - | + if (armorskinIds != null && armorskinIds.length() > 0) |
| 1884 | + | |
| 1885 | + } | |
| 1886 | - | + for (String s : armorskinIds.split(","))
|
| 1886 | + | |
| 1887 | + | |
| 1888 | - | + if (s == null) |
| 1888 | + | |
| 1889 | + {
| |
| 1890 | - | + continue; |
| 1890 | + | |
| 1891 | + } | |
| 1892 | - | + buyArmorSkin(Integer.parseInt(s)); |
| 1892 | + | |
| 1893 | + {
| |
| 1894 | + String s = ""; | |
| 1895 | - | + setArmorSkinOption(rset.getInt("armor_skin_option"));
|
| 1895 | + | |
| 1896 | + {
| |
| 1897 | - | + String weaponskinIds = rset.getString("weapon_skins");
|
| 1897 | + | |
| 1898 | - | + if (weaponskinIds != null && weaponskinIds.length() > 0) |
| 1898 | + | |
| 1899 | + statement.setString(6, s); | |
| 1900 | - | + for (String s : weaponskinIds.split(","))
|
| 1900 | + | |
| 1901 | + statement.setInt(7, getHairSkinOption()); | |
| 1902 | - | + if (s == null) |
| 1902 | + | |
| 1903 | + if (_faceSkins.isEmpty()) | |
| 1904 | - | + continue; |
| 1904 | + | |
| 1905 | + statement.setString(8, ""); | |
| 1906 | - | + buyWeaponSkin(Integer.parseInt(s)); |
| 1906 | + | |
| 1907 | + else | |
| 1908 | + {
| |
| 1909 | - | + setWeaponSkinOption(rset.getInt("weapon_skin_option"));
|
| 1909 | + | |
| 1910 | + for (int i : _faceSkins) | |
| 1911 | - | + String hairskinIds = rset.getString("hair_skins");
|
| 1911 | + | |
| 1912 | - | + if (hairskinIds != null && hairskinIds.length() > 0) |
| 1912 | + | |
| 1913 | + } | |
| 1914 | - | + for (String s : hairskinIds.split(","))
|
| 1914 | + | |
| 1915 | + } | |
| 1916 | - | + if (s == null) |
| 1916 | + | |
| 1917 | + | |
| 1918 | - | + continue; |
| 1918 | + | |
| 1919 | + {
| |
| 1920 | - | + buyHairSkin(Integer.parseInt(s)); |
| 1920 | + | |
| 1921 | + } | |
| 1922 | + else | |
| 1923 | - | + setHairSkinOption(rset.getInt("hair_skin_option"));
|
| 1923 | + | |
| 1924 | + String s = ""; | |
| 1925 | - | + String faceskinIds = rset.getString("face_skins");
|
| 1925 | + | |
| 1926 | - | + if (faceskinIds != null && faceskinIds.length() > 0) |
| 1926 | + | |
| 1927 | + s += String.valueOf(i) + ","; | |
| 1928 | - | + for (String s : faceskinIds.split(","))
|
| 1928 | + | |
| 1929 | + statement.setString(10, s); | |
| 1930 | - | + if (s == null) |
| 1930 | + | |
| 1931 | + statement.setInt(11, getShieldSkinOption()); | |
| 1932 | - | + continue; |
| 1932 | + | |
| 1933 | + // second part | |
| 1934 | - | + buyFaceSkin(Integer.parseInt(s)); |
| 1934 | + | |
| 1935 | + statement.setInt(10, getObjectId()); | |
| 1936 | + if (_armorSkins.isEmpty()) | |
| 1937 | - | + setFaceSkinOption(rset.getInt("face_skin_option"));
|
| 1937 | + | |
| 1938 | + statement.setString(11, ""); | |
| 1939 | - | + String shieldkinIds = rset.getString("shield_skins");
|
| 1939 | + | |
| 1940 | - | + if (shieldkinIds != null && shieldkinIds.length() > 0) |
| 1940 | + | |
| 1941 | + {
| |
| 1942 | - | + for (String s : shieldkinIds.split(","))
|
| 1942 | + | |
| 1943 | + for (int i : _armorSkins) | |
| 1944 | - | + if (s == null) |
| 1944 | + | |
| 1945 | + s += String.valueOf(i) + ","; | |
| 1946 | - | + continue; |
| 1946 | + | |
| 1947 | + statement.setString(11, s); | |
| 1948 | - | + buyShieldSkin(Integer.parseInt(s)); |
| 1948 | + | |
| 1949 | + statement.setInt(12, getArmorSkinOption()); | |
| 1950 | + | |
| 1951 | - | + setShieldSkinOption(rset.getInt("shield_skin_option"));
|
| 1951 | + | |
| 1952 | + {
| |
| 1953 | + statement.setString(13, ""); | |
| 1954 | + } | |
| 1955 | + else | |
| 1956 | + {
| |
| 1957 | + String s = ""; | |
| 1958 | + for (int i : _weaponSkins) | |
| 1959 | + {
| |
| 1960 | + s += String.valueOf(i) + ","; | |
| 1961 | + } | |
| 1962 | + statement.setString(13, s); | |
| 1963 | + } | |
| 1964 | + statement.setInt(14, getWeaponSkinOption()); | |
| 1965 | + | |
| 1966 | + if (_hairSkins.isEmpty()) | |
| 1967 | + {
| |
| 1968 | + statement.setString(15, ""); | |
| 1969 | + } | |
| 1970 | + else | |
| 1971 | + {
| |
| 1972 | + String s = ""; | |
| 1973 | + for (int i : _hairSkins) | |
| 1974 | + {
| |
| 1975 | + s += String.valueOf(i) + ","; | |
| 1976 | + } | |
| 1977 | + statement.setString(15, s); | |
| 1978 | + } | |
| 1979 | + statement.setInt(16, getHairSkinOption()); | |
| 1980 | + | |
| 1981 | + if (_faceSkins.isEmpty()) | |
| 1982 | + {
| |
| 1983 | + statement.setString(17, ""); | |
| 1984 | + } | |
| 1985 | + else | |
| 1986 | + {
| |
| 1987 | + String s = ""; | |
| 1988 | + for (int i : _faceSkins) | |
| 1989 | + {
| |
| 1990 | + s += String.valueOf(i) + ","; | |
| 1991 | + } | |
| 1992 | + statement.setString(17, s); | |
| 1993 | + } | |
| 1994 | + statement.setInt(18, getFaceSkinOption()); | |
| 1995 | + | |
| 1996 | + if (_shieldSkins.isEmpty()) | |
| 1997 | + {
| |
| 1998 | + statement.setString(19, ""); | |
| 1999 | + } | |
| 2000 | + else | |
| 2001 | + {
| |
| 2002 | + String s = ""; | |
| 2003 | + for (int i : _shieldSkins) | |
| 2004 | + {
| |
| 2005 | + s += String.valueOf(i) + ","; | |
| 2006 | + } | |
| 2007 | + statement.setString(19, s); | |
| 2008 | + } | |
| 2009 | + statement.setInt(20, getShieldSkinOption()); | |
| 2010 | + | |
| 2011 | + statement.execute(); | |
| 2012 | + statement.close(); | |
| 2013 | + } | |
| 2014 | + catch (Exception e) | |
| 2015 | + {
| |
| 2016 | + | |
| 2017 | + LOGGER.warn("Could not store storeDressMeData():");
| |
| 2018 | + e.printStackTrace(); | |
| 2019 | + | |
| 2020 | + } | |
| 2021 | + finally | |
| 2022 | + {
| |
| 2023 | + | |
| 2024 | + } | |
| 2025 | + } | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + @SuppressWarnings("resource")
| |
| 2031 | + private void restoreDressMeData() | |
| 2032 | + {
| |
| 2033 | + | |
| 2034 | + Connection con = null; | |
| 2035 | + try | |
| 2036 | + {
| |
| 2037 | + con = ConnectionPool.getConnection(); | |
| 2038 | + PreparedStatement statement = con.prepareStatement(RESTORE_CHARACTER_DRESSME_DATA); | |
| 2039 | + | |
| 2040 | + statement.setInt(1, getObjectId()); | |
| 2041 | + ResultSet rset = statement.executeQuery(); | |
| 2042 | + | |
| 2043 | + while (rset.next()) | |
| 2044 | + {
| |
| 2045 | + String armorskinIds = rset.getString("armor_skins");
| |
| 2046 | + if (armorskinIds != null && armorskinIds.length() > 0) | |
| 2047 | + {
| |
| 2048 | + for (String s : armorskinIds.split(","))
| |
| 2049 | + {
| |
| 2050 | + if (s == null) | |
| 2051 | + {
| |
| 2052 | + continue; | |
| 2053 | + } | |
| 2054 | + buyArmorSkin(Integer.parseInt(s)); | |
| 2055 | + } | |
| 2056 | + } | |
| 2057 | + setArmorSkinOption(rset.getInt("armor_skin_option"));
| |
| 2058 | + | |
| 2059 | + String weaponskinIds = rset.getString("weapon_skins");
| |
| 2060 | + if (weaponskinIds != null && weaponskinIds.length() > 0) | |
| 2061 | + {
| |
| 2062 | + for (String s : weaponskinIds.split(","))
| |
| 2063 | + {
| |
| 2064 | + if (s == null) | |
| 2065 | + {
| |
| 2066 | + continue; | |
| 2067 | + } | |
| 2068 | + buyWeaponSkin(Integer.parseInt(s)); | |
| 2069 | + } | |
| 2070 | + } | |
| 2071 | + setWeaponSkinOption(rset.getInt("weapon_skin_option"));
| |
| 2072 | + | |
| 2073 | + String hairskinIds = rset.getString("hair_skins");
| |
| 2074 | + if (hairskinIds != null && hairskinIds.length() > 0) | |
| 2075 | + {
| |
| 2076 | + for (String s : hairskinIds.split(","))
| |
| 2077 | + {
| |
| 2078 | + if (s == null) | |
| 2079 | + {
| |
| 2080 | + continue; | |
| 2081 | + } | |
| 2082 | + buyHairSkin(Integer.parseInt(s)); | |
| 2083 | + } | |
| 2084 | + } | |
| 2085 | + setHairSkinOption(rset.getInt("hair_skin_option"));
| |
| 2086 | + | |
| 2087 | + String faceskinIds = rset.getString("face_skins");
| |
| 2088 | + if (faceskinIds != null && faceskinIds.length() > 0) | |
| 2089 | + {
| |
| 2090 | + for (String s : faceskinIds.split(","))
| |
| 2091 | + {
| |
| 2092 | + if (s == null) | |
| 2093 | + {
| |
| 2094 | + continue; | |
| 2095 | + } | |
| 2096 | + buyFaceSkin(Integer.parseInt(s)); | |
| 2097 | + } | |
| 2098 | + } | |
| 2099 | + setFaceSkinOption(rset.getInt("face_skin_option"));
| |
| 2100 | + | |
| 2101 | + String shieldkinIds = rset.getString("shield_skins");
| |
| 2102 | + if (shieldkinIds != null && shieldkinIds.length() > 0) | |
| 2103 | + {
| |
| 2104 | + for (String s : shieldkinIds.split(","))
| |
| 2105 | + {
| |
| 2106 | + if (s == null) | |
| 2107 | + {
| |
| 2108 | + continue; | |
| 2109 | + } | |
| 2110 | + buyShieldSkin(Integer.parseInt(s)); | |
| 2111 | + } | |
| 2112 | + } | |
| 2113 | + setShieldSkinOption(rset.getInt("shield_skin_option"));
| |
| 2114 | + } | |
| 2115 | + | |
| 2116 | + rset.close(); | |
| 2117 | + statement.close(); | |
| 2118 | + } | |
| 2119 | + catch (Exception e) | |
| 2120 | + {
| |
| 2121 | + LOGGER.warn("Could not restore char data:");
| |
| 2122 | + e.printStackTrace(); | |
| 2123 | + } | |
| 2124 | + finally | |
| 2125 | + {
| |
| 2126 | + | |
| 2127 | + } | |
| 2128 | + } | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + // Dress Me | |
| 2141 | + public boolean isTryingSkin() | |
| 2142 | + {
| |
| 2143 | + return isTryingSkin; | |
| 2144 | + } | |
| 2145 | + | |
| 2146 | + public void setIsTryingSkin(boolean b) | |
| 2147 | + {
| |
| 2148 | + isTryingSkin = b; | |
| 2149 | + } | |
| 2150 | + | |
| 2151 | + public boolean isTryingSkinPremium() | |
| 2152 | + {
| |
| 2153 | + return isTryingSkinPremium; | |
| 2154 | + } | |
| 2155 | + | |
| 2156 | + public void setIsTryingSkinPremium(boolean b) | |
| 2157 | + {
| |
| 2158 | + isTryingSkinPremium = b; | |
| 2159 | + } | |
| 2160 | + | |
| 2161 | + public boolean hasArmorSkin(int skin) | |
| 2162 | + {
| |
| 2163 | + return _armorSkins.contains(skin); | |
| 2164 | + } | |
| 2165 | + | |
| 2166 | + public boolean hasWeaponSkin(int skin) | |
| 2167 | + {
| |
| 2168 | + return _weaponSkins.contains(skin); | |
| 2169 | + } | |
| 2170 | + | |
| 2171 | + public boolean hasHairSkin(int skin) | |
| 2172 | + {
| |
| 2173 | + return _hairSkins.contains(skin); | |
| 2174 | + } | |
| 2175 | + | |
| 2176 | + public boolean hasFaceSkin(int skin) | |
| 2177 | + {
| |
| 2178 | + return _faceSkins.contains(skin); | |
| 2179 | + } | |
| 2180 | + | |
| 2181 | + public boolean hasShieldSkin(int skin) | |
| 2182 | + {
| |
| 2183 | + return _shieldSkins.contains(skin); | |
| 2184 | + } | |
| 2185 | + | |
| 2186 | + public boolean hasEquippedArmorSkin(String skin) | |
| 2187 | + {
| |
| 2188 | + return String.valueOf(_armorSkinOption).contains(String.valueOf(skin)); | |
| 2189 | + } | |
| 2190 | + | |
| 2191 | + public boolean hasEquippedWeaponSkin(String skin) | |
| 2192 | + {
| |
| 2193 | + return String.valueOf(_weaponSkinOption).contains(String.valueOf(skin)); | |
| 2194 | + } | |
| 2195 | + | |
| 2196 | + public boolean hasEquippedHairSkin(String skin) | |
| 2197 | + {
| |
| 2198 | + return String.valueOf(_hairSkinOption).contains(String.valueOf(skin)); | |
| 2199 | + } | |
| 2200 | + | |
| 2201 | + public boolean hasEquippedFaceSkin(String skin) | |
| 2202 | + {
| |
| 2203 | + return String.valueOf(_faceSkinOption).contains(String.valueOf(skin)); | |
| 2204 | + } | |
| 2205 | + | |
| 2206 | + public boolean hasEquippedShieldSkin(String skin) | |
| 2207 | + {
| |
| 2208 | + return String.valueOf(_shieldSkinOption).contains(String.valueOf(skin)); | |
| 2209 | + } | |
| 2210 | + | |
| 2211 | + public void buyArmorSkin(int id) | |
| 2212 | + {
| |
| 2213 | + if (!_armorSkins.contains(id)) | |
| 2214 | + {
| |
| 2215 | + _armorSkins.add(id); | |
| 2216 | + } | |
| 2217 | + } | |
| 2218 | + | |
| 2219 | + public void buyWeaponSkin(int id) | |
| 2220 | + {
| |
| 2221 | + if (!_weaponSkins.contains(id)) | |
| 2222 | + {
| |
| 2223 | + _weaponSkins.add(id); | |
| 2224 | + } | |
| 2225 | + } | |
| 2226 | + | |
| 2227 | + public void buyHairSkin(int id) | |
| 2228 | + {
| |
| 2229 | + if (!_hairSkins.contains(id)) | |
| 2230 | + {
| |
| 2231 | + _hairSkins.add(id); | |
| 2232 | + } | |
| 2233 | + } | |
| 2234 | + | |
| 2235 | + public void buyFaceSkin(int id) | |
| 2236 | + {
| |
| 2237 | + if (!_faceSkins.contains(id)) | |
| 2238 | + {
| |
| 2239 | + _faceSkins.add(id); | |
| 2240 | + } | |
| 2241 | + } | |
| 2242 | + | |
| 2243 | + public void buyShieldSkin(int id) | |
| 2244 | + {
| |
| 2245 | + if (!_shieldSkins.contains(id)) | |
| 2246 | + {
| |
| 2247 | + _shieldSkins.add(id); | |
| 2248 | + } | |
| 2249 | + } | |
| 2250 | + | |
| 2251 | + public void setArmorSkinOption(int armorSkinOption) | |
| 2252 | + {
| |
| 2253 | + _armorSkinOption = armorSkinOption; | |
| 2254 | + } | |
| 2255 | + | |
| 2256 | + public int getArmorSkinOption() | |
| 2257 | + {
| |
| 2258 | + return _armorSkinOption; | |
| 2259 | + } | |
| 2260 | + | |
| 2261 | + public void setWeaponSkinOption(int weaponSkinOption) | |
| 2262 | + {
| |
| 2263 | + _weaponSkinOption = weaponSkinOption; | |
| 2264 | + } | |
| 2265 | + | |
| 2266 | + public int getWeaponSkinOption() | |
| 2267 | + {
| |
| 2268 | + return _weaponSkinOption; | |
| 2269 | + } | |
| 2270 | + | |
| 2271 | + public void setHairSkinOption(int hairSkinOption) | |
| 2272 | + {
| |
| 2273 | + _hairSkinOption = hairSkinOption; | |
| 2274 | + } | |
| 2275 | + | |
| 2276 | + public int getHairSkinOption() | |
| 2277 | - | index 882ab73..dcabe3f 100644 |
| 2277 | + | |
| 2278 | + return _hairSkinOption; | |
| 2279 | + } | |
| 2280 | + | |
| 2281 | + public void setFaceSkinOption(int faceSkinOption) | |
| 2282 | + {
| |
| 2283 | + _faceSkinOption = faceSkinOption; | |
| 2284 | + } | |
| 2285 | + | |
| 2286 | + public int getFaceSkinOption() | |
| 2287 | + {
| |
| 2288 | + return _faceSkinOption; | |
| 2289 | + } | |
| 2290 | + | |
| 2291 | + public void setShieldSkinOption(int shieldSkinOption) | |
| 2292 | + {
| |
| 2293 | + _shieldSkinOption = shieldSkinOption; | |
| 2294 | + } | |
| 2295 | + | |
| 2296 | + public int getShieldSkinOption() | |
| 2297 | + {
| |
| 2298 | + return _shieldSkinOption; | |
| 2299 | + } | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | } | |
| 2309 | \ No newline at end of file | |
| 2310 | diff --git java/net/sf/l2j/gameserver/model/item/kind/Item.java java/net/sf/l2j/gameserver/model/item/kind/Item.java | |
| 2311 | index a461fe2..9c641b1 100644 | |
| 2312 | --- java/net/sf/l2j/gameserver/model/item/kind/Item.java | |
| 2313 | +++ java/net/sf/l2j/gameserver/model/item/kind/Item.java | |
| 2314 | @@ -1,5 +1,8 @@ | |
| 2315 | package net.sf.l2j.gameserver.model.item.kind; | |
| 2316 | ||
| 2317 | +import java.sql.Connection; | |
| 2318 | +import java.sql.PreparedStatement; | |
| 2319 | +import java.sql.ResultSet; | |
| 2320 | import java.util.ArrayList; | |
| 2321 | import java.util.Collections; | |
| 2322 | import java.util.HashMap; | |
| 2323 | @@ -7,7 +10,9 @@ | |
| 2324 | import java.util.Map; | |
| 2325 | ||
| 2326 | import net.sf.l2j.commons.data.StatSet; | |
| 2327 | - | @@ -72,6 +92,436 @@ |
| 2327 | + | |
| 2328 | - | |
| 2328 | + | |
| 2329 | - | ach.useAdminCommand(_command, player); |
| 2329 | + | |
| 2330 | import net.sf.l2j.gameserver.enums.items.ActionType; | |
| 2331 | import net.sf.l2j.gameserver.enums.items.ArmorType; | |
| 2332 | import net.sf.l2j.gameserver.enums.items.CrystalType; | |
| 2333 | @@ -21,6 +26,7 @@ | |
| 2334 | import net.sf.l2j.gameserver.model.actor.Summon; | |
| 2335 | import net.sf.l2j.gameserver.model.holder.IntIntHolder; | |
| 2336 | - | + else if (_command.startsWith("voiced_"))
|
| 2336 | + | |
| 2337 | - | + {
|
| 2337 | + | |
| 2338 | - | + String command = _command.split(" ")[0];
|
| 2338 | + | |
| 2339 | import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; | |
| 2340 | - | + IVoicedCommandHandler ach = VoicedCommandHandler.getInstance().getHandler(_command.substring(7)); |
| 2340 | + | |
| 2341 | @@ -33,6 +39,10 @@ | |
| 2342 | - | + if (ach == null) |
| 2342 | + | |
| 2343 | - | + {
|
| 2343 | + | |
| 2344 | - | + player.sendMessage("The command " + command.substring(7) + " does not exist!");
|
| 2344 | + | |
| 2345 | - | + LOGGER.warn("No handler registered for command '" + _command + "'");
|
| 2345 | + | |
| 2346 | - | + return; |
| 2346 | + | |
| 2347 | - | + } |
| 2347 | + | |
| 2348 | - | + ach.useVoicedCommand(_command.substring(7), player, null); |
| 2348 | + | |
| 2349 | - | + } |
| 2349 | + | |
| 2350 | {
| |
| 2351 | SLOTS.put("chest", SLOT_CHEST);
| |
| 2352 | @@ -543,4 +553,90 @@ | |
| 2353 | {
| |
| 2354 | - | +else if (_command.startsWith("custom_"))
|
| 2354 | + | |
| 2355 | } | |
| 2356 | - | +Player player2 = getClient().getPlayer(); |
| 2356 | + | |
| 2357 | - | +CustomBypassHandler.getInstance().handleBypass(player2, _command); |
| 2357 | + | |
| 2358 | + | |
| 2359 | + public static String getItemIcon(int itemId) | |
| 2360 | + {
| |
| 2361 | - | +else if (_command.startsWith("dressme"))
|
| 2361 | + | |
| 2362 | + {
| |
| 2363 | - | +if (!Config.ALLOW_DRESS_ME_IN_OLY && player.isInOlympiadMode()) |
| 2363 | + | |
| 2364 | + } | |
| 2365 | - | + player.sendMessage("DressMe can't be used on The Olympiad game.");
|
| 2365 | + | |
| 2366 | - | + return; |
| 2366 | + | |
| 2367 | + | |
| 2368 | + public static void LoadAllIcons() | |
| 2369 | - | +StringTokenizer st = new StringTokenizer(_command, " "); |
| 2369 | + | |
| 2370 | - | +st.nextToken(); |
| 2370 | + | |
| 2371 | - | +if (!st.hasMoreTokens()) |
| 2371 | + | |
| 2372 | + | |
| 2373 | - | + showDressMeMainPage(player); |
| 2373 | + | |
| 2374 | - | + return; |
| 2374 | + | |
| 2375 | + public static String getItemNameById(int itemId) | |
| 2376 | - | +int page = Integer.parseInt(st.nextToken()); |
| 2376 | + | |
| 2377 | + Item item = ItemData.getInstance().getTemplate(itemId); | |
| 2378 | - | +if (!st.hasMoreTokens()) |
| 2378 | + | |
| 2379 | + String itemName = "NoName"; | |
| 2380 | - | + showDressMeMainPage(player); |
| 2380 | + | |
| 2381 | - | + return; |
| 2381 | + | |
| 2382 | + {
| |
| 2383 | - | +String next = st.nextToken(); |
| 2383 | + | |
| 2384 | - | +if (next.startsWith("skinlist"))
|
| 2384 | + | |
| 2385 | + | |
| 2386 | - | + String type = st.nextToken(); |
| 2386 | + | |
| 2387 | - | + showSkinList(player, type, page); |
| 2387 | + | |
| 2388 | + | |
| 2389 | - | +else if (next.startsWith("myskinlist"))
|
| 2389 | + | |
| 2390 | + | |
| 2391 | - | + |
| 2391 | + | |
| 2392 | - | + showMySkinList(player, page); |
| 2392 | + | |
| 2393 | + /** | |
| 2394 | - | +if (next.equals("clean"))
|
| 2394 | + | |
| 2395 | + */ | |
| 2396 | - | + String type = st.nextToken(); |
| 2396 | + | |
| 2397 | - | + |
| 2397 | + | |
| 2398 | - | + if (player.isTryingSkin()) |
| 2398 | + | |
| 2399 | - | + {
|
| 2399 | + | |
| 2400 | - | + player.sendMessage("You can't do this while trying a skin.");
|
| 2400 | + | |
| 2401 | - | + player.sendPacket(new ExShowScreenMessage("You can't do this while trying a skin.", 2000));
|
| 2401 | + | |
| 2402 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2402 | + | |
| 2403 | - | + showDressMeMainPage(player); |
| 2403 | + | |
| 2404 | - | + return; |
| 2404 | + | |
| 2405 | - | + } |
| 2405 | + | |
| 2406 | - | + |
| 2406 | + | |
| 2407 | - | + switch (type.toLowerCase()) |
| 2407 | + | |
| 2408 | - | + {
|
| 2408 | + | |
| 2409 | - | + case "armor": |
| 2409 | + | |
| 2410 | - | + player.setArmorSkinOption(0); |
| 2410 | + | |
| 2411 | - | + break; |
| 2411 | + | |
| 2412 | - | + case "weapon": |
| 2412 | + | |
| 2413 | - | + player.setWeaponSkinOption(0); |
| 2413 | + | |
| 2414 | - | + break; |
| 2414 | + | |
| 2415 | - | + case "hair": |
| 2415 | + | |
| 2416 | - | + player.setHairSkinOption(0); |
| 2416 | + | |
| 2417 | - | + break; |
| 2417 | + | |
| 2418 | - | + case "face": |
| 2418 | + | |
| 2419 | - | + player.setFaceSkinOption(0); |
| 2419 | + | |
| 2420 | - | + break; |
| 2420 | + | |
| 2421 | - | + case "shield": |
| 2421 | + | |
| 2422 | - | + player.setShieldSkinOption(0); |
| 2422 | + | |
| 2423 | - | + break; |
| 2423 | + | |
| 2424 | - | + } |
| 2424 | + | |
| 2425 | - | + |
| 2425 | + | |
| 2426 | - | + player.broadcastUserInfo(); |
| 2426 | + | |
| 2427 | - | + showMySkinList(player, page); |
| 2427 | + | |
| 2428 | + } | |
| 2429 | - | +else if (next.startsWith("buyskin"))
|
| 2429 | + | |
| 2430 | + {
| |
| 2431 | - | + if (!st.hasMoreTokens()) |
| 2431 | + | |
| 2432 | - | + {
|
| 2432 | + | |
| 2433 | - | + showDressMeMainPage(player); |
| 2433 | + | |
| 2434 | - | + return; |
| 2434 | + | |
| 2435 | - | + } |
| 2435 | + | |
| 2436 | - | + |
| 2436 | + | |
| 2437 | - | + int skinId = Integer.parseInt(st.nextToken()); |
| 2437 | + | |
| 2438 | - | + String type = st.nextToken(); |
| 2438 | + | |
| 2439 | - | + int itemId = Integer.parseInt(st.nextToken()); |
| 2439 | + | |
| 2440 | - | + |
| 2440 | + | |
| 2441 | - | + SkinPackage sp = null; |
| 2441 | + | |
| 2442 | - | + |
| 2442 | + | |
| 2443 | - | + switch (type.toLowerCase()) |
| 2443 | + | |
| 2444 | - | + {
|
| 2444 | + | |
| 2445 | - | + case "armor": |
| 2445 | + | index 882ab73..96dfa9a 100644 |
| 2446 | - | + sp = DressMeData.getInstance().getArmorSkinsPackage(skinId); |
| 2446 | + | |
| 2447 | - | + break; |
| 2447 | + | |
| 2448 | - | + case "weapon": |
| 2448 | + | |
| 2449 | - | + sp = DressMeData.getInstance().getWeaponSkinsPackage(skinId); |
| 2449 | + | |
| 2450 | - | + |
| 2450 | + | |
| 2451 | - | + if (player.getActiveWeaponItem() == null) |
| 2451 | + | |
| 2452 | - | + {
|
| 2452 | + | |
| 2453 | - | + player.sendMessage("You can't buy this skin without a weapon.");
|
| 2453 | + | |
| 2454 | - | + player.sendPacket(new ExShowScreenMessage("You can't buy this skin without a weapon.", 2000));
|
| 2454 | + | |
| 2455 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2455 | + | |
| 2456 | - | + showSkinList(player, type, page); |
| 2456 | + | |
| 2457 | - | + return; |
| 2457 | + | |
| 2458 | - | + } |
| 2458 | + | |
| 2459 | - | + |
| 2459 | + | |
| 2460 | - | + ItemInstance skinWeapon = null; |
| 2460 | + | |
| 2461 | - | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2461 | + | |
| 2462 | - | + {
|
| 2462 | + | |
| 2463 | - | + skinWeapon = ItemData.getInstance().createDummyItem(itemId); |
| 2463 | + | |
| 2464 | - | + |
| 2464 | + | |
| 2465 | - | + if (!checkWeapons(player, skinWeapon, WeaponType.BOW, WeaponType.BOW) // |
| 2465 | + | |
| 2466 | - | + || !checkWeapons(player, skinWeapon, WeaponType.SWORD, WeaponType.SWORD) // |
| 2466 | + | |
| 2467 | - | + || !checkWeapons(player, skinWeapon, WeaponType.BLUNT, WeaponType.BLUNT) // |
| 2467 | + | |
| 2468 | - | + || !checkWeapons(player, skinWeapon, WeaponType.DAGGER, WeaponType.DAGGER) // |
| 2468 | + | |
| 2469 | - | + || !checkWeapons(player, skinWeapon, WeaponType.POLE, WeaponType.POLE) // |
| 2469 | + | |
| 2470 | - | + || !checkWeapons(player, skinWeapon, WeaponType.DUAL, WeaponType.DUAL) // |
| 2470 | + | |
| 2471 | - | + || !checkWeapons(player, skinWeapon, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2471 | + | |
| 2472 | - | + || !checkWeapons(player, skinWeapon, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2472 | + | |
| 2473 | - | + || !checkWeapons(player, skinWeapon, WeaponType.FIST, WeaponType.FIST) // |
| 2473 | + | |
| 2474 | - | + || !checkWeapons(player, skinWeapon, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2474 | + | |
| 2475 | - | + {
|
| 2475 | + | |
| 2476 | - | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2476 | + | |
| 2477 | - | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2477 | + | |
| 2478 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2478 | + | |
| 2479 | - | + showSkinList(player, type, page); |
| 2479 | + | |
| 2480 | - | + return; |
| 2480 | + | |
| 2481 | - | + } |
| 2481 | + | |
| 2482 | - | + } |
| 2482 | + | |
| 2483 | - | + break; |
| 2483 | + | |
| 2484 | - | + case "hair": |
| 2484 | + | |
| 2485 | - | + sp = DressMeData.getInstance().getHairSkinsPackage(skinId); |
| 2485 | + | |
| 2486 | - | + break; |
| 2486 | + | |
| 2487 | - | + case "face": |
| 2487 | + | |
| 2488 | - | + sp = DressMeData.getInstance().getFaceSkinsPackage(skinId); |
| 2488 | + | |
| 2489 | - | + break; |
| 2489 | + | |
| 2490 | - | + case "shield": |
| 2490 | + | |
| 2491 | - | + sp = DressMeData.getInstance().getShieldSkinsPackage(skinId); |
| 2491 | + | |
| 2492 | - | + if (player.getActiveWeaponItem() == null) |
| 2492 | + | |
| 2493 | - | + {
|
| 2493 | + | |
| 2494 | - | + player.sendMessage("You can't buy this skin without a weapon.");
|
| 2494 | + | |
| 2495 | - | + player.sendPacket(new ExShowScreenMessage("You can't buy this skin without a weapon.", 2000));
|
| 2495 | + | @@ -98,6 +118,433 @@ |
| 2496 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2496 | + | html.disableValidation(); |
| 2497 | - | + showSkinList(player, type, page); |
| 2497 | + | player.sendPacket(html); |
| 2498 | - | + return; |
| 2498 | + | |
| 2499 | - | + } |
| 2499 | + | |
| 2500 | - | + |
| 2500 | + | + else if (_command.startsWith("voiced_"))
|
| 2501 | - | + ItemInstance skinShield = null; |
| 2501 | + | |
| 2502 | - | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2502 | + | + String command = _command.split(" ")[0];
|
| 2503 | - | + {
|
| 2503 | + | |
| 2504 | - | + skinShield = ItemData.getInstance().createDummyItem(itemId); |
| 2504 | + | + IVoicedCommandHandler ach = VoicedCommandHandler.getInstance().getHandler(_command.substring(7)); |
| 2505 | - | + |
| 2505 | + | |
| 2506 | - | + if (!checkWeapons(player, skinShield, WeaponType.BOW, WeaponType.BOW) // |
| 2506 | + | + if (ach == null) |
| 2507 | - | + || !checkWeapons(player, skinShield, WeaponType.POLE, WeaponType.POLE) // |
| 2507 | + | |
| 2508 | - | + || !checkWeapons(player, skinShield, WeaponType.DUAL, WeaponType.DUAL) // |
| 2508 | + | + player.sendMessage("The command " + command.substring(7) + " does not exist!");
|
| 2509 | - | + || !checkWeapons(player, skinShield, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2509 | + | + LOGGER.warn("No handler registered for command '" + _command + "'");
|
| 2510 | - | + || !checkWeapons(player, skinShield, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2510 | + | + return; |
| 2511 | - | + || !checkWeapons(player, skinShield, WeaponType.FIST, WeaponType.FIST) // |
| 2511 | + | |
| 2512 | - | + || !checkWeapons(player, skinShield, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2512 | + | + ach.useVoicedCommand(_command.substring(7), player, null); |
| 2513 | - | + {
|
| 2513 | + | |
| 2514 | - | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2514 | + | |
| 2515 | - | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2515 | + | |
| 2516 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2516 | + | |
| 2517 | - | + showSkinList(player, type, page); |
| 2517 | + | |
| 2518 | - | + return; |
| 2518 | + | + else if (_command.startsWith("custom_"))
|
| 2519 | - | + } |
| 2519 | + | |
| 2520 | - | + } |
| 2520 | + | + Player player2 = getClient().getPlayer(); |
| 2521 | - | + break; |
| 2521 | + | + CustomBypassHandler.getInstance().handleBypass(player2, _command); |
| 2522 | - | + } |
| 2522 | + | |
| 2523 | - | + |
| 2523 | + | |
| 2524 | - | + if (sp == null) |
| 2524 | + | |
| 2525 | - | + {
|
| 2525 | + | + else if (_command.startsWith("dressme"))
|
| 2526 | - | + player.sendMessage("There is no such skin.");
|
| 2526 | + | |
| 2527 | - | + player.sendPacket(new ExShowScreenMessage("There is no such skin.", 2000));
|
| 2527 | + | + if (!Config.ALLOW_DRESS_ME_IN_OLY && player.isInOlympiadMode()) |
| 2528 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2528 | + | |
| 2529 | - | + showSkinList(player, type, page); |
| 2529 | + | + player.sendMessage("DressMe can't be used on The Olympiad game.");
|
| 2530 | - | + return; |
| 2530 | + | + return; |
| 2531 | - | + } |
| 2531 | + | |
| 2532 | - | + |
| 2532 | + | |
| 2533 | - | + |
| 2533 | + | + StringTokenizer st = new StringTokenizer(_command, " "); |
| 2534 | - | + if (player.destroyItemByItemId("dressme", sp.getPriceId(), sp.getPriceCount(), player, true))
|
| 2534 | + | + st.nextToken(); |
| 2535 | - | + {
|
| 2535 | + | + if (!st.hasMoreTokens()) |
| 2536 | - | + player.sendMessage("You have successfully purchased " + sp.getName() + " skin.");
|
| 2536 | + | |
| 2537 | - | + player.sendPacket(new ExShowScreenMessage("You have successfully purchased " + sp.getName() + " skin.", 2000));
|
| 2537 | + | + showDressMeMainPage(player); |
| 2538 | - | + |
| 2538 | + | + return; |
| 2539 | - | + switch (type.toLowerCase()) |
| 2539 | + | |
| 2540 | - | + {
|
| 2540 | + | + int page = Integer.parseInt(st.nextToken()); |
| 2541 | - | + case "armor": |
| 2541 | + | |
| 2542 | - | + player.buyArmorSkin(skinId); |
| 2542 | + | + if (!st.hasMoreTokens()) |
| 2543 | - | + player.setArmorSkinOption(skinId); |
| 2543 | + | |
| 2544 | - | + break; |
| 2544 | + | + showDressMeMainPage(player); |
| 2545 | - | + case "weapon": |
| 2545 | + | + return; |
| 2546 | - | + player.buyWeaponSkin(skinId); |
| 2546 | + | |
| 2547 | - | + player.setWeaponSkinOption(skinId); |
| 2547 | + | + String next = st.nextToken(); |
| 2548 | - | + break; |
| 2548 | + | + if (next.startsWith("skinlist"))
|
| 2549 | - | + case "hair": |
| 2549 | + | |
| 2550 | - | + player.buyHairSkin(skinId); |
| 2550 | + | + String type = st.nextToken(); |
| 2551 | - | + player.setHairSkinOption(skinId); |
| 2551 | + | + showSkinList(player, type, page); |
| 2552 | - | + break; |
| 2552 | + | |
| 2553 | - | + case "face": |
| 2553 | + | + else if (next.startsWith("myskinlist"))
|
| 2554 | - | + player.buyFaceSkin(skinId); |
| 2554 | + | |
| 2555 | - | + player.setFaceSkinOption(skinId); |
| 2555 | + | |
| 2556 | - | + break; |
| 2556 | + | + showMySkinList(player, page); |
| 2557 | - | + case "shield": |
| 2557 | + | |
| 2558 | - | + player.buyShieldSkin(skinId); |
| 2558 | + | + if (next.equals("clean"))
|
| 2559 | - | + player.setShieldSkinOption(skinId); |
| 2559 | + | |
| 2560 | - | + break; |
| 2560 | + | + String type = st.nextToken(); |
| 2561 | - | + } |
| 2561 | + | |
| 2562 | - | + |
| 2562 | + | + if (player.isTryingSkin()) |
| 2563 | - | + player.broadcastUserInfo(); |
| 2563 | + | |
| 2564 | - | + } |
| 2564 | + | + player.sendMessage("You can't do this while trying a skin.");
|
| 2565 | - | + showSkinList(player, type, page); |
| 2565 | + | + player.sendPacket(new ExShowScreenMessage("You can't do this while trying a skin.", 2000));
|
| 2566 | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
| |
| 2567 | - | +else if (next.startsWith("tryskin"))
|
| 2567 | + | + showDressMeMainPage(player); |
| 2568 | + return; | |
| 2569 | - | + |
| 2569 | + | |
| 2570 | - | + int skinId = Integer.parseInt(st.nextToken()); |
| 2570 | + | |
| 2571 | - | + |
| 2571 | + | + switch (type.toLowerCase()) |
| 2572 | - | + String type = st.nextToken(); |
| 2572 | + | |
| 2573 | - | + |
| 2573 | + | + case "armor": |
| 2574 | - | + if (player.isTryingSkin()) |
| 2574 | + | + player.setArmorSkinOption(0); |
| 2575 | - | + {
|
| 2575 | + | + break; |
| 2576 | - | + player.sendMessage("You are already trying a skin.");
|
| 2576 | + | + case "weapon": |
| 2577 | - | + player.sendPacket(new ExShowScreenMessage("You are already trying a skin.", 2000));
|
| 2577 | + | + player.setWeaponSkinOption(0); |
| 2578 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2578 | + | + break; |
| 2579 | - | + showSkinList(player, type, page); |
| 2579 | + | + case "hair": |
| 2580 | - | + return; |
| 2580 | + | + player.setHairSkinOption(0); |
| 2581 | - | + } |
| 2581 | + | + break; |
| 2582 | - | + |
| 2582 | + | + case "face": |
| 2583 | - | + player.setIsTryingSkin(true); |
| 2583 | + | + player.setFaceSkinOption(0); |
| 2584 | - | + |
| 2584 | + | + break; |
| 2585 | - | + int oldArmorSkinId = player.getArmorSkinOption(); |
| 2585 | + | + case "shield": |
| 2586 | - | + int oldWeaponSkinId = player.getWeaponSkinOption(); |
| 2586 | + | + player.setShieldSkinOption(0); |
| 2587 | - | + int oldHairSkinId = player.getHairSkinOption(); |
| 2587 | + | + break; |
| 2588 | - | + int oldFaceSkinId = player.getFaceSkinOption(); |
| 2588 | + | |
| 2589 | - | + int oldShieldSkinId = player.getShieldSkinOption(); |
| 2589 | + | |
| 2590 | - | + |
| 2590 | + | + player.broadcastUserInfo(); |
| 2591 | - | + switch (type.toLowerCase()) |
| 2591 | + | + showMySkinList(player, page); |
| 2592 | - | + {
|
| 2592 | + | |
| 2593 | - | + case "armor": |
| 2593 | + | + else if (next.startsWith("buyskin"))
|
| 2594 | - | + player.setArmorSkinOption(skinId); |
| 2594 | + | |
| 2595 | - | + break; |
| 2595 | + | + if (!st.hasMoreTokens()) |
| 2596 | - | + case "weapon": |
| 2596 | + | |
| 2597 | - | + player.setWeaponSkinOption(skinId); |
| 2597 | + | + showDressMeMainPage(player); |
| 2598 | - | + break; |
| 2598 | + | + return; |
| 2599 | - | + case "hair": |
| 2599 | + | |
| 2600 | - | + player.setHairSkinOption(skinId); |
| 2600 | + | |
| 2601 | - | + break; |
| 2601 | + | + int skinId = Integer.parseInt(st.nextToken()); |
| 2602 | - | + case "face": |
| 2602 | + | + String type = st.nextToken(); |
| 2603 | - | + player.setFaceSkinOption(skinId); |
| 2603 | + | + int itemId = Integer.parseInt(st.nextToken()); |
| 2604 | - | + break; |
| 2604 | + | |
| 2605 | - | + case "shield": |
| 2605 | + | + SkinPackage sp = null; |
| 2606 | - | + |
| 2606 | + | |
| 2607 | - | + player.setShieldSkinOption(skinId); |
| 2607 | + | + switch (type.toLowerCase()) |
| 2608 | - | + |
| 2608 | + | |
| 2609 | - | + break; |
| 2609 | + | + case "armor": |
| 2610 | - | + } |
| 2610 | + | + sp = DressMeData.getInstance().getArmorSkinsPackage(skinId); |
| 2611 | - | + |
| 2611 | + | + break; |
| 2612 | - | + player.broadcastUserInfo(); |
| 2612 | + | + case "weapon": |
| 2613 | - | + showSkinList(player, type, page); |
| 2613 | + | + sp = DressMeData.getInstance().getWeaponSkinsPackage(skinId); |
| 2614 | - | + |
| 2614 | + | |
| 2615 | - | + ThreadPool.schedule(() -> |
| 2615 | + | + if (player.getActiveWeaponItem() == null) |
| 2616 | - | + {
|
| 2616 | + | |
| 2617 | - | + switch (type.toLowerCase()) |
| 2617 | + | + player.sendMessage("You can't buy this skin without a weapon.");
|
| 2618 | - | + {
|
| 2618 | + | + player.sendPacket(new ExShowScreenMessage("You can't buy this skin without a weapon.", 2000));
|
| 2619 | - | + case "armor": |
| 2619 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2620 | - | + player.setArmorSkinOption(oldArmorSkinId); |
| 2620 | + | + showSkinList(player, type, page); |
| 2621 | - | + break; |
| 2621 | + | + return; |
| 2622 | - | + case "weapon": |
| 2622 | + | |
| 2623 | - | + player.setWeaponSkinOption(oldWeaponSkinId); |
| 2623 | + | |
| 2624 | - | + break; |
| 2624 | + | + ItemInstance skinWeapon = null; |
| 2625 | - | + case "hair": |
| 2625 | + | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2626 | - | + player.setHairSkinOption(oldHairSkinId); |
| 2626 | + | |
| 2627 | - | + break; |
| 2627 | + | + skinWeapon = ItemData.getInstance().createDummyItem(itemId); |
| 2628 | - | + case "face": |
| 2628 | + | + |
| 2629 | - | + player.setFaceSkinOption(oldFaceSkinId); |
| 2629 | + | + if (!checkWeapons(player, skinWeapon, WeaponType.BOW, WeaponType.BOW) // |
| 2630 | - | + break; |
| 2630 | + | + || !checkWeapons(player, skinWeapon, WeaponType.SWORD, WeaponType.SWORD) // |
| 2631 | - | + case "shield": |
| 2631 | + | + || !checkWeapons(player, skinWeapon, WeaponType.BLUNT, WeaponType.BLUNT) // |
| 2632 | - | + player.setShieldSkinOption(oldShieldSkinId); |
| 2632 | + | + || !checkWeapons(player, skinWeapon, WeaponType.DAGGER, WeaponType.DAGGER) // |
| 2633 | - | + break; |
| 2633 | + | + || !checkWeapons(player, skinWeapon, WeaponType.POLE, WeaponType.POLE) // |
| 2634 | - | + } |
| 2634 | + | + || !checkWeapons(player, skinWeapon, WeaponType.DUAL, WeaponType.DUAL) // |
| 2635 | - | + |
| 2635 | + | + || !checkWeapons(player, skinWeapon, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2636 | - | + player.broadcastUserInfo(); |
| 2636 | + | + || !checkWeapons(player, skinWeapon, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2637 | - | + player.setIsTryingSkin(false); |
| 2637 | + | + || !checkWeapons(player, skinWeapon, WeaponType.FIST, WeaponType.FIST) // |
| 2638 | - | + }, 5000); |
| 2638 | + | + || !checkWeapons(player, skinWeapon, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2639 | + {
| |
| 2640 | - | +else if (next.startsWith("setskin"))
|
| 2640 | + | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2641 | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
| |
| 2642 | - | + int id = Integer.parseInt(st.nextToken()); |
| 2642 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2643 | - | + String type = st.nextToken(); |
| 2643 | + | + showSkinList(player, type, page); |
| 2644 | - | + int itemId = Integer.parseInt(st.nextToken()); |
| 2644 | + | + return; |
| 2645 | - | + |
| 2645 | + | |
| 2646 | - | + if (player.isTryingSkin()) |
| 2646 | + | |
| 2647 | - | + {
|
| 2647 | + | + break; |
| 2648 | - | + player.sendMessage("You can't do this while trying skins.");
|
| 2648 | + | + case "hair": |
| 2649 | - | + player.sendPacket(new ExShowScreenMessage("You can't do this while trying skins.", 2000));
|
| 2649 | + | + sp = DressMeData.getInstance().getHairSkinsPackage(skinId); |
| 2650 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2650 | + | + break; |
| 2651 | - | + showMySkinList(player, page); |
| 2651 | + | + case "face": |
| 2652 | - | + return; |
| 2652 | + | + sp = DressMeData.getInstance().getFaceSkinsPackage(skinId); |
| 2653 | - | + } |
| 2653 | + | + break; |
| 2654 | - | + |
| 2654 | + | + case "shield": |
| 2655 | - | + if (type.toLowerCase().contains("armor") && player.hasEquippedArmorSkin(String.valueOf(id)) || type.toLowerCase().contains("weapon") && player.hasEquippedWeaponSkin(String.valueOf(id))
|
| 2655 | + | + sp = DressMeData.getInstance().getShieldSkinsPackage(skinId); |
| 2656 | - | + || type.toLowerCase().contains("hair") && player.hasEquippedHairSkin(String.valueOf(id)) || type.toLowerCase().contains("face") && player.hasEquippedFaceSkin(String.valueOf(id)))
|
| 2656 | + | + if (player.getActiveWeaponItem() == null) |
| 2657 | - | + {
|
| 2657 | + | |
| 2658 | - | + player.sendMessage("You are already equipped this skin.");
|
| 2658 | + | + player.sendMessage("You can't buy this skin without a weapon.");
|
| 2659 | - | + player.sendPacket(new ExShowScreenMessage("You are already equipped this skin.", 2000));
|
| 2659 | + | + player.sendPacket(new ExShowScreenMessage("You can't buy this skin without a weapon.", 2000));
|
| 2660 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2660 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2661 | - | + showMySkinList(player, page); |
| 2661 | + | + showSkinList(player, type, page); |
| 2662 | - | + return; |
| 2662 | + | + return; |
| 2663 | - | + } |
| 2663 | + | |
| 2664 | - | + |
| 2664 | + | |
| 2665 | - | + switch (type.toLowerCase()) |
| 2665 | + | + ItemInstance skinShield = null; |
| 2666 | - | + {
|
| 2666 | + | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2667 | - | + case "armor": |
| 2667 | + | |
| 2668 | - | + player.setArmorSkinOption(id); |
| 2668 | + | + skinShield = ItemData.getInstance().createDummyItem(itemId); |
| 2669 | - | + break; |
| 2669 | + | + |
| 2670 | - | + case "weapon": |
| 2670 | + | + if (!checkWeapons(player, skinShield, WeaponType.BOW, WeaponType.BOW) // |
| 2671 | - | + if (player.getActiveWeaponItem() == null) |
| 2671 | + | + || !checkWeapons(player, skinShield, WeaponType.POLE, WeaponType.POLE) // |
| 2672 | - | + {
|
| 2672 | + | + || !checkWeapons(player, skinShield, WeaponType.DUAL, WeaponType.DUAL) // |
| 2673 | - | + player.sendMessage("You can't use this skin without a weapon.");
|
| 2673 | + | + || !checkWeapons(player, skinShield, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2674 | - | + player.sendPacket(new ExShowScreenMessage("You can't use this skin without a weapon.", 2000));
|
| 2674 | + | + || !checkWeapons(player, skinShield, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2675 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2675 | + | + || !checkWeapons(player, skinShield, WeaponType.FIST, WeaponType.FIST) // |
| 2676 | - | + showMySkinList(player, page); |
| 2676 | + | + || !checkWeapons(player, skinShield, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2677 | - | + return; |
| 2677 | + | |
| 2678 | - | + } |
| 2678 | + | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2679 | - | + |
| 2679 | + | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2680 | - | + ItemInstance skinWeapon = null; |
| 2680 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2681 | - | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2681 | + | + showSkinList(player, type, page); |
| 2682 | - | + {
|
| 2682 | + | + return; |
| 2683 | - | + skinWeapon = ItemData.getInstance().createDummyItem(itemId); |
| 2683 | + | |
| 2684 | - | + |
| 2684 | + | |
| 2685 | - | + if (!checkWeapons(player, skinWeapon, WeaponType.BOW, WeaponType.BOW) // |
| 2685 | + | + break; |
| 2686 | - | + || !checkWeapons(player, skinWeapon, WeaponType.SWORD, WeaponType.SWORD) // |
| 2686 | + | |
| 2687 | - | + || !checkWeapons(player, skinWeapon, WeaponType.BLUNT, WeaponType.BLUNT) // |
| 2687 | + | |
| 2688 | - | + || !checkWeapons(player, skinWeapon, WeaponType.DAGGER, WeaponType.DAGGER) // |
| 2688 | + | + if (sp == null) |
| 2689 | - | + || !checkWeapons(player, skinWeapon, WeaponType.POLE, WeaponType.POLE) // |
| 2689 | + | |
| 2690 | - | + || !checkWeapons(player, skinWeapon, WeaponType.DUAL, WeaponType.DUAL) // |
| 2690 | + | + player.sendMessage("There is no such skin.");
|
| 2691 | - | + || !checkWeapons(player, skinWeapon, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2691 | + | + player.sendPacket(new ExShowScreenMessage("There is no such skin.", 2000));
|
| 2692 | - | + || !checkWeapons(player, skinWeapon, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2692 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2693 | - | + || !checkWeapons(player, skinWeapon, WeaponType.FIST, WeaponType.FIST) // |
| 2693 | + | + showSkinList(player, type, page); |
| 2694 | - | + || !checkWeapons(player, skinWeapon, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2694 | + | + return; |
| 2695 | - | + {
|
| 2695 | + | |
| 2696 | - | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2696 | + | |
| 2697 | - | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2697 | + | |
| 2698 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2698 | + | + if (player.destroyItemByItemId("dressme", sp.getPriceId(), sp.getPriceCount(), player, true))
|
| 2699 | - | + showMySkinList(player, page); |
| 2699 | + | |
| 2700 | - | + return; |
| 2700 | + | + player.sendMessage("You have successfully purchased " + sp.getName() + " skin.");
|
| 2701 | - | + } |
| 2701 | + | + player.sendPacket(new ExShowScreenMessage("You have successfully purchased " + sp.getName() + " skin.", 2000));
|
| 2702 | - | + |
| 2702 | + | |
| 2703 | - | + player.setWeaponSkinOption(id); |
| 2703 | + | + switch (type.toLowerCase()) |
| 2704 | - | + } |
| 2704 | + | |
| 2705 | - | + break; |
| 2705 | + | + case "armor": |
| 2706 | - | + case "hair": |
| 2706 | + | + player.buyArmorSkin(skinId); |
| 2707 | - | + player.setHairSkinOption(id); |
| 2707 | + | + player.setArmorSkinOption(skinId); |
| 2708 | - | + break; |
| 2708 | + | + break; |
| 2709 | - | + case "face": |
| 2709 | + | + case "weapon": |
| 2710 | - | + player.setFaceSkinOption(id); |
| 2710 | + | + player.buyWeaponSkin(skinId); |
| 2711 | - | + break; |
| 2711 | + | + player.setWeaponSkinOption(skinId); |
| 2712 | - | + case "shield": |
| 2712 | + | + break; |
| 2713 | - | + if (player.getActiveWeaponItem() == null) |
| 2713 | + | + case "hair": |
| 2714 | - | + {
|
| 2714 | + | + player.buyHairSkin(skinId); |
| 2715 | - | + player.sendMessage("You can't use this skin without a weapon.");
|
| 2715 | + | + player.setHairSkinOption(skinId); |
| 2716 | - | + player.sendPacket(new ExShowScreenMessage("You can't use this skin without a weapon.", 2000));
|
| 2716 | + | + break; |
| 2717 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2717 | + | + case "face": |
| 2718 | - | + showMySkinList(player, page); |
| 2718 | + | + player.buyFaceSkin(skinId); |
| 2719 | - | + return; |
| 2719 | + | + player.setFaceSkinOption(skinId); |
| 2720 | - | + } |
| 2720 | + | + break; |
| 2721 | - | + |
| 2721 | + | + case "shield": |
| 2722 | - | + ItemInstance skinShield = null; |
| 2722 | + | + player.buyShieldSkin(skinId); |
| 2723 | - | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2723 | + | + player.setShieldSkinOption(skinId); |
| 2724 | - | + {
|
| 2724 | + | + break; |
| 2725 | - | + skinShield = ItemData.getInstance().createDummyItem(itemId); |
| 2725 | + | |
| 2726 | - | + |
| 2726 | + | |
| 2727 | - | + if (!checkWeapons(player, skinShield, WeaponType.BOW, WeaponType.BOW) // |
| 2727 | + | + player.broadcastUserInfo(); |
| 2728 | - | + || !checkWeapons(player, skinShield, WeaponType.POLE, WeaponType.POLE) // |
| 2728 | + | |
| 2729 | - | + || !checkWeapons(player, skinShield, WeaponType.DUAL, WeaponType.DUAL) // |
| 2729 | + | + showSkinList(player, type, page); |
| 2730 | - | + || !checkWeapons(player, skinShield, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2730 | + | |
| 2731 | - | + || !checkWeapons(player, skinShield, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2731 | + | + else if (next.startsWith("tryskin"))
|
| 2732 | - | + || !checkWeapons(player, skinShield, WeaponType.FIST, WeaponType.FIST) // |
| 2732 | + | |
| 2733 | - | + || !checkWeapons(player, skinShield, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2733 | + | |
| 2734 | - | + {
|
| 2734 | + | + int skinId = Integer.parseInt(st.nextToken()); |
| 2735 | - | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2735 | + | |
| 2736 | - | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2736 | + | + String type = st.nextToken(); |
| 2737 | - | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2737 | + | |
| 2738 | - | + showMySkinList(player, page); |
| 2738 | + | + if (player.isTryingSkin()) |
| 2739 | - | + return; |
| 2739 | + | |
| 2740 | - | + } |
| 2740 | + | + player.sendMessage("You are already trying a skin.");
|
| 2741 | - | + |
| 2741 | + | + player.sendPacket(new ExShowScreenMessage("You are already trying a skin.", 2000));
|
| 2742 | - | + player.setShieldSkinOption(id); |
| 2742 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2743 | - | + } |
| 2743 | + | + showSkinList(player, type, page); |
| 2744 | - | + |
| 2744 | + | + return; |
| 2745 | - | + break; |
| 2745 | + | |
| 2746 | - | + } |
| 2746 | + | |
| 2747 | - | + |
| 2747 | + | + player.setIsTryingSkin(true); |
| 2748 | - | + player.broadcastUserInfo(); |
| 2748 | + | |
| 2749 | - | + showMySkinList(player, page); |
| 2749 | + | + int oldArmorSkinId = player.getArmorSkinOption(); |
| 2750 | + int oldWeaponSkinId = player.getWeaponSkinOption(); | |
| 2751 | + int oldHairSkinId = player.getHairSkinOption(); | |
| 2752 | + int oldFaceSkinId = player.getFaceSkinOption(); | |
| 2753 | - | + } |
| 2753 | + | + int oldShieldSkinId = player.getShieldSkinOption(); |
| 2754 | + | |
| 2755 | + switch (type.toLowerCase()) | |
| 2756 | + {
| |
| 2757 | + case "armor": | |
| 2758 | + player.setArmorSkinOption(skinId); | |
| 2759 | + break; | |
| 2760 | + case "weapon": | |
| 2761 | - | else if (_command.startsWith("player_help "))
|
| 2761 | + | + player.setWeaponSkinOption(skinId); |
| 2762 | + break; | |
| 2763 | - | final String path = _command.substring(12); |
| 2763 | + | + case "hair": |
| 2764 | - | @@ -186,4 +636,263 @@ |
| 2764 | + | + player.setHairSkinOption(skinId); |
| 2765 | + break; | |
| 2766 | + case "face": | |
| 2767 | + player.setFaceSkinOption(skinId); | |
| 2768 | + break; | |
| 2769 | - | + public static String getItemNameById(int itemId) |
| 2769 | + | + case "shield": |
| 2770 | - | + {
|
| 2770 | + | |
| 2771 | - | + Item item = ItemData.getInstance().getTemplate(itemId); |
| 2771 | + | + player.setShieldSkinOption(skinId); |
| 2772 | - | + |
| 2772 | + | |
| 2773 | - | + String itemName = "NoName"; |
| 2773 | + | + break; |
| 2774 | - | + |
| 2774 | + | |
| 2775 | - | + if (itemId != 0) |
| 2775 | + | |
| 2776 | - | + {
|
| 2776 | + | + player.broadcastUserInfo(); |
| 2777 | - | + itemName = item.getName(); |
| 2777 | + | + showSkinList(player, type, page); |
| 2778 | - | + } |
| 2778 | + | |
| 2779 | - | + |
| 2779 | + | + ThreadPool.schedule(() -> |
| 2780 | - | + return itemName; |
| 2780 | + | |
| 2781 | - | + } |
| 2781 | + | + switch (type.toLowerCase()) |
| 2782 | - | + |
| 2782 | + | |
| 2783 | - | + |
| 2783 | + | + case "armor": |
| 2784 | - | + public static void showDressMeMainPage(Player player) |
| 2784 | + | + player.setArmorSkinOption(oldArmorSkinId); |
| 2785 | - | + {
|
| 2785 | + | + break; |
| 2786 | - | + NpcHtmlMessage htm = new NpcHtmlMessage(1); |
| 2786 | + | + case "weapon": |
| 2787 | - | + String text = HtmCache.getInstance().getHtm("data/html/dressme/index.htm");
|
| 2787 | + | + player.setWeaponSkinOption(oldWeaponSkinId); |
| 2788 | - | + |
| 2788 | + | + break; |
| 2789 | - | + htm.setHtml(text); |
| 2789 | + | + case "hair": |
| 2790 | - | + |
| 2790 | + | + player.setHairSkinOption(oldHairSkinId); |
| 2791 | - | + {
|
| 2791 | + | + break; |
| 2792 | - | + htm.replace("%time%", sdf.format(new Date(System.currentTimeMillis())));
|
| 2792 | + | + case "face": |
| 2793 | - | + htm.replace("%dat%", (new SimpleDateFormat("dd/MM/yyyy")).format(new Date(System.currentTimeMillis())));
|
| 2793 | + | + player.setFaceSkinOption(oldFaceSkinId); |
| 2794 | - | + |
| 2794 | + | + break; |
| 2795 | - | + } |
| 2795 | + | + case "shield": |
| 2796 | - | + |
| 2796 | + | + player.setShieldSkinOption(oldShieldSkinId); |
| 2797 | - | + player.sendPacket(htm); |
| 2797 | + | + break; |
| 2798 | - | + } |
| 2798 | + | |
| 2799 | - | + |
| 2799 | + | |
| 2800 | - | + static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
| 2800 | + | + player.broadcastUserInfo(); |
| 2801 | - | + |
| 2801 | + | + player.setIsTryingSkin(false); |
| 2802 | - | + private static void showSkinList(Player player, String type, int page) |
| 2802 | + | + }, 5000); |
| 2803 | - | + {
|
| 2803 | + | |
| 2804 | - | + NpcHtmlMessage html = new NpcHtmlMessage(1); |
| 2804 | + | + else if (next.startsWith("setskin"))
|
| 2805 | - | + |
| 2805 | + | |
| 2806 | - | + html.setFile("data/html/dressme/allskins.htm");
|
| 2806 | + | + int id = Integer.parseInt(st.nextToken()); |
| 2807 | - | + |
| 2807 | + | + String type = st.nextToken(); |
| 2808 | - | + html.replace("%time%", sdf.format(new Date(System.currentTimeMillis())));
|
| 2808 | + | + int itemId = Integer.parseInt(st.nextToken()); |
| 2809 | - | + html.replace("%dat%", (new SimpleDateFormat("dd/MM/yyyy")).format(new Date(System.currentTimeMillis())));
|
| 2809 | + | |
| 2810 | - | + |
| 2810 | + | + if (player.isTryingSkin()) |
| 2811 | - | + final int ITEMS_PER_PAGE = 8; |
| 2811 | + | |
| 2812 | - | + |
| 2812 | + | + player.sendMessage("You can't do this while trying skins.");
|
| 2813 | - | + int myPage = 1; |
| 2813 | + | + player.sendPacket(new ExShowScreenMessage("You can't do this while trying skins.", 2000));
|
| 2814 | - | + int i = 0; |
| 2814 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2815 | - | + int shown = 0; |
| 2815 | + | + showMySkinList(player, page); |
| 2816 | - | + boolean hasMore = false; |
| 2816 | + | + return; |
| 2817 | - | + int itemId = 0; |
| 2817 | + | |
| 2818 | - | + |
| 2818 | + | |
| 2819 | - | + final StringBuilder sb = new StringBuilder(); |
| 2819 | + | + if (type.toLowerCase().contains("armor") && player.hasEquippedArmorSkin(String.valueOf(id)) || type.toLowerCase().contains("weapon") && player.hasEquippedWeaponSkin(String.valueOf(id))
|
| 2820 | - | + |
| 2820 | + | + || type.toLowerCase().contains("hair") && player.hasEquippedHairSkin(String.valueOf(id)) || type.toLowerCase().contains("face") && player.hasEquippedFaceSkin(String.valueOf(id)))
|
| 2821 | - | + List<SkinPackage> tempList = null; |
| 2821 | + | |
| 2822 | - | + switch (type.toLowerCase()) |
| 2822 | + | + player.sendMessage("You are already equipped this skin.");
|
| 2823 | - | + {
|
| 2823 | + | + player.sendPacket(new ExShowScreenMessage("You are already equipped this skin.", 2000));
|
| 2824 | - | + case "armor": |
| 2824 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2825 | - | + tempList = DressMeData.getInstance().getArmorSkinOptions().values().stream().filter(s -> !player.hasArmorSkin(s.getId())).collect(Collectors.toList()); |
| 2825 | + | + showMySkinList(player, page); |
| 2826 | - | + break; |
| 2826 | + | + return; |
| 2827 | - | + case "weapon": |
| 2827 | + | |
| 2828 | - | + tempList = DressMeData.getInstance().getWeaponSkinOptions().values().stream().filter(s -> !player.hasWeaponSkin(s.getId())).collect(Collectors.toList()); |
| 2828 | + | |
| 2829 | - | + break; |
| 2829 | + | + switch (type.toLowerCase()) |
| 2830 | - | + case "hair": |
| 2830 | + | |
| 2831 | - | + tempList = DressMeData.getInstance().getHairSkinOptions().values().stream().filter(s -> !player.hasHairSkin(s.getId())).collect(Collectors.toList()); |
| 2831 | + | + case "armor": |
| 2832 | - | + break; |
| 2832 | + | + player.setArmorSkinOption(id); |
| 2833 | - | + case "face": |
| 2833 | + | + break; |
| 2834 | - | + tempList = DressMeData.getInstance().getFaceSkinOptions().values().stream().filter(s -> !player.hasFaceSkin(s.getId())).collect(Collectors.toList()); |
| 2834 | + | + case "weapon": |
| 2835 | - | + break; |
| 2835 | + | + if (player.getActiveWeaponItem() == null) |
| 2836 | - | + case "shield": |
| 2836 | + | |
| 2837 | - | + tempList = DressMeData.getInstance().getShieldSkinOptions().values().stream().filter(s -> !player.hasShieldSkin(s.getId())).collect(Collectors.toList()); |
| 2837 | + | + player.sendMessage("You can't use this skin without a weapon.");
|
| 2838 | - | + break; |
| 2838 | + | + player.sendPacket(new ExShowScreenMessage("You can't use this skin without a weapon.", 2000));
|
| 2839 | - | + } |
| 2839 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2840 | - | + |
| 2840 | + | + showMySkinList(player, page); |
| 2841 | - | + if (tempList != null && !tempList.isEmpty()) |
| 2841 | + | + return; |
| 2842 | - | + {
|
| 2842 | + | |
| 2843 | - | + for (SkinPackage sp : tempList) |
| 2843 | + | |
| 2844 | - | + {
|
| 2844 | + | + ItemInstance skinWeapon = null; |
| 2845 | - | + if (sp == null) |
| 2845 | + | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2846 | - | + {
|
| 2846 | + | |
| 2847 | - | + continue; |
| 2847 | + | + skinWeapon = ItemData.getInstance().createDummyItem(itemId); |
| 2848 | - | + } |
| 2848 | + | + |
| 2849 | - | + |
| 2849 | + | + if (!checkWeapons(player, skinWeapon, WeaponType.BOW, WeaponType.BOW) // |
| 2850 | - | + if (shown == ITEMS_PER_PAGE) |
| 2850 | + | + || !checkWeapons(player, skinWeapon, WeaponType.SWORD, WeaponType.SWORD) // |
| 2851 | - | + {
|
| 2851 | + | + || !checkWeapons(player, skinWeapon, WeaponType.BLUNT, WeaponType.BLUNT) // |
| 2852 | - | + hasMore = true; |
| 2852 | + | + || !checkWeapons(player, skinWeapon, WeaponType.DAGGER, WeaponType.DAGGER) // |
| 2853 | - | + break; |
| 2853 | + | + || !checkWeapons(player, skinWeapon, WeaponType.POLE, WeaponType.POLE) // |
| 2854 | - | + } |
| 2854 | + | + || !checkWeapons(player, skinWeapon, WeaponType.DUAL, WeaponType.DUAL) // |
| 2855 | - | + |
| 2855 | + | + || !checkWeapons(player, skinWeapon, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2856 | - | + if (myPage != page) |
| 2856 | + | + || !checkWeapons(player, skinWeapon, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2857 | - | + {
|
| 2857 | + | + || !checkWeapons(player, skinWeapon, WeaponType.FIST, WeaponType.FIST) // |
| 2858 | - | + i++; |
| 2858 | + | + || !checkWeapons(player, skinWeapon, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2859 | - | + if (i == ITEMS_PER_PAGE) |
| 2859 | + | |
| 2860 | - | + {
|
| 2860 | + | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2861 | - | + myPage++; |
| 2861 | + | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2862 | - | + i = 0; |
| 2862 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2863 | - | + } |
| 2863 | + | + showMySkinList(player, page); |
| 2864 | - | + continue; |
| 2864 | + | + return; |
| 2865 | - | + } |
| 2865 | + | |
| 2866 | - | + |
| 2866 | + | + |
| 2867 | - | + if (shown == ITEMS_PER_PAGE) |
| 2867 | + | + player.setWeaponSkinOption(id); |
| 2868 | - | + {
|
| 2868 | + | |
| 2869 | - | + hasMore = true; |
| 2869 | + | + break; |
| 2870 | - | + break; |
| 2870 | + | + case "hair": |
| 2871 | - | + } |
| 2871 | + | + player.setHairSkinOption(id); |
| 2872 | - | + |
| 2872 | + | + break; |
| 2873 | - | + switch (type.toLowerCase()) |
| 2873 | + | + case "face": |
| 2874 | - | + {
|
| 2874 | + | + player.setFaceSkinOption(id); |
| 2875 | - | + case "armor": |
| 2875 | + | + break; |
| 2876 | - | + itemId = sp.getChestId(); |
| 2876 | + | + case "shield": |
| 2877 | - | + break; |
| 2877 | + | + if (player.getActiveWeaponItem() == null) |
| 2878 | - | + case "weapon": |
| 2878 | + | |
| 2879 | - | + itemId = sp.getWeaponId(); |
| 2879 | + | + player.sendMessage("You can't use this skin without a weapon.");
|
| 2880 | - | + break; |
| 2880 | + | + player.sendPacket(new ExShowScreenMessage("You can't use this skin without a weapon.", 2000));
|
| 2881 | - | + case "hair": |
| 2881 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2882 | - | + itemId = sp.getHairId(); |
| 2882 | + | + showMySkinList(player, page); |
| 2883 | - | + break; |
| 2883 | + | + return; |
| 2884 | - | + case "face": |
| 2884 | + | |
| 2885 | - | + itemId = sp.getFaceId(); |
| 2885 | + | |
| 2886 | - | + break; |
| 2886 | + | + ItemInstance skinShield = null; |
| 2887 | - | + case "shield": |
| 2887 | + | + if (ItemData.getInstance().getTemplate(itemId) != null) |
| 2888 | - | + itemId = sp.getShieldId(); |
| 2888 | + | |
| 2889 | - | + break; |
| 2889 | + | + skinShield = ItemData.getInstance().createDummyItem(itemId); |
| 2890 | - | + } |
| 2890 | + | + |
| 2891 | - | + |
| 2891 | + | + if (!checkWeapons(player, skinShield, WeaponType.BOW, WeaponType.BOW) // |
| 2892 | - | + sb.append("<table border=0 cellspacing=0 cellpadding=2 height=36><tr>");
|
| 2892 | + | + || !checkWeapons(player, skinShield, WeaponType.POLE, WeaponType.POLE) // |
| 2893 | - | + sb.append("<td width=32 align=center>" + "<button width=32 height=32 back=" + Item.getItemIcon(itemId) + " fore=" + Item.getItemIcon(itemId) + ">" + "</td>");
|
| 2893 | + | + || !checkWeapons(player, skinShield, WeaponType.DUAL, WeaponType.DUAL) // |
| 2894 | - | + sb.append("<td width=124>" + sp.getName() + "<br1> <font color=999999>Price:</font> <font color=339966>" + Item.getItemNameById(sp.getPriceId()) + "</font> (<font color=LEVEL>" + sp.getPriceCount() + "</font>)</td>");
|
| 2894 | + | + || !checkWeapons(player, skinShield, WeaponType.DUALFIST, WeaponType.DUALFIST) // |
| 2895 | - | + sb.append("<td align=center width=65>" + "<button value=\"Buy\" action=\"bypass -h dressme " + page + " buyskin " + sp.getId() + " " + type + " " + itemId + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 2895 | + | + || !checkWeapons(player, skinShield, WeaponType.BIGSWORD, WeaponType.BIGSWORD) // |
| 2896 | - | + sb.append("<td align=center width=65>" + "<button value=\"Try\" action=\"bypass -h dressme " + page + " tryskin " + sp.getId() + " " + type + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 2896 | + | + || !checkWeapons(player, skinShield, WeaponType.FIST, WeaponType.FIST) // |
| 2897 | - | + |
| 2897 | + | + || !checkWeapons(player, skinShield, WeaponType.BIGBLUNT, WeaponType.BIGBLUNT)) |
| 2898 | - | + sb.append("</tr></table>");
|
| 2898 | + | |
| 2899 | - | + sb.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
|
| 2899 | + | + player.sendMessage("This skin is not suitable for your weapon type.");
|
| 2900 | - | + shown++; |
| 2900 | + | + player.sendPacket(new ExShowScreenMessage("This skin is not suitable for your weapon type.", 2000));
|
| 2901 | - | + } |
| 2901 | + | + player.sendPacket(new PlaySound("ItemSound3.sys_impossible"));
|
| 2902 | - | + } |
| 2902 | + | + showMySkinList(player, page); |
| 2903 | - | + |
| 2903 | + | + return; |
| 2904 | - | + sb.append("<table width=300><tr>");
|
| 2904 | + | |
| 2905 | - | + sb.append("<td align=center width=70>" + (page > 1 ? "<button value=\"< PREV\" action=\"bypass -h dressme " + (page - 1) + " skinlist " + type + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
|
| 2905 | + | + |
| 2906 | - | + sb.append("<td align=center width=140>Page: " + page + "</td>");
|
| 2906 | + | + player.setShieldSkinOption(id); |
| 2907 | - | + sb.append("<td align=center width=70>" + (hasMore ? "<button value=\"NEXT >\" action=\"bypass -h dressme " + (page + 1) + " skinlist " + type + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
|
| 2907 | + | |
| 2908 | - | + sb.append("</tr></table>");
|
| 2908 | + | |
| 2909 | - | + |
| 2909 | + | + break; |
| 2910 | - | + html.replace("%showList%", sb.toString());
|
| 2910 | + | |
| 2911 | - | + player.sendPacket(html); |
| 2911 | + | |
| 2912 | - | + } |
| 2912 | + | + player.broadcastUserInfo(); |
| 2913 | - | + |
| 2913 | + | + showMySkinList(player, page); |
| 2914 | - | + private static void showMySkinList(Player player, int page) |
| 2914 | + | |
| 2915 | - | + {
|
| 2915 | + | |
| 2916 | - | + NpcHtmlMessage html = new NpcHtmlMessage(1); |
| 2916 | + | |
| 2917 | - | + html.setFile("data/html/dressme/myskins.htm");
|
| 2917 | + | + } |
| 2918 | - | + |
| 2918 | + | |
| 2919 | - | + html.replace("%time%", sdf.format(new Date(System.currentTimeMillis())));
|
| 2919 | + | |
| 2920 | - | + html.replace("%dat%", (new SimpleDateFormat("dd/MM/yyyy")).format(new Date(System.currentTimeMillis())));
|
| 2920 | + | |
| 2921 | - | + |
| 2921 | + | |
| 2922 | - | + final int ITEMS_PER_PAGE = 8; |
| 2922 | + | |
| 2923 | - | + int itemId = 0; |
| 2923 | + | |
| 2924 | - | + |
| 2924 | + | |
| 2925 | - | + int myPage = 1; |
| 2925 | + | |
| 2926 | - | + int i = 0; |
| 2926 | + | else if (_command.startsWith("npc_"))
|
| 2927 | - | + int shown = 0; |
| 2927 | + | |
| 2928 | - | + boolean hasMore = false; |
| 2928 | + | if (!player.validateBypass(_command)) |
| 2929 | - | + |
| 2929 | + | @@ -186,4 +633,272 @@ |
| 2930 | - | + final StringBuilder sb = new StringBuilder(); |
| 2930 | + | |
| 2931 | - | + |
| 2931 | + | |
| 2932 | - | + List<SkinPackage> armors = DressMeData.getInstance().getArmorSkinOptions().values().stream().filter(s -> player.hasArmorSkin(s.getId())).collect(Collectors.toList()); |
| 2932 | + | |
| 2933 | - | + List<SkinPackage> weapons = DressMeData.getInstance().getWeaponSkinOptions().values().stream().filter(s -> player.hasWeaponSkin(s.getId())).collect(Collectors.toList()); |
| 2933 | + | |
| 2934 | - | + List<SkinPackage> hairs = DressMeData.getInstance().getHairSkinOptions().values().stream().filter(s -> player.hasHairSkin(s.getId())).collect(Collectors.toList()); |
| 2934 | + | |
| 2935 | - | + List<SkinPackage> faces = DressMeData.getInstance().getFaceSkinOptions().values().stream().filter(s -> player.hasFaceSkin(s.getId())).collect(Collectors.toList()); |
| 2935 | + | |
| 2936 | - | + List<SkinPackage> shield = DressMeData.getInstance().getShieldSkinOptions().values().stream().filter(s -> player.hasShieldSkin(s.getId())).collect(Collectors.toList()); |
| 2936 | + | |
| 2937 | - | + |
| 2937 | + | |
| 2938 | - | + List<SkinPackage> list = Stream.concat(armors.stream(), weapons.stream()).collect(Collectors.toList()); |
| 2938 | + | |
| 2939 | - | + shield.stream().collect(Collectors.toList()); |
| 2939 | + | |
| 2940 | - | + List<SkinPackage> list2 = Stream.concat(hairs.stream(), shield.stream()).collect(Collectors.toList()); |
| 2940 | + | + Item item = ItemData.getInstance().getTemplate(itemId); |
| 2941 | - | + List<SkinPackage> list3 = faces.stream().collect(Collectors.toList()); |
| 2941 | + | |
| 2942 | - | + |
| 2942 | + | |
| 2943 | - | + List<SkinPackage> allLists = Stream.concat(list.stream(),Stream.concat(list2.stream(), list3.stream())).collect(Collectors.toList()); |
| 2943 | + | |
| 2944 | - | + |
| 2944 | + | |
| 2945 | - | + if (!allLists.isEmpty()) |
| 2945 | + | |
| 2946 | - | + {
|
| 2946 | + | |
| 2947 | - | + for (SkinPackage sp : allLists) |
| 2947 | + | |
| 2948 | - | + {
|
| 2948 | + | |
| 2949 | - | + if (sp == null) |
| 2949 | + | |
| 2950 | - | + {
|
| 2950 | + | |
| 2951 | - | + continue; |
| 2951 | + | |
| 2952 | - | + } |
| 2952 | + | |
| 2953 | - | + |
| 2953 | + | + public static void showDressMeMainPage(Player player) |
| 2954 | - | + if (shown == ITEMS_PER_PAGE) |
| 2954 | + | |
| 2955 | - | + {
|
| 2955 | + | |
| 2956 | - | + hasMore = true; |
| 2956 | + | |
| 2957 | - | + break; |
| 2957 | + | |
| 2958 | - | + } |
| 2958 | + | |
| 2959 | - | + |
| 2959 | + | |
| 2960 | - | + if (myPage != page) |
| 2960 | + | |
| 2961 | - | + {
|
| 2961 | + | |
| 2962 | - | + i++; |
| 2962 | + | |
| 2963 | - | + if (i == ITEMS_PER_PAGE) |
| 2963 | + | |
| 2964 | - | + {
|
| 2964 | + | |
| 2965 | - | + myPage++; |
| 2965 | + | |
| 2966 | - | + i = 0; |
| 2966 | + | |
| 2967 | - | + } |
| 2967 | + | |
| 2968 | - | + continue; |
| 2968 | + | |
| 2969 | - | + } |
| 2969 | + | |
| 2970 | - | + |
| 2970 | + | |
| 2971 | - | + if (shown == ITEMS_PER_PAGE) |
| 2971 | + | + private static void showSkinList(Player player, String type, int page) |
| 2972 | - | + {
|
| 2972 | + | |
| 2973 | - | + hasMore = true; |
| 2973 | + | + NpcHtmlMessage html = new NpcHtmlMessage(1); |
| 2974 | - | + break; |
| 2974 | + | |
| 2975 | - | + } |
| 2975 | + | + html.setFile("data/html/dressme/allskins.htm");
|
| 2976 | - | + |
| 2976 | + | |
| 2977 | - | + switch (sp.getType().toLowerCase()) |
| 2977 | + | + html.replace("%time%", sdf.format(new Date(System.currentTimeMillis())));
|
| 2978 | - | + {
|
| 2978 | + | + html.replace("%dat%", (new SimpleDateFormat("dd/MM/yyyy")).format(new Date(System.currentTimeMillis())));
|
| 2979 | - | + case "armor": |
| 2979 | + | |
| 2980 | - | + itemId = sp.getChestId(); |
| 2980 | + | + final int ITEMS_PER_PAGE = 8; |
| 2981 | - | + break; |
| 2981 | + | |
| 2982 | - | + case "weapon": |
| 2982 | + | + int myPage = 1; |
| 2983 | - | + itemId = sp.getWeaponId(); |
| 2983 | + | + int i = 0; |
| 2984 | - | + break; |
| 2984 | + | + int shown = 0; |
| 2985 | - | + case "hair": |
| 2985 | + | + boolean hasMore = false; |
| 2986 | - | + itemId = sp.getHairId(); |
| 2986 | + | + int itemId = 0; |
| 2987 | - | + break; |
| 2987 | + | |
| 2988 | - | + case "face": |
| 2988 | + | + final StringBuilder sb = new StringBuilder(); |
| 2989 | - | + itemId = sp.getFaceId(); |
| 2989 | + | |
| 2990 | - | + break; |
| 2990 | + | + List<SkinPackage> tempList = null; |
| 2991 | - | + case "shield": |
| 2991 | + | + switch (type.toLowerCase()) |
| 2992 | - | + itemId = sp.getShieldId(); |
| 2992 | + | |
| 2993 | - | + break; |
| 2993 | + | + case "armor": |
| 2994 | - | + } |
| 2994 | + | + tempList = DressMeData.getInstance().getArmorSkinOptions().values().stream().filter(s -> !player.hasArmorSkin(s.getId())).collect(Collectors.toList()); |
| 2995 | - | + |
| 2995 | + | |
| 2996 | - | + sb.append("<table border=0 cellspacing=0 cellpadding=2 height=36><tr>");
|
| 2996 | + | + case "weapon": |
| 2997 | - | + sb.append("<td width=32 align=center>" + "<button width=32 height=32 back=" + Item.getItemIcon(itemId) + " fore=" + Item.getItemIcon(itemId) + ">" + "</td>");
|
| 2997 | + | + tempList = DressMeData.getInstance().getWeaponSkinOptions().values().stream().filter(s -> !player.hasWeaponSkin(s.getId())).collect(Collectors.toList()); |
| 2998 | - | + sb.append("<td width=124>" + sp.getName() + "</td>");
|
| 2998 | + | |
| 2999 | - | + sb.append("<td align=center width=65>" + "<button value=\"Equip\" action=\"bypass -h dressme " + page + " setskin " + sp.getId() + " " + sp.getType() + " " + itemId + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 2999 | + | + case "hair": |
| 3000 | - | + sb.append("<td align=center width=65>" + "<button value=\"Remove\" action=\"bypass -h dressme " + page + " clean " + sp.getType() + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 3000 | + | + tempList = DressMeData.getInstance().getHairSkinOptions().values().stream().filter(s -> !player.hasHairSkin(s.getId())).collect(Collectors.toList()); |
| 3001 | - | + sb.append("</tr></table>");
|
| 3001 | + | |
| 3002 | - | + sb.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
|
| 3002 | + | + case "face": |
| 3003 | - | + shown++; |
| 3003 | + | + tempList = DressMeData.getInstance().getFaceSkinOptions().values().stream().filter(s -> !player.hasFaceSkin(s.getId())).collect(Collectors.toList()); |
| 3004 | - | + } |
| 3004 | + | |
| 3005 | - | + } |
| 3005 | + | + case "shield": |
| 3006 | - | + |
| 3006 | + | + tempList = DressMeData.getInstance().getShieldSkinOptions().values().stream().filter(s -> !player.hasShieldSkin(s.getId())).collect(Collectors.toList()); |
| 3007 | - | + sb.append("<table width=300><tr>");
|
| 3007 | + | |
| 3008 | - | + sb.append("<td align=center width=70>" + (page > 1 ? "<button value=\"< PREV\" action=\"bypass -h dressme " + (page - 1) + " myskinlist\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
|
| 3008 | + | |
| 3009 | - | + sb.append("<td align=center width=140>Page: " + page + "</td>");
|
| 3009 | + | |
| 3010 | - | + sb.append("<td align=center width=70>" + (hasMore ? "<button value=\"NEXT >\" action=\"bypass -h dressme " + (page + 1) + " myskinlist\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
|
| 3010 | + | + if (tempList != null && !tempList.isEmpty()) |
| 3011 | - | + sb.append("</tr></table>");
|
| 3011 | + | |
| 3012 | - | + |
| 3012 | + | + for (SkinPackage sp : tempList) |
| 3013 | - | + html.replace("%showList%", sb.toString());
|
| 3013 | + | |
| 3014 | - | + player.sendPacket(html); |
| 3014 | + | + if (sp == null) |
| 3015 | - | + } |
| 3015 | + | |
| 3016 | - | + |
| 3016 | + | + continue; |
| 3017 | - | + public static boolean checkWeapons(Player player, ItemInstance skin, WeaponType weapon1, WeaponType weapon2) |
| 3017 | + | |
| 3018 | - | + {
|
| 3018 | + | |
| 3019 | - | + if (player.getActiveWeaponItem().getItemType() == weapon1 && skin.getItem().getItemType() != weapon2) |
| 3019 | + | + if (shown == ITEMS_PER_PAGE) |
| 3020 | - | + {
|
| 3020 | + | |
| 3021 | - | + return false; |
| 3021 | + | + hasMore = true; |
| 3022 | - | + } |
| 3022 | + | + break; |
| 3023 | - | + |
| 3023 | + | |
| 3024 | - | + return true; |
| 3024 | + | |
| 3025 | - | + } |
| 3025 | + | + if (myPage != page) |
| 3026 | + {
| |
| 3027 | + i++; | |
| 3028 | + if (i == ITEMS_PER_PAGE) | |
| 3029 | - | diff --git java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java |
| 3029 | + | |
| 3030 | - | index 473b3fc..9ea446b 100644 |
| 3030 | + | + myPage++; |
| 3031 | - | --- java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java |
| 3031 | + | + i = 0; |
| 3032 | - | +++ java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java |
| 3032 | + | |
| 3033 | - | @@ -8,12 +8,16 @@ |
| 3033 | + | + continue; |
| 3034 | + } | |
| 3035 | - | import net.sf.l2j.commons.pool.ConnectionPool; |
| 3035 | + | |
| 3036 | + if (shown == ITEMS_PER_PAGE) | |
| 3037 | + {
| |
| 3038 | - | import net.sf.l2j.gameserver.data.sql.ClanTable; |
| 3038 | + | + hasMore = true; |
| 3039 | - | import net.sf.l2j.gameserver.enums.Paperdoll; |
| 3039 | + | + break; |
| 3040 | - | import net.sf.l2j.gameserver.model.CharSelectSlot; |
| 3040 | + | |
| 3041 | - | import net.sf.l2j.gameserver.model.pledge.Clan; |
| 3041 | + | |
| 3042 | + switch (type.toLowerCase()) | |
| 3043 | + {
| |
| 3044 | + case "armor": | |
| 3045 | + itemId = sp.getChestId(); | |
| 3046 | + break; | |
| 3047 | - | public class CharSelectInfo extends L2GameServerPacket |
| 3047 | + | + case "weapon": |
| 3048 | + itemId = sp.getWeaponId(); | |
| 3049 | - | private static final String SELECT_INFOS = "SELECT obj_Id, char_name, level, maxHp, curHp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, accesslevel, online, lastAccess, base_class FROM characters WHERE account_name=?"; |
| 3049 | + | + break; |
| 3050 | - | @@ -111,16 +115,77 @@ |
| 3050 | + | + case "hair": |
| 3051 | - | writeD(slot.getPaperdollObjectId(Paperdoll.RFINGER)); |
| 3051 | + | + itemId = sp.getHairId(); |
| 3052 | - | writeD(slot.getPaperdollObjectId(Paperdoll.LFINGER)); |
| 3052 | + | + break; |
| 3053 | - | writeD(slot.getPaperdollObjectId(Paperdoll.HEAD)); |
| 3053 | + | + case "face": |
| 3054 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3054 | + | + itemId = sp.getFaceId(); |
| 3055 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.LHAND)); |
| 3055 | + | + break; |
| 3056 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.GLOVES)); |
| 3056 | + | + case "shield": |
| 3057 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.CHEST)); |
| 3057 | + | + itemId = sp.getShieldId(); |
| 3058 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.LEGS)); |
| 3058 | + | + break; |
| 3059 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.FEET)); |
| 3059 | + | |
| 3060 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.CLOAK)); |
| 3060 | + | |
| 3061 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3061 | + | + sb.append("<table border=0 cellspacing=0 cellpadding=2 height=36><tr>");
|
| 3062 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.HAIR)); |
| 3062 | + | + sb.append("<td width=32 align=center>" + "<button width=32 height=32 back=" + Item.getItemIcon(itemId) + " fore=" + Item.getItemIcon(itemId) + ">" + "</td>");
|
| 3063 | - | - writeD(slot.getPaperdollObjectId(Paperdoll.FACE)); |
| 3063 | + | + sb.append("<td width=124>" + sp.getName() + "<br1> <font color=999999>Price:</font> <font color=339966>" + Item.getItemNameById(sp.getPriceId()) + "</font> (<font color=LEVEL>" + sp.getPriceCount() + "</font>)</td>");
|
| 3064 | + sb.append("<td align=center width=65>" + "<button value=\"Buy\" action=\"bypass -h dressme " + page + " buyskin " + sp.getId() + " " + type + " " + itemId + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
| |
| 3065 | - | + if (Config.ALLOW_DRESS_ME_SYSTEM) |
| 3065 | + | + sb.append("<td align=center width=65>" + "<button value=\"Try\" action=\"bypass -h dressme " + page + " tryskin " + sp.getId() + " " + type + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 3066 | + | |
| 3067 | - | + if (slot.getWeaponSkinOption() > 0 && getWeaponOption(slot.getWeaponSkinOption()) != null) |
| 3067 | + | + sb.append("</tr></table>");
|
| 3068 | + sb.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
| |
| 3069 | - | + writeD(getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() : slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3069 | + | + shown++; |
| 3070 | + } | |
| 3071 | - | + else |
| 3071 | + | |
| 3072 | + | |
| 3073 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3073 | + | + sb.append("<table width=300><tr>");
|
| 3074 | + sb.append("<td align=center width=70>" + (page > 1 ? "<button value=\"< PREV\" action=\"bypass -h dressme " + (page - 1) + " skinlist " + type + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
| |
| 3075 | + sb.append("<td align=center width=140>Page: " + page + "</td>");
| |
| 3076 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.LHAND)); |
| 3076 | + | + sb.append("<td align=center width=70>" + (hasMore ? "<button value=\"NEXT >\" action=\"bypass -h dressme " + (page + 1) + " skinlist " + type + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
|
| 3077 | + sb.append("</tr></table>");
| |
| 3078 | - | + if (slot.getArmorSkinOption() > 0 && getArmorOption(slot.getArmorSkinOption()) != null) |
| 3078 | + | |
| 3079 | + html.replace("%showList%", sb.toString());
| |
| 3080 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getGlovesId() : slot.getPaperdollObjectId(Paperdoll.GLOVES)); |
| 3080 | + | + player.sendPacket(html); |
| 3081 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getChestId() : slot.getPaperdollObjectId(Paperdoll.CHEST)); |
| 3081 | + | |
| 3082 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getLegsId() : slot.getPaperdollObjectId(Paperdoll.LEGS)); |
| 3082 | + | |
| 3083 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getFeetId() : slot.getPaperdollObjectId(Paperdoll.FEET)); |
| 3083 | + | + private static void showMySkinList(Player player, int page) |
| 3084 | + {
| |
| 3085 | - | + else |
| 3085 | + | + NpcHtmlMessage html = new NpcHtmlMessage(1); |
| 3086 | + html.setFile("data/html/dressme/myskins.htm");
| |
| 3087 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.GLOVES)); |
| 3087 | + | |
| 3088 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.CHEST)); |
| 3088 | + | + html.replace("%time%", sdf.format(new Date(System.currentTimeMillis())));
|
| 3089 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.LEGS)); |
| 3089 | + | + html.replace("%dat%", (new SimpleDateFormat("dd/MM/yyyy")).format(new Date(System.currentTimeMillis())));
|
| 3090 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.FEET)); |
| 3090 | + | |
| 3091 | + final int ITEMS_PER_PAGE = 8; | |
| 3092 | + int itemId = 0; | |
| 3093 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.CLOAK)); |
| 3093 | + | |
| 3094 | + int myPage = 1; | |
| 3095 | - | + if (slot.getWeaponSkinOption() > 0 && getWeaponOption(slot.getWeaponSkinOption()) != null) |
| 3095 | + | + int i = 0; |
| 3096 | + int shown = 0; | |
| 3097 | - | + writeD(getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() : slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3097 | + | + boolean hasMore = false; |
| 3098 | + | |
| 3099 | - | + else |
| 3099 | + | + final StringBuilder sb = new StringBuilder(); |
| 3100 | + | |
| 3101 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3101 | + | + List<SkinPackage> armors = DressMeData.getInstance().getArmorSkinOptions().values().stream().filter(s -> player.hasArmorSkin(s.getId())).collect(Collectors.toList()); |
| 3102 | + List<SkinPackage> weapons = DressMeData.getInstance().getWeaponSkinOptions().values().stream().filter(s -> player.hasWeaponSkin(s.getId())).collect(Collectors.toList()); | |
| 3103 | + List<SkinPackage> hairs = DressMeData.getInstance().getHairSkinOptions().values().stream().filter(s -> player.hasHairSkin(s.getId())).collect(Collectors.toList()); | |
| 3104 | - | + if (slot.getHairSkinOption() > 0 && getHairOption(slot.getHairSkinOption()) != null) |
| 3104 | + | + List<SkinPackage> faces = DressMeData.getInstance().getFaceSkinOptions().values().stream().filter(s -> player.hasFaceSkin(s.getId())).collect(Collectors.toList()); |
| 3105 | + List<SkinPackage> shield = DressMeData.getInstance().getShieldSkinOptions().values().stream().filter(s -> player.hasShieldSkin(s.getId())).collect(Collectors.toList()); | |
| 3106 | - | + writeD(getHairOption(slot.getHairSkinOption()).getHairId() != 0 ? getHairOption(slot.getHairSkinOption()).getHairId() : slot.getPaperdollObjectId(Paperdoll.HAIR)); |
| 3106 | + | |
| 3107 | + List<SkinPackage> list = Stream.concat(armors.stream(), weapons.stream()).collect(Collectors.toList()); | |
| 3108 | - | + else |
| 3108 | + | + shield.stream().collect(Collectors.toList()); |
| 3109 | + List<SkinPackage> list2 = Stream.concat(hairs.stream(), shield.stream()).collect(Collectors.toList()); | |
| 3110 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.HAIR)); |
| 3110 | + | + List<SkinPackage> list3 = faces.stream().collect(Collectors.toList()); |
| 3111 | + | |
| 3112 | + List<SkinPackage> allLists = Stream.concat(list.stream(),Stream.concat(list2.stream(), list3.stream())).collect(Collectors.toList()); | |
| 3113 | - | + if (slot.getFaceSkinOption() > 0 && getFaceOption(slot.getFaceSkinOption()) != null) |
| 3113 | + | |
| 3114 | + if (!allLists.isEmpty()) | |
| 3115 | - | + writeD(getFaceOption(slot.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(slot.getFaceSkinOption()).getFaceId() : slot.getPaperdollObjectId(Paperdoll.FACE)); |
| 3115 | + | |
| 3116 | + for (SkinPackage sp : allLists) | |
| 3117 | - | + else |
| 3117 | + | |
| 3118 | + if (sp == null) | |
| 3119 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.FACE)); |
| 3119 | + | |
| 3120 | + continue; | |
| 3121 | + } | |
| 3122 | + | |
| 3123 | + if (shown == ITEMS_PER_PAGE) | |
| 3124 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3124 | + | |
| 3125 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.LHAND)); |
| 3125 | + | + hasMore = true; |
| 3126 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.GLOVES)); |
| 3126 | + | + break; |
| 3127 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.CHEST)); |
| 3127 | + | |
| 3128 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.LEGS)); |
| 3128 | + | |
| 3129 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.FEET)); |
| 3129 | + | + if (myPage != page) |
| 3130 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.CLOAK)); |
| 3130 | + | |
| 3131 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.RHAND)); |
| 3131 | + | + i++; |
| 3132 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.HAIR)); |
| 3132 | + | + if (i == ITEMS_PER_PAGE) |
| 3133 | - | + writeD(slot.getPaperdollObjectId(Paperdoll.FACE)); |
| 3133 | + | |
| 3134 | + myPage++; | |
| 3135 | - | |
| 3135 | + | + i = 0; |
| 3136 | - | writeD(slot.getPaperdollItemId(Paperdoll.HAIRALL)); |
| 3136 | + | |
| 3137 | - | writeD(slot.getPaperdollItemId(Paperdoll.REAR)); |
| 3137 | + | + continue; |
| 3138 | - | @@ -129,16 +194,76 @@ |
| 3138 | + | |
| 3139 | - | writeD(slot.getPaperdollItemId(Paperdoll.RFINGER)); |
| 3139 | + | |
| 3140 | - | writeD(slot.getPaperdollItemId(Paperdoll.LFINGER)); |
| 3140 | + | + if (shown == ITEMS_PER_PAGE) |
| 3141 | - | writeD(slot.getPaperdollItemId(Paperdoll.HEAD)); |
| 3141 | + | |
| 3142 | - | - writeD(slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3142 | + | + hasMore = true; |
| 3143 | - | - writeD(slot.getPaperdollItemId(Paperdoll.LHAND)); |
| 3143 | + | + break; |
| 3144 | - | - writeD(slot.getPaperdollItemId(Paperdoll.GLOVES)); |
| 3144 | + | |
| 3145 | - | - writeD(slot.getPaperdollItemId(Paperdoll.CHEST)); |
| 3145 | + | |
| 3146 | - | - writeD(slot.getPaperdollItemId(Paperdoll.LEGS)); |
| 3146 | + | + switch (sp.getType().toLowerCase()) |
| 3147 | - | - writeD(slot.getPaperdollItemId(Paperdoll.FEET)); |
| 3147 | + | |
| 3148 | - | - writeD(slot.getPaperdollItemId(Paperdoll.CLOAK)); |
| 3148 | + | + case "armor": |
| 3149 | - | - writeD(slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3149 | + | + itemId = sp.getChestId(); |
| 3150 | - | - writeD(slot.getPaperdollItemId(Paperdoll.HAIR)); |
| 3150 | + | + break; |
| 3151 | - | - writeD(slot.getPaperdollItemId(Paperdoll.FACE)); |
| 3151 | + | + case "weapon": |
| 3152 | - | + if (Config.ALLOW_DRESS_ME_SYSTEM) |
| 3152 | + | + itemId = sp.getWeaponId(); |
| 3153 | + break; | |
| 3154 | - | + if (slot.getWeaponSkinOption() > 0 && getWeaponOption(slot.getWeaponSkinOption()) != null) |
| 3154 | + | + case "hair": |
| 3155 | + itemId = sp.getHairId(); | |
| 3156 | - | + writeD(getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() : slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3156 | + | + break; |
| 3157 | + case "face": | |
| 3158 | - | + else |
| 3158 | + | + itemId = sp.getFaceId(); |
| 3159 | + break; | |
| 3160 | - | + writeD(slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3160 | + | + case "shield": |
| 3161 | + itemId = sp.getShieldId(); | |
| 3162 | + break; | |
| 3163 | - | + writeD(slot.getPaperdollItemId(Paperdoll.LHAND)); |
| 3163 | + | |
| 3164 | + | |
| 3165 | - | + if (slot.getArmorSkinOption() > 0 && getArmorOption(slot.getArmorSkinOption()) != null) |
| 3165 | + | + sb.append("<table border=0 cellspacing=0 cellpadding=2 height=36><tr>");
|
| 3166 | + sb.append("<td width=32 align=center>" + "<button width=32 height=32 back=" + Item.getItemIcon(itemId) + " fore=" + Item.getItemIcon(itemId) + ">" + "</td>");
| |
| 3167 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getGlovesId() : slot.getPaperdollItemId(Paperdoll.GLOVES)); |
| 3167 | + | + sb.append("<td width=124>" + sp.getName() + "</td>");
|
| 3168 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getChestId() : slot.getPaperdollItemId(Paperdoll.CHEST)); |
| 3168 | + | + sb.append("<td align=center width=65>" + "<button value=\"Equip\" action=\"bypass -h dressme " + page + " setskin " + sp.getId() + " " + sp.getType() + " " + itemId + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 3169 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getLegsId() : slot.getPaperdollItemId(Paperdoll.LEGS)); |
| 3169 | + | + sb.append("<td align=center width=65>" + "<button value=\"Remove\" action=\"bypass -h dressme " + page + " clean " + sp.getType() + "\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" + "</td>");
|
| 3170 | - | + writeD(getArmorOption(slot.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(slot.getArmorSkinOption()).getFeetId() : slot.getPaperdollItemId(Paperdoll.FEET)); |
| 3170 | + | + sb.append("</tr></table>");
|
| 3171 | + sb.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
| |
| 3172 | - | + else |
| 3172 | + | + shown++; |
| 3173 | + } | |
| 3174 | - | + writeD(slot.getPaperdollItemId(Paperdoll.GLOVES)); |
| 3174 | + | |
| 3175 | - | + writeD(slot.getPaperdollItemId(Paperdoll.CHEST)); |
| 3175 | + | |
| 3176 | - | + writeD(slot.getPaperdollItemId(Paperdoll.LEGS)); |
| 3176 | + | + sb.append("<table width=300><tr>");
|
| 3177 | - | + writeD(slot.getPaperdollItemId(Paperdoll.FEET)); |
| 3177 | + | + sb.append("<td align=center width=70>" + (page > 1 ? "<button value=\"< PREV\" action=\"bypass -h dressme " + (page - 1) + " myskinlist\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
|
| 3178 | + sb.append("<td align=center width=140>Page: " + page + "</td>");
| |
| 3179 | + sb.append("<td align=center width=70>" + (hasMore ? "<button value=\"NEXT >\" action=\"bypass -h dressme " + (page + 1) + " myskinlist\" width=65 height=19 back=L2UI_ch3.smallbutton2_over fore=L2UI_ch3.smallbutton2>" : "") + "</td>");
| |
| 3180 | - | + writeD(slot.getPaperdollItemId(Paperdoll.CLOAK)); |
| 3180 | + | + sb.append("</tr></table>");
|
| 3181 | + | |
| 3182 | - | + if (slot.getWeaponSkinOption() > 0 && getWeaponOption(slot.getWeaponSkinOption()) != null) |
| 3182 | + | + html.replace("%showList%", sb.toString());
|
| 3183 | + player.sendPacket(html); | |
| 3184 | - | + writeD(getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(slot.getWeaponSkinOption()).getWeaponId() : slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3184 | + | |
| 3185 | + | |
| 3186 | - | + else |
| 3186 | + | + public static boolean checkWeapons(Player player, ItemInstance skin, WeaponType weapon1, WeaponType weapon2) |
| 3187 | + {
| |
| 3188 | - | + writeD(slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3188 | + | + if (player.getActiveWeaponItem().getItemType() == weapon1 && skin.getItem().getItemType() != weapon2) |
| 3189 | + {
| |
| 3190 | + return false; | |
| 3191 | - | + if (slot.getHairSkinOption() > 0 && getHairOption(slot.getHairSkinOption()) != null) |
| 3191 | + | |
| 3192 | + | |
| 3193 | - | + writeD(getHairOption(slot.getHairSkinOption()).getHairId() != 0 ? getHairOption(slot.getHairSkinOption()).getHairId() : slot.getPaperdollItemId(Paperdoll.HAIR)); |
| 3193 | + | |
| 3194 | + } | |
| 3195 | - | + else |
| 3195 | + | |
| 3196 | + | |
| 3197 | - | + writeD(slot.getPaperdollItemId(Paperdoll.HAIR)); |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | - | + if (slot.getFaceSkinOption() > 0 && getFaceOption(slot.getFaceSkinOption()) != null) |
| 3200 | + | |
| 3201 | } | |
| 3202 | - | + writeD(getFaceOption(slot.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(slot.getFaceSkinOption()).getFaceId() : slot.getPaperdollItemId(Paperdoll.FACE)); |
| 3202 | + | |
| 3203 | diff --git java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java | |
| 3204 | - | + else |
| 3204 | + | index b963bd0..189ca7e 100644 |
| 3205 | --- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java | |
| 3206 | - | + writeD(slot.getPaperdollItemId(Paperdoll.FACE)); |
| 3206 | + | |
| 3207 | @@ -9,6 +9,9 @@ | |
| 3208 | import net.sf.l2j.gameserver.model.actor.Summon; | |
| 3209 | import net.sf.l2j.gameserver.model.actor.instance.Cubic; | |
| 3210 | ||
| 3211 | - | + writeD(slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3211 | + | |
| 3212 | - | + writeD(slot.getPaperdollItemId(Paperdoll.LHAND)); |
| 3212 | + | |
| 3213 | - | + writeD(slot.getPaperdollItemId(Paperdoll.GLOVES)); |
| 3213 | + | |
| 3214 | - | + writeD(slot.getPaperdollItemId(Paperdoll.CHEST)); |
| 3214 | + | |
| 3215 | - | + writeD(slot.getPaperdollItemId(Paperdoll.LEGS)); |
| 3215 | + | |
| 3216 | - | + writeD(slot.getPaperdollItemId(Paperdoll.FEET)); |
| 3216 | + | |
| 3217 | - | + writeD(slot.getPaperdollItemId(Paperdoll.CLOAK)); |
| 3217 | + | @@ -41,19 +44,92 @@ |
| 3218 | - | + writeD(slot.getPaperdollItemId(Paperdoll.RHAND)); |
| 3218 | + | writeD(_player.getAppearance().getSex().ordinal()); |
| 3219 | - | + writeD(slot.getPaperdollItemId(Paperdoll.HAIR)); |
| 3219 | + | writeD((_player.getClassIndex() == 0) ? _player.getClassId().getId() : _player.getBaseClass()); |
| 3220 | - | + writeD(slot.getPaperdollItemId(Paperdoll.FACE)); |
| 3220 | + | |
| 3221 | writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIRALL)); | |
| 3222 | - | |
| 3222 | + | writeD(_player.getInventory().getItemIdFrom(Paperdoll.HEAD)); |
| 3223 | - | writeD(slot.getHairStyle()); |
| 3223 | + | |
| 3224 | - | writeD(slot.getHairColor()); |
| 3224 | + | |
| 3225 | - | @@ -235,6 +360,7 @@ |
| 3225 | + | |
| 3226 | - | } |
| 3226 | + | |
| 3227 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); | |
| 3228 | - | slot.setClassId(activeClassId); |
| 3228 | + | |
| 3229 | - | + loadCharacterDressMeInfo(slot, objectId); |
| 3229 | + | |
| 3230 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); | |
| 3231 | - | // Get the augmentation for equipped weapon. |
| 3231 | + | |
| 3232 | - | final int weaponObjId = slot.getPaperdollObjectId(Paperdoll.RHAND); |
| 3232 | + | |
| 3233 | - | @@ -273,4 +399,49 @@ |
| 3233 | + | |
| 3234 | + | |
| 3235 | - | return new CharSelectSlot[0]; |
| 3235 | + | |
| 3236 | + if (Config.ALLOW_DRESS_ME_SYSTEM) | |
| 3237 | + {
| |
| 3238 | - | + private static void loadCharacterDressMeInfo(final CharSelectSlot charInfopackage, final int objectId) |
| 3238 | + | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3239 | + {
| |
| 3240 | - | + try (Connection con = ConnectionPool.getConnection(); |
| 3240 | + | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3241 | - | + PreparedStatement statement = con.prepareStatement("SELECT obj_Id, armor_skins, armor_skin_option, weapon_skins, weapon_skin_option, hair_skins, hair_skin_option, face_skins, face_skin_option FROM characters_dressme_data WHERE obj_id=?"))
|
| 3241 | + | |
| 3242 | + else | |
| 3243 | + {
| |
| 3244 | - | + statement.setInt(1, objectId); |
| 3244 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3245 | - | + try (ResultSet chardata = statement.executeQuery()) |
| 3245 | + | |
| 3246 | + | |
| 3247 | - | + if (chardata.next()) |
| 3247 | + | + if (_player.getShieldSkinOption() > 0 && getShieldOption(_player.getShieldSkinOption()) != null) |
| 3248 | + {
| |
| 3249 | - | + charInfopackage.setArmorSkinOption(chardata.getInt("armor_skin_option"));
|
| 3249 | + | + writeD(getShieldOption(_player.getShieldSkinOption()).getShieldId() != 0 ? getShieldOption(_player.getShieldSkinOption()).getShieldId() : _player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3250 | - | + charInfopackage.setWeaponSkinOption(chardata.getInt("weapon_skin_option"));
|
| 3250 | + | |
| 3251 | - | + charInfopackage.setHairSkinOption(chardata.getInt("hair_skin_option"));
|
| 3251 | + | |
| 3252 | - | + charInfopackage.setFaceSkinOption(chardata.getInt("face_skin_option"));
|
| 3252 | + | |
| 3253 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); | |
| 3254 | + } | |
| 3255 | + | |
| 3256 | - | + catch (final Exception e) |
| 3256 | + | + if (_player.getArmorSkinOption() > 0 && getArmorOption(_player.getArmorSkinOption()) != null) |
| 3257 | + {
| |
| 3258 | + writeD(getArmorOption(_player.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getGlovesId() : _player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); | |
| 3259 | + writeD(getArmorOption(_player.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getChestId() : _player.getInventory().getItemIdFrom(Paperdoll.CHEST)); | |
| 3260 | + writeD(getArmorOption(_player.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getLegsId() : _player.getInventory().getItemIdFrom(Paperdoll.LEGS)); | |
| 3261 | + writeD(getArmorOption(_player.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getFeetId() : _player.getInventory().getItemIdFrom(Paperdoll.FEET)); | |
| 3262 | + } | |
| 3263 | + else | |
| 3264 | - | + return (DressMeData.getInstance().getArmorSkinsPackage(option)); |
| 3264 | + | |
| 3265 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); | |
| 3266 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); | |
| 3267 | - | + public SkinPackage getWeaponOption(int option) |
| 3267 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3268 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); | |
| 3269 | - | + return DressMeData.getInstance().getWeaponSkinsPackage(option); |
| 3269 | + | |
| 3270 | + | |
| 3271 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); | |
| 3272 | - | + public SkinPackage getHairOption(int option) |
| 3272 | + | |
| 3273 | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) | |
| 3274 | - | + return DressMeData.getInstance().getHairSkinsPackage(option); |
| 3274 | + | |
| 3275 | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); | |
| 3276 | + } | |
| 3277 | - | + public SkinPackage getFaceOption(int option) |
| 3277 | + | |
| 3278 | + {
| |
| 3279 | - | + return DressMeData.getInstance().getFaceSkinsPackage(option); |
| 3279 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3280 | + } | |
| 3281 | + | |
| 3282 | + if (_player.getHairSkinOption() > 0 && getHairOption(_player.getHairSkinOption()) != null) | |
| 3283 | + {
| |
| 3284 | - | diff --git java/net/sf/l2j/gameserver/model/CharSelectSlot.java java/net/sf/l2j/gameserver/model/CharSelectSlot.java |
| 3284 | + | + writeD(getHairOption(_player.getHairSkinOption()).getHairId() != 0 ? getHairOption(_player.getHairSkinOption()).getHairId() : _player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3285 | - | index 814d28a..4ef5400 100644 |
| 3285 | + | |
| 3286 | - | --- java/net/sf/l2j/gameserver/model/CharSelectSlot.java |
| 3286 | + | |
| 3287 | - | +++ java/net/sf/l2j/gameserver/model/CharSelectSlot.java |
| 3287 | + | |
| 3288 | - | @@ -49,6 +49,11 @@ |
| 3288 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3289 | - | private int _z = 0; |
| 3289 | + | |
| 3290 | - | private int _accessLevel = 0; |
| 3290 | + | |
| 3291 | + if (_player.getFaceSkinOption() > 0 && getFaceOption(_player.getFaceSkinOption()) != null) | |
| 3292 | - | + private int _armorSkinOption = 0; |
| 3292 | + | |
| 3293 | - | + private int _weaponSkinOption = 0; |
| 3293 | + | + writeD(getFaceOption(_player.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(_player.getFaceSkinOption()).getFaceId() : _player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3294 | - | + private int _hairSkinOption = 0; |
| 3294 | + | |
| 3295 | - | + private int _faceSkinOption = 0; |
| 3295 | + | |
| 3296 | + {
| |
| 3297 | - | public CharSelectSlot(int objectId, String name) |
| 3297 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3298 | + } | |
| 3299 | - | _objectId = objectId; |
| 3299 | + | |
| 3300 | - | @@ -368,4 +373,45 @@ |
| 3300 | + | |
| 3301 | + else {
| |
| 3302 | - | return paperdoll; |
| 3302 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3303 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); | |
| 3304 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); | |
| 3305 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); | |
| 3306 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); | |
| 3307 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); | |
| 3308 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); | |
| 3309 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); | |
| 3310 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); | |
| 3311 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); | |
| 3312 | + } | |
| 3313 | + | |
| 3314 | + | |
| 3315 | - | + public void setWeaponSkinOption(int armorSkinOption) |
| 3315 | + | |
| 3316 | + | |
| 3317 | - | + _weaponSkinOption = armorSkinOption; |
| 3317 | + | |
| 3318 | writeH(0x00); | |
| 3319 | writeH(0x00); | |
| 3320 | @@ -159,4 +235,30 @@ | |
| 3321 | writeD(_player.getAppearance().getTitleColor()); | |
| 3322 | writeD(CursedWeaponManager.getInstance().getCurrentStage(_player.getCursedWeaponEquippedId())); | |
| 3323 | } | |
| 3324 | + | |
| 3325 | + public SkinPackage getArmorOption(int option) | |
| 3326 | +{
| |
| 3327 | + return (DressMeData.getInstance().getArmorSkinsPackage(option)); | |
| 3328 | +} | |
| 3329 | + | |
| 3330 | +public SkinPackage getWeaponOption(int option) | |
| 3331 | +{
| |
| 3332 | + return DressMeData.getInstance().getWeaponSkinsPackage(option); | |
| 3333 | +} | |
| 3334 | + | |
| 3335 | +public SkinPackage getHairOption(int option) | |
| 3336 | +{
| |
| 3337 | + return DressMeData.getInstance().getHairSkinsPackage(option); | |
| 3338 | +} | |
| 3339 | + | |
| 3340 | +public SkinPackage getFaceOption(int option) | |
| 3341 | +{
| |
| 3342 | + return DressMeData.getInstance().getFaceSkinsPackage(option); | |
| 3343 | +} | |
| 3344 | + | |
| 3345 | +public SkinPackage getShieldOption(int option) | |
| 3346 | +{
| |
| 3347 | + return DressMeData.getInstance().getShieldSkinsPackage(option); | |
| 3348 | - | index b963bd0..e5601b6 100644 |
| 3348 | + | +} |
| 3349 | + | |
| 3350 | } | |
| 3351 | \ No newline at end of file | |
| 3352 | diff --git java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java | |
| 3353 | index b1679c0..7005b8f 100644 | |
| 3354 | --- java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java | |
| 3355 | +++ java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java | |
| 3356 | @@ -9,6 +9,9 @@ | |
| 3357 | import net.sf.l2j.gameserver.model.actor.Summon; | |
| 3358 | import net.sf.l2j.gameserver.model.actor.instance.Cubic; | |
| 3359 | ||
| 3360 | +import Base.Skin.DressMeData; | |
| 3361 | - | @@ -43,16 +46,83 @@ |
| 3361 | + | |
| 3362 | + | |
| 3363 | public class UserInfo extends L2GameServerPacket | |
| 3364 | {
| |
| 3365 | private final Player _player; | |
| 3366 | @@ -56,6 +59,12 @@ | |
| 3367 | writeD(_player.getWeightLimit()); | |
| 3368 | writeD(_player.getActiveWeaponItem() != null ? 40 : 20); | |
| 3369 | ||
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | - | + if (Config.ALLOW_DRESS_ME_SYSTEM) |
| 3375 | + | |
| 3376 | - | + {
|
| 3376 | + | writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.HAIRALL)); |
| 3377 | - | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3377 | + | writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.REAR)); |
| 3378 | - | + {
|
| 3378 | + | writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LEAR)); |
| 3379 | - | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3379 | + | @@ -63,16 +72,88 @@ |
| 3380 | - | + } |
| 3380 | + | |
| 3381 | - | + else |
| 3381 | + | |
| 3382 | - | + {
|
| 3382 | + | |
| 3383 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3383 | + | |
| 3384 | - | + } |
| 3384 | + | |
| 3385 | - | + |
| 3385 | + | |
| 3386 | - | + if (_player.getShieldSkinOption() > 0 && getShieldOption(_player.getShieldSkinOption()) != null) |
| 3386 | + | |
| 3387 | - | + {
|
| 3387 | + | |
| 3388 | - | + writeD(getShieldOption(_player.getShieldSkinOption()).getShieldId() != 0 ? getShieldOption(_player.getShieldSkinOption()).getShieldId() : _player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3388 | + | |
| 3389 | - | + } |
| 3389 | + | |
| 3390 | - | + else |
| 3390 | + | |
| 3391 | - | + {
|
| 3391 | + | |
| 3392 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3392 | + | |
| 3393 | - | + } |
| 3393 | + | |
| 3394 | - | + |
| 3394 | + | |
| 3395 | - | + if (_player.getArmorSkinOption() > 0 && getArmorOption(_player.getArmorSkinOption()) != null) |
| 3395 | + | |
| 3396 | - | + {
|
| 3396 | + | + if (Config.ALLOW_DRESS_ME_SYSTEM) |
| 3397 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getGlovesId() : _player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3397 | + | |
| 3398 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getChestId() : _player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3398 | + | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3399 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getLegsId() : _player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3399 | + | |
| 3400 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getFeetId() : _player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3400 | + | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3401 | - | + } |
| 3401 | + | |
| 3402 | - | + else |
| 3402 | + | |
| 3403 | - | + {
|
| 3403 | + | |
| 3404 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3404 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3405 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3405 | + | |
| 3406 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3406 | + | |
| 3407 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3407 | + | + if (_player.getShieldSkinOption() > 0 && getShieldOption(_player.getShieldSkinOption()) != null) |
| 3408 | - | + } |
| 3408 | + | |
| 3409 | - | + |
| 3409 | + | + writeD(getShieldOption(_player.getShieldSkinOption()).getShieldId() != 0 ? getShieldOption(_player.getShieldSkinOption()).getShieldId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.LHAND)); |
| 3410 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); |
| 3410 | + | |
| 3411 | - | + |
| 3411 | + | |
| 3412 | - | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3412 | + | |
| 3413 | - | + {
|
| 3413 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LHAND)); |
| 3414 | - | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3414 | + | |
| 3415 | - | + } |
| 3415 | + | |
| 3416 | - | + else |
| 3416 | + | + if (_player.getArmorSkinOption() > 0 && getArmorOption(_player.getArmorSkinOption()) != null) |
| 3417 | - | + {
|
| 3417 | + | |
| 3418 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3418 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getGlovesId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.GLOVES)); |
| 3419 | - | + } |
| 3419 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getChestId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.CHEST)); |
| 3420 | - | + |
| 3420 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getLegsId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.LEGS)); |
| 3421 | - | + if (_player.getHairSkinOption() > 0 && getHairOption(_player.getHairSkinOption()) != null) |
| 3421 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getFeetId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.FEET)); |
| 3422 | - | + {
|
| 3422 | + | |
| 3423 | - | + writeD(getHairOption(_player.getHairSkinOption()).getHairId() != 0 ? getHairOption(_player.getHairSkinOption()).getHairId() : _player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3423 | + | |
| 3424 | - | + } |
| 3424 | + | |
| 3425 | - | + else |
| 3425 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.GLOVES)); |
| 3426 | - | + {
|
| 3426 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CHEST)); |
| 3427 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3427 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LEGS)); |
| 3428 | - | + } |
| 3428 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FEET)); |
| 3429 | - | + |
| 3429 | + | |
| 3430 | - | + if (_player.getFaceSkinOption() > 0 && getFaceOption(_player.getFaceSkinOption()) != null) |
| 3430 | + | |
| 3431 | - | + {
|
| 3431 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CLOAK)); |
| 3432 | - | + writeD(getFaceOption(_player.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(_player.getFaceSkinOption()).getFaceId() : _player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3432 | + | |
| 3433 | - | + } |
| 3433 | + | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3434 | - | + else |
| 3434 | + | |
| 3435 | - | + {
|
| 3435 | + | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3436 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3436 | + | |
| 3437 | - | + } |
| 3437 | + | |
| 3438 | - | + |
| 3438 | + | |
| 3439 | - | + } |
| 3439 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3440 | - | + else {
|
| 3440 | + | |
| 3441 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3441 | + | |
| 3442 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3442 | + | + if (_player.getHairSkinOption() > 0 && getHairOption(_player.getHairSkinOption()) != null) |
| 3443 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3443 | + | |
| 3444 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3444 | + | + writeD(getHairOption(_player.getHairSkinOption()).getHairId() != 0 ? getHairOption(_player.getHairSkinOption()).getHairId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.HAIR)); |
| 3445 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3445 | + | |
| 3446 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3446 | + | |
| 3447 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); |
| 3447 | + | |
| 3448 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3448 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.HAIR)); |
| 3449 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3449 | + | |
| 3450 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3450 | + | |
| 3451 | - | + } |
| 3451 | + | + if (_player.getFaceSkinOption() > 0 && getFaceOption(_player.getFaceSkinOption()) != null) |
| 3452 | + {
| |
| 3453 | + writeD(getFaceOption(_player.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(_player.getFaceSkinOption()).getFaceId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.FACE)); | |
| 3454 | + } | |
| 3455 | - | @@ -159,4 +229,30 @@ |
| 3455 | + | |
| 3456 | + {
| |
| 3457 | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FACE)); | |
| 3458 | + } | |
| 3459 | + | |
| 3460 | - | + public SkinPackage getArmorOption(int option) |
| 3460 | + | |
| 3461 | - | + {
|
| 3461 | + | + else {
|
| 3462 | - | + return (DressMeData.getInstance().getArmorSkinsPackage(option)); |
| 3462 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3463 | - | + } |
| 3463 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LHAND)); |
| 3464 | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.GLOVES)); | |
| 3465 | - | + public SkinPackage getWeaponOption(int option) |
| 3465 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CHEST)); |
| 3466 | - | + {
|
| 3466 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LEGS)); |
| 3467 | - | + return DressMeData.getInstance().getWeaponSkinsPackage(option); |
| 3467 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FEET)); |
| 3468 | - | + } |
| 3468 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CLOAK)); |
| 3469 | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); | |
| 3470 | - | + public SkinPackage getHairOption(int option) |
| 3470 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.HAIR)); |
| 3471 | - | + {
|
| 3471 | + | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FACE)); |
| 3472 | - | + return DressMeData.getInstance().getHairSkinsPackage(option); |
| 3472 | + | |
| 3473 | - | + } |
| 3473 | + | |
| 3474 | + | |
| 3475 | - | + public SkinPackage getFaceOption(int option) |
| 3475 | + | |
| 3476 | - | + {
|
| 3476 | + | |
| 3477 | - | + return DressMeData.getInstance().getFaceSkinsPackage(option); |
| 3477 | + | |
| 3478 | - | + } |
| 3478 | + | @@ -81,16 +162,84 @@ |
| 3479 | writeD(_player.getInventory().getItemIdFrom(Paperdoll.RFINGER)); | |
| 3480 | - | + public SkinPackage getShieldOption(int option) |
| 3480 | + | |
| 3481 | - | + {
|
| 3481 | + | |
| 3482 | - | + return DressMeData.getInstance().getShieldSkinsPackage(option); |
| 3482 | + | |
| 3483 | - | + } |
| 3483 | + | |
| 3484 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); | |
| 3485 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); | |
| 3486 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); | |
| 3487 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); | |
| 3488 | - | index b1679c0..b89ba55 100644 |
| 3488 | + | |
| 3489 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); | |
| 3490 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); | |
| 3491 | - writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); | |
| 3492 | + if (Config.ALLOW_DRESS_ME_SYSTEM) | |
| 3493 | + {
| |
| 3494 | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) | |
| 3495 | + {
| |
| 3496 | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); | |
| 3497 | + } | |
| 3498 | + else | |
| 3499 | + {
| |
| 3500 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); | |
| 3501 | - | @@ -63,16 +66,83 @@ |
| 3501 | + | |
| 3502 | + | |
| 3503 | + if (_player.getShieldSkinOption() > 0 && getShieldOption(_player.getShieldSkinOption()) != null) | |
| 3504 | + {
| |
| 3505 | + writeD(getShieldOption(_player.getShieldSkinOption()).getShieldId() != 0 ? getShieldOption(_player.getShieldSkinOption()).getShieldId() : _player.getInventory().getItemIdFrom(Paperdoll.LHAND)); | |
| 3506 | + } | |
| 3507 | + else | |
| 3508 | + {
| |
| 3509 | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); | |
| 3510 | + } | |
| 3511 | + | |
| 3512 | + if (_player.getArmorSkinOption() > 0 && getArmorOption(_player.getArmorSkinOption()) != null) | |
| 3513 | + {
| |
| 3514 | + writeD(getArmorOption(_player.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getGlovesId() : _player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); | |
| 3515 | - | + if (Config.ALLOW_DRESS_ME_SYSTEM) |
| 3515 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getChestId() : _player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3516 | - | + {
|
| 3516 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getLegsId() : _player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3517 | - | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3517 | + | + writeD(getArmorOption(_player.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getFeetId() : _player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3518 | - | + {
|
| 3518 | + | |
| 3519 | - | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3519 | + | |
| 3520 | - | + } |
| 3520 | + | |
| 3521 | - | + else |
| 3521 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3522 | - | + {
|
| 3522 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3523 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3523 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3524 | - | + } |
| 3524 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3525 | - | + |
| 3525 | + | |
| 3526 | - | + if (_player.getShieldSkinOption() > 0 && getShieldOption(_player.getShieldSkinOption()) != null) |
| 3526 | + | |
| 3527 | - | + {
|
| 3527 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); |
| 3528 | - | + writeD(getShieldOption(_player.getShieldSkinOption()).getShieldId() != 0 ? getShieldOption(_player.getShieldSkinOption()).getShieldId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.LHAND)); |
| 3528 | + | |
| 3529 | - | + } |
| 3529 | + | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3530 | - | + else |
| 3530 | + | |
| 3531 | - | + {
|
| 3531 | + | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3532 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LHAND)); |
| 3532 | + | |
| 3533 | - | + } |
| 3533 | + | |
| 3534 | - | + |
| 3534 | + | |
| 3535 | - | + if (_player.getArmorSkinOption() > 0 && getArmorOption(_player.getArmorSkinOption()) != null) |
| 3535 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3536 | - | + {
|
| 3536 | + | |
| 3537 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getGlovesId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.GLOVES)); |
| 3537 | + | |
| 3538 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getChestId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.CHEST)); |
| 3538 | + | + if (_player.getHairSkinOption() > 0 && getHairOption(_player.getHairSkinOption()) != null) |
| 3539 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getLegsId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.LEGS)); |
| 3539 | + | |
| 3540 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getFeetId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.FEET)); |
| 3540 | + | + writeD(getHairOption(_player.getHairSkinOption()).getHairId() != 0 ? getHairOption(_player.getHairSkinOption()).getHairId() : _player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3541 | - | + } |
| 3541 | + | |
| 3542 | - | + else |
| 3542 | + | |
| 3543 | - | + {
|
| 3543 | + | |
| 3544 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.GLOVES)); |
| 3544 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3545 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CHEST)); |
| 3545 | + | |
| 3546 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LEGS)); |
| 3546 | + | |
| 3547 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FEET)); |
| 3547 | + | + if (_player.getFaceSkinOption() > 0 && getFaceOption(_player.getFaceSkinOption()) != null) |
| 3548 | - | + } |
| 3548 | + | |
| 3549 | - | + |
| 3549 | + | + writeD(getFaceOption(_player.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(_player.getFaceSkinOption()).getFaceId() : _player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3550 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CLOAK)); |
| 3550 | + | |
| 3551 | - | + |
| 3551 | + | |
| 3552 | - | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3552 | + | |
| 3553 | - | + {
|
| 3553 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3554 | - | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3554 | + | |
| 3555 | - | + } |
| 3555 | + | |
| 3556 | - | + else |
| 3556 | + | |
| 3557 | - | + {
|
| 3557 | + | + else {
|
| 3558 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3558 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3559 | - | + } |
| 3559 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3560 | - | + |
| 3560 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3561 | - | + if (_player.getHairSkinOption() > 0 && getHairOption(_player.getHairSkinOption()) != null) |
| 3561 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3562 | - | + {
|
| 3562 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3563 | - | + writeD(getHairOption(_player.getHairSkinOption()).getHairId() != 0 ? getHairOption(_player.getHairSkinOption()).getHairId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.HAIR)); |
| 3563 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3564 | - | + } |
| 3564 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); |
| 3565 | - | + else |
| 3565 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3566 | - | + {
|
| 3566 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3567 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.HAIR)); |
| 3567 | + | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3568 | - | + } |
| 3568 | + | |
| 3569 | - | + |
| 3569 | + | |
| 3570 | - | + if (_player.getFaceSkinOption() > 0 && getFaceOption(_player.getFaceSkinOption()) != null) |
| 3570 | + | |
| 3571 | - | + {
|
| 3571 | + | |
| 3572 | - | + writeD(getFaceOption(_player.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(_player.getFaceSkinOption()).getFaceId() : _player.getInventory().getItemObjectIdFrom(Paperdoll.FACE)); |
| 3572 | + | |
| 3573 | - | + } |
| 3573 | + | @@ -214,4 +363,29 @@ |
| 3574 | - | + else |
| 3574 | + | |
| 3575 | - | + {
|
| 3575 | + | |
| 3576 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FACE)); |
| 3576 | + | |
| 3577 | - | + } |
| 3577 | + | |
| 3578 | - | + |
| 3578 | + | + public SkinPackage getArmorOption(int option) |
| 3579 | - | + } |
| 3579 | + | |
| 3580 | - | + else {
|
| 3580 | + | + return (DressMeData.getInstance().getArmorSkinsPackage(option)); |
| 3581 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3581 | + | |
| 3582 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LHAND)); |
| 3582 | + | |
| 3583 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.GLOVES)); |
| 3583 | + | + public SkinPackage getWeaponOption(int option) |
| 3584 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CHEST)); |
| 3584 | + | |
| 3585 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.LEGS)); |
| 3585 | + | + return DressMeData.getInstance().getWeaponSkinsPackage(option); |
| 3586 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FEET)); |
| 3586 | + | |
| 3587 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.CLOAK)); |
| 3587 | + | |
| 3588 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.RHAND)); |
| 3588 | + | + public SkinPackage getHairOption(int option) |
| 3589 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.HAIR)); |
| 3589 | + | |
| 3590 | - | + writeD(_player.getInventory().getItemObjectIdFrom(Paperdoll.FACE)); |
| 3590 | + | + return DressMeData.getInstance().getHairSkinsPackage(option); |
| 3591 | - | + } |
| 3591 | + | |
| 3592 | + | |
| 3593 | + public SkinPackage getFaceOption(int option) | |
| 3594 | + {
| |
| 3595 | - | @@ -81,16 +151,83 @@ |
| 3595 | + | + return DressMeData.getInstance().getFaceSkinsPackage(option); |
| 3596 | + } | |
| 3597 | + | |
| 3598 | + public SkinPackage getShieldOption(int option) | |
| 3599 | + {
| |
| 3600 | + return DressMeData.getInstance().getShieldSkinsPackage(option); | |
| 3601 | + } | |
| 3602 | } | |
| 3603 | \ No newline at end of file | |
| 3604 | diff --git server/gameserver/config/players.properties server/gameserver/config/players.properties | |
| 3605 | index a3e8e08..c1da93b 100644 | |
| 3606 | --- server/gameserver/config/players.properties | |
| 3607 | +++ server/gameserver/config/players.properties | |
| 3608 | @@ -14,6 +14,22 @@ | |
| 3609 | - | + if (Config.ALLOW_DRESS_ME_SYSTEM) |
| 3609 | + | MpRegenMultiplier = 1. |
| 3610 | - | + {
|
| 3610 | + | CpRegenMultiplier = 1. |
| 3611 | - | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3611 | + | |
| 3612 | - | + {
|
| 3612 | + | |
| 3613 | - | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3613 | + | |
| 3614 | - | + } |
| 3614 | + | |
| 3615 | - | + else |
| 3615 | + | |
| 3616 | - | + {
|
| 3616 | + | |
| 3617 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3617 | + | |
| 3618 | - | + } |
| 3618 | + | |
| 3619 | - | + |
| 3619 | + | |
| 3620 | - | + if (_player.getShieldSkinOption() > 0 && getShieldOption(_player.getShieldSkinOption()) != null) |
| 3620 | + | +AllowDressMeForPremiumOnly = True |
| 3621 | - | + {
|
| 3621 | + | |
| 3622 | - | + writeD(getShieldOption(_player.getShieldSkinOption()).getShieldId() != 0 ? getShieldOption(_player.getShieldSkinOption()).getShieldId() : _player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3622 | + | |
| 3623 | - | + } |
| 3623 | + | |
| 3624 | - | + else |
| 3624 | + | |
| 3625 | - | + {
|
| 3625 | + | |
| 3626 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3626 | + | |
| 3627 | - | + } |
| 3627 | + | |
| 3628 | - | + |
| 3628 | + | # Player Protection after teleporting or login in seconds, 0 for disabled |
| 3629 | - | + if (_player.getArmorSkinOption() > 0 && getArmorOption(_player.getArmorSkinOption()) != null) |
| 3629 | + | PlayerSpawnProtection = 0 |
| 3630 | - | + {
|
| 3630 | + | |
| 3631 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getGlovesId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getGlovesId() : _player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3631 | + | |
| 3632 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getChestId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getChestId() : _player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3632 | + | |
| 3633 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getLegsId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getLegsId() : _player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3633 | + | index 0000000..f46a2bd |
| 3634 | - | + writeD(getArmorOption(_player.getArmorSkinOption()).getFeetId() != 0 ? getArmorOption(_player.getArmorSkinOption()).getFeetId() : _player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3634 | + | |
| 3635 | - | + } |
| 3635 | + | |
| 3636 | - | + else |
| 3636 | + | |
| 3637 | - | + {
|
| 3637 | + | |
| 3638 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3638 | + | |
| 3639 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3639 | + | |
| 3640 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3640 | + | |
| 3641 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3641 | + | |
| 3642 | - | + } |
| 3642 | + | |
| 3643 | - | + |
| 3643 | + | |
| 3644 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); |
| 3644 | + | |
| 3645 | - | + |
| 3645 | + | |
| 3646 | - | + if (_player.getWeaponSkinOption() > 0 && getWeaponOption(_player.getWeaponSkinOption()) != null) |
| 3646 | + | |
| 3647 | - | + {
|
| 3647 | + | |
| 3648 | - | + writeD(getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() != 0 ? getWeaponOption(_player.getWeaponSkinOption()).getWeaponId() : _player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3648 | + | |
| 3649 | - | + } |
| 3649 | + | |
| 3650 | - | + else |
| 3650 | + | |
| 3651 | - | + {
|
| 3651 | + | |
| 3652 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3652 | + | |
| 3653 | - | + } |
| 3653 | + | |
| 3654 | - | + |
| 3654 | + | |
| 3655 | - | + if (_player.getHairSkinOption() > 0 && getHairOption(_player.getHairSkinOption()) != null) |
| 3655 | + | |
| 3656 | - | + {
|
| 3656 | + | |
| 3657 | - | + writeD(getHairOption(_player.getHairSkinOption()).getHairId() != 0 ? getHairOption(_player.getHairSkinOption()).getHairId() : _player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3657 | + | |
| 3658 | - | + } |
| 3658 | + | |
| 3659 | - | + else |
| 3659 | + | |
| 3660 | - | + {
|
| 3660 | + | index 0000000..1175fed |
| 3661 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3661 | + | |
| 3662 | - | + } |
| 3662 | + | |
| 3663 | - | + |
| 3663 | + | |
| 3664 | - | + if (_player.getFaceSkinOption() > 0 && getFaceOption(_player.getFaceSkinOption()) != null) |
| 3664 | + | |
| 3665 | - | + {
|
| 3665 | + | |
| 3666 | - | + writeD(getFaceOption(_player.getFaceSkinOption()).getFaceId() != 0 ? getFaceOption(_player.getFaceSkinOption()).getFaceId() : _player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3666 | + | |
| 3667 | - | + } |
| 3667 | + | |
| 3668 | - | + else |
| 3668 | + | |
| 3669 | - | + {
|
| 3669 | + | |
| 3670 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3670 | + | |
| 3671 | - | + } |
| 3671 | + | |
| 3672 | - | + |
| 3672 | + | |
| 3673 | - | + } |
| 3673 | + | |
| 3674 | - | + else {
|
| 3674 | + | |
| 3675 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3675 | + | |
| 3676 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LHAND)); |
| 3676 | + | |
| 3677 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.GLOVES)); |
| 3677 | + | |
| 3678 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CHEST)); |
| 3678 | + | |
| 3679 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.LEGS)); |
| 3679 | + | |
| 3680 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FEET)); |
| 3680 | + | |
| 3681 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.CLOAK)); |
| 3681 | + | |
| 3682 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.RHAND)); |
| 3682 | + | |
| 3683 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.HAIR)); |
| 3683 | + | |
| 3684 | - | + writeD(_player.getInventory().getItemIdFrom(Paperdoll.FACE)); |
| 3684 | + | |
| 3685 | - | + } |
| 3685 | + | |
| 3686 | +<tr> | |
| 3687 | +<td align=center><button value="My skins" action="bypass -h dressme 1 myskinlist" width=134 height=19 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3"></td> | |
| 3688 | +</tr> | |
| 3689 | - | @@ -214,4 +351,28 @@ |
| 3689 | + | |
| 3690 | + | |
| 3691 | +</body> | |
| 3692 | +</html> | |
| 3693 | - | + public SkinPackage getArmorOption(int option) |
| 3693 | + | |
| 3694 | - | + {
|
| 3694 | + | |
| 3695 | - | + return (DressMeData.getInstance().getArmorSkinsPackage(option)); |
| 3695 | + | |
| 3696 | - | + } |
| 3696 | + | index 0000000..381164c |
| 3697 | - | + |
| 3697 | + | |
| 3698 | - | + public SkinPackage getWeaponOption(int option) |
| 3698 | + | |
| 3699 | - | + {
|
| 3699 | + | |
| 3700 | - | + return DressMeData.getInstance().getWeaponSkinsPackage(option); |
| 3700 | + | |
| 3701 | - | + } |
| 3701 | + | |
| 3702 | - | + |
| 3702 | + | |
| 3703 | - | + public SkinPackage getHairOption(int option) |
| 3703 | + | |
| 3704 | - | + {
|
| 3704 | + | |
| 3705 | - | + return DressMeData.getInstance().getHairSkinsPackage(option); |
| 3705 | + | |
| 3706 | - | + } |
| 3706 | + | |
| 3707 | - | + |
| 3707 | + | |
| 3708 | - | + public SkinPackage getFaceOption(int option) |
| 3708 | + | |
| 3709 | - | + {
|
| 3709 | + | |
| 3710 | - | + return DressMeData.getInstance().getFaceSkinsPackage(option); |
| 3710 | + | |
| 3711 | - | + } |
| 3711 | + | |
| 3712 | - | + |
| 3712 | + | |
| 3713 | - | + public SkinPackage getShieldOption(int option) |
| 3713 | + | |
| 3714 | - | + {
|
| 3714 | + | |
| 3715 | - | + return DressMeData.getInstance().getShieldSkinsPackage(option); |
| 3715 | + | |
| 3716 | - | + } |
| 3716 | + | |
| 3717 | +<button value="Back" action="bypass -h custom_dressme_back" width=65 height=19 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> | |
| 3718 | +</center> | |
| 3719 | +</body> | |
| 3720 | +</html> | |
| 3721 | - | index 0000000..c865d6a |
| 3721 | + | |
| 3722 | diff --git server/gameserver/data/xml/dressme.xml server/gameserver/data/xml/dressme.xml | |
| 3723 | new file mode 100644 | |
| 3724 | index 0000000..b8c5ef5 | |
| 3725 | --- /dev/null | |
| 3726 | +++ server/gameserver/data/xml/dressme.xml | |
| 3727 | @@ -0,0 +1,18 @@ | |
| 3728 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 3729 | +<list> | |
| 3730 | + <skin type="armor"> <!-- Armors --> | |
| 3731 | + <type id="1" name="Draconic Armor" chestId="6379" legsId="6379" glovesId="6380" feetId=" 6381" priceId="57" priceCount="100"/> | |
| 3732 | + <type id="2" name="Blue Wolf Leather Armor" chestId="2391" legsId="0" glovesId="0" feetId="0" priceId="57" priceCount="100"/> | |
| 3733 | + </skin> | |
| 3734 | + <skin type="weapon"> <!-- Weapons --> | |
| 3735 | + <type id="1" name="Draconic Bow" weaponId="7575" priceId="57" priceCount="100"/> | |
| 3736 | + <type id="2" name="Arcana Mace" weaponId="6608" priceId="57" priceCount="100"/> | |
| 3737 | + <type id="3" name="Keshanberk*Keshanberk" weaponId="5704" priceId="57" priceCount="100"/> | |
| 3738 | + </skin> | |
| 3739 | + <skin type="hair"> <!-- Hairs --> | |
| 3740 | + <type id="1" name="Cat Ear" hairId="6843" priceId="57" priceCount="100"/> | |
| 3741 | + </skin> | |
| 3742 | + <skin type="face"> <!-- Faces --> | |
| 3743 | + <type id="1" name="Party Mask" faceId="5808" priceId="57" priceCount="100"/> | |
| 3744 | + </skin> | |
| 3745 | + <skin type="shield"> <!-- Shields --> | |
| 3746 | + <type id="1" name="Shield of Night" shieldId="2498" priceId="57" priceCount="100"/> | |
| 3747 | + <type id="2" name="Imperial Shield" shieldId="6377" priceId="57" priceCount="100"/> | |
| 3748 | - | index 0000000..f03dd39 |
| 3748 | + | |
| 3749 | +</list> | |
| 3750 | \ No newline at end of file |