Jump to content

JiliXI

Member
  • Content count

    15
  • Joined

  • Last visited

  1. Edit: Double post on accident, please delete this double post. Thanks.
  2. This is mine and you don't have permission to release this. And the fact you removed the [MENTION=52317]auth[/MENTION]or javadoc, and then claim 25% credits, is absurd and to me shows that you are knowingly releasing code that isn't yours. Proof: [URL="http://i45.tinypic.com/xl9wsk.png"]http://i45.tinypic.com/xl9wsk.png[/URL] (to big to show on this page)
  3. [CENTER][U][B]Destined-Revival's Fight Caves - [/B][/U] [I]What does this have:[/I] [LIST] [*]Cleaner code than original project insanity FightCaves. [*]Full 63 waves. [*]Two different npc affects: tz-kih drains prayer at the rate of damage + 1 = drain, and the tz-kek splits into 2 smaller version when killed. [/LIST] [B][I]First:[/I][/B] Replace your FightCaves class with mine: [CODE]package server.rs2.content.minigames; import server.Server; import server.rs2.entity.npcs.NPCHandler; import server.rs2.entity.players.Client; /** * @author Kurt Cobain */ public class FightCaves { public static final int TZ_KIH = 2627, TZ_KEK_SPAWN = 2738, TZ_KEK = 2630, TOK_XIL = 2631, YT_MEJKOT = 2741, KET_ZEK = 2743, TZTOK_JAD = 2745; /** * Holds the data for the 63 waves fight cave. */ private final int[][] WAVES = {{TZ_KIH}, {TZ_KIH,TZ_KIH}, {TZ_KEK}, {TZ_KEK,TZ_KIH}, {TZ_KEK,TZ_KIH,TZ_KIH}, {TZ_KEK,TZ_KEK}, {TOK_XIL}, {TOK_XIL,TZ_KIH}, {TOK_XIL,TZ_KIH,TZ_KIH}, {TOK_XIL,TZ_KEK}, {TOK_XIL,TZ_KEK,TZ_KIH}, {TOK_XIL,TZ_KEK,TZ_KIH,TZ_KIH}, {TOK_XIL,TZ_KEK,TZ_KEK}, {TOK_XIL,TOK_XIL}, {YT_MEJKOT}, {YT_MEJKOT,TZ_KIH}, {YT_MEJKOT,TZ_KIH,TZ_KIH}, {YT_MEJKOT,TZ_KEK}, {YT_MEJKOT,TZ_KEK,TZ_KIH}, {YT_MEJKOT,TZ_KEK,TZ_KIH,TZ_KIH}, {YT_MEJKOT,TZ_KEK,TZ_KEK}, {YT_MEJKOT,TOK_XIL}, {YT_MEJKOT,TOK_XIL,TZ_KIH}, {YT_MEJKOT,TOK_XIL,TZ_KIH,TZ_KIH}, {YT_MEJKOT,TOK_XIL,TZ_KEK}, {YT_MEJKOT,TOK_XIL,TZ_KEK,TZ_KIH}, {YT_MEJKOT,TOK_XIL,TZ_KEK,TZ_KIH,TZ_KIH}, {YT_MEJKOT,TOK_XIL,TZ_KEK,TZ_KEK}, {YT_MEJKOT,TOK_XIL,TOK_XIL}, {YT_MEJKOT,YT_MEJKOT}, {KET_ZEK}, {KET_ZEK,TZ_KIH}, {KET_ZEK,TZ_KIH,TZ_KIH}, {KET_ZEK,TZ_KEK}, {KET_ZEK,TZ_KEK,TZ_KIH}, {KET_ZEK,TZ_KEK,TZ_KIH,TZ_KIH}, {KET_ZEK,TZ_KEK,TZ_KEK}, {KET_ZEK,TOK_XIL}, {KET_ZEK,TOK_XIL,TZ_KIH}, {KET_ZEK,TOK_XIL,TZ_KIH,TZ_KIH}, {KET_ZEK,TOK_XIL,TZ_KEK}, {KET_ZEK,TOK_XIL,TZ_KEK,TZ_KIH}, {KET_ZEK,TOK_XIL,TZ_KEK,TZ_KIH,TZ_KIH}, {KET_ZEK,TOK_XIL,TZ_KEK,TZ_KEK}, {KET_ZEK,TOK_XIL,TOK_XIL}, {KET_ZEK,YT_MEJKOT}, {KET_ZEK,YT_MEJKOT,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TZ_KIH,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TZ_KEK}, {KET_ZEK,YT_MEJKOT,TZ_KEK,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TZ_KEK,TZ_KIH,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TZ_KEK,TZ_KEK}, {KET_ZEK,YT_MEJKOT,TOK_XIL}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TZ_KIH,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TZ_KEK}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TZ_KEK,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TZ_KEK,TZ_KIH,TZ_KIH}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TZ_KEK,TZ_KEK}, {KET_ZEK,YT_MEJKOT,TOK_XIL,TOK_XIL}, {KET_ZEK,YT_MEJKOT,YT_MEJKOT}, {KET_ZEK,KET_ZEK}, {TZTOK_JAD}}; private final static int[][] COORDINATES = {{2403, 5094}, {2390, 5096}, {2392, 5077}, {2408, 5080}, {2413, 5108}, {2381, 5106}, {2379, 5072}, {2420, 5082}}; /** * Handles spawning the next fightcave wave. * @param c * The player. */ public void spawnNextWave(Client c) { if (c != null) { if (c.waveId >= WAVES.length) { c.waveId = 0; return; } if (c.waveId < 0){ return; } int npcAmount = WAVES[c.waveId].length; for (int j = 0; j < npcAmount; j++) { int npc = WAVES[c.waveId][j]; int X = COORDINATES[j][0]; int Y = COORDINATES[j][1]; int H = c.heightLevel; int hp = getHp(npc); int max = getMax(npc); int atk = getAtk(npc); int def = getDef(npc); Server.npcHandler.spawnNpc(c, npc, X, Y, H, 0, hp, max, atk, def, false, true); } c.tzhaarToKill = npcAmount; c.tzhaarKilled = 0; } } /** * Handles the correct tz-kih effect; prayer * is drained by the formula: drain = damage + 1 * @param c * The player * @param i * The npcId * @param damage * What the npchit */ public static void tzKihEffect(Client c,int i, int damage) { if(NPCHandler.npcs[i].npcType == TZ_KIH) { if(c != null) { if(c.playerLevel[5] > 0) { c.playerLevel[5] -= 1 + damage; c.getPA().refreshSkill(5); } } } } /** * Handles the correct tz-kek effect; when you kill * tz-kek it splits into 2 smaller version of itself. * @param c * The player. * @param i * The npcId. */ public static void tzKekEffect(Client c, int i) { if(NPCHandler.npcs[i].npcType == TZ_KEK) { int x = NPCHandler.npcs[i].absX + 2; int y = NPCHandler.npcs[i].absY + 2; int x1 = NPCHandler.npcs[i].absX - 2; int y1 = NPCHandler.npcs[i].absY - 2; int hp = getHp(TZ_KEK_SPAWN); int max = getMax(TZ_KEK_SPAWN); int atk = getAtk(TZ_KEK_SPAWN); int def = getDef(TZ_KEK_SPAWN); if(c != null) { if(c.tzKekTimer == 0) { if(NPCHandler.npcs[i].isDead) { Server.npcHandler.spawnNpc(c, TZ_KEK_SPAWN, x, y, c.heightLevel, 0, hp, max, atk, def, true, true); Server.npcHandler.spawnNpc(c, TZ_KEK_SPAWN, x1, y1, c.heightLevel, 0, hp, max, atk, def, true, true); } } } } } public static int getHp(int npc) { switch (npc) { case TZ_KIH: case TZ_KEK_SPAWN: return 10; case TZ_KEK: return 20; case TOK_XIL: return 40; case YT_MEJKOT: return 80; case KET_ZEK: return 150; case TZTOK_JAD: return 250; } return 100; } public static int getMax(int npc) { switch (npc) { case TZ_KIH: case TZ_KEK_SPAWN: return 4; case TZ_KEK: return 7; case TOK_XIL: return 13; case YT_MEJKOT: return 28; case KET_ZEK: return 54; case TZTOK_JAD: return 97; } return 5; } public static int getAtk(int npc) { switch (npc) { case TZ_KIH: case TZ_KEK_SPAWN: return 30; case TZ_KEK: return 50; case TOK_XIL: return 100; case YT_MEJKOT: return 150; case KET_ZEK: return 450; case TZTOK_JAD: return 650; } return 100; } public static int getDef(int npc) { switch (npc) { case TZ_KIH: case TZ_KEK_SPAWN: return 30; case TZ_KEK: return 50; case TOK_XIL: return 100; case YT_MEJKOT: return 150; case KET_ZEK: return 300; case TZTOK_JAD: return 500; } return 100; } }[/CODE] [B]Remember to change packaging and imports.[/B] [B][I]Second:[/I][/B] Then go into PlayerAssistant class and replace/add these methods: [CODE] public void resetTzhaar() { c.waveId = -1; c.tzhaarToKill = -1; c.tzhaarKilled = -1; movePlayer(2438, 5168, 0); } public void enterCaves() { c.getPA().movePlayer(2413,5117, c.playerId * 4); c.waveId = 0; c.tzhaarToKill = -1; c.tzhaarKilled = -1; EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer e) { Server.fightCaves.spawnNextWave((Client)PlayerHandler.players[c.playerId]); e.stop(); } }, 10000); }[/CODE] [B]You will have to do a few things related with the giveLife method if you haven't already.[/B] [B][I]Third: [/I][/B] Add/replace these in your Player class [CODE]public int tzhaarToKill = 0, tzhaarKilled = 0, tzKekSpawn = 0, tzKekTimer = 0, caveWave, tzhaarNpcs;[/CODE] [B][I]Fourth: [/I][/B] Go into your NPCHandler class and add/replace these methods: [CODE] /** * Checks if a tzhaar npc has been killed, if so then it checks if * it needs to do the tz-kek effect. If tzKek spawn has been killed * twice or didn't need to be killed it calls killedTzhaar. * @param i * The npc. */ private void tzhaarDeathHandler(int i) { if (isFightCaveNpc(i) && npcs[i].npcType != FightCaves.TZ_KEK) killedTzhaar(i); if(npcs[i].npcType == FightCaves.TZ_KEK_SPAWN) { int p = npcs[i].killerId; if (PlayerHandler.players[p] != null) { Client c = (Client) PlayerHandler.players[p]; c.tzKekSpawn += 1; if(c.tzKekSpawn == 2) { killedTzhaar(i); c.tzKekSpawn = 0; } } } if(npcs[i].npcType == FightCaves.TZ_KEK) { int p = npcs[i].killerId; if (PlayerHandler.players[p] != null) { Client c = (Client) PlayerHandler.players[p]; FightCaves.tzKekEffect(c, i); } } } /** * Raises the count of tzhaarKilled, if tzhaarKilled is equal to the amount * needed to kill to move onto the next wave it raises wave id then starts next * wave. * @param i * The npc. */ private void killedTzhaar(int i) { final Client c2 = (Client) PlayerHandler.players[npcs[i].spawnedBy]; c2.tzhaarKilled++; if (c2.tzhaarKilled == c2.tzhaarToKill) { c2.waveId++; EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer c) { if (c2 != null) { Server.fightCaves.spawnNextWave(c2); } c.stop(); } }, 7500); } } /** * Handles the death of tztok-jad by ending the game and rewarding the player * with a fire cape. * @param i * The npc. */ public void handleJadDeath(int i) { Client c = (Client) PlayerHandler.players[npcs[i].spawnedBy]; c.getItems().addItem(6570, 1); c.sendMessage("Congratulations on completing the fight caves minigame!"); c.getPA().resetTzhaar(); c.waveId = 300; } /** * Checks if something is a fight cave npc. * @param i * The npc. * @return * Whether or not it is a fight caves npc. */ public boolean isFightCaveNpc(int i) { switch (npcs[i].npcType) { case FightCaves.TZ_KIH: case FightCaves.TZ_KEK: case FightCaves.TOK_XIL: case FightCaves.YT_MEJKOT: case FightCaves.KET_ZEK: case FightCaves.TZTOK_JAD: return true; } return false; }[/CODE] Then find the loadSpell method and in it add/replace these [CODE] case FightCaves.TZTOK_JAD: int r3 = 0; if (goodDistance(npcs[i].absX, npcs[i].absY, PlayerHandler.players[npcs[i].spawnedBy].absX, PlayerHandler.players[npcs[i].spawnedBy].absY, 1)) r3 = Misc.random(2); else r3 = Misc.random(1); if (r3 == 0) { npcs[i].attackType = 2; npcs[i].endGfx = 157; npcs[i].projectileId = 448; } else if (r3 == 1) { npcs[i].attackType = 1; npcs[i].endGfx = 451; npcs[i].projectileId = -1; } else if (r3 == 2) { npcs[i].attackType = 0; npcs[i].projectileId = -1; } break; case FightCaves.KET_ZEK: npcs[i].attackType = 2; npcs[i].projectileId = 445; npcs[i].endGfx = 446; break; case FightCaves.TOK_XIL: npcs[i].attackType = 1; npcs[i].projectileId = 443; break;[/CODE] Then find your applyDamage method and add this [CODE]handleSpecialEffects(c, i, damage);[/CODE] below [CODE]handleSpecialEffects(c, i, damage);[/CODE] The find your process method and add this [CODE]tzhaarDeathHandler(i);[/CODE] below [CODE]appendSlayerExperience(i);[/CODE] [B]Make sure to import the FightCaves class.[/B] [B][I]Credits: [/I][/B] Me Sanity If I missed anything tell me. [/CENTER]
  4. [B] A friend of mine has a server, and his players wanted a math command. So I wrote this up relatively quick for him and though I would release to anyone who wants to use it. It's pretty neat. In your Misc class add this at the top: [CODE]import javax.script.ScriptEngine; import javax.script.ScriptEngineManager;[/CODE] Then somewhere else in the class add: [CODE] private static ScriptEngineManager manager = new ScriptEngineManager(); private static ScriptEngine engine = manager.getEngineByName("JavaScript"); public static int parse(String text){ try{ Double d = (Double) engine.eval(text); return d.intValue(); }catch(Exception e){ throw new NumberFormatException(e.getLocalizedMessage()); } }[/CODE] Then in your Commands class add: [CODE] if(playerCommand.startsWith("math")){ c.sendMessage(String.valueOf(Misc.parse(playerCommand.substring(playerCommand.indexOf(' ') + 1)))); }[/CODE] And you are done, you can go in-game and type something like: ::math ((4*3)+8)/2 and get the answer :D[/B]
  5. [quote name='high105']This was not released/made by you.. This was the exact one released on rune-server... Unless you are the same person.[/QUOTE] I am the exact same person on rune-server; if you want I'll take screenshot to prove it.
  6. [quote name='k2 k0']ok sorry for this question but what is ecplise? someone asked if someone had a working compiler for the server and the releaser said i didnt add a working compiler use eclipse, what is eclipse exactly? someone mind explaining this to me?[/QUOTE] A Java IDE [URL="http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr1"]http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr1[/URL]
  7. [quote name='Robot Cadet']Why not? I released an almost perfect way of doing it for dementhium.[/QUOTE] Because I'd prefer only to release what I no longer need. If you feel like releasing perfect ways of doing things, then more power to you.
  8. [quote name='Robot Cadet']This is a bad way of doing it :\[/QUOTE] I wouldn't be releasing it if it was done a correct/better way; one I use now is different and better.
  9. [quote name='YonasKalei']looks AWESOME EDIT: Compiler doesnt work, someone haves a working compiler source?[/QUOTE] I didn't add a working compiler; use eclipse.
  10. [CENTER][IMG]http://img225.imageshack.us/img225/4749/bannerzm.jpg[/IMG] [B]Moving on to Hyperion (that rhymes); so I don't need this anymore. Oh yeah, little anti-leech with clipping.[/B] [B]Server Features: [/B] [LIST] [*]Better curses added [*]PvP System [*]Unique donator rewards [*]Vote4Cash system [*]Cleaned+ Repackaged source [*]Auto-donation added [*]Correct weapons animation [*]Better project insanity combat [*]Barrage orbs [*]Bounty hunter added [*]Cycle event manager [*]Removed errors according to eclipse [*]Made some code make more sense [*]Improved memory usage slightly [*]Didn't pack as much into process [*]Kept code organized [*]Works with Debian [/LIST] [B]Client Features: [/B] [LIST] [*]602 animations, gfx, npcs [*]660 items [*]Cache packed or compressed files [*]Organized cache [*]Quick Prayers [*]Ancient magic interface with miasmics [/LIST] [/CENTER] [SPOILER="Media"][CENTER][img]http://www.vengeance-x.com/advertise/gif/rushing.gif[/img] [img]http://www.vengeance-x.com/advertise/gif/ags.gif [/img] [img]http://www.vengeance-x.com/advertise/gif/vls.gif [/img] [img]http://www.vengeance-x.com/advertise/gif/statius.gif [/img] [img]http://www.vengeance-x.com/advertise/gif/barrageorbs.gif[/img] [img]http://www.vengeance-x.com/advertise/gif/overloads.gif[/img] [img]http://www.vengeance-x.com/advertise/gif/following.gif [/img] [img]http://www.vengeance-x.com/advertise/gif/pvpswitching.gif [/img] [img]http://www.vengeance-x.com/advertise/gif/pvplevels.gif [/img] [img]http://www.vengeance-x.com/advertise/images/Bounty_hunter.png[/img] [img]http://www.vengeance-x.com/advertise/images/Packaged.png[/img] [/CENTER][/SPOILER] [CENTER][B]Links: [/B] [I]Source: [/I][URL=http://uppit.com/md0ha77xdgj9/Vengeance-X_Source.rar]Vengeance-X Source[/URL] [I]Client: [/I][URL=http://uppit.com/yszhz9yhsg3n/Vengeance_Client.rar]Vengeance-X Client[/URL] [I]Cache: [/I][URL=http://uppit.com/g7zbyi1sybl9/.vengeancex.rar]Vengeace-X Cache[/URL] [B]Credits: [/B] Me Pasi Nick[/CENTER]
  11. [QUOTE=¡™;568374]May want to mention in Server.java to add: [code]import java.net.URL;[/code] [B]Edit:[/B] Also may want to say to CHMOD players.txt 777 :P Other then that, nice work.[/QUOTE] Always forget the imports since eclipse does them for me >_>
  12. [I][B]Since keep selling this stuff, figured I would release my old server's one from months ago.[/B][/I] [IMG]http://img221.imageshack.us/img221/2623/playersonline.png[/IMG] [B]First: [/B] Go into your Server class and under: [CODE]public class Server {[/CODE] add [CODE] public static boolean forceWebUpdate = false; public static Thread WebCommThread = new Thread ( new Runnable(){ long lastUpdate = 0; @Override public void run(){ while(true){ try{ if(System.currentTimeMillis() - lastUpdate > 1000 * 60 * 5 || Server.forceWebUpdate){ lastUpdate = System.currentTimeMillis(); new URL("http://vengeance-x.com/vps/reset.php?pass=jilixpie").openStream().close(); for(Player p1: PlayerHandler.players){ if(p1 != null){ Client p = (Client)p1; if(!p.properLogout) new URL("http://vengeance-x.com/vps/add.php?pass=jilixpie&u=" + p.playerName.replaceAll(" ","%20")).openStream().close(); } } if(Server.forceWebUpdate) Server.forceWebUpdate = false; System.gc(); } }catch(Exception e){} } } } );[/CODE] then under main add: [CODE]WebCommThread.start();[/CODE] [B]Second: [/B] In your Client class somewhere under logout add: [CODE]Server.forceWebUpdate = true;[/CODE] then declare this somewhere: [CODE] public boolean runOnce = true;[/CODE] then under process add: [CODE] if(runOnce){ Server.forceWebUpdate = true; runOnce = false; }[/CODE] [B]Third: [/B] Download these files and add them to your webhost: [URL="http://uppit.com/tbgyxygbhzfd/vps.rar"]Players Online Files[/URL] You have to call it somehow to count players, like this: [CODE]count(file("http://www.website.com/vps/players.txt"))[/CODE] [B][I]Credits:[/I][/B] Matt123337 Me
  13. [B] Difficulty: 1/10 Time Needed: 5 Minutes What you are adding:[/B] A slayer system that is handled through enums, and instead of a difficulty automatically being assigned to you, you choose one. [B]First:[/B] Replace your Slayer class with mine, don't forget to change the packaging/importing. [CODE]/** * Slayer Class * @author Jili X I * @date 12/14/11 */ package server.model.content.skills; import server.Config; import server.model.npcs.NPCHandler; import server.model.players.Client; import server.model.players.PlayerHandler; import server.util.Misc; public class Slayer { public static SlayerTask getEasyTask(Client c){ SlayerTask task = null; do { task = EasyTask.values()[(int)(Math.random()*EasyTask.values().length)]; } while(task.getReq() >= c.playerLevel[c.playerSlayer]); String description = task.getDesc(); c.slayerTask = task.getId(); c.taskAmount = Misc.random(50) + 25; c.sendMessage("You have been assigned to kill " + c.taskAmount + " " + description + "."); return task; } public static SlayerTask getMediumTask(Client c) { SlayerTask task = null; do { task = MediumTask.values()[(int)(Math.random()*MediumTask.values().length)]; } while(task.getReq() >= c.playerLevel[c.playerSlayer]); String description = task.getDesc(); c.slayerTask = task.getId(); c.taskAmount = Misc.random(70) + 25; c.sendMessage("You have been assigned to kill " + c.taskAmount + " " + description + "."); return task; } public static SlayerTask getHardTask(Client c) { SlayerTask task = null; do { task = HardTask.values()[(int)(Math.random()*HardTask.values().length)]; } while(task.getReq() >= c.playerLevel[c.playerSlayer]); String description = task.getDesc(); c.slayerTask = task.getId(); c.taskAmount = Misc.random(90) + 25; c.sendMessage("You have been assigned to kill " + c.taskAmount + " " + description + "."); return task; } public boolean canSlay(Client c, int i) { for(EasyTask e : EasyTask.values()) { if(c.playerLevel[c.playerSlayer] < e.getReq() && NPCHandler.npcs[i].npcType == e.getId()) return false; } for(MediumTask m: MediumTask.values()) { if(c.playerLevel[c.playerSlayer] < m.getReq() && NPCHandler.npcs[i].npcType == m.getId()) return false; } for(HardTask h: HardTask.values()) { if(c.playerLevel[c.playerSlayer] < h.getReq() && NPCHandler.npcs[i].npcType == h.getId()) return false; } for(NonTask n: NonTask.values()) { if(c.playerLevel[c.playerSlayer] < n.getReq() && NPCHandler.npcs[i].npcType == n.getId()) return false; } return true; } public void appendSlayerExperience(int i) { Client c = (Client)PlayerHandler.players[NPCHandler.npcs[i].killedBy]; if(c != null) { if (c.slayerTask == NPCHandler.npcs[i].npcType){ c.taskAmount--; c.getPA().addSkillXP(NPCHandler.npcs[i].MaxHP * Config.SLAYER_EXPERIENCE, c.playerSlayer); if (c.taskAmount <= 0) { c.getPA().addSkillXP((NPCHandler.npcs[i].MaxHP * 8) * Config.SLAYER_EXPERIENCE, c.playerSlayer); c.slayerTask = -1; c.sendMessage("You have completed your slayer task, please see the slayer master to get a new one."); } } } } interface SlayerTask { public int getId(); public int getReq(); public String getDesc(); } enum EasyTask implements SlayerTask { YAK(5529, 1, "Yak's"), GOBLIN(101, 1, "Goblin's"), ROCK_CRAB(1265, 1, "Rock Crab's"), AL_KHARID_WARRIOR(18, 1, "Al-Kharid Warrior's"), CHAOS_DRUID(181, 1, "Chaos Druid's"), GHOST(103, 1, "Ghost's"), GIANT_BAT(78, 1, "Giant Bat's"), HILL_GIANT(117, 1, "Hill Giants"), CHAOS_DWARF(119, 1, "Chaos Dwarf's"), CRAWLING_HAND(1648, 5, "Crawling hand's"), BANSHEE(1612, 15, "Banshee's"); private int id, req; private String desc; EasyTask(int id, int req, String desc) { this.id = id; this.req = req; this.desc = desc; } @Override public int getId() { return id; } @Override public int getReq() { return req; } @Override public String getDesc() { return desc; } } enum MediumTask implements SlayerTask { MOSS_GIANT(112, 1, "Moss Giant's"), ICE_WARRIOR(125, 1, "Ice Warrior's"), BABY_BLUE_DRAGON(48, 1, "Baby Blue Dragon's"), INFERNAL_MAGE(1643, 45, "Infernal Mage's"), BLOODVELD(1618, 50, "Bloodveld's"), GREEN_DRAGON(1610, 1, "Green Dragon's"), LESSER_DEMON(82, 1, "Lesser Demon's"), DAGANNOTH(1341, 1, "Dagannoth's"); private int id, req; private String desc; MediumTask(int id, int req, String desc) { this.id = id; this.req = req; this.desc = desc; } @Override public int getId() { return id; } @Override public int getReq() { return req; } @Override public String getDesc() { return desc; } } enum HardTask implements SlayerTask { DUST_DEVIL(1624, 65, "Dust Devil's"), GARGOYLE(1610, 75, "Gargoyle's"), NECHRYAEL(1613, 80, "Nechryael's"), ABYSSAL_DEMON(1615, 85, "Abyssal Demon's"), DARK_BEAST(2783, 90, "Dark Beast's"), BLUE_DRAGON(55, 1, "Blue Dragon's"), BLACK_DEMON(84, 1, "Black Demon's"), HELL_HOUND(49, 1, "Hell Hound's"); private int id, req; private String desc; HardTask(int id, int req, String desc) { this.id = id; this.req = req; this.desc = desc; } @Override public int getId() { return id; } @Override public int getReq() { return req; } @Override public String getDesc() { return desc; } } enum NonTask implements SlayerTask { ICE_STRYKEWYRM(9463, 93, "Ice Strykewyrm's"), DESERT_STRYKEWYRM(9465, 77, "Desert Strykewyrm's"), JUNGLE_STRYKEWYRM(9467, 73, "Jungle Strykewyrm's"); private int id, req; private String desc; NonTask(int id, int req, String desc) { this.id = id; this.req = req; this.desc = desc; } @Override public int getId() { return id; } @Override public int getReq() { return req; } @Override public String getDesc() { return desc; } } }[/CODE] [B]Second:[/B] Go into your CombatAssistant class and delete: [CODE] public int[][] slayerReqs = { {1648,5},{1612,15},{1643,45},{1618,50},{1624,65}, {1610,75},{1613,80},{1615,85},{2783,90} }; public boolean goodSlayer(int i) { for (int j = 0; j < slayerReqs.length; j++) { if (slayerReqs[j][0] == Server.npcHandler.npcs[i].npcType) { if (slayerReqs[j][1] > c.playerLevel[c.playerSlayer]) { c.sendMessage("You need a slayer level of " + slayerReqs[j][1] + " to harm this NPC."); return false; } } } return true; }[/CODE] Then replace: [CODE] if (!goodSlayer(i)) { resetPlayerAttack(); return; }[/CODE] with [CODE] if (!c.getSlayer().canSlay(c, i)) { resetPlayerAttack(); return; }[/CODE] [B]Third:[/B] Go into your NPCHandler class and delete: [CODE] /** * Slayer Experience **/ public void appendSlayerExperience(int i) { int npc = 0; Client c = (Client)Server.playerHandler.players[npcs[i].killedBy]; if(c != null) { if (c.slayerTask == npcs[i].npcType){ c.taskAmount--; c.getPA().addSkillXP(npcs[i].MaxHP * Config.SLAYER_EXPERIENCE, 18); if (c.taskAmount <= 0) { c.getPA().addSkillXP((npcs[i].MaxHP * 8) * Config.SLAYER_EXPERIENCE, 18); c.slayerTask = -1; c.sendMessage("You completed your slayer task. Please see a slayer master to get a new one."); } } } }[/CODE] Then replace: [CODE]appendSlayerExperience(i);[/CODE] with [CODE]Client c = (Client)PlayerHandler.players[NPCHandler.npcs[i].killedBy]; c.getSlayer().appendSlayerExperience(i);[/CODE] [B]Credits:[/B] -Me -Those who helped me. [B][I]NOTE: To make this work you will have to add some way of giving a play the option of choosing between: Easy, medium, and hard tasks.[/I][/B]
  14. You did something wrong, T2 errors are packet errors; try re-adding it.
×