Jump to content

Search the Community

Showing results for tags 'wave'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 3 results

  1. [COLOR="Lime"]What are you adding? Fully 63 Wave Fight Caves like runescape[/COLOR] Lets start First make a new class named Location:server/model/minigames/thzaar/FightCaves.java [CODE]package server.game.minigames.tzhaar; import server.Server; import server.game.npcs.NPCHandler; import server.game.players.Client; 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_MEJK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{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. * [MENTION=75098]Para[/MENTION]m 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, true, false); } c.tzhaarToKill = npcAmount; c.tzhaarKilled = 0; } } /** * Handles the correct tz-kih effect; prayer * is drained by the formula: drain = damage + 1 * [MENTION=75098]Para[/MENTION]m c * The player * [MENTION=75098]Para[/MENTION]m i * The npcId * [MENTION=75098]Para[/MENTION]m 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); } } } } 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, false); Server.npcHandler.spawnNpc(c, TZ_KEK_SPAWN, x1, y1, c.heightLevel, 0, hp, max, atk, def, true, false); } } } } } 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] Next go to NPCHandler look for something [B]private void killedBarrow(int i) {[/B] add this under the last } u see: [CODE] 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); } } } 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); } } public void handleJadDeath(int i) { Client c = (Client)Server.playerHandler.players[npcs[i].spawnedBy]; c.getItems().addItem(6570,1); c.getDH().sendDialogues(69, 2617); c.getPA().resetTzhaar(); c.waveId = 300; }[/CODE] then look for [B]if (npcs[i].isDead == true) {[/B] scroll down till u see something like this [CODE]dropItems(i); // npc drops items! appendSlayerExperience(i);[/CODE] under one of them add : [CODE]tzhaarDeathHandler(i); [/CODE] and [CODE] if (npcs[i].npcType == 2745) { handleJadDeath(i); }[/CODE] then look for [B]public void applydamage[/B] and scroll down till u reach the end of the public above [B]c.getPA().refreshSkill(3);[/B] add : [CODE] FightCaves.tzKihEffect(c, i, damage);[/CODE] Next go to PlayerAssistant and add this somewhere : [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] Next look for givelife and add this: [CODE] } else if (c.inFightCaves()) { c.getPA().resetTzhaar();[/CODE] next go to client.java and look for [B]correctCoordinates()[/B] put this under it [CODE] if (inFightCaves()) { getPA().movePlayer(absX, absY, playerId * 4); sendMessage("Your wave will start in 10 seconds."); EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer c) { Server.fightCaves.spawnNextWave((Client)PlayerHandler.players[playerId]); c.stop(); } }, 10000); }[/CODE] Next go to player.java and add this: [CODE] tzhaarToKill = 0, tzhaarKilled = 0, tzKekSpawn = 0, tzKekTimer = 0, waveId,[/CODE] Next search for [B]inMulti()[/B] add this under the last } u see after inmulti : [CODE] public boolean inFightCaves() { return absX >= 2360 && absX <= 2445 && absY >= 5045 && absY <= 5125; }[/CODE] go to your sendialogue and add this : [CODE] case 69: sendNpcChat2("You even defeated TzTok-Jad, I am most impressed!", "Please accept this gift as a reward.", c.talkingNpc, "Tzhaar-Mej-Tal"); c.nextChat = -1; break;[/CODE] reply if i forgot something btw add the imports Credits : 25% me for ripping from source and editing a little part 75% to the owner of the source
  2. I just wrote this in about 20 mins nothing big. Work it out yourself, I've done the hard part for you :L [code] public class FightCaves { private final static int[] NPCS = new int[]{2734, 2735, 2736, 2737, 2739, 2740, 2741, 2742, 2743, 2744, 2745}; private int wave = 0; private int[] waveNpcs = new int[] {}; public void generateWave() { wave++; int len = waveNpcs.length; switch(len) { case 0: waveNpcs = new int[]{NPCS[0]}; break; case 1: if(waveNpcs[0] == 2734) waveNpcs = new int[]{waveNpcs[0], NPCS[1]}; else if(waveNpcs[0] != NPCS[NPCS.length-1]) waveNpcs = new int[] {waveNpcs[0], NPCS[0]}; else { //Killed Jad return; } break; case 2: if(waveNpcs[0]+1 == waveNpcs[1]) waveNpcs = new int[]{NPCS[getIndex(waveNpcs[1])+1]}; else if(waveNpcs[1] == 2734) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], NPCS[getIndex(waveNpcs[1]+1)]}; else waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], NPCS[0]}; break; case 3: if(waveNpcs[1]+1 == waveNpcs[2]) { if(waveNpcs[0] != 2736 && waveNpcs[2] == 2735 && waveNpcs[1] == 2734) waveNpcs = new int[]{waveNpcs[0], NPCS[getIndex(waveNpcs[2])+1]}; else if(waveNpcs[1]+1 == waveNpcs[2] && waveNpcs[0]+1 == NPCS[getIndex(waveNpcs[2])+2]) waveNpcs = new int[]{waveNpcs[0], NPCS[getIndex(waveNpcs[2])+2]}; else waveNpcs = new int[]{waveNpcs[0], NPCS[getIndex(waveNpcs[2])+1]}; } else { if(waveNpcs[2] != 2734) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], NPCS[0]}; else waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], NPCS[1]}; } break; case 4: if(waveNpcs[2]+1 == waveNpcs[3]) { if(waveNpcs[1] != 2736 && waveNpcs[3] == 2735 && waveNpcs[2] == 2734) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], NPCS[getIndex(waveNpcs[3])+1]}; else if(waveNpcs[2]+1 == waveNpcs[3] && waveNpcs[1]+1 == NPCS[getIndex(waveNpcs[3])+2]) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], NPCS[getIndex(waveNpcs[3])+2]}; else waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], NPCS[getIndex(waveNpcs[3])+1]}; } else { if(waveNpcs[3] != 2734) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], waveNpcs[3], NPCS[0]}; else waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], waveNpcs[3], NPCS[1]}; } break; case 5: if(waveNpcs[3]+1 == waveNpcs[4]) { if(waveNpcs[2] != 2736 && waveNpcs[4] == 2735 && waveNpcs[3] == 2734) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], NPCS[getIndex(waveNpcs[4])+1]}; else if(waveNpcs[3]+1 == waveNpcs[4]) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], NPCS[getIndex(waveNpcs[4])+2]}; } else waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], waveNpcs[3], waveNpcs[4], NPCS[1]}; break; case 6: if(waveNpcs[4]+1 == waveNpcs[5]) if(waveNpcs[4]+1 == waveNpcs[5]) waveNpcs = new int[]{waveNpcs[0], waveNpcs[1], waveNpcs[2], waveNpcs[3], NPCS[getIndex(waveNpcs[5])+2]}; break; } } public static int getIndex(int npcId) { for(int i = 0; i < NPCS.length; i++) if(NPCS[i] == npcId) return i; return -1; } public int getWave() { return wave; } } [/code]
  3. [CODE]private int[][] waveList = { { }, { 2628 }, { 2628, 2628 }, { 2629 }, { 2629, 2628 }, { 2629, 2628, 2628 }, { 2629, 2629 }, { 2631 }, { 2631, 2628 }, {2631, 2628, 2628 }, { 2631, 2629 }, { 2631, 2629, 2628 }, { 2631, 2629, 2628, 2628 }, { 2631, 2629, 2629 }, { 2631, 2631 }, { 2741 }, { 2741, 2628 }, { 2741, 2628, 2628 }, { 2741, 2629 }, { 2741, 2629, 2628 }, { 2741, 2629, 2628, 2628 }, { 2741, 2629, 2629 }, { 2741, 2631 }, { 2741, 2631, 2628 }, { 2741, 2631, 2628, 2628 }, { 2741, 2631, 2629 }, { 2741, 2631, 2629, 2628 }, { 2741, 2631, 2629, 2628, 2628 }, { 2741, 2631, 2629, 2629 }, { 2741, 2631, 2631 }, { 2741, 2741 }, { 2743 }, { 2743, 2628 }, { 2743, 2628, 2628 }, { 2743, 2629 }, { 2743, 2629, 2628 }, { 2743, 2629, 2628, 2628 }, { 2743, 2629, 2629 }, { 2743, 2631 }, { 2743, 2631, 2628 }, { 2743, 2631, 2628, 2628 }, { 2743, 2631, 2629 }, { 2743, 2631, 2629, 2628 }, { 2743, 2631, 2629, 2628, 2628 }, { 2743, 2631, 2629, 2629 }, { 2743, 2631, 2631 }, { 2743, 2741 }, { 2743, 2741, 2628 }, { 2743, 2741, 2628, 2628 }, { 2743, 2741, 2629 }, { 2743, 2741, 2629, 2628 }, { 2743, 2741, 2629, 2628, 2628 }, { 2743, 2741, 2629, 2629 }, { 2743, 2741, 2631 }, { 2743, 2741, 2631, 2628 }, { 2743, 2741, 2631, 2628, 2628 }, { 2743, 2741, 2631, 2629 }, { 2743, 2741, 2631, 2629, 2628 }, { 2743, 2741, 2631, 2629, 2628, 2628 }, { 2743, 2741, 2631, 2629, 2629 }, { 2743, 2741, 2631, 2631 }, { 2743, 2741, 2741 }, { 2743, 2743 }, { 2745 } };[/CODE] Left the first one blank so all you have to do is: [CODE]for(int i = 0; i < waveList[waveId]; i++) {[/CODE] Do with it what you will.
×