From aab662e500470368f645c012f6e223673d8bcea6 Mon Sep 17 00:00:00 2001 From: ceik Date: Thu, 19 Mar 2020 15:53:25 -0500 Subject: [PATCH 1/5] Fixed the amount of coins the star awards --- Server/src/plugin/interaction/object/ShootingStarPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/plugin/interaction/object/ShootingStarPlugin.java b/Server/src/plugin/interaction/object/ShootingStarPlugin.java index c42f7372c..7834a9aec 100644 --- a/Server/src/plugin/interaction/object/ShootingStarPlugin.java +++ b/Server/src/plugin/interaction/object/ShootingStarPlugin.java @@ -742,7 +742,7 @@ public class ShootingStarPlugin extends OptionHandler { int cosmicRunes = (int) (Math.ceil(0.76 * dust) * AMPLIFIER); int astralRunes = (int) (Math.ceil(0.26 * dust) * AMPLIFIER); int goldOre = (int) (Math.ceil(0.1 * dust) * AMPLIFIER); - int coins = (int) (Math.ceil(50.1 * dust) * AMPLIFIER); + int coins = (int) (Math.ceil((dust * 40) > 90000 ? 90000 : 40.0 * dust) * AMPLIFIER); // limits the amount of gp per turn-in to 90k, same as 2009 rs, and minimum from all stardust from a level 1 star works out to 50k, same as rs in 2009 player.getInventory().add(new Item(COSMIC_RUNE, cosmicRunes), player); player.getInventory().add(new Item(ASTRAL_RUNE, astralRunes), player); player.getInventory().add(new Item(GOLD_ORE, goldOre), player); From f3425102045dcd3edc86316084fe62660723daec Mon Sep 17 00:00:00 2001 From: ceik Date: Thu, 19 Mar 2020 17:22:32 -0500 Subject: [PATCH 2/5] Fixed the amount of coins the star awards --- Server/src/plugin/interaction/object/ShootingStarPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/plugin/interaction/object/ShootingStarPlugin.java b/Server/src/plugin/interaction/object/ShootingStarPlugin.java index 7834a9aec..5a1f1b736 100644 --- a/Server/src/plugin/interaction/object/ShootingStarPlugin.java +++ b/Server/src/plugin/interaction/object/ShootingStarPlugin.java @@ -742,7 +742,7 @@ public class ShootingStarPlugin extends OptionHandler { int cosmicRunes = (int) (Math.ceil(0.76 * dust) * AMPLIFIER); int astralRunes = (int) (Math.ceil(0.26 * dust) * AMPLIFIER); int goldOre = (int) (Math.ceil(0.1 * dust) * AMPLIFIER); - int coins = (int) (Math.ceil((dust * 40) > 90000 ? 90000 : 40.0 * dust) * AMPLIFIER); // limits the amount of gp per turn-in to 90k, same as 2009 rs, and minimum from all stardust from a level 1 star works out to 50k, same as rs in 2009 + int coins = (int) (Math.ceil(250.0 * dust) * AMPLIFIER); // limits the amount of gp per turn-in to 90k, same as 2009 rs, and minimum from all stardust from a level 1 star works out to 50k, same as rs in 2009 player.getInventory().add(new Item(COSMIC_RUNE, cosmicRunes), player); player.getInventory().add(new Item(ASTRAL_RUNE, astralRunes), player); player.getInventory().add(new Item(GOLD_ORE, goldOre), player); From e6e190ff23b144e3900d93d4c46c13df65aee940 Mon Sep 17 00:00:00 2001 From: ceik Date: Thu, 19 Mar 2020 17:23:48 -0500 Subject: [PATCH 3/5] Added world map! --- .../net/packet/out/CSConfigPacket.java | 13 ++++++- .../net/packet/out/RunScriptPacket.java | 25 +++++++++++- .../interaction/inter/GameInterface.java | 38 ++++++++----------- .../interaction/inter/WorldMapInterface.java | 13 +++++-- 4 files changed, 58 insertions(+), 31 deletions(-) diff --git a/Server/src/org/crandor/net/packet/out/CSConfigPacket.java b/Server/src/org/crandor/net/packet/out/CSConfigPacket.java index 5de848e44..950726256 100644 --- a/Server/src/org/crandor/net/packet/out/CSConfigPacket.java +++ b/Server/src/org/crandor/net/packet/out/CSConfigPacket.java @@ -7,11 +7,20 @@ import org.crandor.net.packet.context.CSConfigContext; /** * The outgoing packet for client script configs. * - * @author Torchic + * @author Snickerize */ public class CSConfigPacket implements OutgoingPacket { @Override + public void send(CSConfigContext context) { + IoBuffer buffer = new IoBuffer(65); + buffer.putLEShort(context.getPlayer().getInterfaceManager().getPacketCount(1)); + buffer.putC((byte) context.getValue()); + buffer.putLEShortA(context.getId()); + context.getPlayer().getDetails().getSession().write(buffer); + } + + /*@Override public void send(CSConfigContext context) { IoBuffer buffer = new IoBuffer(115); buffer.putShort(context.getId()); @@ -27,5 +36,5 @@ public class CSConfigPacket implements OutgoingPacket { buffer.putInt(context.getValue()); context.getPlayer().getDetails().getSession().write(buffer); - } + }*/ } \ No newline at end of file diff --git a/Server/src/org/crandor/net/packet/out/RunScriptPacket.java b/Server/src/org/crandor/net/packet/out/RunScriptPacket.java index 6b5cb35d4..615e1f945 100644 --- a/Server/src/org/crandor/net/packet/out/RunScriptPacket.java +++ b/Server/src/org/crandor/net/packet/out/RunScriptPacket.java @@ -7,11 +7,11 @@ import org.crandor.net.packet.context.RunScriptContext; /** * The run script outgoing packet. - * @author Emperor + * @author Snickerize */ public class RunScriptPacket implements OutgoingPacket { - @Override + /*@Override public void send(RunScriptContext context) { String string = context.getString(); Object[] objects = context.getObjects(); @@ -27,6 +27,27 @@ public class RunScriptPacket implements OutgoingPacket { } j++; } + buffer.putInt(context.getId()); + context.getPlayer().getDetails().getSession().write(buffer); + }*/ + @Override + public void send(RunScriptContext context) { + String types = context.getString(); + Object[] objects = context.getObjects(); + IoBuffer buffer = new IoBuffer(115, PacketHeader.SHORT); + buffer.putShort(context.getPlayer().getInterfaceManager().getPacketCount(1)); + + buffer.putString(types); + int j = 0; + for (int i = (types.length() - 1); i >= 0; i--) { + if (types.charAt(i) == 's') { + buffer.putString((String) objects[j]); + } else { + buffer.putInt((Integer) objects[j]); + } + j++; + } + buffer.putInt(context.getId()); context.getPlayer().getDetails().getSession().write(buffer); } diff --git a/Server/src/plugin/interaction/inter/GameInterface.java b/Server/src/plugin/interaction/inter/GameInterface.java index 2442fdcfc..95ffc5732 100644 --- a/Server/src/plugin/interaction/inter/GameInterface.java +++ b/Server/src/plugin/interaction/inter/GameInterface.java @@ -181,6 +181,21 @@ public final class GameInterface extends ComponentPlugin { return true; } + /** + * World map + * Thanks, Snickerize! + */ + private void configureWorldMap(Player player) { + if (player.inCombat()) { + player.getPacketDispatch().sendMessage("It wouldn't be very wise opening the world map during combat."); + return; + } + player.getInterfaceManager().openWindowsPane(new Component(755), 2); + int posHash = (player.getLocation().getZ() << 28) | (player.getLocation().getX() << 14) | player.getLocation().getY(); + player.getPacketDispatch().sendScriptConfigs(622, posHash, "", 0); + player.getPacketDispatch().sendScriptConfigs(674, posHash, "", 0); + } + /** * Method used to open the report interface. * @param player the player. @@ -216,27 +231,4 @@ public final class GameInterface extends ComponentPlugin { * Configures the world map for a player. * @param player The player. */ - private void configureWorldMap(Player player) { - if (player.inCombat()) { - player.getPacketDispatch().sendMessage("It wouldn't be very wise opening the world map during combat."); - return; - } -// player.getInterfaceManager().openWindowsPane(new Component(755), 1); -// player.getPacketDispatch().sendScriptConfig(1187, 0, "ii", 0); - int position = player.getLocation().getX() << 14 | player.getLocation().getY() | player.getLocation().getZ() << 28; - -// player.getPacketDispatch().sendScriptConfig(622, position, "ii"); -// player.getPacketDispatch().sendScriptConfig(674, position, "ii"); -// player.getPacketDispatch().sendScriptConfig(622, position); -// player.getPacketDispatch().sendScriptConfig(674, position); - System.out.println(position); - - - /*player.getPacketDispatch().sendWindowsPane(755, 1); - int hash = player.getLocation().getX() << 14 | player.getLocation().getY(); - player.getPacketDispatch().sendRunScript(622, "", hash); - player.getPacketDispatch().sendRunScript(674, "", hash); - PacketRepository.send(InterfaceConfig.class, new InterfaceConfigContext(player, 371, 25, true)); - player.setAttribute("worldMap:viewing", true);*/ - } } diff --git a/Server/src/plugin/interaction/inter/WorldMapInterface.java b/Server/src/plugin/interaction/inter/WorldMapInterface.java index 548652fe9..5238de42e 100644 --- a/Server/src/plugin/interaction/inter/WorldMapInterface.java +++ b/Server/src/plugin/interaction/inter/WorldMapInterface.java @@ -21,14 +21,19 @@ public final class WorldMapInterface extends ComponentPlugin { return this; } + //Thanks snicker! @Override public boolean handle(Player player, Component component, int opcode, int button, int slot, int itemId) { switch (button) { - case 3: -// player.getInterfaceManager().openWindowsPane(new Component(player.getInterfaceManager().isResizable() ? 746 : 548), 2); - return true; + case 3: + player.getInterfaceManager().openWindowsPane(new Component(player.getInterfaceManager().isResizable() ? 746 : 548), 2); + player.getPacketDispatch().sendRunScript(1187, "ii", 0, 0); + player.updateSceneGraph(true); + return true; + default: + System.err.println("World map: buttonid: " + button + ", opcode: " + opcode + ", slot: " + slot); + return true; } - return false; } } From 9a3ea345cc4445f37e2ec03d84afc2f7af200682 Mon Sep 17 00:00:00 2001 From: ceik Date: Thu, 19 Mar 2020 17:24:26 -0500 Subject: [PATCH 4/5] Fixed a bug with houses --- .../game/content/skill/member/construction/HouseZone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/org/crandor/game/content/skill/member/construction/HouseZone.java b/Server/src/org/crandor/game/content/skill/member/construction/HouseZone.java index 7b51ae254..6d52f0a8e 100644 --- a/Server/src/org/crandor/game/content/skill/member/construction/HouseZone.java +++ b/Server/src/org/crandor/game/content/skill/member/construction/HouseZone.java @@ -73,6 +73,6 @@ public final class HouseZone extends MapZone { return true; } } - return false; + return true; } } \ No newline at end of file From 3ba0c9dbc9127ca162c4eaab5d243e2163470e97 Mon Sep 17 00:00:00 2001 From: ceik Date: Thu, 19 Mar 2020 20:58:44 -0500 Subject: [PATCH 5/5] Fixed a minor bug with carts --- Server/src/plugin/interaction/object/BrokenCartBypass.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/src/plugin/interaction/object/BrokenCartBypass.java b/Server/src/plugin/interaction/object/BrokenCartBypass.java index 9be0a7c2c..cf710a578 100644 --- a/Server/src/plugin/interaction/object/BrokenCartBypass.java +++ b/Server/src/plugin/interaction/object/BrokenCartBypass.java @@ -42,9 +42,9 @@ public class BrokenCartBypass extends OptionHandler { Location location = new Location(0,0); Location playerloc = new Location(player.getLocation().getX(),player.getLocation().getY()); if(options.equals("look-at")) { - if (playerloc.getX() == 2880 && playerloc.getY() >= 2951 && playerloc.getY() <= 2953) { + if (playerloc.getX() > 2878) { location = new Location(2876, 2952); - } else if (playerloc.getX() == 2876 && playerloc.getY() >= 2951 && playerloc.getY() <= 2953) { + } else if (playerloc.getX() < 2879) { location = new Location(2880, 2952); } }