From fab3c3eac75b4778a590aa1155ebdecafb3855f3 Mon Sep 17 00:00:00 2001 From: Josh Shippam Date: Mon, 22 Aug 2022 05:22:00 +0100 Subject: [PATCH] Various Changes (#533) * Add Shield Blocking Emote For Two NPC's * Fix KARAMBWAN HP Restore Amount * Add Link Command To Discord Bot * Github Actions Update --- .github/workflows/maven.yml | 17 +++++++++++++---- .../game/content/combat/npcs/NpcEmotes.java | 5 +++-- .../com/rs2/game/content/consumables/Food.java | 2 +- .../com/rs2/integrations/discord/JavaCord.java | 1 + .../discord/commands/Commands.java | 2 ++ .../integrations/discord/commands/Link.java | 18 ++++++++++++++++++ 6 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Link.java diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 812fb4af..8bdef676 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,4 +1,4 @@ -# This workflow will build a Java project with Maven +# This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: Java CI with Maven @@ -11,9 +11,7 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Set up JDK 1.8 @@ -21,4 +19,15 @@ jobs: with: java-version: 1.8 - name: Build with Maven - run: mvn -B clean install + id: build + run: | + mvn -B clean package + mkdir -p ~/artifacts + cp "2006Scape Client/target/client-1.0-jar-with-dependencies.jar" ~/artifacts/Client.jar + cp "2006Scape Server/target/server-1.0-jar-with-dependencies.jar" ~/artifacts/Server.jar + cp -r "2006Scape Server/data" ~/artifacts/ + - name: Publish build to GH Actions + uses: actions/upload-artifact@v2 + with: + path: ~/artifacts/* + name: 2006Scape-Build diff --git a/2006Scape Server/src/main/java/com/rs2/game/content/combat/npcs/NpcEmotes.java b/2006Scape Server/src/main/java/com/rs2/game/content/combat/npcs/NpcEmotes.java index baf346c4..73c01992 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/content/combat/npcs/NpcEmotes.java +++ b/2006Scape Server/src/main/java/com/rs2/game/content/combat/npcs/NpcEmotes.java @@ -11,8 +11,9 @@ import com.rs2.game.players.Player; public enum NpcEmotes { MAN(new int[] {1, 2, 3, 4, 5, 6}, 422, 1834, 836), - AL_KHARID_WARRIOR(new int[] {18}, 451, 404, 836), - GUARD(new int[] {9, 10}, 412, 404, 836), + AL_KHARID_WARRIOR(new int[] {18}, 451, 1156, 836), + GUARD(new int[] {9}, 412, 1156, 836), + GUARD_NO_SHIELD(new int[] {10}, 412, 404, 836), GARGOYLE(new int[] {1610, 1611}, 1517, 1519, 1518), SKELETAL_WYVERN(new int[] {3068}, 2989, 2988, 2987), BAT(new int[] {412, 78}, 30, 31, 36), diff --git a/2006Scape Server/src/main/java/com/rs2/game/content/consumables/Food.java b/2006Scape Server/src/main/java/com/rs2/game/content/consumables/Food.java index 83b99a00..a2d74bd1 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/content/consumables/Food.java +++ b/2006Scape Server/src/main/java/com/rs2/game/content/consumables/Food.java @@ -24,7 +24,7 @@ public class Food { MANTA(391, 22, "Manta Ray", 0, "Food", false), SHARK(385, 20, "Shark", 0, "Food", false), LOBSTER(379, 12, "Lobster", 0, "Food", false), - KARAMBWAN(3144, 2 + Misc.random(4), "Karambwan", 0, "Food", false), + KARAMBWAN(3144, 18, "Karambwan", 0, "Food", false), TROUT(333, 7, "Trout", 0, "Food", false), SALMON(329, 9, "Salmon", 0, "Food", false), SWORDFISH(373, 14, "Swordfish", 0, "Food", false), diff --git a/2006Scape Server/src/main/java/com/rs2/integrations/discord/JavaCord.java b/2006Scape Server/src/main/java/com/rs2/integrations/discord/JavaCord.java index f4548c76..16efe793 100644 --- a/2006Scape Server/src/main/java/com/rs2/integrations/discord/JavaCord.java +++ b/2006Scape Server/src/main/java/com/rs2/integrations/discord/JavaCord.java @@ -32,6 +32,7 @@ public class JavaCord { api.addListener(new Forum()); api.addListener(new Hiscores()); api.addListener(new Issues()); + api.addListener(new Link()); api.addListener(new Online()); api.addListener(new Players()); api.addListener(new Vote()); diff --git a/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Commands.java b/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Commands.java index e08c7f79..3fde1f21 100644 --- a/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Commands.java +++ b/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Commands.java @@ -11,6 +11,8 @@ public class Commands implements MessageCreateListener { Message message = event.getMessage(); if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " commands")) { event.getChannel().sendMessage("```fix" + + System.lineSeparator() + + "::link" + System.lineSeparator() + "::forum/::forums" + System.lineSeparator() + diff --git a/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Link.java b/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Link.java new file mode 100644 index 00000000..98dc1b85 --- /dev/null +++ b/2006Scape Server/src/main/java/com/rs2/integrations/discord/commands/Link.java @@ -0,0 +1,18 @@ +package com.rs2.integrations.discord.commands; + +import org.javacord.api.entity.message.Message; +import org.javacord.api.entity.user.User; +import org.javacord.api.event.message.MessageCreateEvent; +import org.javacord.api.listener.message.MessageCreateListener; + +public class Link implements MessageCreateListener { + @Override + public void onMessageCreate(MessageCreateEvent event) { + Message message = event.getMessage(); + User user = message.getAuthor().asUser().get(); + if (message.getContent().equalsIgnoreCase("::link")) { + event.getChannel().sendMessage(user.getMentionTag() + ", Please check your DM's to continue."); + user.sendMessage("Please copy/paste the following in-game to link your Discord account: \n ```::link " + user.getIdAsString() + "```"); + } + } +} \ No newline at end of file