Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Dev.VisualSkins.Visual.java
- ===================================================================
- --- Dev.VisualSkins.Visual.java (revision 384)
- +++ Dev.VisualSkins.Visual.java (working copy)
- + package Dev.VisualSkins;
- +
- + import net.sf.l2j.gameserver.handler.IItemHandler;
- + import net.sf.l2j.gameserver.model.actor.Playable;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
- + import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
- +
- + /**
- + * @author COMBATE
- + * @author Juvenil Amaro
- + */
- + public class Visual implements IItemHandler
- + {
- + @Override
- + public void useItem(Playable playable, ItemInstance item, boolean forceUse)
- + {
- + if (!(playable instanceof Player))
- + return;
- +
- + Player player = (Player) playable;
- + int itemId = item.getItemId();
- + switch(itemId)
- + {
- + case 26101:
- + case 26111:
- + case 26121:
- + player.broadcastPacket(new MagicSkillUse(player, 1410, 1, 10000, 10000));
- + player.setVisual(player.getVisual() == 1 ? 0 : 1);
- + break;
- + case 26102:
- + case 26112:
- + case 26122:
- + player.setVisual(player.getVisual() == 2 ? 0 : 2);
- + break;
- + case 26103:
- + case 26113:
- + case 26123:
- + player.setVisual(player.getVisual() == 3 ? 0 : 3);
- + break;
- + case 26104:
- + case 26114:
- + case 26124:
- + player.setVisual(player.getVisual() == 4 ? 0 : 4);
- + break;
- + case 26105:
- + case 26115:
- + case 26125:
- + player.setVisual(player.getVisual() == 5 ? 0 : 5);
- + break;
- + case 23881:
- + player.setVisual(player.getVisual() == 6 ? 0 : 6);
- + break;
- + }
- + }
- + }
- +
- Index: net.sf.l2j.gameserver.model.actor.instance;Merchant.java
- ===================================================================
- --- net.sf.l2j.gameserver.model.actor.instance;Merchant.java (revision 384)
- +++ net.sf.l2j.gameserver.model.actor.instance;Merchant.java (working copy)
- + else if (currentCommand.startsWith("visualTest"))
- + {
- + if (player.getVisualTest() > 0)
- + {
- + player.sendMessage("You are already trying on a uniform, please wait till it finishes.");
- + return;
- + }
- +
- + player.broadcastPacket(new MagicSkillUse(player, 1410, 1, 1000, 1000));
- + player.setDressMeEnabled(false);
- + int uniform = Integer.parseInt(command.substring(11));
- + player.setVisualTest(uniform);
- + ThreadPool.schedule(() -> player.setVisualTest(0), 1000 * 15);
- + player.broadcastUserInfo();
- +
- +
- +
- + }
- Index: net.sf.l2j.gameserver.network.serverpackets;UserInfo.java
- ===================================================================
- --- net.sf.l2j.gameserver.network.serverpackets;UserInfo.java (revision 384)
- +++ net.sf.l2j.gameserver.network.serverpackets;UserInfo.java (working copy)
- + writeD(_activeChar.visual_test_chest > 0 ? _activeChar.visual_test_chest : (_activeChar.visual_chest > 0 ? _activeChar.visual_chest : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST)));
- +
- + writeD(_activeChar.visual_test_hair > 0 ? _activeChar.visual_test_hair : (_activeChar.visual_hair > 0 ? _activeChar.visual_hair : _activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR)));
- Index: net.sf.l2j.gameserver.model.actor;Player.java
- ===================================================================
- --- net.sf.l2j.gameserver.model.actor;Player.java (revision 384)
- +++ net.sf.l2j.gameserver.model.actor;Player.java (working copy)
- + private int visual = 0;
- + private int visualTest = 0;
- +
- + // Testing
- + public int visual_test_hair = 0;
- + public int visual_test_chest = 0;
- +
- + public int visual_hair = 0;
- + public int visual_chest = 0;
- +
- + public void setVisualTest(int val)
- + {
- + // HARDCODED FOR NOW
- + switch(val)
- + {
- + case 0:
- + visual_test_hair = 0;
- + visual_test_chest = 0;
- + break;
- +
- + case 1: // Draconic
- + visual_test_hair = 26201;
- + visual_test_chest = 26101;
- + break;
- + case 2:
- + visual_test_hair = 26202;
- + visual_test_chest = 26102;
- + break;
- + case 3:
- + visual_test_hair = 26203;
- + visual_test_chest = 26103;
- + break;
- + case 4:
- + visual_test_hair = 26204;
- + visual_test_chest = 26104;
- + break;
- + case 5:
- + visual_test_hair = 26205;
- + visual_test_chest = 26105;
- + break;
- + case 6:
- + visual_test_hair = 0;
- + visual_test_chest = 23881;
- + break;
- + }
- +
- + visualTest = val;
- + broadcastUserInfo();
- + }
- +
- + public int getVisualTest()
- + {
- + return visualTest;
- + }
- +
- + public void setVisual(int val)
- + {
- + // HARDCODED FOR NOW
- + switch(val)
- + {
- + case 0:
- + visual_hair = 0;
- + visual_chest = 0;
- + break;
- +
- + case 1:
- + visual_hair = 26201;
- + visual_chest = 26101;
- + break;
- + case 2:
- + visual_hair = 26202;
- + visual_chest = 26102;
- + break;
- + case 3:
- + visual_hair = 26203;
- + visual_chest = 26103;
- + break;
- + case 4:
- + visual_hair = 26204;
- + visual_chest = 26104;
- + break;
- + case 5:
- + visual_hair = 26205;
- + visual_chest = 26105;
- + break;
- + case 6:
- + visual_hair = 0;
- + visual_chest = 23881;
- + break;
- + }
- +
- + visual = val;
- + broadcastUserInfo();
- + }
- +
- + public int getVisual()
- + {
- + return visual;
- + }
- +
- Index: net.sf.l2j.gameserver.handler;ItemHandler.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler;ItemHandler.java(revision 384)
- +++ net.sf.l2j.gameserver.handler;ItemHandler.java (working copy)
- + registerHandler(new Visual());
- Index: data/html/merchant
- ===================================================================
- --- data/html/merchant (revision 384)
- +++ data/html/merchant (working copy)
- + <html>
- + <title>Beauty Shop</title>
- + <body>
- + <center>
- + <table cellpadding=-15 cellspacing=0>
- + <tr>
- + <td width=20></td>
- + <td><img src="TestLogo2.LogoTest2" width=210 height=145></td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=295 height=2>
- + <table width=295 bgcolor="000000">
- + <tr>
- + <td align=center><font color="CCCC66">You can try the Accesory before you buy it for 15 Seconds!</font></td>
- + </tr>
- + <tr>
- + <td align=center><font color="CCCC66">Choose which accesory you want before you pay for it!</font></td>
- + </tr>
- + <tr></tr>
- + <tr>
- + <td align=center><button value="Try White Assassin" action="bypass -h npc_%objectId%_visualTest 3" width=204 height=19 back="eola.btn_over" fore="eola.btn">
- + </td>
- + </tr>
- + <tr>
- + <td align=center><button value="Try Dark Assassin" action="bypass -h npc_%objectId%_visualTest 4" width=204 height=19 back="eola.btn_over" fore="eola.btn"></td>
- + </tr>
- + <tr>
- + <td align=center><button value="Try Dark Killer" action="bypass -h npc_%objectId%_visualTest 2" width=204 height=19 back="eola.btn_over" fore="eola.btn"></td>
- + </tr>
- + <tr>
- + <td align=center><button value="Try Beleth Costume" action="bypass -h npc_%objectId%_visualTest 5" width=204 height=19 back="eola.btn_over" fore="eola.btn"></td>
- + </tr>
- + <tr>
- + <td align=center><button value="Try Draconic Suit" action="bypass -h npc_%objectId%_visualTest 1" width=204 height=19 back="eola.btn_over" fore="eola.btn"></td>
- + </tr>
- + <tr>
- + <td align=center><button value="Try Anakim Costume" action="bypass -h npc_%objectId%_visualTest 6" width=204 height=19 back="eola.btn_over" fore="eola.btn"></td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=295 height=2>
- + <br>
- + <button value="Buy Uniforms" action="bypass -h npc_%objectId%_multisell 3259" width=204 height=19 back="eola.btn_over" fore="eola.btn">
- +
- + <br>
- + <br1>
- + <button value="Back" action="bypass -h npc_%objectId%_Chat 0" width=204 height=19 back="eola.btn_over" fore="eola.btn">
- +
- + <br>
- +
- + </center>
- + </body>
- + </html>
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement