mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 16:49:03 +00:00
Cleanup part 1 (#213)
* Clean up part 1 - Removed lots of dead code - Removed unncessary files not in use - Cleaned up small bits of code - Removed a few warnings - Server.java ---> GameEngine.java - Constants.java ---> GameConstants.java * Cape Dye Rewrote cape dying * Packaging - redone ----> com.rebotted * PacketSender/clean up - ActionSender ---> PacketSender - Moved many more packets to packetsender - Cleaned up more dead code * Merge Client/Player - Merged Client.java with Player.java (both were doing same thing so redundant to have both) - Removed some more dead code - Tidy a few small things up * Quests/more clean up - Removed more dead code - Made quests static in order to clean them up a bit * More cleanup - Removed some more of the dead quest code - Correcting naming of some of the shop variables
This commit is contained in:
committed by
Daniel Ginovker
parent
3d1ae1b288
commit
d876a923b9
@@ -0,0 +1,64 @@
|
||||
package com.rebotted.net.packets.impl;
|
||||
|
||||
import com.rebotted.game.items.impl.RareProtection;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.net.packets.PacketType;
|
||||
|
||||
/**
|
||||
* Wear Item
|
||||
**/
|
||||
public class WearItem implements PacketType {
|
||||
|
||||
@Override
|
||||
public void processPacket(Player player, int packetType, int packetSize) {
|
||||
player.wearId = player.getInStream().readUnsignedWord();
|
||||
player.wearSlot = player.getInStream().readUnsignedWordA();
|
||||
player.interfaceId = player.getInStream().readUnsignedWordA();
|
||||
if (!RareProtection.equipItem(player)) {
|
||||
return;
|
||||
}
|
||||
if (player.duelStatus > 0 && player.duelStatus < 5) {
|
||||
return;
|
||||
}
|
||||
if (!player.getItemAssistant().playerHasItem(player.wearId, 1, player.wearSlot)) {
|
||||
return;
|
||||
}
|
||||
if (player.playerIndex > 0 || player.npcIndex > 0) {
|
||||
player.getCombatAssistant().resetPlayerAttack();
|
||||
}
|
||||
|
||||
player.endCurrentTask();
|
||||
|
||||
if (player.wearId >= 5509 && player.wearId <= 5515) {
|
||||
int pouch = -1;
|
||||
int a = player.wearId;
|
||||
if (a == 5509) {
|
||||
pouch = 0;
|
||||
}
|
||||
if (a == 5510) {
|
||||
pouch = 1;
|
||||
}
|
||||
if (a == 5512) {
|
||||
pouch = 2;
|
||||
}
|
||||
if (a == 5514) {
|
||||
pouch = 3;
|
||||
}
|
||||
player.getPlayerAssistant().emptyPouch(pouch);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.wearId == 88) {
|
||||
player.weight -= 4.5;
|
||||
player.getPacketSender().writeWeight((int) player.weight);
|
||||
}
|
||||
|
||||
if (player.wearSlot == player.playerHat) {
|
||||
player.getPacketSender().setConfig(491, 0);
|
||||
}
|
||||
|
||||
player.getPlayerAssistant().handleTiara();
|
||||
player.getItemAssistant().wearItem(player.wearId, player.wearSlot);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user