Fixed grounditems

This commit is contained in:
dginovker
2019-06-19 22:06:24 -04:00
parent 4f60be22c0
commit 6591eb43cf
503 changed files with 435 additions and 483 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ public class ClientSettings {
/** /**
* The Servers Ip * The Servers Ip
*/ */
public final static String SERVER_IP = "35.226.247.68"; //public final static String SERVER_IP = "35.226.247.68";
//public final static String SERVER_IP = "127.0.0.1"; public final static String SERVER_IP = "127.0.0.1";
/** /**
* The Npc Bits for the Server * The Npc Bits for the Server
*/ */
@@ -0,0 +1 @@
[2019/06/19] 22:04 irdb dropped 1 bronze sword absX: 3210 absY: 3218
@@ -2,18 +2,12 @@ package redone.net;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import redone.Server;
import redone.game.items.GroundItem;
import redone.game.items.ItemAssistant;
import redone.game.players.Client; import redone.game.players.Client;
import redone.game.players.Player; import redone.game.players.Player;
import redone.game.players.PlayerHandler; import redone.game.players.PlayerHandler;
import redone.util.GameLogger;
import redone.util.Misc; import redone.util.Misc;
import redone.world.clip.Region; import redone.world.clip.Region;
import static redone.world.ItemHandler.HIDE_TICKS;
public class ActionSender { public class ActionSender {
private final Client player; private final Client player;
@@ -586,50 +580,7 @@ public class ActionSender {
return this; return this;
} }
public void createGroundItem(Client player, int itemId, int itemX, int itemY, int itemAmount, int playerId) {
System.out.println("Here");
if (itemId > 0) {
if (itemId >= 2412 && itemId <= 2414) {
player.getActionSender().sendMessage("The cape vanishes as it touches the ground.");
return;
}
if (itemId > 4705 && itemId < 4760) {
for (int[] brokenBarrow : Server.itemHandler.brokenBarrows) {
if (brokenBarrow[0] == itemId) {
itemId = brokenBarrow[1];
break;
}
}
}
if (!redone.game.items.Item.itemStackable[itemId] && itemAmount > 0) {
for (int j = 0; j < itemAmount; j++) {
player.getActionSender().createGroundItem(itemId, itemX, itemY, 1);
GroundItem item = new GroundItem(itemId, itemX, itemY, player.getH(), 1, player.playerId, HIDE_TICKS, PlayerHandler.players[playerId].playerName);
Server.itemHandler.addItem(item);
String itemName = ItemAssistant.getItemName(itemId).toLowerCase();
if (player.isDead == false && itemId != 526) {
if (player.getPlayerAssistant().isPlayer()) {
GameLogger.writeLog(player.playerName, "dropitem", player.playerName + " dropped " + itemAmount + " " + itemName + " absX: " + player.absX + " absY: " + player.absY + "");
}
}
}
} else {
player.getActionSender().createGroundItem(itemId, itemX, itemY, itemAmount);
GroundItem item = new GroundItem(itemId, itemX, itemY, player.getH(), itemAmount, player.playerId, HIDE_TICKS, PlayerHandler.players[playerId].playerName);
Server.itemHandler.addItem(item);
String itemName = ItemAssistant.getItemName(itemId).toLowerCase();
if (player.isDead == false && itemId != 526) {
if (player.getPlayerAssistant().isPlayer()) {
GameLogger.writeLog(player.playerName, "dropitem", player.playerName + " dropped " + itemAmount + " " + itemName + " absX: " + player.absX + " absY: " + player.absY + "");
}
}
}
}
}
public ActionSender createGroundItem(int itemID, int itemX, int itemY, int itemAmount) { public ActionSender createGroundItem(int itemID, int itemX, int itemY, int itemAmount) {
System.out.println("Wtf fucks sake");
createGroundItem(this.player, itemID, itemX, itemY, itemAmount, this.player.getId());
player.getOutStream().createFrame(85); player.getOutStream().createFrame(85);
player.getOutStream().writeByteC(itemY - 8 * player.mapRegionY); player.getOutStream().writeByteC(itemY - 8 * player.mapRegionY);
player.getOutStream().writeByteC(itemX - 8 * player.mapRegionX); player.getOutStream().writeByteC(itemX - 8 * player.mapRegionX);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More