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:
Mr Extremez
2019-11-25 11:08:56 -06:00
committed by Daniel Ginovker
parent 3d1ae1b288
commit d876a923b9
379 changed files with 80684 additions and 83170 deletions
@@ -0,0 +1,100 @@
package com.rebotted.net.packets.impl;
import com.rebotted.game.content.random.PartyRoom;
import com.rebotted.game.content.skills.crafting.JewelryMaking;
import com.rebotted.game.items.impl.RareProtection;
import com.rebotted.game.players.Player;
import com.rebotted.net.packets.PacketType;
/**
* Remove Item
**/
public class RemoveItem implements PacketType {
@Override
public void processPacket(Player c, int packetType, int packetSize) {
int interfaceId = c.getInStream().readUnsignedWordA();
int removeSlot = c.getInStream().readUnsignedWordA();
int removeId = c.getInStream().readUnsignedWordA();
if (removeId == 88) {
c.weight += 4.5;
c.getPacketSender().writeWeight((int) c.weight);
}
if (!RareProtection.removeItem(c, removeId)) {
return;
}
c.endCurrentTask();
switch (interfaceId) {
case 4233:
case 4239:
case 4245:
JewelryMaking.mouldItem(c, removeId, 1);
break;
case 7423:
if (c.inTrade) {
c.getTrading().declineTrade(true);
return;
}
c.getItemAssistant().bankItem(removeId, removeSlot, 1);
c.getItemAssistant().resetItems(7423);
break;
case 1688:
c.getItemAssistant().removeItem(removeId, removeSlot);
break;
case 5064:
if (c.inPartyRoom) {
PartyRoom.depositItem(c, removeId, 1);
} else {
c.getItemAssistant().bankItem(removeId, removeSlot, 1);
}
break;
case 5382:
c.getItemAssistant().fromBank(removeId, removeSlot, 1);
break;
case 3900:
c.getShopAssistant().buyFromShopPrice(removeId);
break;
case 3823:
c.getShopAssistant().sellToShopPrice(removeId, removeSlot);
break;
case 3322:
if (c.duelStatus <= 0) {
c.getTrading().tradeItem(removeId, removeSlot, 1);
} else {
c.getDueling().stakeItem(removeId, removeSlot, 1);
}
break;
case 3415:
if (c.duelStatus <= 0) {
c.getTrading().fromTrade(removeId, removeSlot, 1);
}
break;
case 6669:
c.getDueling().fromDuel(removeId, removeSlot, 1);
break;
case 1119:
case 1120:
case 1121:
case 1122:
case 1123:
c.getSmithing().readInput(c.playerLevel[c.playerSmithing],
Integer.toString(removeId), c, 1);
break;
}
}
}