From 81e6344dd83f8cd6f310b2c872ffb88b3906a30e Mon Sep 17 00:00:00 2001 From: MatthewBishop <55411296+MatthewBishop@users.noreply.github.com> Date: Mon, 6 Feb 2023 13:43:27 -0500 Subject: [PATCH] Bug fixes (#603) * Update Boundary.java * fix xp to level up * tomato shop * fix longsword attack anim * Update MeleeData.java * fix dagger/longsword/shortsword anims * Update MeleeData.java * obby maul and warhammer interfaces and halberd anims * Pickaxe anims randomly uses the anim for either stab str or crush str. Cheaphax before system redesign * adds razmires builder shop * pom.xml update --- .../plugin/click/npc/NpcThirdClick.java | 7 ++++ .../plugin/click/obj/ObjectFirstClick.java | 6 +++ 2006Scape Server/pom.xml | 23 +++++++++-- .../game/content/combat/melee/MeleeData.java | 40 +++++++++++++------ .../com/rs2/game/items/ItemAssistant.java | 2 +- .../com/rs2/game/players/PlayerAssistant.java | 2 +- .../src/main/java/com/rs2/world/Boundary.java | 2 +- 7 files changed, 64 insertions(+), 18 deletions(-) diff --git a/2006Scape Server/plugins/plugin/click/npc/NpcThirdClick.java b/2006Scape Server/plugins/plugin/click/npc/NpcThirdClick.java index 429b87f6..f4e788cc 100644 --- a/2006Scape Server/plugins/plugin/click/npc/NpcThirdClick.java +++ b/2006Scape Server/plugins/plugin/click/npc/NpcThirdClick.java @@ -4,6 +4,8 @@ import com.rs2.event.EventContext; import com.rs2.event.EventSubscriber; import com.rs2.event.SubscribesTo; import com.rs2.event.impl.NpcThirdClickEvent; +import com.rs2.game.content.StaticNpcList; +import com.rs2.game.content.StaticObjectList; import com.rs2.game.players.Player; @SubscribesTo(NpcThirdClickEvent.class) @@ -14,6 +16,11 @@ public final class NpcThirdClick implements EventSubscriber if (player.playerRights == 3) { player.getPacketSender().sendMessage("[click= npc], [type = third], [id= " + event.getNpc() + "], [Type= " + event.getNpc() + "]"); } + + //TODO when plugins occur, move the handling of this to the specific plugin for those map areas. + if(event.getNpc() == StaticNpcList.RAZMIRE_KEELGAN) { + player.getShopAssistant().openShop(283); + } } } diff --git a/2006Scape Server/plugins/plugin/click/obj/ObjectFirstClick.java b/2006Scape Server/plugins/plugin/click/obj/ObjectFirstClick.java index 953b0e0c..7c3c38c3 100644 --- a/2006Scape Server/plugins/plugin/click/obj/ObjectFirstClick.java +++ b/2006Scape Server/plugins/plugin/click/obj/ObjectFirstClick.java @@ -4,6 +4,7 @@ import com.rs2.event.EventContext; import com.rs2.event.EventSubscriber; import com.rs2.event.SubscribesTo; import com.rs2.event.impl.ObjectFirstClickEvent; +import com.rs2.game.content.StaticObjectList; import com.rs2.game.content.skills.core.Mining; import com.rs2.game.players.Player; import com.rs2.world.clip.Region; @@ -26,6 +27,11 @@ public final class ObjectFirstClick implements EventSubscriber + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + generate-sources + + add-source + + + + src/main/java + plugins + + + + + - org.apache.maven.plugins + org.apache.maven.plugins maven-compiler-plugin 3.5.1 - ${project.basedir}/plugins - ${project.basedir}/src/main/java 8 8 UTF-8 diff --git a/2006Scape Server/src/main/java/com/rs2/game/content/combat/melee/MeleeData.java b/2006Scape Server/src/main/java/com/rs2/game/content/combat/melee/MeleeData.java index 1dd7819d..96f6fe5a 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/content/combat/melee/MeleeData.java +++ b/2006Scape Server/src/main/java/com/rs2/game/content/combat/melee/MeleeData.java @@ -6,6 +6,7 @@ import com.rs2.game.items.DeprecatedItems; import com.rs2.game.items.ItemConstants; import com.rs2.game.items.impl.Greegree.MonkeyData; import com.rs2.game.players.Player; +import com.rs2.util.Misc; import static com.rs2.game.content.StaticItemList.TOKTZKETXIL; @@ -330,14 +331,22 @@ public class MeleeData { return 806; } if (weaponName.contains("halberd")) { - return 440; + return c.fightMode == 2 ? 440 : 412; + } + + //pickaxe anims are 395, 400, 401, 395 + //this is for attack, str, str, and def. + if (weaponName.contains("pickaxe")) { + switch (c.fightMode) { + case 2: + return (Misc.random(1) == 0) ? 400 : 401; + default: + return 395; + } } if (weaponName.contains("dragon dagger")) { return 402; } - if (weaponName.endsWith("dagger")) { - return 412; - } if (weaponName.contains("2h sword") || weaponName.contains("godsword") || weaponName.contains("aradomin sword")) { switch (c.fightMode) { @@ -349,14 +358,21 @@ public class MeleeData { return 407; } } - if (weaponName.contains("sword")) { - switch (c.fightMode) { - case 0: - case 1: - return 412; - case 2: - return 451; - } + if (weaponName.contains("longsword")) { + switch (c.fightMode) { + case 3: + return 412; + default: + return 451; + } + } + if (weaponName.contains("sword") || weaponName.endsWith("dagger")) { + switch (c.fightMode) { + case 3: + return 451; + default: + return 412; + } } if (weaponName.contains("karil")) { return 2075; diff --git a/2006Scape Server/src/main/java/com/rs2/game/items/ItemAssistant.java b/2006Scape Server/src/main/java/com/rs2/game/items/ItemAssistant.java index 03a9d153..2e5b42c2 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/items/ItemAssistant.java +++ b/2006Scape Server/src/main/java/com/rs2/game/items/ItemAssistant.java @@ -646,7 +646,7 @@ public class ItemAssistant { player.getPacketSender().setSidebarInterface(0, 3796); // pound, pummel, spike, block player.getPacketSender().sendFrame246(3797, 200, weapon); player.getPacketSender().sendString(weaponName, 3799); - } else if (player.playerEquipment[player.playerWeapon] == 4153) { + } else if (newWeapon.toLowerCase().contains("tzhaar") || newWeapon.toLowerCase().contains("warhammer") || player.playerEquipment[player.playerWeapon] == 4153) { player.getPacketSender().setSidebarInterface(0, 425); // war hammer equip player.getPacketSender().sendFrame246(426, 200, weapon); player.getPacketSender().sendString(weaponName, 428); diff --git a/2006Scape Server/src/main/java/com/rs2/game/players/PlayerAssistant.java b/2006Scape Server/src/main/java/com/rs2/game/players/PlayerAssistant.java index 12859cc4..91092b69 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/players/PlayerAssistant.java +++ b/2006Scape Server/src/main/java/com/rs2/game/players/PlayerAssistant.java @@ -2039,7 +2039,7 @@ public class PlayerAssistant { } int oldLevel = getLevelForXP(player.playerXP[skill]); player.playerXP[skill] += amount; - if (oldLevel < getLevelForXP(player.playerXP[skill])) { + if (oldLevel <= getLevelForXP(player.playerXP[skill])) { if (player.playerLevel[skill] < player.getLevelForXP(player.playerXP[skill]) && skill != 3 && skill != 5) { player.playerLevel[skill] = player.getLevelForXP(player.playerXP[skill]); } diff --git a/2006Scape Server/src/main/java/com/rs2/world/Boundary.java b/2006Scape Server/src/main/java/com/rs2/world/Boundary.java index 65302c20..627be1df 100644 --- a/2006Scape Server/src/main/java/com/rs2/world/Boundary.java +++ b/2006Scape Server/src/main/java/com/rs2/world/Boundary.java @@ -274,7 +274,7 @@ public class Boundary { public static final Boundary SOPHANEM = new Boundary(3273, 3323, 2749, 2806); public static final Boundary MENAPHOS = new Boundary(3200, 3266, 2749, 2806); public static final Boundary POLLIVNEACH = new Boundary(3329, 3377, 2936, 3002); - public static final Boundary SHANTAY_PASS = new Boundary(3298, 3312, 3304, 3303); + public static final Boundary SHANTAY_PASS = new Boundary(3295, 3311, 3116, 3128); public static final Boundary[] NO_HEAT = {NARDAH, BANDIT_CAMP, MINING_CAMP, BEDABIN, UZER, AGILITY_PYRAMID, PYRAMID, SOPHANEM, MENAPHOS, POLLIVNEACH, SHANTAY_PASS};