Ruse
All Ruse snippets belong here.
22 topics in this forum
-
package com.deathwish.world.entity.impl.player.bot.type; import com.deathwish.model.Animation; import com.deathwish.model.Flag; import com.deathwish.model.Item; import com.deathwish.model.Skill; import com.deathwish.model.container.impl.Equipment; import com.deathwish.model.definitions.WeaponAnimations; import com.deathwish.model.definitions.WeaponInterfaces; import com.deathwish.util.Misc; import com.deathwish.world.content.BonusManager; import com.deathwish.world.content.clan.ClanChatManager; import com.deathwish.world.content.combat.CombatFactory; import com.deathwish.world.content.combat.weapon.FightType; import com.deathwish.world.content.skill.SkillManager; import…
-
0
Reputation Points
- 2 replies
- 635 views
-
-
Hey guys. I see far too many servers using this method to generate percentage chance; int chance = 10; if (Misc.random(100) <= chance){ doSomething; } I made this one to simplify things: public static double randomDouble(double i) { return getRandomDouble(i); } public static boolean percentageChance(double percentage) { return percentage >= randomDouble(100); } You need the random double method in order for for the percentage chance to work. Shove them into Misc.java or something. Use like this (This example is generating a 10% chance) if (Misc.percentageChance(10.0)) { doSomething; } …
-
0
Reputation Points
- 10 replies
- 1.9k views
-
-
The objectivate of this is to take a area and imply water on the ground. This can be done by changing a tiles texture value. I'm releasing because this knowledge could have saved me a lot of time but I couldn't find it anywhere. In ObjectManager search for if(tileX >= 0 && tileX < 104 && tileY >= 0 && tileY < 104) { Add this directly after int absX = (k1 + tileX); int absY = (j + tileY); In the same method you should find something like this if(tileType <= 49) { overLay[tilePlane][tileX][tileY] = stream.readSignedByte(); overlayClippingPaths[tile…
-
1
Reputation Points
- 12 replies
- 4.2k views
-
-
Hey guys, Today I'm making a guide on how you can encrypt your player(s) passwords! I made this initially for PlatinumPS (Now leaked) Note: We will be saving the encryption key as plaintext in the server files for this tutorial. This is obviously a terrible idea for most applications, however you can adapt the code to store the key somewhere else if you want to. The purpose of doing this is to stop people who gain unauthorised access to your player files from using the passwords nefariously. First step - Creating Encryptor.java in your server files. I have left an example key as you'll see. Change this! Encryptor.java package c…
-
0
Reputation Points
- 5 replies
- 1.1k views
-
-
Hey guys! I'm here with a little tutorial! The RSPS Scene has some notoriously shady characters. It's almost impossible to perm ban people these days because there's always a way to circumvent the standard IP / Mac bans. Well, today you'll learn how to scan a users IP address and retrieve quality metrics such as; If they're using a VPN If they're on the TOR network If they're using a Proxy A 'Fraud Score' (Based on location, previous suspicious behaviour across the internet etc) And plenty more such as their estimated location, ISP and timezone. So, let's get started! First of all, you're going to need an amazing Jav…
-
0
Reputation Points
- 6 replies
- 2.4k views
-
-
Welcome! Today I'll be showing a SUPER simple way to replace the old, outdated and frankly terrible way that most Ruse servers handle launching URLs. First off, go ahead and create a new packet in your PacketSender (May be called PacketHandler). public PacketSender openURL(String url) { return this; } I called mine openURL. (Big brain, I know!) Next, you'll want to head over to your Client Configuration file. Scroll to the bottom, and you'll see a load of seemingly confusing numbers. You can usually find them easily: public static final int[] packetSizes = {... Find one that is currently 0 I have chosen packet 220.…
-
0
Reputation Points
- 3 replies
- 1k views
-
-
I decided not to add degrading armours so basically it's dead code I made a while back. If you wan't to use it enjoy. CombatFactory: Find: /** PHOENIX NECK **/ Add all this above that line. /** DHAROKS DEGRADE START BY JAKE **/ /** DHAROKS HELM **/ else if(t2.getEquipment().getItems()[Equipment.HEAD_SLOT].getId() == 4716) { int recDamage = (int) (damage * 0.001); if (recDamage <= 0) return; if (recDamage > t2.getConstitution()) recDamage = t2.getConstitution(); attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT)); ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_HELM); …
-
0
Reputation Points
- 9 replies
- 2.2k views
-
-
Hello, I am new to the scene, I am a little confused as to what to do next. I have downloaded and setup a development environment of Necrotic in IntelliJ, I have it up and running on local host. I would like to start to customizing the server, but do not know where to start. I would like to make it more of a questing server. Since quests is what made me fall in love with RS in the first place. Anyone know where I can find any tutorials on hot to set up a quest? A list of in game command that would be helpful for a developer? How to add custom tiles, models, and UI Art? Anything else that IDK of since I am new to RSPS server development. Please …
-
0
Reputation Points
- 1 reply
- 636 views
-
-
Hey guys, this tut is for a system I created for the now leaked Platinum PS. It is a boss which is triggered when the server hits a global XP target. It then spawns in an instanced area, but the players can leaver / enter smoothly. Adapt as required, this wasn't ever intended to be a tutorial so it's more involved than others I've done. The rewards are currently XP in the chosen boss skill. Players are ranked based on damage caused to the boss. Positions 1-5 are rewarded. They are then shown a crappy interface, but it does the trick I made a new package in src.com.platinum.world.content.skillingboss Then there are two files: …
-
0
Reputation Points
- 11 replies
- 1.7k views
-
-
Pretty simple if you have a player and cant keep track of appeals/warnings. Let's start off in PointsHandler: /* * Warning Points */ private int warningPoints; public void setwarningPoints(int points, boolean add) { if(add) this.warningPoints += points; else this.warningPoints = points; } public int getWarningPoints() { return this.warningPoints; } public void incrementWarningPoints() { this.warningPoints++; } public void incrementWarningPoints(int amt) { this.warningPoints += amt; } public void setWarningPoints(int warningPoints) { this.warningPoints = warningPoints; } Now we if they have more than 0 warning points they will get …
-
0
Reputation Points
- 5 replies
- 2.6k views
-
-
Note, if you want to keep a track of clues completed simply create clue scroll points and have them called there. (String 47703) Client (RsInterface) : public static void clueScrolls(TextDrawingArea wid[]) { RSInterface tab = addInterface(47700); addSpriteLoader(47701, 959); addText(47702, "Clues Completed", wid, 1, 16750623, true, true); addText(47703, "-", wid, 2, 0xffffff, true, true); addText(47704, "Dig somewhere in the Edgeville bank", wid, 1, 16750623, true, true); addCloseButton(47705, 18535, 18536); tab.children(5); tab.child(0,…
-
0
Reputation Points
- 10 replies
- 2.2k views
-
-
Hey guys.. Had the need to re-write SlayerTasks.java for someone, figured I'd share it. It includes a kill requirement - if your server doesn't have that, just set the KC requirement to 0 or properly remove it if you know what you're doing package com.arlania.world.content.skill.impl.slayer; import com.arlania.model.Position; import com.arlania.model.Skill; import com.arlania.model.definitions.NpcDefinition; import com.arlania.util.Misc; import com.arlania.world.entity.impl.player.Player; import lombok.Getter; import java.util.ArrayList; import java.util.List; /** * @author Flub * https://discord.com/users/496606216047558667 */ public enum SlayerTask…
-
0
Reputation Points
- 11 replies
- 2.3k views
-
-
I always forget about this tip. In Client.java, search for: for (int j = 0; j < 5; j++) { if (!parsePacket()) { break; } } Change the 5 to around 35-40. for (int j = 0; j < 35; j++) { if (!parsePacket()) { break; } } Try to login / open an interface before and after - It's a huge difference! Essentially the client was limited to just 5 packets per tick, now it's 35
-
0
Reputation Points
- 10 replies
- 1.8k views
-
-
if (hotKey == 508) { if (i == KeyEvent.VK_ESCAPE && Client.openInterfaceID != -1) { Client.instance.clearTopInterfaces(); //Client.setTab(10); } else if (i == KeyEvent.VK_F1) { Client.setTab(3); } else if (i == KeyEvent.VK_F2) { Client.setTab(4); } else if (i == KeyEvent.VK_F3) { Client.setTab(5); } else if (i == KeyEvent.VK_F4) { Client.setTab(6); } else if (i == KeyEvent.VK_F5) { Client.setTab(0); } else if (i == KeyEvent.VK_F6) { Client.setTab(1); } else if (i == KeyEvent.VK_F7) { Client.setTab(2); } else if (i == KeyEvent.VK_F8) { Client.setTab(7); } else if (i == KeyEvent.VK_F9) { Clien…
-
0
Reputation Points
- 5 replies
- 2.7k views
-
-
Hi guys, Here is a command I created to discover what NPC's drop an item. Main code (I put mine inside ItemDefinition so that I can use ItemDefinition.whatDrops(player, name))``` public static void whatDrops(Player player, String name) { int itemID = getItemId(name); if (itemID == -1) { player.getPacketSender().sendMessage("Item not found!"); return; } ItemDefinition itemDef = ItemDefinition.forId(itemID); List<Integer> previouslyListed = new ArrayList<>(); try { for (NPCDrops npcDrops : NPCDrops.getDrops().values()) { if (npcDrops != nu…
-
0
Reputation Points
- 8 replies
- 1.5k views
-
-
I've used Ruse a lot and never seen anything even similar to this. OT: int recDamage = (int) (damage * 0.001); if (recDamage <= 0) return; if (recDamage > t2.getConstitution()) recDamage = t2.getConstitution(); attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT)); From the recoil effect lol. It has nothing to do with barrows degrading. You're making your Dharok's return damage to the attacker.. You also have so much repetetive code. You could do it as simple as this: DegradingItem: public static Optional<DegradingItem> forItem(int item) { for(DegradingItem d : DegradingItem.values()) { …
-
0
Reputation Points
- 5 replies
- 1.9k views
-
-
Hey everyone. This is a better way to select a random entry from an enum An example of an enum group is: @AllArgsConstructor public enum SlayerTasks { DARKWIZARDS(SlayerMaster.SUMONA, 9203, "Find Darkblue Wizards at ::wizards", 1500, new Position(2903, 5203)), HEATED_PYRO(SlayerMaster.SUMONA, 172, "Heated Pyro can be found in the Elite Teleports", 1500, new Position(2863, 5354, 2)), PURPLE_WYRM(SlayerMaster.SUMONA, 9935, "Purple Wyrm can be found in the Elite Teleports", 1500, new Position(2602, 5713)), TRINITY(SlayerMaster.SUMONA, 170, "Trinity can be found in the Elite Teleports", 1500, new Position(2273, 4680, 1)), CLOUD(SlayerMaste…
-
0
Reputation Points
- 2 replies
- 806 views
-
-
Hey guys, whipped this up quickly. Make sure to add my previous snippets too. Genie.java package com.janus.world.content.randomevents; import com.janus.engine.task.Task; import com.janus.engine.task.TaskManager; import com.janus.model.Animation; import com.janus.model.Graphic; import com.janus.model.Item; import com.janus.model.container.impl.Inventory; import com.janus.world.World; import com.janus.world.entity.impl.npc.NPC; import com.janus.world.entity.impl.player.Player; import lombok.Getter; import lombok.Setter; public class Genie { @Getter @Setter private Player spawnedFor; @Getter @Setter private boolean claimed; public Geni…
-
0
Reputation Points
- 7 replies
- 1.3k views
-
-
Hey guys, commands below.. adapt as required for other sites! if (command[0].equals("google")) { String query = (wholeCommand.substring(command[0].length() + 1)).replace(" ", "%20"); player.getPacketSender().openURL("https://www.google.com/search?q=" + query); } if (command[0].equals("youtube")) { String query = (wholeCommand.substring(command[0].length() + 1)).replace(" ", "%20"); player.getPacketSender().openURL("https://www.youtube.com/results?search_query=" + query); } If you'd like the same openURL method, checkout my other tut:
-
0
Reputation Points
- 1 reply
- 592 views
-
-
Hey everyone. I bet all of you have come across the need to select a random item from a group before. You'll see this in many areas of your server. Most prominently in your mystery / donator box files, raid rewards and crystal chest too! An example of an item group is: Item[] items = {new Item(113, 1) , newI Item(333,4)}; Now, we have a group that includes two items. The most common way of selecting a random reward (You'll see this EVERYWHERE) is; Item reward = (items[Misc.getRandom(items.length - 1)], 1); This will work. However, it's ugly! There are always ways to improve. Here is a new method for you.. I've added mine into Misc.java. …
-
0
Reputation Points
- 3 replies
- 1k views
-
-
I've always liked being able to reference an item in code via static ints. I have a file named Items.java, and I simply reference Items.RUNE_ARROW for example. Well if you want this too, I made this to generate them. public static void main(String[] args) { try { File dumpedDefs = new File("./DumpedDefs.txt"); FileWriter fw = new FileWriter(dumpedDefs, false); //Loading ints into definitions[] init(); HashMap<String, ItemDefinition> map = new HashMap<>(); // Adding definitions into a hashmap in reverse // This replaces items that have duplicate names su…
-
0
Reputation Points
- 2 replies
- 811 views
-
-
I believe this was released by someone else for PI, I've had it forever so credits to whoever released it, didn't take long to convert. Make this class wherever you want. package com.arlania.engine; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import com.arlania.util.Stopwatch; public class CharacterBackup { private static final int TIME = 28800000; //8 hours public static Stopwatch timer = new Stopwatch().reset(); public CharacterBackup(…
-
0
Reputation Points
- 11 replies
- 2.5k views
-