From fdbb05597a203f1c695d442ce25364f89688eca4 Mon Sep 17 00:00:00 2001 From: Mr Extremez Date: Fri, 3 Jan 2020 08:12:09 -0600 Subject: [PATCH] A few fun fixes (#348) - Ranging guild now works - Fletching should no longer randomly stop if more than on person is doing it - Added dragon longsword special attack Closes #346 Closes #216 Closes #245 --- .../data/logs/commands/andrew5.txt | 3 + .../data/logs/trades/recieved/andrew.txt | 13 + .../game/content/combat/Specials.java | 4 +- .../content/skills/fletching/LogCutting.java | 237 +++++++++--------- .../skills/fletching/LogCuttingInterface.java | 4 +- .../src/com/rebotted/game/items/Weight.java | 1 - .../src/com/rebotted/game/players/Player.java | 7 + .../net/packets/impl/ClickObject.java | 6 +- 8 files changed, 153 insertions(+), 122 deletions(-) create mode 100644 2006Redone Server/data/logs/trades/recieved/andrew.txt diff --git a/2006Redone Server/data/logs/commands/andrew5.txt b/2006Redone Server/data/logs/commands/andrew5.txt index 1afc8f0c..4311f7a2 100644 --- a/2006Redone Server/data/logs/commands/andrew5.txt +++ b/2006Redone Server/data/logs/commands/andrew5.txt @@ -5,3 +5,6 @@ [2019/12/22] 05:58 andrew5 used command: bank [2019/12/22] 05:58 andrew5 used command: bank [2019/12/22] 05:59 andrew5 used command: bank +[2020/01/03] 07:00 andrew5 used command: bank +[2020/01/03] 07:00 andrew5 used command: bank +[2020/01/03] 07:02 andrew5 used command: bank diff --git a/2006Redone Server/data/logs/trades/recieved/andrew.txt b/2006Redone Server/data/logs/trades/recieved/andrew.txt new file mode 100644 index 00000000..4717d61a --- /dev/null +++ b/2006Redone Server/data/logs/trades/recieved/andrew.txt @@ -0,0 +1,13 @@ +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Knife +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs +[2020/01/03] 07:19 andrew was traded by andrew5 and recieved 1 Logs diff --git a/2006Redone Server/src/com/rebotted/game/content/combat/Specials.java b/2006Redone Server/src/com/rebotted/game/content/combat/Specials.java index 90aa6301..595e43dd 100644 --- a/2006Redone Server/src/com/rebotted/game/content/combat/Specials.java +++ b/2006Redone Server/src/com/rebotted/game/content/combat/Specials.java @@ -354,7 +354,9 @@ public class Specials { break; case 29138: - if (player2.playerEquipment[player2.playerWeapon] == 1215 || player2.playerEquipment[player2.playerWeapon] == 1231 || player2.playerEquipment[player2.playerWeapon] == 5680 || player2.playerEquipment[player2.playerWeapon] == 5698) { + if (player2.playerEquipment[player2.playerWeapon] == 1215 || player2.playerEquipment[player2.playerWeapon] == 1231 + || player2.playerEquipment[player2.playerWeapon] == 5680 || player2.playerEquipment[player2.playerWeapon] == 5698 + || player2.playerEquipment[player2.playerWeapon] == 1305) { player2.specBarId = 7586; player2.usingSpecial = !player2.usingSpecial; player2.getItemAssistant().updateSpecialBar(); diff --git a/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCutting.java b/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCutting.java index b8f1b7f8..6b20910a 100644 --- a/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCutting.java +++ b/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCutting.java @@ -35,24 +35,29 @@ public class LogCutting { CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() { @Override public void execute(CycleEventContainer container) { - if (player.doAmount <= 0 || !player.getItemAssistant().playerHasItem(LogCuttingInterface.log) || !player.getItemAssistant().playerHasItem(KNIFE) || player.isWoodcutting || player.isCrafting || player.isMoving || player.isMining || player.isBusy || player.isShopping || player.isSmithing || player.isFiremaking || player.isSpinning || player.isPotionMaking || player.playerIsFishing || player.isBanking || player.isSmelting || player.isTeleporting || player.isHarvesting || player.playerIsCooking || player.isPotCrafting) { + if (player.doAmount <= 0 || !player.getItemAssistant().playerHasItem(player.getFletching().log) + || !player.getItemAssistant().playerHasItem(KNIFE) || player.isWoodcutting || player.isCrafting + || player.isMoving || player.isMining || player.isBusy || player.isShopping || player.isSmithing + || player.isFiremaking || player.isSpinning || player.isPotionMaking || player.playerIsFishing + || player.isBanking || player.isSmelting || player.isTeleporting || player.isHarvesting + || player.playerIsCooking || player.isPotCrafting) { container.stop(); return; } else { player.startAnimation(1248); - player.getItemAssistant().deleteItem(LogCuttingInterface.log, 1); + player.getItemAssistant().deleteItem(player.getFletching().log, 1); if (product == 52) { player.getItemAssistant().addItem(product, 15); - player.getPacketSender().sendMessage("You carefully cut the " + ItemAssistant.getItemName(LogCuttingInterface.log) + " into 15 " + ItemAssistant.getItemName(product) + "s."); + player.getPacketSender().sendMessage("You carefully cut the " + ItemAssistant.getItemName(player.getFletching().log) + " into 15 " + ItemAssistant.getItemName(product) + "s."); } else { player.getItemAssistant().addItem(product, 1); - player.getPacketSender().sendMessage("You carefully cut the " + ItemAssistant.getItemName(LogCuttingInterface.log) + " into a " + ItemAssistant.getItemName(product) + "."); + player.getPacketSender().sendMessage("You carefully cut the " + ItemAssistant.getItemName(player.getFletching().log) + " into a " + ItemAssistant.getItemName(product) + "."); } player.getPlayerAssistant().addSkillXP(xp, player.playerFletching); @@ -69,10 +74,10 @@ public class LogCutting { } } - public static void handleClick(Player c, int buttonId) { - if (c.doAmount == 28 && c.playerIsFletching) { - c.getPacketSender().closeAllWindows(); - c.playerIsFletching = false; + public static void handleClick(Player player, int buttonId) { + if (player.doAmount == 28 && player.playerIsFletching) { + player.getPacketSender().closeAllWindows(); + player.playerIsFletching = false; return; } switch (buttonId) { @@ -80,52 +85,52 @@ public class LogCutting { * normal log (item on interface 3) */ case 34185: - if (c.playerIsFletching) { - cutLog(c, 52, 1, 5, 1); - c.playerIsFletching = false; + if (player.playerIsFletching) { + cutLog(player, 52, 1, 5, 1); + player.playerIsFletching = false; return; } break; case 34184: - cutLog(c, 52, 1, 5, 5); + cutLog(player, 52, 1, 5, 5); return; case 34183: - cutLog(c, 52, 1, 5, 10); + cutLog(player, 52, 1, 5, 10); return; case 34182: - cutLog(c, 52, 1, 5, 28); + cutLog(player, 52, 1, 5, 28); return; case 34189: - if (c.playerIsFletching) { - cutLog(c, 50, 5, 5, 1); - c.playerIsFletching = false; + if (player.playerIsFletching) { + cutLog(player, 50, 5, 5, 1); + player.playerIsFletching = false; return; } break; case 34188: - cutLog(c, 50, 5, 5, 5); + cutLog(player, 50, 5, 5, 5); return; case 34187: - cutLog(c, 50, 5, 5, 10); + cutLog(player, 50, 5, 5, 10); return; case 34186: - cutLog(c, 50, 5, 5, 28); + cutLog(player, 50, 5, 5, 28); return; case 34193: - if (c.playerIsFletching) { - cutLog(c, 48, 10, 10, 1); - c.playerIsFletching = false; + if (player.playerIsFletching) { + cutLog(player, 48, 10, 10, 1); + player.playerIsFletching = false; return; } break; case 34192: - cutLog(c, 48, 10, 10, 5); + cutLog(player, 48, 10, 10, 5); return; case 34191: - cutLog(c, 48, 10, 10, 10); + cutLog(player, 48, 10, 10, 10); return; case 34190: - cutLog(c, 48, 10, 10, 28); + cutLog(player, 48, 10, 10, 28); return; /* * rest of the log's (item on interface 2) @@ -134,152 +139,152 @@ public class LogCutting { * first item */ case 34170: - if (LogCuttingInterface.log == 1521 && c.playerIsFletching) { - cutLog(c, 54, 20, 16.5, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1521 && player.playerIsFletching) { + cutLog(player, 54, 20, 16.5, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1519 && c.playerIsFletching) { - cutLog(c, 60, 35, 33.3, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1519 && player.playerIsFletching) { + cutLog(player, 60, 35, 33.3, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1517 && c.playerIsFletching) { - cutLog(c, 64, 50, 50, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1517 && player.playerIsFletching) { + cutLog(player, 64, 50, 50, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1515 && c.playerIsFletching) { - cutLog(c, 68, 65, 67.5, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1515 && player.playerIsFletching) { + cutLog(player, 68, 65, 67.5, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1513 && c.playerIsFletching) { - cutLog(c, 72, 80, 83.25, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1513 && player.playerIsFletching) { + cutLog(player, 72, 80, 83.25, 1); + player.playerIsFletching = false; } return; case 34169: - if (LogCuttingInterface.log == 1521) { - cutLog(c, 54, 20, 16.5, 5); + if (player.getFletching().log == 1521) { + cutLog(player, 54, 20, 16.5, 5); } - if (LogCuttingInterface.log == 1519) { - cutLog(c, 60, 35, 33.3, 5); + if (player.getFletching().log == 1519) { + cutLog(player, 60, 35, 33.3, 5); } - if (LogCuttingInterface.log == 1517) { - cutLog(c, 64, 50, 50, 5); + if (player.getFletching().log == 1517) { + cutLog(player, 64, 50, 50, 5); } - if (LogCuttingInterface.log == 1515) { - cutLog(c, 68, 65, 67.5, 5); + if (player.getFletching().log == 1515) { + cutLog(player, 68, 65, 67.5, 5); } - if (LogCuttingInterface.log == 1513) { - cutLog(c, 72, 80, 83.25, 5); + if (player.getFletching().log == 1513) { + cutLog(player, 72, 80, 83.25, 5); } return; case 34168: - if (LogCuttingInterface.log == 1521) { - cutLog(c, 54, 20, 16.5, 10); + if (player.getFletching().log == 1521) { + cutLog(player, 54, 20, 16.5, 10); } - if (LogCuttingInterface.log == 1519) { - cutLog(c, 60, 35, 33.3, 10); + if (player.getFletching().log == 1519) { + cutLog(player, 60, 35, 33.3, 10); } - if (LogCuttingInterface.log == 1517) { - cutLog(c, 64, 50, 50, 10); + if (player.getFletching().log == 1517) { + cutLog(player, 64, 50, 50, 10); } - if (LogCuttingInterface.log == 1515) { - cutLog(c, 68, 65, 67.5, 10); + if (player.getFletching().log == 1515) { + cutLog(player, 68, 65, 67.5, 10); } - if (LogCuttingInterface.log == 1513) { - cutLog(c, 72, 80, 83.25, 10); + if (player.getFletching().log == 1513) { + cutLog(player, 72, 80, 83.25, 10); } return; case 34167: - if (LogCuttingInterface.log == 1521) { - cutLog(c, 54, 20, 16.5, 28); + if (player.getFletching().log == 1521) { + cutLog(player, 54, 20, 16.5, 28); } - if (LogCuttingInterface.log == 1519) { - cutLog(c, 60, 35, 33.3, 28); + if (player.getFletching().log == 1519) { + cutLog(player, 60, 35, 33.3, 28); } - if (LogCuttingInterface.log == 1517) { - cutLog(c, 64, 50, 50, 28); + if (player.getFletching().log == 1517) { + cutLog(player, 64, 50, 50, 28); } - if (LogCuttingInterface.log == 1515) { - cutLog(c, 68, 65, 67.5, 28); + if (player.getFletching().log == 1515) { + cutLog(player, 68, 65, 67.5, 28); } - if (LogCuttingInterface.log == 1513) { - cutLog(c, 72, 80, 83.25, 28); + if (player.getFletching().log == 1513) { + cutLog(player, 72, 80, 83.25, 28); } return; /* * second item */ case 34174: - if (LogCuttingInterface.log == 1521 && c.playerIsFletching) { - cutLog(c, 56, 25, 25, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1521 && player.playerIsFletching) { + cutLog(player, 56, 25, 25, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1519 && c.playerIsFletching) { - cutLog(c, 58, 40, 41.5, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1519 && player.playerIsFletching) { + cutLog(player, 58, 40, 41.5, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1517 && c.playerIsFletching) { - cutLog(c, 62, 55, 58.3, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1517 && player.playerIsFletching) { + cutLog(player, 62, 55, 58.3, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1515 && c.playerIsFletching) { - cutLog(c, 66, 70, 70, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1515 && player.playerIsFletching) { + cutLog(player, 66, 70, 70, 1); + player.playerIsFletching = false; } - if (LogCuttingInterface.log == 1513 && c.playerIsFletching) { - cutLog(c, 70, 85, 91.5, 1); - c.playerIsFletching = false; + if (player.getFletching().log == 1513 && player.playerIsFletching) { + cutLog(player, 70, 85, 91.5, 1); + player.playerIsFletching = false; } return; case 34173: - if (LogCuttingInterface.log == 1521) { - cutLog(c, 56, 25, 25, 5); + if (player.getFletching().log == 1521) { + cutLog(player, 56, 25, 25, 5); } - if (LogCuttingInterface.log == 1519) { - cutLog(c, 58, 40, 41.5, 5); + if (player.getFletching().log == 1519) { + cutLog(player, 58, 40, 41.5, 5); } - if (LogCuttingInterface.log == 1517) { - cutLog(c, 62, 55, 58.3, 5); + if (player.getFletching().log == 1517) { + cutLog(player, 62, 55, 58.3, 5); } - if (LogCuttingInterface.log == 1515) { - cutLog(c, 66, 70, 70, 5); + if (player.getFletching().log == 1515) { + cutLog(player, 66, 70, 70, 5); } - if (LogCuttingInterface.log == 1513) { - cutLog(c, 70, 85, 91.5, 5); + if (player.getFletching().log == 1513) { + cutLog(player, 70, 85, 91.5, 5); } return; case 34172: - if (LogCuttingInterface.log == 1521) { - cutLog(c, 56, 25, 25, 10); + if (player.getFletching().log == 1521) { + cutLog(player, 56, 25, 25, 10); } - if (LogCuttingInterface.log == 1519) { - cutLog(c, 58, 40, 41.5, 10); + if (player.getFletching().log == 1519) { + cutLog(player, 58, 40, 41.5, 10); } - if (LogCuttingInterface.log == 1517) { - cutLog(c, 62, 55, 58.3, 10); + if (player.getFletching().log == 1517) { + cutLog(player, 62, 55, 58.3, 10); } - if (LogCuttingInterface.log == 1515) { - cutLog(c, 66, 70, 70, 10); + if (player.getFletching().log == 1515) { + cutLog(player, 66, 70, 70, 10); } - if (LogCuttingInterface.log == 1513) { - cutLog(c, 70, 85, 91.5, 10); + if (player.getFletching().log == 1513) { + cutLog(player, 70, 85, 91.5, 10); } return; case 34171: - if (LogCuttingInterface.log == 1521) { - cutLog(c, 56, 25, 25, 28); + if (player.getFletching().log == 1521) { + cutLog(player, 56, 25, 25, 28); } - if (LogCuttingInterface.log == 1519) { - cutLog(c, 58, 40, 41.5, 28); + if (player.getFletching().log == 1519) { + cutLog(player, 58, 40, 41.5, 28); } - if (LogCuttingInterface.log == 1517) { - cutLog(c, 62, 55, 58.3, 28); + if (player.getFletching().log == 1517) { + cutLog(player, 62, 55, 58.3, 28); } - if (LogCuttingInterface.log == 1515) { - cutLog(c, 66, 70, 70, 28); + if (player.getFletching().log == 1515) { + cutLog(player, 66, 70, 70, 28); } - if (LogCuttingInterface.log == 1513) { - cutLog(c, 70, 85, 91.5, 28); + if (player.getFletching().log == 1513) { + cutLog(player, 70, 85, 91.5, 28); } return; } diff --git a/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCuttingInterface.java b/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCuttingInterface.java index 6ee89289..c65e3d41 100644 --- a/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCuttingInterface.java +++ b/2006Redone Server/src/com/rebotted/game/content/skills/fletching/LogCuttingInterface.java @@ -9,7 +9,7 @@ import com.rebotted.game.players.Player; public class LogCuttingInterface { - public static int log; + public int log; public static void handleLog(Player c, int item1, int item2) { if (item1 == 946) { @@ -29,7 +29,7 @@ public class LogCuttingInterface { c.getPacketSender().sendMessage("Nothing interesting happens."); return; } - log = item; + c.getFletching().log = item; if (item == 1511) { c.getPacketSender().sendChatInterface(8880); c.getPacketSender().sendFrame126("What would you like to make?", 8879); diff --git a/2006Redone Server/src/com/rebotted/game/items/Weight.java b/2006Redone Server/src/com/rebotted/game/items/Weight.java index 104893de..60e1eaa8 100644 --- a/2006Redone Server/src/com/rebotted/game/items/Weight.java +++ b/2006Redone Server/src/com/rebotted/game/items/Weight.java @@ -1,6 +1,5 @@ package com.rebotted.game.items; -import com.rebotted.GameEngine; import com.rebotted.game.players.Player; /** diff --git a/2006Redone Server/src/com/rebotted/game/players/Player.java b/2006Redone Server/src/com/rebotted/game/players/Player.java index da8346ab..dce69372 100644 --- a/2006Redone Server/src/com/rebotted/game/players/Player.java +++ b/2006Redone Server/src/com/rebotted/game/players/Player.java @@ -43,6 +43,7 @@ import com.rebotted.game.content.skills.agility.WildernessAgility; import com.rebotted.game.content.skills.cooking.Potatoes; import com.rebotted.game.content.skills.core.Mining; import com.rebotted.game.content.skills.crafting.GlassBlowing; +import com.rebotted.game.content.skills.fletching.LogCuttingInterface; import com.rebotted.game.content.skills.runecrafting.Runecrafting; import com.rebotted.game.content.skills.slayer.Slayer; import com.rebotted.game.content.skills.smithing.Smithing; @@ -76,6 +77,7 @@ import com.rebotted.world.ObjectManager; public abstract class Player { + public byte buffer[] = null; public Stream inStream = null, outStream = null; public IoSession session; @@ -118,6 +120,7 @@ public abstract class Player { private final Smithing smithing = new Smithing(); private final SmithingInterface smithingInterface = new SmithingInterface(this); private final PrayerData prayer = new PrayerData(); + private final LogCuttingInterface fletching = new LogCuttingInterface(); private final ObjectManager objectManager = new ObjectManager(); public ArrayList fishingTrawlerReward = new ArrayList(); private final RangersGuild rangersGuild = new RangersGuild(this); @@ -132,6 +135,10 @@ public abstract class Player { private DoubleGates doubleGates = new DoubleGates(); public int lastMainFrameInterface = -1; //Possibly used in future to prevent packet exploits + public LogCuttingInterface getFletching() { + return fletching; + } + public SingleGates getSingleGates() { return singleGates; } diff --git a/2006Redone Server/src/com/rebotted/net/packets/impl/ClickObject.java b/2006Redone Server/src/com/rebotted/net/packets/impl/ClickObject.java index d5ccd1e9..47d94073 100644 --- a/2006Redone Server/src/com/rebotted/net/packets/impl/ClickObject.java +++ b/2006Redone Server/src/com/rebotted/net/packets/impl/ClickObject.java @@ -58,14 +58,16 @@ public class ClickObject implements PacketType { int yMin = objectY - 1; int yMax = yMin + size[1] + 1; - if (x >= xMin && y >= yMin && x <= xMax && y <= yMax) { + if ((x >= xMin && y >= yMin && x <= xMax && y <= yMax) || (player.getRangersGuild().isInTargetArea() && player.objectId == 2513)) { consumer.accept(player); container.stop(); } } @Override - public void stop() {} + public void stop() { + + } }; player.startCurrentTask(1, objectWalkToEvent);