Jump to content

Resolute

Member
  • Content count

    33
  • Joined

  • Last visited

  1. In Walking.java implement in the processPacket method.. [code] c.getPA().closeAllWindows(); [/code]
  2. Item.java, replace pouchId with the item id of your pouch. [code] Item.itemStackable[[B]pouchId[/B]] = true; [/code] Edit: Are you stupid or something? You claim I'm wrong but that's the exact instructions which I gave you but I didn't include what method it was in since that was upto you to figure out. /facepalm
  3. Happy Birthday!!!!!!

  4. You actually need to make it check whether the player has actually received the starter, or not. It is simple to fix, do the following steps below. In Player.java feel free to implement this anywhere: [code] public boolean hasStarter; [/code] Now in PlayerSave.java, implement theses: [code] } else if (token.equals("starter")) { p.hasStarter = Boolean.parseBoolean(token2); [/code] [code] characterfile.write("starter = ", 0, 10); characterfile.write(Boolean.toString(p.hasStarter), 0, Boolean.toString(p.hasStarter).length()); characterfile.newLine(); [/code] Finally in Client.java search for the method initialize, and under it implement this: [code] if (!hasStarter) { getPA().addStarter(); hasStarter = true; } [/code]
  5. Resolute

    Few problems[pi]

    To change a shop name edit it in shops.cfg, and post the exact error that you're receiving.
  6. Resolute

    eclipse problem..

    It's a simple fix, simply right click LegitScape 718 Alpha, and then click on build path. Move onto configure build path and then click on source, once you're there click the little down arrow. You will notice the dialogue folder under excluded, click on it and then on the right hand side click remove.
  7. Check whether the tormented demon id is implemented in npc.cfg, if it isn't implement it. And implement the item command under if (c.playerRights >= 2) { if you don't find it provide the entire class.
  8. [quote name='EvolvedBlitz']It can still differ.[/QUOTE] It was a suggestion, could have worked, maybe not, and it was included with the tutorial you provided aswell.. But we'll have to wait until neeko6464 logs on, and tries it.
  9. [quote name='neeko6464']I got it but what do I change the "frame ID" to?[/QUOTE] It's included on the tutorial. [code] sendFrame126("Combat Level: "+(int)c.getCombatLevel()+"", [COLOR="#FF0000"]13251[/COLOR]); [/code] 13251
  10. It'd be easier for us to assist you if you posted the Client.java, and ItemAssistant.java files.
  11. Replace your file with this.. [code] package org.cleaned.rs2.model; import org.cleaned.Config; import org.cleaned.Server; import org.cleaned.rs2.model.players.PlayerSave; import org.cleaned.rs2.util.Misc; public class PlayerAssistant{ private Client c; public PlayerAssistant(Client Client) { this.c = Client; } public int CraftInt, Dcolor, FletchInt; public void resetAutocast() { c.autocastId = 0; c.autocasting = false; c.getActionSender().sendFrame36(108, 0); } public int mapStatus = 0; /** * Show option, attack, trade, follow etc **/ public String optionType = "null"; /** * Private Messaging **/ [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void logIntoPM() { c.getActionSender().setPrivateMessaging(2); for(int i1 = 0; i1 < Config.MAX_PLAYERS; i1++) { Player p = Server.playerHandler.players[i1]; if(p != null && p.isActive) { Client o = (Client)p; if(o != null) { o.getPA().updatePM(c.playerId, 1); } } } boolean pmLoaded = false; for(int i = 0; i < c.friends.length; i++) { if(c.friends[i] != 0) { for(int i2 = 1; i2 < Config.MAX_PLAYERS; i2++) { Player p = Server.playerHandler.players[i2]; if (p != null && p.isActive && Misc.playerNameToInt64(p.playerName) == c.friends[i]) { Client o = (Client)p; if(o != null) { if (c.playerRights >= 2 || p.privateChat == 0 || (p.privateChat == 1 && o.getPA().isInPM(Misc.playerNameToInt64(c.playerName)))) { c.getActionSender().loadPM(c.friends[i], 1); pmLoaded = true; } break; } } } if(!pmLoaded) { c.getActionSender().loadPM(c.friends[i], 0); } pmLoaded = false; } for(int i1 = 1; i1 < Config.MAX_PLAYERS; i1++) { Player p = Server.playerHandler.players[i1]; if(p != null && p.isActive) { Client o = (Client)p; if(o != null) { o.getPA().updatePM(c.playerId, 1); } } } } } [MENTION=19271]supp[/MENTION]ressWarnings({ "static-access", "unused" }) public void updatePM(int pID, int world) { // used for private chat updates Player p = Server.playerHandler.players[pID]; if(p == null || p.playerName == null || p.playerName.equals("null")){ return; } Client o = (Client)p; if(o == null) { return; } long l = Misc.playerNameToInt64(Server.playerHandler.players[pID].playerName); if (p.privateChat == 0) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i]) { c.getActionSender().loadPM(l, world); return; } } } } else if (p.privateChat == 1) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i]) { if (o.getPA().isInPM(Misc.playerNameToInt64(c.playerName))) { c.getActionSender().loadPM(l, world); return; } else { c.getActionSender().loadPM(l, 0); return; } } } } } else if (p.privateChat == 2) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i] && c.playerRights < 2) { c.getActionSender().loadPM(l, 0); return; } } } } } public boolean isInPM(long l) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i]) { return true; } } } return false; } /** * Drink AntiPosion Potions * [MENTION=75098]Para[/MENTION]m itemId The itemId * [MENTION=75098]Para[/MENTION]m itemSlot The itemSlot * [MENTION=75098]Para[/MENTION]m newItemId The new item After Drinking * [MENTION=75098]Para[/MENTION]m healType The type of poison it heals */ public void potionPoisonHeal(int itemId, int itemSlot, int newItemId, int healType) { c.attackTimer = c.getCombat().getAttackDelay(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()); if(c.duelRule[5]) { c.sendMessage("Potions has been disabled in this duel!"); return; } if(!c.isDead && System.currentTimeMillis() - c.foodDelay > 2000) { if(c.getItems().playerHasItem(itemId, 1, itemSlot)) { c.sendMessage("You drink the "+c.getItems().getItemName(itemId).toLowerCase()+"."); c.foodDelay = System.currentTimeMillis(); // Actions if(healType == 1) { //Cures The Poison } else if(healType == 2) { //Cures The Poison + protects from getting poison again } c.startAnimation(0x33D); c.getItems().deleteItem(itemId, itemSlot, 1); c.getItems().addItem(newItemId, 1); requestUpdates(); } } } /** * Magic on items **/ public void magicOnItems(int slot, int itemId, int spellId) { switch(spellId) { case 1162: // low alch if(System.currentTimeMillis() - c.alchDelay > 1000) { if(!c.getCombat().checkMagicReqs(49)) { break; } if(itemId == 995) { c.sendMessage("You can't alch coins"); break; } c.getItems().deleteItem(itemId, slot, 1); c.getItems().addItem(995, c.getShops().getItemShopValue(itemId)/3); c.startAnimation(c.MAGIC_SPELLS[49][2]); c.gfx100(c.MAGIC_SPELLS[49][3]); c.alchDelay = System.currentTimeMillis(); c.getActionSender().sendFrame106(6); addSkillXP(c.MAGIC_SPELLS[49][7] * Config.MAGIC_EXP_RATE, 6); refreshSkill(6); } break; case 1178: // high alch if(System.currentTimeMillis() - c.alchDelay > 2000) { if(!c.getCombat().checkMagicReqs(50)) { break; } if(itemId == 995) { c.sendMessage("You can't alch coins"); break; } c.getItems().deleteItem(itemId, slot, 1); c.getItems().addItem(995, (int)(c.getShops().getItemShopValue(itemId)*.75)); c.startAnimation(c.MAGIC_SPELLS[50][2]); c.gfx100(c.MAGIC_SPELLS[50][3]); c.alchDelay = System.currentTimeMillis(); c.getActionSender().sendFrame106(6); addSkillXP(c.MAGIC_SPELLS[50][7] * Config.MAGIC_EXP_RATE, 6); refreshSkill(6); } break; case 1155: handleAlt(itemId); break; } } /** * Dieing **/ [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void applyDead() { c.respawnTimer = 15; c.isDead = false; if(c.duelStatus != 6) { //c.killerId = c.getCombat().getKillerId(c.playerId); c.killerId = findKiller(); Client o = (Client) Server.playerHandler.players[c.killerId]; if(o != null) { if (c.killerId != c.playerId) o.sendMessage("You have defeated "+c.playerName+"!"); c.playerKilled = c.playerId; if(o.duelStatus == 5) { o.duelStatus++; } } } c.faceUpdate(0); c.npcIndex = 0; c.playerIndex = 0; c.stopMovement(); if(c.duelStatus <= 4) { c.sendMessage("Oh dear you are dead!"); } else if(c.duelStatus != 6) { c.sendMessage("You have lost the duel!"); } resetDamageDone(); c.specAmount = 10; c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]); c.lastVeng = 0; c.vengOn = false; resetFollowers(); c.attackTimer = 10; } public void resetDamageDone() { for (int i = 0; i < PlayerHandler.players.length; i++) { if (PlayerHandler.players[i] != null) { PlayerHandler.players[i].damageTaken[c.playerId] = 0; } } } public void vengMe() { if (System.currentTimeMillis() - c.lastVeng > 30000) { if (c.getItems().playerHasItem(557,10) && c.getItems().playerHasItem(9075,4) && c.getItems().playerHasItem(560,2)) { c.vengOn = true; c.lastVeng = System.currentTimeMillis(); c.startAnimation(4410); c.gfx100(726); c.getItems().deleteItem(557,c.getItems().getItemSlot(557),10); c.getItems().deleteItem(560,c.getItems().getItemSlot(560),2); c.getItems().deleteItem(9075,c.getItems().getItemSlot(9075),4); } else { c.sendMessage("You do not have the required runes to cast this spell. (9075 for astrals)"); } } else { c.sendMessage("You must wait 30 seconds before casting this again."); } } public void resetTb() { c.teleBlockLength = 0; c.teleBlockDelay = 0; } public void handleStatus(int i, int i2, int i3) { if (i == 1) c.getItems().addItem(i2,i3); else if (i == 2) { c.playerXP[i2] = c.getPA().getXPForLevel(i3)+5; c.playerLevel[i2] = c.getPA().getLevelForXP(c.playerXP[i2]); } } [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void resetFollowers() { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { if (Server.playerHandler.players[j].followId == c.playerId) { Client c = (Client)Server.playerHandler.players[j]; c.getPA().resetFollow(); } } } } [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void giveLife() { c.isDead = false; c.faceUpdate(-1); c.freezeTimer = 0; if(c.duelStatus <= 4 && !c.getPA().inPitsWait()) { // if we are not in a duel we must be in wildy so remove items if (!c.inPits && !c.inFightCaves()) { c.getItems().resetKeepItems(); if((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 2) { if(!c.isSkulled) { // what items to keep c.getItems().keepItem(0, true); c.getItems().keepItem(1, true); c.getItems().keepItem(2, true); } if(c.prayerActive[10] && System.currentTimeMillis() - c.lastProtItem > 700) { c.getItems().keepItem(3, true); } c.getItems().dropAllItems(); // drop all items c.getItems().deleteAllItems(); // delete all items if(!c.isSkulled) { // add the kept items once we finish deleting and dropping them for (int i1 = 0; i1 < 3; i1++) { if(c.itemKeptId[i1] > 0) { c.getItems().addItem(c.itemKeptId[i1], 1); } } } if(c.prayerActive[10]) { // if we have protect items if(c.itemKeptId[3] > 0) { c.getItems().addItem(c.itemKeptId[3], 1); } } } c.getItems().resetKeepItems(); } c.getCombat().resetPrayers(); for (int i = 0; i < 20; i++) { c.playerLevel[i] = getLevelForXP(c.playerXP[i]); c.getPA().refreshSkill(i); } if (c.pitsStatus == 1) { movePlayer(2399, 5173, 0); } else if(c.duelStatus <= 4) { // if we are not in a duel repawn to wildy movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0); c.isSkulled = false; c.skullTimer = 0; c.attackedPlayers.clear(); } else if (c.inFightCaves()) { c.getPA().resetTzhaar(); } else { // we are in a duel, respawn outside of arena Client o = (Client) Server.playerHandler.players[c.duelingWith]; if(o != null) { o.getActionSender().createPlayerHints(10, -1); if(o.duelStatus == 6) { o.getTradeAndDuel().duelVictory(); } } movePlayer(Config.DUELING_RESPAWN_X+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), Config.DUELING_RESPAWN_Y+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0); if(c.duelStatus != 6) { // if we have won but have died, don't reset the duel status. c.getTradeAndDuel().resetDuel(); } } //PlayerSaving.getSingleton().requestSave(c.playerId); PlayerSave.saveGame(c); c.getCombat().resetPlayerAttack(); resetAnimation(); c.startAnimation(65535); c.getActionSender().frame1(); resetTb(); c.isSkulled = false; c.attackedPlayers.clear(); c.headIconPk = -1; c.skullTimer = -1; c.damageTaken = new int[Config.MAX_PLAYERS]; c.getPA().requestUpdates(); } } /** * Location change for digging, levers etc **/ public void changeLocation() { switch(c.newLocation) { case 1: c.getActionSender().sendFrame99(2); movePlayer(3578,9706,-1); break; case 2: c.getActionSender().sendFrame99(2); movePlayer(3568,9683,-1); break; case 3: c.getActionSender().sendFrame99(2); movePlayer(3557,9703,-1); break; case 4: c.getActionSender().sendFrame99(2); movePlayer(3556,9718,-1); break; case 5: c.getActionSender().sendFrame99(2); movePlayer(3534,9704,-1); break; case 6: c.getActionSender().sendFrame99(2); movePlayer(3546,9684,-1); break; } c.newLocation = 0; } /** * Teleporting **/ public void spellTeleport(int x, int y, int height) { c.getPA().startTeleport(x, y, height, c.playerMagicBook == 1 ? "ancient" : "modern"); } public void startTeleport(int x, int y, int height, String teleportType) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if(c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL) { c.sendMessage("You can't teleport above level "+Config.NO_TELEPORT_WILD_LEVEL+" in the wilderness."); return; } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0 && c.respawnTimer == -6) { if (c.playerIndex > 0 || c.npcIndex > 0) c.getCombat().resetPlayerAttack(); c.stopMovement(); c.getActionSender().removeAllWindows(); c.teleX = x; c.teleY = y; c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = height; if(teleportType.equalsIgnoreCase("modern")) { c.startAnimation(714); c.teleTimer = 11; c.teleGfx = 308; c.teleEndAnimation = 715; } if(teleportType.equalsIgnoreCase("ancient")) { c.startAnimation(1979); c.teleGfx = 0; c.teleTimer = 9; c.teleEndAnimation = 0; c.gfx0(392); } } } public void startTeleport2(int x, int y, int height) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0) { c.stopMovement(); c.getActionSender().removeAllWindows(); c.teleX = x; c.teleY = y; c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = height; c.startAnimation(714); c.teleTimer = 11; c.teleGfx = 308; c.teleEndAnimation = 715; } } public void processTeleport() { c.teleportToX = c.teleX; c.teleportToY = c.teleY; c.heightLevel = c.teleHeight; if(c.teleEndAnimation > 0) { c.startAnimation(c.teleEndAnimation); } } public void movePlayer(int x, int y, int h) { c.resetWalkingQueue(); c.teleportToX = x; c.teleportToY = y; c.heightLevel = h; requestUpdates(); } /** * Following **/ /*public void Player() { if(Server.playerHandler.players[c.followId] == null || Server.playerHandler.players[c.followId].isDead) { c.getPA().resetFollow(); return; } if(c.freezeTimer > 0) { return; } int otherX = Server.playerHandler.players[c.followId].getX(); int otherY = Server.playerHandler.players[c.followId].getY(); boolean withinDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 6); boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean sameSpot = (c.absX == otherX && c.absY == otherY); if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) { c.followId = 0; c.getPA().resetFollow(); return; } c.faceUpdate(c.followId+32768); if ((c.usingBow || c.mageFollow || c.autocastId > 0 && (c.npcIndex > 0 || c.playerIndex > 0)) && bowDistance && !sameSpot) { c.stopMovement(); return; } if (c.usingRangeWeapon && rangeWeaponDistance && !sameSpot && (c.npcIndex > 0 || c.playerIndex > 0)) { c.stopMovement(); return; } if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1) && !sameSpot) { return; } c.outStream.createFrame(174); boolean followPlayer = c.followId > 0; if (c.freezeTimer <= 0) if (followPlayer) c.outStream.writeWord(c.followId); else c.outStream.writeWord(c.followId2); else c.outStream.writeWord(0); if (followPlayer) c.outStream.writeByte(1); else c.outStream.writeByte(0); if (c.usingBow && c.playerIndex > 0) c.followDistance = 5; else if (c.usingRangeWeapon && c.playerIndex > 0) c.followDistance = 3; else if (c.spellId > 0 && c.playerIndex > 0) c.followDistance = 5; else c.followDistance = 1; c.outStream.writeWord(c.followDistance); }*/ [MENTION=19271]supp[/MENTION]ressWarnings({ "static-access", "unused" }) public void followPlayer() { if(Server.playerHandler.players[c.followId] == null || Server.playerHandler.players[c.followId].isDead) { c.followId = 0; return; } if(c.freezeTimer > 0) { return; } if (c.isDead || c.playerLevel[3] <= 0) return; int otherX = Server.playerHandler.players[c.followId].getX(); int otherY = Server.playerHandler.players[c.followId].getY(); boolean withinDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean goodDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1); boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 8); boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 4); boolean sameSpot = c.absX == otherX && c.absY == otherY; if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) { c.followId = 0; return; } if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1)) { if (otherX != c.getX() && otherY != c.getY()) { stopDiagonal(otherX, otherY); return; } } if((c.usingBow || c.mageFollow || (c.playerIndex > 0 && c.autocastId > 0)) && bowDistance && !sameSpot) { return; } if(c.getCombat().usingHally() && hallyDistance && !sameSpot) { return; } if(c.usingRangeWeapon && rangeWeaponDistance && !sameSpot) { return; } c.faceUpdate(c.followId+32768); if (otherX == c.absX && otherY == c.absY) { int r = Misc.random(3); switch (r) { case 0: walkTo(0,-1); break; case 1: walkTo(0,1); break; case 2: walkTo(1,0); break; case 3: walkTo(-1,0); break; } } else if(c.isRunning2 && !withinDistance) { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } } else { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY + 1)); } } c.faceUpdate(c.followId+32768); } [MENTION=19271]supp[/MENTION]ressWarnings({ "static-access", "unused" }) public void followNpc() { if(Server.npcHandler.npcs[c.followId2] == null || Server.npcHandler.npcs[c.followId2].isDead) { c.followId2 = 0; return; } if(c.freezeTimer > 0) { return; } if (c.isDead || c.playerLevel[3] <= 0) return; int otherX = Server.npcHandler.npcs[c.followId2].getX(); int otherY = Server.npcHandler.npcs[c.followId2].getY(); boolean withinDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean goodDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1); boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 8); boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 4); boolean sameSpot = c.absX == otherX && c.absY == otherY; if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) { c.followId2 = 0; return; } if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1)) { if (otherX != c.getX() && otherY != c.getY()) { stopDiagonal(otherX, otherY); return; } } if((c.usingBow || c.mageFollow || (c.npcIndex > 0 && c.autocastId > 0)) && bowDistance && !sameSpot) { return; } if(c.getCombat().usingHally() && hallyDistance && !sameSpot) { return; } if(c.usingRangeWeapon && rangeWeaponDistance && !sameSpot) { return; } c.faceUpdate(c.followId2); if (otherX == c.absX && otherY == c.absY) { int r = Misc.random(3); switch (r) { case 0: walkTo(0,-1); break; case 1: walkTo(0,1); break; case 2: walkTo(1,0); break; case 3: walkTo(-1,0); break; } } else if(c.isRunning2 && !withinDistance) { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } } else { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY + 1)); } } c.faceUpdate(c.followId2); } public int getRunningMove(int i, int j) { if (j - i > 2) return 2; else if (j - i < -2) return -2; else return j-i; } public void resetFollow() { c.followId = 0; c.followId2 = 0; c.mageFollow = false; c.outStream.createFrame(174); c.outStream.writeWord(0); c.outStream.writeByte(0); c.outStream.writeWord(1); } public void walkTo(int i, int j) { c.newWalkCmdSteps = 0; if(++c.newWalkCmdSteps > 50) c.newWalkCmdSteps = 0; int k = c.getX() + i; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + j; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public void walkTo2(int i, int j) { if (c.freezeDelay > 0) return; c.newWalkCmdSteps = 0; if(++c.newWalkCmdSteps > 50) c.newWalkCmdSteps = 0; int k = c.getX() + i; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + j; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public void stopDiagonal(int otherX, int otherY) { if (c.freezeDelay > 0) return; c.newWalkCmdSteps = 1; int xMove = otherX - c.getX(); int yMove = 0; if (xMove == 0) yMove = otherY - c.getY(); /*if (!clipHor) { yMove = 0; } else if (!clipVer) { xMove = 0; }*/ int k = c.getX() + xMove; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + yMove; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public void walkToCheck(int i, int j) { if (c.freezeDelay > 0) return; c.newWalkCmdSteps = 0; if(++c.newWalkCmdSteps > 50) c.newWalkCmdSteps = 0; int k = c.getX() + i; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + j; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public int getMove(int place1,int place2) { if (System.currentTimeMillis() - c.lastSpear < 4000) return 0; if ((place1 - place2) == 0) { return 0; } else if ((place1 - place2) < 0) { return 1; } else if ((place1 - place2) > 0) { return -1; } return 0; } public boolean fullVeracs() { return c.playerEquipment[c.playerHat] == 4753 && c.playerEquipment[c.playerChest] == 4757 && c.playerEquipment[c.playerLegs] == 4759 && c.playerEquipment[c.playerWeapon] == 4755; } public boolean fullGuthans() { return c.playerEquipment[c.playerHat] == 4724 && c.playerEquipment[c.playerChest] == 4728 && c.playerEquipment[c.playerLegs] == 4730 && c.playerEquipment[c.playerWeapon] == 4726; } /** * reseting animation **/ public void resetAnimation() { c.getCombat().getPlayerAnimIndex(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()); c.startAnimation(c.playerStandIndex); requestUpdates(); } public void requestUpdates() { c.updateRequired = true; c.setAppearanceUpdateRequired(true); } public void handleAlt(int id) { if (!c.getItems().playerHasItem(id)) { c.getItems().addItem(id,1); } } public void l*****p(int skill) { int totalLevel = (getLevelForXP(c.playerXP[0]) + getLevelForXP(c.playerXP[1]) + getLevelForXP(c.playerXP[2]) + getLevelForXP(c.playerXP[3]) + getLevelForXP(c.playerXP[4]) + getLevelForXP(c.playerXP[5]) + getLevelForXP(c.playerXP[6]) + getLevelForXP(c.playerXP[7]) + getLevelForXP(c.playerXP[8]) + getLevelForXP(c.playerXP[9]) + getLevelForXP(c.playerXP[10]) + getLevelForXP(c.playerXP[11]) + getLevelForXP(c.playerXP[12]) + getLevelForXP(c.playerXP[13]) + getLevelForXP(c.playerXP[14]) + getLevelForXP(c.playerXP[15]) + getLevelForXP(c.playerXP[16]) + getLevelForXP(c.playerXP[17]) + getLevelForXP(c.playerXP[18]) + getLevelForXP(c.playerXP[19]) + getLevelForXP(c.playerXP[20])); c.getActionSender().sendFrame126("Total Lvl: "+totalLevel, 3984); switch(skill) { case 0: c.getActionSender().sendFrame126("Congratulations, you just advanced an attack level!", 6248); c.getActionSender().sendFrame126("Your attack level is now "+getLevelForXP(c.playerXP[skill])+".", 6249); c.sendMessage("Congratulations, you just advanced an attack level."); c.getActionSender().sendFrame164(6247); break; case 1: c.getActionSender().sendFrame126("Congratulations, you just advanced a defence level!", 6254); c.getActionSender().sendFrame126("Your defence level is now "+getLevelForXP(c.playerXP[skill])+".", 6255); c.sendMessage("Congratulations, you just advanced a defence level."); c.getActionSender().sendFrame164(6253); break; case 2: c.getActionSender().sendFrame126("Congratulations, you just advanced a strength level!", 6207); c.getActionSender().sendFrame126("Your strength level is now "+getLevelForXP(c.playerXP[skill])+".", 6208); c.sendMessage("Congratulations, you just advanced a strength level."); c.getActionSender().sendFrame164(6206); break; case 3: c.getActionSender().sendFrame126("Congratulations, you just advanced a hitpoints level!", 6217); c.getActionSender().sendFrame126("Your hitpoints level is now "+getLevelForXP(c.playerXP[skill])+".", 6218); c.sendMessage("Congratulations, you just advanced a hitpoints level."); c.getActionSender().sendFrame164(6216); break; case 4: c.getActionSender().sendFrame126("Congratulations, you just advanced a ranged level!", 5453); c.getActionSender().sendFrame126("Your ranged level is now "+getLevelForXP(c.playerXP[skill])+".", 6114); c.sendMessage("Congratulations, you just advanced a ranging level."); c.getActionSender().sendFrame164(4443); break; case 5: c.getActionSender().sendFrame126("Congratulations, you just advanced a prayer level!", 6243); c.getActionSender().sendFrame126("Your prayer level is now "+getLevelForXP(c.playerXP[skill])+".", 6244); c.sendMessage("Congratulations, you just advanced a prayer level."); c.getActionSender().sendFrame164(6242); break; case 6: c.getActionSender().sendFrame126("Congratulations, you just advanced a magic level!", 6212); c.getActionSender().sendFrame126("Your magic level is now "+getLevelForXP(c.playerXP[skill])+".", 6213); c.sendMessage("Congratulations, you just advanced a magic level."); c.getActionSender().sendFrame164(6211); break; case 7: c.getActionSender().sendFrame126("Congratulations, you just advanced a cooking level!", 6227); c.getActionSender().sendFrame126("Your cooking level is now "+getLevelForXP(c.playerXP[skill])+".", 6228); c.sendMessage("Congratulations, you just advanced a cooking level."); c.getActionSender().sendFrame164(6226); break; case 8: c.getActionSender().sendFrame126("Congratulations, you just advanced a woodcutting level!", 4273); c.getActionSender().sendFrame126("Your woodcutting level is now "+getLevelForXP(c.playerXP[skill])+".", 4274); c.sendMessage("Congratulations, you just advanced a woodcutting level."); c.getActionSender().sendFrame164(4272); break; case 9: c.getActionSender().sendFrame126("Congratulations, you just advanced a fletching level!", 6232); c.getActionSender().sendFrame126("Your fletching level is now "+getLevelForXP(c.playerXP[skill])+".", 6233); c.sendMessage("Congratulations, you just advanced a fletching level."); c.getActionSender().sendFrame164(6231); break; case 10: c.getActionSender().sendFrame126("Congratulations, you just advanced a fishing level!", 6259); c.getActionSender().sendFrame126("Your fishing level is now "+getLevelForXP(c.playerXP[skill])+".", 6260); c.sendMessage("Congratulations, you just advanced a fishing level."); c.getActionSender().sendFrame164(6258); break; case 11: c.getActionSender().sendFrame126("Congratulations, you just advanced a fire making level!", 4283); c.getActionSender().sendFrame126("Your firemaking level is now "+getLevelForXP(c.playerXP[skill])+".", 4284); c.sendMessage("Congratulations, you just advanced a fire making level."); c.getActionSender().sendFrame164(4282); break; case 12: c.getActionSender().sendFrame126("Congratulations, you just advanced a crafting level!", 6264); c.getActionSender().sendFrame126("Your crafting level is now "+getLevelForXP(c.playerXP[skill])+".", 6265); c.sendMessage("Congratulations, you just advanced a crafting level."); c.getActionSender().sendFrame164(6263); break; case 13: c.getActionSender().sendFrame126("Congratulations, you just advanced a smithing level!", 6222); c.getActionSender().sendFrame126("Your smithing level is now "+getLevelForXP(c.playerXP[skill])+".", 6223); c.sendMessage("Congratulations, you just advanced a smithing level."); c.getActionSender().sendFrame164(6221); break; case 14: c.getActionSender().sendFrame126("Congratulations, you just advanced a mining level!", 4417); c.getActionSender().sendFrame126("Your mining level is now "+getLevelForXP(c.playerXP[skill])+".", 4438); c.sendMessage("Congratulations, you just advanced a mining level."); c.getActionSender().sendFrame164(4416); break; case 15: c.getActionSender().sendFrame126("Congratulations, you just advanced a herblore level!", 6238); c.getActionSender().sendFrame126("Your herblore level is now "+getLevelForXP(c.playerXP[skill])+".", 6239); c.sendMessage("Congratulations, you just advanced a herblore level."); c.getActionSender().sendFrame164(6237); break; case 16: c.getActionSender().sendFrame126("Congratulations, you just advanced a agility level!", 4278); c.getActionSender().sendFrame126("Your agility level is now "+getLevelForXP(c.playerXP[skill])+".", 4279); c.sendMessage("Congratulations, you just advanced an agility level."); c.getActionSender().sendFrame164(4277); break; case 17: c.getActionSender().sendFrame126("Congratulations, you just advanced a thieving level!", 4263); c.getActionSender().sendFrame126("Your theiving level is now "+getLevelForXP(c.playerXP[skill])+".", 4264); c.sendMessage("Congratulations, you just advanced a thieving level."); c.getActionSender().sendFrame164(4261); break; case 18: c.getActionSender().sendFrame126("Congratulations, you just advanced a slayer level!", 12123); c.getActionSender().sendFrame126("Your slayer level is now "+getLevelForXP(c.playerXP[skill])+".", 12124); c.sendMessage("Congratulations, you just advanced a slayer level."); c.getActionSender().sendFrame164(12122); break; case 20: c.getActionSender().sendFrame126("Congratulations, you just advanced a runecrafting level!", 4268); c.getActionSender().sendFrame126("Your runecrafting level is now "+getLevelForXP(c.playerXP[skill])+".", 4269); c.sendMessage("Congratulations, you just advanced a runecrafting level."); c.getActionSender().sendFrame164(4267); break; } c.dialogueAction = 0; c.nextChat = 0; } public void refreshSkill(int i) { switch (i) { case 0: c.getActionSender().sendFrame126("" + c.playerLevel[0] + "", 4004); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[0]) + "", 4005); c.getActionSender().sendFrame126("" + c.playerXP[0] + "", 4044); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[0]) + 1) + "", 4045); break; case 1: c.getActionSender().sendFrame126("" + c.playerLevel[1] + "", 4008); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[1]) + "", 4009); c.getActionSender().sendFrame126("" + c.playerXP[1] + "", 4056); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[1]) + 1) + "", 4057); break; case 2: c.getActionSender().sendFrame126("" + c.playerLevel[2] + "", 4006); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[2]) + "", 4007); c.getActionSender().sendFrame126("" + c.playerXP[2] + "", 4050); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[2]) + 1) + "", 4051); break; case 3: c.getActionSender().sendFrame126("" + c.playerLevel[3] + "", 4016); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[3]) + "", 4017); c.getActionSender().sendFrame126("" + c.playerXP[3] + "", 4080); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[3])+1) + "", 4081); break; case 4: c.getActionSender().sendFrame126("" + c.playerLevel[4] + "", 4010); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[4]) + "", 4011); c.getActionSender().sendFrame126("" + c.playerXP[4] + "", 4062); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[4]) + 1) + "", 4063); break; case 5: c.getActionSender().sendFrame126("" + c.playerLevel[5] + "", 4012); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[5]) + "", 4013); c.getActionSender().sendFrame126("" + c.playerXP[5] + "", 4068); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[5]) + 1) + "", 4069); c.getActionSender().sendFrame126("" +c.playerLevel[5]+"/"+getLevelForXP(c.playerXP[5])+"", 687);//Prayer frame break; case 6: c.getActionSender().sendFrame126("" + c.playerLevel[6] + "", 4014); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[6]) + "", 4015); c.getActionSender().sendFrame126("" + c.playerXP[6] + "", 4074); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[6]) + 1) + "", 4075); break; case 7: c.getActionSender().sendFrame126("" + c.playerLevel[7] + "", 4034); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[7]) + "", 4035); c.getActionSender().sendFrame126("" + c.playerXP[7] + "", 4134); c.getActionSender().sendFrame126("" +getXPForLevel(getLevelForXP(c.playerXP[7]) + 1) + "", 4135); break; case 8: c.getActionSender().sendFrame126("" + c.playerLevel[8] + "", 4038); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[8]) + "", 4039); c.getActionSender().sendFrame126("" + c.playerXP[8] + "", 4146); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[8]) + 1) + "", 4147); break; case 9: c.getActionSender().sendFrame126("" + c.playerLevel[9] + "", 4026); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[9]) + "", 4027); c.getActionSender().sendFrame126("" + c.playerXP[9] + "", 4110); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[9]) + 1) + "", 4111); break; case 10: c.getActionSender().sendFrame126("" + c.playerLevel[10] + "", 4032); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[10]) + "", 4033); c.getActionSender().sendFrame126("" + c.playerXP[10] + "", 4128); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[10]) + 1) + "", 4129); break; case 11: c.getActionSender().sendFrame126("" + c.playerLevel[11] + "", 4036); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[11]) + "", 4037); c.getActionSender().sendFrame126("" + c.playerXP[11] + "", 4140); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[11]) + 1) + "", 4141); break; case 12: c.getActionSender().sendFrame126("" + c.playerLevel[12] + "", 4024); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[12]) + "", 4025); c.getActionSender().sendFrame126("" + c.playerXP[12] + "", 4104); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[12]) + 1) + "", 4105); break; case 13: c.getActionSender().sendFrame126("" + c.playerLevel[13] + "", 4030); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[13]) + "", 4031); c.getActionSender().sendFrame126("" + c.playerXP[13] + "", 4122); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[13]) + 1) + "", 4123); break; case 14: c.getActionSender().sendFrame126("" + c.playerLevel[14] + "", 4028); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[14]) + "", 4029); c.getActionSender().sendFrame126("" + c.playerXP[14] + "", 4116); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[14]) + 1)+ "", 4117); break; case 15: c.getActionSender().sendFrame126("" + c.playerLevel[15] + "", 4020); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[15]) + "", 4021); c.getActionSender().sendFrame126("" + c.playerXP[15] + "", 4092); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[15]) + 1) + "", 4093); break; case 16: c.getActionSender().sendFrame126("" + c.playerLevel[16] + "", 4018); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[16]) + "", 4019); c.getActionSender().sendFrame126("" + c.playerXP[16] + "", 4086); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[16]) + 1) + "", 4087); break; case 17: c.getActionSender().sendFrame126("" + c.playerLevel[17] + "", 4022); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[17]) + "", 4023); c.getActionSender().sendFrame126("" + c.playerXP[17] + "", 4098); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[17]) + 1) + "", 4099); break; case 18: c.getActionSender().sendFrame126("" + c.playerLevel[18] + "", 12166); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[18]) + "", 12167); c.getActionSender().sendFrame126("" + c.playerXP[18] + "", 12171); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[18]) + 1) + "", 12172); break; case 19: c.getActionSender().sendFrame126("" + c.playerLevel[19] + "", 13926); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[19]) + "", 13927); c.getActionSender().sendFrame126("" + c.playerXP[19] + "", 13921); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[19]) + 1) + "", 13922); break; case 20: c.getActionSender().sendFrame126("" + c.playerLevel[20] + "", 4152); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[20]) + "", 4153); c.getActionSender().sendFrame126("" + c.playerXP[20] + "", 4157); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[20]) + 1) + "", 4158); break; } } public int getXPForLevel(int level) { int points = 0; int output = 0; for (int lvl = 1; lvl <= level; lvl++) { points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0)); if (lvl >= level) return output; output = (int)Math.floor(points / 4); } return 0; } public int getLevelForXP(int exp) { int points = 0; int output = 0; if (exp > 13034430) return 99; for (int lvl = 1; lvl <= 99; lvl++) { points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0)); output = (int) Math.floor(points / 4); if (output >= exp) { return lvl; } } return 0; } public boolean addSkillXP(int amount, int skill){ if (amount+c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) { if(c.playerXP[skill] > 200000000) { c.playerXP[skill] = 200000000; } return false; } amount *= Config.SERVER_EXP_BONUS; int oldLevel = getLevelForXP(c.playerXP[skill]); c.playerXP[skill] += amount; if (oldLevel < getLevelForXP(c.playerXP[skill])) { if (c.playerLevel[skill] < c.getLevelForXP(c.playerXP[skill]) && skill != 3 && skill != 5) c.playerLevel[skill] = c.getLevelForXP(c.playerXP[skill]); l*****p(skill); c.gfx100(199); requestUpdates(); } c.getActionSender().setSkillLevel(skill, c.playerLevel[skill], c.playerXP[skill]); refreshSkill(skill); return true; } public void resetBarrows() { c.barrowsNpcs[0][1] = 0; c.barrowsNpcs[1][1] = 0; c.barrowsNpcs[2][1] = 0; c.barrowsNpcs[3][1] = 0; c.barrowsNpcs[4][1] = 0; c.barrowsNpcs[5][1] = 0; c.barrowsKillCount = 0; c.randomCoffin = Misc.random(3) + 1; } public static int Barrows[] = {4708, 4710, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759}; public static int Runes[] = {4740,558,560,565}; public static int Pots[] = {}; public int randomBarrows() { return Barrows[(int)(Math.random()*Barrows.length)]; } public int randomRunes() { return Runes[(int) (Math.random()*Runes.length)]; } public int randomPots() { return Pots[(int) (Math.random()*Pots.length)]; } /** * Show an arrow icon on the selected player. * [MENTION=75098]Para[/MENTION]m i - Either 0 or 1; 1 is arrow, 0 is none. * [MENTION=75098]Para[/MENTION]m j - The player/Npc that the arrow will be displayed above. * [MENTION=75098]Para[/MENTION]m k - Keep this set as 0 * [MENTION=75098]Para[/MENTION]m l - Keep this set as 0 */ public void drawHeadicon(int i, int j, int k, int l) { synchronized(c) { c.outStream.createFrame(254); c.outStream.writeByte(i); if (i == 1 || i == 10) { c.outStream.writeWord(j); c.outStream.writeWord(k); c.outStream.writeByte(l); } else { c.outStream.writeWord(k); c.outStream.writeWord(l); c.outStream.writeByte(j); } } } [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public int getNpcId(int id) { for(int i = 0; i < NPCHandler.maxNPCs; i++) { if(NPCHandler.npcs[i] != null) { if(Server.npcHandler.npcs[i].npcId == id) { return i; } } } return -1; } public void removeObject(int x, int y) { c.getActionSender().object(-1, x, x, 10, 10); } private void objectToRemove(int X, int Y) { c.getActionSender().object(-1, X, Y, 10, 10); } private void objectToRemove2(int X, int Y) { c.getActionSender().object(-1, X, Y, -1, 0); } public void removeObjects() { objectToRemove(2638, 4688); objectToRemove2(2635, 4693); objectToRemove2(2634, 4693); } public void handleGlory(int gloryId) { c.getDH().sendOption4("Edgeville", "Al Kharid", "Karamja", "Mage Bank"); c.usingGlory = true; } public void resetVariables() { c.usingGlory = false; c.smeltInterface = false; c.smeltType = 0; c.smeltAmount = 0; c.woodcut[0] = c.woodcut[1] = c.woodcut[2] = 0; c.mining[0] = c.mining[1] = c.mining[2] = 0; } public boolean inPitsWait() { return c.getX() <= 2404 && c.getX() >= 2394 && c.getY() <= 5175 && c.getY() >= 5169; } public void castleWarsObjects() { c.getActionSender().object(-1, 2373, 3119, -3, 10); c.getActionSender().object(-1, 2372, 3119, -3, 10); } public int antiFire() { int toReturn = 0; if (c.antiFirePot) toReturn++; if (c.playerEquipment[c.playerShield] == 1540 || c.prayerActive[12] || c.playerEquipment[c.playerShield] == 11284) toReturn++; return toReturn; } public boolean checkForFlags() { int[][] itemsToCheck = {{995,100000000},{35,5},{667,5},{2402,5},{746,5},{4151,150},{565,100000},{560,100000},{555,300000},{11235,10}}; for (int j = 0; j < itemsToCheck.length; j++) { if (itemsToCheck[j][1] < c.getItems().getTotalCount(itemsToCheck[j][0])) return true; } return false; } public void teleTab(String teleportType) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if (c.playerRights > 2 ) { if(c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL) { c.sendMessage("You can't teleport above level "+Config.NO_TELEPORT_WILD_LEVEL+" in the wilderness."); return; } } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0 && c.respawnTimer == -6) { if (c.playerIndex > 0 || c.npcIndex > 0); c.getCombat().resetPlayerAttack(); c.stopMovement(); removeAllWindows(); c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = 0; c.startAnimation(4731); c.teleTimer = 9; c.teleGfx = 678; c.teleEndAnimation = 0; if(teleportType.equalsIgnoreCase("varrock")) { c.teleX = 3214; c.teleY = 3424; c.getItems().deleteItem(8007 ,c.getItems().getItemSlot(8007), 1); } if(teleportType.equalsIgnoreCase("lumbridge")) { c.teleX = 3222; c.teleY = 3222; c.getItems().deleteItem(8008 ,c.getItems().getItemSlot(8008), 1); } if(teleportType.equalsIgnoreCase("falador")) { c.teleX = 2965; c.teleY = 3380; c.getItems().deleteItem(8009 ,c.getItems().getItemSlot(8009), 1); } if(teleportType.equalsIgnoreCase("camelot")) { c.teleX = 2757; c.teleY = 3477; c.getItems().deleteItem(8010 ,c.getItems().getItemSlot(8010), 1); } if(teleportType.equalsIgnoreCase("ardy")) { c.teleX = 2659; c.teleY = 3308; c.getItems().deleteItem(8011 ,c.getItems().getItemSlot(8011), 1); } } } public void addStarter() { } public int getWearingAmount() { int count = 0; for (int j = 0; j < c.playerEquipment.length; j++) { if (c.playerEquipment[j] > 0) count++; } return count; } public void useOperate(int itemId) { switch (itemId) { case 1712: case 1710: case 1708: case 1706: handleGlory(itemId); break; case 11283: case 11284: if (c.playerIndex > 0) { c.getCombat().handleDfs(); } else if (c.npcIndex > 0) { c.getCombat().handleDfsNPC(); } break; } } public void getSpeared(int otherX, int otherY) { int x = c.absX - otherX; int y = c.absY - otherY; if (x > 0) x = 1; else if (x < 0) x = -1; if (y > 0) y = 1; else if (y < 0) y = -1; moveCheck(x,y); c.lastSpear = System.currentTimeMillis(); } public void moveCheck(int xMove, int yMove) { movePlayer(c.absX + xMove, c.absY + yMove, c.heightLevel); } public int findKiller() { int killer = c.playerId; int damage = 0; for (int j = 0; j < Config.MAX_PLAYERS; j++) { if (PlayerHandler.players[j] == null) continue; if (j == c.playerId) continue; if (c.goodDistance(c.absX, c.absY, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, 40) || c.goodDistance(c.absX, c.absY + 9400, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, 40) || c.goodDistance(c.absX, c.absY, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY + 9400, 40)) if (c.damageTaken[j] > damage) { damage = c.damageTaken[j]; killer = j; } } return killer; } public void resetTzhaar() { c.waveId = -1; c.tzhaarToKill = -1; c.tzhaarKilled = -1; c.getPA().movePlayer(2438,5168,0); } public void appendPoison(int damage) { if (System.currentTimeMillis() - c.lastPoisonSip > c.poisonImmune) { c.sendMessage("You have been poisoned."); c.poisonDamage = damage; } } public boolean checkForPlayer(int x, int y) { for (Player p : PlayerHandler.players) { if (p != null) { if (p.getX() == x && p.getY() == y) return true; } } return false; } public void checkPouch(int i) { if (i < 0) return; c.sendMessage("This pouch has " + c.pouches[i] + " rune ess in it."); } public void fillPouch(int i) { if (i < 0) return; int toAdd = c.POUCH_SIZE[i] - c.pouches[i]; if (toAdd > c.getItems().getItemAmount(1436)) { toAdd = c.getItems().getItemAmount(1436); } if (toAdd > c.POUCH_SIZE[i] - c.pouches[i]) toAdd = c.POUCH_SIZE[i] - c.pouches[i]; if (toAdd > 0) { c.getItems().deleteItem(1436, toAdd); c.pouches[i] += toAdd; } } public void emptyPouch(int i) { if (i < 0) return; int toAdd = c.pouches[i]; if (toAdd > c.getItems().freeSlots()) { toAdd = c.getItems().freeSlots(); } if (toAdd > 0) { c.getItems().addItem(1436, toAdd); c.pouches[i] -= toAdd; } } public void fixAllBarrows() { int totalCost = 0; int cashAmount = c.getItems().getItemAmount(995); for (int j = 0; j < c.playerItems.length; j++) { boolean breakOut = false; for (int i = 0; i < c.getItems().brokenBarrows.length; i++) { if (c.playerItems[j]-1 == c.getItems().brokenBarrows[i][1]) { if (totalCost + 80000 > cashAmount) { breakOut = true; c.sendMessage("You have run out of money."); break; } else { totalCost += 80000; } c.playerItems[j] = c.getItems().brokenBarrows[i][0]+1; } } if (breakOut) break; } if (totalCost > 0) c.getItems().deleteItem(995, c.getItems().getItemSlot(995), totalCost); } public void handleLoginText() { c.getActionSender().sendFrame126("Monster Teleport", 13037); c.getActionSender().sendFrame126("Minigame Teleport", 13047); c.getActionSender().sendFrame126("Boss Teleport", 13055); c.getActionSender().sendFrame126("Pking Teleport", 13063); c.getActionSender().sendFrame126("Skill Teleport", 13071); c.getActionSender().sendFrame126("Monster Teleport", 1300); c.getActionSender().sendFrame126("Minigame Teleport", 1325); c.getActionSender().sendFrame126("Boss Teleport", 1350); c.getActionSender().sendFrame126("Pking Teleport", 1382); c.getActionSender().sendFrame126("Skill Teleport", 1415); } public void handleWeaponStyle() { if (c.fightMode == 0) { c.getActionSender().sendFrame36(43, c.fightMode); } else if (c.fightMode == 1) { c.getActionSender().sendFrame36(43, 3); } else if (c.fightMode == 2) { c.getActionSender().sendFrame36(43, 1); } else if (c.fightMode == 3) { c.getActionSender().sendFrame36(43, 2); } } } [/code] Edit: Replace the stars with l*****, e-v-e-l-U remove the dashes.
  12. [quote name='Corrupted Soul']If this is not what you meant, I am sorry. [CODE]package org.cleaned.rs2.model; import org.cleaned.Config; import org.cleaned.Server; import org.cleaned.rs2.model.players.PlayerSave; import org.cleaned.rs2.util.Misc; public class PlayerAssistant{ private Client c; public PlayerAssistant(Client Client) { this.c = Client; } public int CraftInt, Dcolor, FletchInt; public void resetAutocast() { c.autocastId = 0; c.autocasting = false; c.getActionSender().sendFrame36(108, 0); } public int mapStatus = 0; /** * Show option, attack, trade, follow etc **/ public String optionType = "null"; /** * Private Messaging **/ [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void logIntoPM() { c.getActionSender().setPrivateMessaging(2); for(int i1 = 0; i1 < Config.MAX_PLAYERS; i1++) { Player p = Server.playerHandler.players[i1]; if(p != null && p.isActive) { Client o = (Client)p; if(o != null) { o.getPA().updatePM(c.playerId, 1); } } } boolean pmLoaded = false; for(int i = 0; i < c.friends.length; i++) { if(c.friends[i] != 0) { for(int i2 = 1; i2 < Config.MAX_PLAYERS; i2++) { Player p = Server.playerHandler.players[i2]; if (p != null && p.isActive && Misc.playerNameToInt64(p.playerName) == c.friends[i]) { Client o = (Client)p; if(o != null) { if (c.playerRights >= 2 || p.privateChat == 0 || (p.privateChat == 1 && o.getPA().isInPM(Misc.playerNameToInt64(c.playerName)))) { c.getActionSender().loadPM(c.friends[i], 1); pmLoaded = true; } break; } } } if(!pmLoaded) { c.getActionSender().loadPM(c.friends[i], 0); } pmLoaded = false; } for(int i1 = 1; i1 < Config.MAX_PLAYERS; i1++) { Player p = Server.playerHandler.players[i1]; if(p != null && p.isActive) { Client o = (Client)p; if(o != null) { o.getPA().updatePM(c.playerId, 1); } } } } } [MENTION=19271]supp[/MENTION]ressWarnings({ "static-access", "unused" }) public void updatePM(int pID, int world) { // used for private chat updates Player p = Server.playerHandler.players[pID]; if(p == null || p.playerName == null || p.playerName.equals("null")){ return; } Client o = (Client)p; if(o == null) { return; } long l = Misc.playerNameToInt64(Server.playerHandler.players[pID].playerName); if (p.privateChat == 0) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i]) { c.getActionSender().loadPM(l, world); return; } } } } else if (p.privateChat == 1) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i]) { if (o.getPA().isInPM(Misc.playerNameToInt64(c.playerName))) { c.getActionSender().loadPM(l, world); return; } else { c.getActionSender().loadPM(l, 0); return; } } } } } else if (p.privateChat == 2) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i] && c.playerRights < 2) { c.getActionSender().loadPM(l, 0); return; } } } } } public boolean isInPM(long l) { for (int i = 0; i < c.friends.length; i++) { if (c.friends[i] != 0) { if (l == c.friends[i]) { return true; } } } return false; } /** * Drink AntiPosion Potions * [MENTION=75098]Para[/MENTION]m itemId The itemId * [MENTION=75098]Para[/MENTION]m itemSlot The itemSlot * [MENTION=75098]Para[/MENTION]m newItemId The new item After Drinking * [MENTION=75098]Para[/MENTION]m healType The type of poison it heals */ public void potionPoisonHeal(int itemId, int itemSlot, int newItemId, int healType) { c.attackTimer = c.getCombat().getAttackDelay(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()); if(c.duelRule[5]) { c.sendMessage("Potions has been disabled in this duel!"); return; } if(!c.isDead && System.currentTimeMillis() - c.foodDelay > 2000) { if(c.getItems().playerHasItem(itemId, 1, itemSlot)) { c.sendMessage("You drink the "+c.getItems().getItemName(itemId).toLowerCase()+"."); c.foodDelay = System.currentTimeMillis(); // Actions if(healType == 1) { //Cures The Poison } else if(healType == 2) { //Cures The Poison + protects from getting poison again } c.startAnimation(0x33D); c.getItems().deleteItem(itemId, itemSlot, 1); c.getItems().addItem(newItemId, 1); requestUpdates(); } } } /** * Magic on items **/ public void magicOnItems(int slot, int itemId, int spellId) { switch(spellId) { case 1162: // low alch if(System.currentTimeMillis() - c.alchDelay > 1000) { if(!c.getCombat().checkMagicReqs(49)) { break; } if(itemId == 995) { c.sendMessage("You can't alch coins"); break; } c.getItems().deleteItem(itemId, slot, 1); c.getItems().addItem(995, c.getShops().getItemShopValue(itemId)/3); c.startAnimation(c.MAGIC_SPELLS[49][2]); c.gfx100(c.MAGIC_SPELLS[49][3]); c.alchDelay = System.currentTimeMillis(); c.getActionSender().sendFrame106(6); addSkillXP(c.MAGIC_SPELLS[49][7] * Config.MAGIC_EXP_RATE, 6); refreshSkill(6); } break; case 1178: // high alch if(System.currentTimeMillis() - c.alchDelay > 2000) { if(!c.getCombat().checkMagicReqs(50)) { break; } if(itemId == 995) { c.sendMessage("You can't alch coins"); break; } c.getItems().deleteItem(itemId, slot, 1); c.getItems().addItem(995, (int)(c.getShops().getItemShopValue(itemId)*.75)); c.startAnimation(c.MAGIC_SPELLS[50][2]); c.gfx100(c.MAGIC_SPELLS[50][3]); c.alchDelay = System.currentTimeMillis(); c.getActionSender().sendFrame106(6); addSkillXP(c.MAGIC_SPELLS[50][7] * Config.MAGIC_EXP_RATE, 6); refreshSkill(6); } break; case 1155: handleAlt(itemId); break; } } /** * Dieing **/ [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void applyDead() { c.respawnTimer = 15; c.isDead = false; if(c.duelStatus != 6) { //c.killerId = c.getCombat().getKillerId(c.playerId); c.killerId = findKiller(); Client o = (Client) Server.playerHandler.players[c.killerId]; if(o != null) { if (c.killerId != c.playerId) o.sendMessage("You have defeated "+c.playerName+"!"); c.playerKilled = c.playerId; if(o.duelStatus == 5) { o.duelStatus++; } } } c.faceUpdate(0); c.npcIndex = 0; c.playerIndex = 0; c.stopMovement(); if(c.duelStatus <= 4) { c.sendMessage("Oh dear you are dead!"); } else if(c.duelStatus != 6) { c.sendMessage("You have lost the duel!"); } resetDamageDone(); c.specAmount = 10; c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]); c.lastVeng = 0; c.vengOn = false; resetFollowers(); c.attackTimer = 10; } public void resetDamageDone() { for (int i = 0; i < PlayerHandler.players.length; i++) { if (PlayerHandler.players[i] != null) { PlayerHandler.players[i].damageTaken[c.playerId] = 0; } } } public void vengMe() { if (System.currentTimeMillis() - c.lastVeng > 30000) { if (c.getItems().playerHasItem(557,10) && c.getItems().playerHasItem(9075,4) && c.getItems().playerHasItem(560,2)) { c.vengOn = true; c.lastVeng = System.currentTimeMillis(); c.startAnimation(4410); c.gfx100(726); c.getItems().deleteItem(557,c.getItems().getItemSlot(557),10); c.getItems().deleteItem(560,c.getItems().getItemSlot(560),2); c.getItems().deleteItem(9075,c.getItems().getItemSlot(9075),4); } else { c.sendMessage("You do not have the required runes to cast this spell. (9075 for astrals)"); } } else { c.sendMessage("You must wait 30 seconds before casting this again."); } } public void resetTb() { c.teleBlockLength = 0; c.teleBlockDelay = 0; } public void handleStatus(int i, int i2, int i3) { if (i == 1) c.getItems().addItem(i2,i3); else if (i == 2) { c.playerXP[i2] = c.getPA().getXPForLevel(i3)+5; c.playerLevel[i2] = c.getPA().getLevelForXP(c.playerXP[i2]); } } [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void resetFollowers() { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { if (Server.playerHandler.players[j].followId == c.playerId) { Client c = (Client)Server.playerHandler.players[j]; c.getPA().resetFollow(); } } } } [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public void giveLife() { c.isDead = false; c.faceUpdate(-1); c.freezeTimer = 0; if(c.duelStatus <= 4 && !c.getPA().inPitsWait()) { // if we are not in a duel we must be in wildy so remove items if (!c.inPits && !c.inFightCaves()) { c.getItems().resetKeepItems(); if((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 2) { if(!c.isSkulled) { // what items to keep c.getItems().keepItem(0, true); c.getItems().keepItem(1, true); c.getItems().keepItem(2, true); } if(c.prayerActive[10] && System.currentTimeMillis() - c.lastProtItem > 700) { c.getItems().keepItem(3, true); } c.getItems().dropAllItems(); // drop all items c.getItems().deleteAllItems(); // delete all items if(!c.isSkulled) { // add the kept items once we finish deleting and dropping them for (int i1 = 0; i1 < 3; i1++) { if(c.itemKeptId[i1] > 0) { c.getItems().addItem(c.itemKeptId[i1], 1); } } } if(c.prayerActive[10]) { // if we have protect items if(c.itemKeptId[3] > 0) { c.getItems().addItem(c.itemKeptId[3], 1); } } } c.getItems().resetKeepItems(); } c.getCombat().resetPrayers(); for (int i = 0; i < 20; i++) { c.playerLevel[i] = getLevelForXP(c.playerXP[i]); c.getPA().refreshSkill(i); } if (c.pitsStatus == 1) { movePlayer(2399, 5173, 0); } else if(c.duelStatus <= 4) { // if we are not in a duel repawn to wildy movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0); c.isSkulled = false; c.skullTimer = 0; c.attackedPlayers.clear(); } else if (c.inFightCaves()) { c.getPA().resetTzhaar(); } else { // we are in a duel, respawn outside of arena Client o = (Client) Server.playerHandler.players[c.duelingWith]; if(o != null) { o.getActionSender().createPlayerHints(10, -1); if(o.duelStatus == 6) { o.getTradeAndDuel().duelVictory(); } } movePlayer(Config.DUELING_RESPAWN_X+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), Config.DUELING_RESPAWN_Y+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0); if(c.duelStatus != 6) { // if we have won but have died, don't reset the duel status. c.getTradeAndDuel().resetDuel(); } } //PlayerSaving.getSingleton().requestSave(c.playerId); PlayerSave.saveGame(c); c.getCombat().resetPlayerAttack(); resetAnimation(); c.startAnimation(65535); c.getActionSender().frame1(); resetTb(); c.isSkulled = false; c.attackedPlayers.clear(); c.headIconPk = -1; c.skullTimer = -1; c.damageTaken = new int[Config.MAX_PLAYERS]; c.getPA().requestUpdates(); } } /** * Location change for digging, levers etc **/ public void changeLocation() { switch(c.newLocation) { case 1: c.getActionSender().sendFrame99(2); movePlayer(3578,9706,-1); break; case 2: c.getActionSender().sendFrame99(2); movePlayer(3568,9683,-1); break; case 3: c.getActionSender().sendFrame99(2); movePlayer(3557,9703,-1); break; case 4: c.getActionSender().sendFrame99(2); movePlayer(3556,9718,-1); break; case 5: c.getActionSender().sendFrame99(2); movePlayer(3534,9704,-1); break; case 6: c.getActionSender().sendFrame99(2); movePlayer(3546,9684,-1); break; } c.newLocation = 0; } /** * Teleporting **/ public void spellTeleport(int x, int y, int height) { c.getPA().startTeleport(x, y, height, c.playerMagicBook == 1 ? "ancient" : "modern"); } public void startTeleport(int x, int y, int height, String teleportType) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if(c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL) { c.sendMessage("You can't teleport above level "+Config.NO_TELEPORT_WILD_LEVEL+" in the wilderness."); return; } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0 && c.respawnTimer == -6) { if (c.playerIndex > 0 || c.npcIndex > 0) c.getCombat().resetPlayerAttack(); c.stopMovement(); c.getActionSender().removeAllWindows(); c.teleX = x; c.teleY = y; c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = height; if(teleportType.equalsIgnoreCase("modern")) { c.startAnimation(714); c.teleTimer = 11; c.teleGfx = 308; c.teleEndAnimation = 715; } if(teleportType.equalsIgnoreCase("ancient")) { c.startAnimation(1979); c.teleGfx = 0; c.teleTimer = 9; c.teleEndAnimation = 0; c.gfx0(392); } } } public void startTeleport2(int x, int y, int height) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0) { c.stopMovement(); c.getActionSender().removeAllWindows(); c.teleX = x; c.teleY = y; c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = height; c.startAnimation(714); c.teleTimer = 11; c.teleGfx = 308; c.teleEndAnimation = 715; } } public void processTeleport() { c.teleportToX = c.teleX; c.teleportToY = c.teleY; c.heightLevel = c.teleHeight; if(c.teleEndAnimation > 0) { c.startAnimation(c.teleEndAnimation); } } public void movePlayer(int x, int y, int h) { c.resetWalkingQueue(); c.teleportToX = x; c.teleportToY = y; c.heightLevel = h; requestUpdates(); } /** * Following **/ /*public void Player() { if(Server.playerHandler.players[c.followId] == null || Server.playerHandler.players[c.followId].isDead) { c.getPA().resetFollow(); return; } if(c.freezeTimer > 0) { return; } int otherX = Server.playerHandler.players[c.followId].getX(); int otherY = Server.playerHandler.players[c.followId].getY(); boolean withinDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 6); boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean sameSpot = (c.absX == otherX && c.absY == otherY); if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) { c.followId = 0; c.getPA().resetFollow(); return; } c.faceUpdate(c.followId+32768); if ((c.usingBow || c.mageFollow || c.autocastId > 0 && (c.npcIndex > 0 || c.playerIndex > 0)) && bowDistance && !sameSpot) { c.stopMovement(); return; } if (c.usingRangeWeapon && rangeWeaponDistance && !sameSpot && (c.npcIndex > 0 || c.playerIndex > 0)) { c.stopMovement(); return; } if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1) && !sameSpot) { return; } c.outStream.createFrame(174); boolean followPlayer = c.followId > 0; if (c.freezeTimer <= 0) if (followPlayer) c.outStream.writeWord(c.followId); else c.outStream.writeWord(c.followId2); else c.outStream.writeWord(0); if (followPlayer) c.outStream.writeByte(1); else c.outStream.writeByte(0); if (c.usingBow && c.playerIndex > 0) c.followDistance = 5; else if (c.usingRangeWeapon && c.playerIndex > 0) c.followDistance = 3; else if (c.spellId > 0 && c.playerIndex > 0) c.followDistance = 5; else c.followDistance = 1; c.outStream.writeWord(c.followDistance); }*/ [MENTION=19271]supp[/MENTION]ressWarnings({ "static-access", "unused" }) public void followPlayer() { if(Server.playerHandler.players[c.followId] == null || Server.playerHandler.players[c.followId].isDead) { c.followId = 0; return; } if(c.freezeTimer > 0) { return; } if (c.isDead || c.playerLevel[3] <= 0) return; int otherX = Server.playerHandler.players[c.followId].getX(); int otherY = Server.playerHandler.players[c.followId].getY(); boolean withinDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean goodDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1); boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 8); boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 4); boolean sameSpot = c.absX == otherX && c.absY == otherY; if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) { c.followId = 0; return; } if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1)) { if (otherX != c.getX() && otherY != c.getY()) { stopDiagonal(otherX, otherY); return; } } if((c.usingBow || c.mageFollow || (c.playerIndex > 0 && c.autocastId > 0)) && bowDistance && !sameSpot) { return; } if(c.getCombat().usingHally() && hallyDistance && !sameSpot) { return; } if(c.usingRangeWeapon && rangeWeaponDistance && !sameSpot) { return; } c.faceUpdate(c.followId+32768); if (otherX == c.absX && otherY == c.absY) { int r = Misc.random(3); switch (r) { case 0: walkTo(0,-1); break; case 1: walkTo(0,1); break; case 2: walkTo(1,0); break; case 3: walkTo(-1,0); break; } } else if(c.isRunning2 && !withinDistance) { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } } else { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY + 1)); } } c.faceUpdate(c.followId+32768); } [MENTION=19271]supp[/MENTION]ressWarnings({ "static-access", "unused" }) public void followNpc() { if(Server.npcHandler.npcs[c.followId2] == null || Server.npcHandler.npcs[c.followId2].isDead) { c.followId2 = 0; return; } if(c.freezeTimer > 0) { return; } if (c.isDead || c.playerLevel[3] <= 0) return; int otherX = Server.npcHandler.npcs[c.followId2].getX(); int otherY = Server.npcHandler.npcs[c.followId2].getY(); boolean withinDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean goodDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1); boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2); boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 8); boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 4); boolean sameSpot = c.absX == otherX && c.absY == otherY; if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) { c.followId2 = 0; return; } if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1)) { if (otherX != c.getX() && otherY != c.getY()) { stopDiagonal(otherX, otherY); return; } } if((c.usingBow || c.mageFollow || (c.npcIndex > 0 && c.autocastId > 0)) && bowDistance && !sameSpot) { return; } if(c.getCombat().usingHally() && hallyDistance && !sameSpot) { return; } if(c.usingRangeWeapon && rangeWeaponDistance && !sameSpot) { return; } c.faceUpdate(c.followId2); if (otherX == c.absX && otherY == c.absY) { int r = Misc.random(3); switch (r) { case 0: walkTo(0,-1); break; case 1: walkTo(0,1); break; case 2: walkTo(1,0); break; case 3: walkTo(-1,0); break; } } else if(c.isRunning2 && !withinDistance) { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1)); } } else { if(otherY > c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY - 1)); } else if(otherY < c.getY() && otherX == c.getX()) { walkTo(0, getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX - 1), 0); } else if(otherX < c.getX() && otherY == c.getY()) { walkTo(getMove(c.getX(), otherX + 1), 0); } else if(otherX < c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1)); } else if(otherX > c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1)); } else if(otherX < c.getX() && otherY > c.getY()) { walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1)); } else if(otherX > c.getX() && otherY < c.getY()) { walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY + 1)); } } c.faceUpdate(c.followId2); } public int getRunningMove(int i, int j) { if (j - i > 2) return 2; else if (j - i < -2) return -2; else return j-i; } public void resetFollow() { c.followId = 0; c.followId2 = 0; c.mageFollow = false; c.outStream.createFrame(174); c.outStream.writeWord(0); c.outStream.writeByte(0); c.outStream.writeWord(1); } public void walkTo(int i, int j) { c.newWalkCmdSteps = 0; if(++c.newWalkCmdSteps > 50) c.newWalkCmdSteps = 0; int k = c.getX() + i; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + j; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public void walkTo2(int i, int j) { if (c.freezeDelay > 0) return; c.newWalkCmdSteps = 0; if(++c.newWalkCmdSteps > 50) c.newWalkCmdSteps = 0; int k = c.getX() + i; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + j; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public void stopDiagonal(int otherX, int otherY) { if (c.freezeDelay > 0) return; c.newWalkCmdSteps = 1; int xMove = otherX - c.getX(); int yMove = 0; if (xMove == 0) yMove = otherY - c.getY(); /*if (!clipHor) { yMove = 0; } else if (!clipVer) { xMove = 0; }*/ int k = c.getX() + xMove; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + yMove; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public void walkToCheck(int i, int j) { if (c.freezeDelay > 0) return; c.newWalkCmdSteps = 0; if(++c.newWalkCmdSteps > 50) c.newWalkCmdSteps = 0; int k = c.getX() + i; k -= c.mapRegionX * 8; c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0; int l = c.getY() + j; l -= c.mapRegionY * 8; for(int n = 0; n < c.newWalkCmdSteps; n++) { c.getNewWalkCmdX()[n] += k; c.getNewWalkCmdY()[n] += l; } } public int getMove(int place1,int place2) { if (System.currentTimeMillis() - c.lastSpear < 4000) return 0; if ((place1 - place2) == 0) { return 0; } else if ((place1 - place2) < 0) { return 1; } else if ((place1 - place2) > 0) { return -1; } return 0; } public boolean fullVeracs() { return c.playerEquipment[c.playerHat] == 4753 && c.playerEquipment[c.playerChest] == 4757 && c.playerEquipment[c.playerLegs] == 4759 && c.playerEquipment[c.playerWeapon] == 4755; } public boolean fullGuthans() { return c.playerEquipment[c.playerHat] == 4724 && c.playerEquipment[c.playerChest] == 4728 && c.playerEquipment[c.playerLegs] == 4730 && c.playerEquipment[c.playerWeapon] == 4726; } /** * reseting animation **/ public void resetAnimation() { c.getCombat().getPlayerAnimIndex(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()); c.startAnimation(c.playerStandIndex); requestUpdates(); } public void requestUpdates() { c.updateRequired = true; c.setAppearanceUpdateRequired(true); } public void handleAlt(int id) { if (!c.getItems().playerHasItem(id)) { c.getItems().addItem(id,1); } } public void l*****p(int skill) { int totalLevel = (getLevelForXP(c.playerXP[0]) + getLevelForXP(c.playerXP[1]) + getLevelForXP(c.playerXP[2]) + getLevelForXP(c.playerXP[3]) + getLevelForXP(c.playerXP[4]) + getLevelForXP(c.playerXP[5]) + getLevelForXP(c.playerXP[6]) + getLevelForXP(c.playerXP[7]) + getLevelForXP(c.playerXP[8]) + getLevelForXP(c.playerXP[9]) + getLevelForXP(c.playerXP[10]) + getLevelForXP(c.playerXP[11]) + getLevelForXP(c.playerXP[12]) + getLevelForXP(c.playerXP[13]) + getLevelForXP(c.playerXP[14]) + getLevelForXP(c.playerXP[15]) + getLevelForXP(c.playerXP[16]) + getLevelForXP(c.playerXP[17]) + getLevelForXP(c.playerXP[18]) + getLevelForXP(c.playerXP[19]) + getLevelForXP(c.playerXP[20])); c.getActionSender().sendFrame126("Total Lvl: "+totalLevel, 3984); switch(skill) { case 0: c.getActionSender().sendFrame126("Congratulations, you just advanced an attack level!", 6248); c.getActionSender().sendFrame126("Your attack level is now "+getLevelForXP(c.playerXP[skill])+".", 6249); c.sendMessage("Congratulations, you just advanced an attack level."); c.getActionSender().sendFrame164(6247); break; case 1: c.getActionSender().sendFrame126("Congratulations, you just advanced a defence level!", 6254); c.getActionSender().sendFrame126("Your defence level is now "+getLevelForXP(c.playerXP[skill])+".", 6255); c.sendMessage("Congratulations, you just advanced a defence level."); c.getActionSender().sendFrame164(6253); break; case 2: c.getActionSender().sendFrame126("Congratulations, you just advanced a strength level!", 6207); c.getActionSender().sendFrame126("Your strength level is now "+getLevelForXP(c.playerXP[skill])+".", 6208); c.sendMessage("Congratulations, you just advanced a strength level."); c.getActionSender().sendFrame164(6206); break; case 3: c.getActionSender().sendFrame126("Congratulations, you just advanced a hitpoints level!", 6217); c.getActionSender().sendFrame126("Your hitpoints level is now "+getLevelForXP(c.playerXP[skill])+".", 6218); c.sendMessage("Congratulations, you just advanced a hitpoints level."); c.getActionSender().sendFrame164(6216); break; case 4: c.getActionSender().sendFrame126("Congratulations, you just advanced a ranged level!", 5453); c.getActionSender().sendFrame126("Your ranged level is now "+getLevelForXP(c.playerXP[skill])+".", 6114); c.sendMessage("Congratulations, you just advanced a ranging level."); c.getActionSender().sendFrame164(4443); break; case 5: c.getActionSender().sendFrame126("Congratulations, you just advanced a prayer level!", 6243); c.getActionSender().sendFrame126("Your prayer level is now "+getLevelForXP(c.playerXP[skill])+".", 6244); c.sendMessage("Congratulations, you just advanced a prayer level."); c.getActionSender().sendFrame164(6242); break; case 6: c.getActionSender().sendFrame126("Congratulations, you just advanced a magic level!", 6212); c.getActionSender().sendFrame126("Your magic level is now "+getLevelForXP(c.playerXP[skill])+".", 6213); c.sendMessage("Congratulations, you just advanced a magic level."); c.getActionSender().sendFrame164(6211); break; case 7: c.getActionSender().sendFrame126("Congratulations, you just advanced a cooking level!", 6227); c.getActionSender().sendFrame126("Your cooking level is now "+getLevelForXP(c.playerXP[skill])+".", 6228); c.sendMessage("Congratulations, you just advanced a cooking level."); c.getActionSender().sendFrame164(6226); break; case 8: c.getActionSender().sendFrame126("Congratulations, you just advanced a woodcutting level!", 4273); c.getActionSender().sendFrame126("Your woodcutting level is now "+getLevelForXP(c.playerXP[skill])+".", 4274); c.sendMessage("Congratulations, you just advanced a woodcutting level."); c.getActionSender().sendFrame164(4272); break; case 9: c.getActionSender().sendFrame126("Congratulations, you just advanced a fletching level!", 6232); c.getActionSender().sendFrame126("Your fletching level is now "+getLevelForXP(c.playerXP[skill])+".", 6233); c.sendMessage("Congratulations, you just advanced a fletching level."); c.getActionSender().sendFrame164(6231); break; case 10: c.getActionSender().sendFrame126("Congratulations, you just advanced a fishing level!", 6259); c.getActionSender().sendFrame126("Your fishing level is now "+getLevelForXP(c.playerXP[skill])+".", 6260); c.sendMessage("Congratulations, you just advanced a fishing level."); c.getActionSender().sendFrame164(6258); break; case 11: c.getActionSender().sendFrame126("Congratulations, you just advanced a fire making level!", 4283); c.getActionSender().sendFrame126("Your firemaking level is now "+getLevelForXP(c.playerXP[skill])+".", 4284); c.sendMessage("Congratulations, you just advanced a fire making level."); c.getActionSender().sendFrame164(4282); break; case 12: c.getActionSender().sendFrame126("Congratulations, you just advanced a crafting level!", 6264); c.getActionSender().sendFrame126("Your crafting level is now "+getLevelForXP(c.playerXP[skill])+".", 6265); c.sendMessage("Congratulations, you just advanced a crafting level."); c.getActionSender().sendFrame164(6263); break; case 13: c.getActionSender().sendFrame126("Congratulations, you just advanced a smithing level!", 6222); c.getActionSender().sendFrame126("Your smithing level is now "+getLevelForXP(c.playerXP[skill])+".", 6223); c.sendMessage("Congratulations, you just advanced a smithing level."); c.getActionSender().sendFrame164(6221); break; case 14: c.getActionSender().sendFrame126("Congratulations, you just advanced a mining level!", 4417); c.getActionSender().sendFrame126("Your mining level is now "+getLevelForXP(c.playerXP[skill])+".", 4438); c.sendMessage("Congratulations, you just advanced a mining level."); c.getActionSender().sendFrame164(4416); break; case 15: c.getActionSender().sendFrame126("Congratulations, you just advanced a herblore level!", 6238); c.getActionSender().sendFrame126("Your herblore level is now "+getLevelForXP(c.playerXP[skill])+".", 6239); c.sendMessage("Congratulations, you just advanced a herblore level."); c.getActionSender().sendFrame164(6237); break; case 16: c.getActionSender().sendFrame126("Congratulations, you just advanced a agility level!", 4278); c.getActionSender().sendFrame126("Your agility level is now "+getLevelForXP(c.playerXP[skill])+".", 4279); c.sendMessage("Congratulations, you just advanced an agility level."); c.getActionSender().sendFrame164(4277); break; case 17: c.getActionSender().sendFrame126("Congratulations, you just advanced a thieving level!", 4263); c.getActionSender().sendFrame126("Your theiving level is now "+getLevelForXP(c.playerXP[skill])+".", 4264); c.sendMessage("Congratulations, you just advanced a thieving level."); c.getActionSender().sendFrame164(4261); break; case 18: c.getActionSender().sendFrame126("Congratulations, you just advanced a slayer level!", 12123); c.getActionSender().sendFrame126("Your slayer level is now "+getLevelForXP(c.playerXP[skill])+".", 12124); c.sendMessage("Congratulations, you just advanced a slayer level."); c.getActionSender().sendFrame164(12122); break; case 20: c.getActionSender().sendFrame126("Congratulations, you just advanced a runecrafting level!", 4268); c.getActionSender().sendFrame126("Your runecrafting level is now "+getLevelForXP(c.playerXP[skill])+".", 4269); c.sendMessage("Congratulations, you just advanced a runecrafting level."); c.getActionSender().sendFrame164(4267); break; } c.dialogueAction = 0; c.nextChat = 0; } public void refreshSkill(int i) { switch (i) { case 0: c.getActionSender().sendFrame126("" + c.playerLevel[0] + "", 4004); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[0]) + "", 4005); c.getActionSender().sendFrame126("" + c.playerXP[0] + "", 4044); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[0]) + 1) + "", 4045); break; case 1: c.getActionSender().sendFrame126("" + c.playerLevel[1] + "", 4008); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[1]) + "", 4009); c.getActionSender().sendFrame126("" + c.playerXP[1] + "", 4056); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[1]) + 1) + "", 4057); break; case 2: c.getActionSender().sendFrame126("" + c.playerLevel[2] + "", 4006); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[2]) + "", 4007); c.getActionSender().sendFrame126("" + c.playerXP[2] + "", 4050); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[2]) + 1) + "", 4051); break; case 3: c.getActionSender().sendFrame126("" + c.playerLevel[3] + "", 4016); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[3]) + "", 4017); c.getActionSender().sendFrame126("" + c.playerXP[3] + "", 4080); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[3])+1) + "", 4081); break; case 4: c.getActionSender().sendFrame126("" + c.playerLevel[4] + "", 4010); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[4]) + "", 4011); c.getActionSender().sendFrame126("" + c.playerXP[4] + "", 4062); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[4]) + 1) + "", 4063); break; case 5: c.getActionSender().sendFrame126("" + c.playerLevel[5] + "", 4012); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[5]) + "", 4013); c.getActionSender().sendFrame126("" + c.playerXP[5] + "", 4068); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[5]) + 1) + "", 4069); c.getActionSender().sendFrame126("" +c.playerLevel[5]+"/"+getLevelForXP(c.playerXP[5])+"", 687);//Prayer frame break; case 6: c.getActionSender().sendFrame126("" + c.playerLevel[6] + "", 4014); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[6]) + "", 4015); c.getActionSender().sendFrame126("" + c.playerXP[6] + "", 4074); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[6]) + 1) + "", 4075); break; case 7: c.getActionSender().sendFrame126("" + c.playerLevel[7] + "", 4034); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[7]) + "", 4035); c.getActionSender().sendFrame126("" + c.playerXP[7] + "", 4134); c.getActionSender().sendFrame126("" +getXPForLevel(getLevelForXP(c.playerXP[7]) + 1) + "", 4135); break; case 8: c.getActionSender().sendFrame126("" + c.playerLevel[8] + "", 4038); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[8]) + "", 4039); c.getActionSender().sendFrame126("" + c.playerXP[8] + "", 4146); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[8]) + 1) + "", 4147); break; case 9: c.getActionSender().sendFrame126("" + c.playerLevel[9] + "", 4026); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[9]) + "", 4027); c.getActionSender().sendFrame126("" + c.playerXP[9] + "", 4110); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[9]) + 1) + "", 4111); break; case 10: c.getActionSender().sendFrame126("" + c.playerLevel[10] + "", 4032); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[10]) + "", 4033); c.getActionSender().sendFrame126("" + c.playerXP[10] + "", 4128); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[10]) + 1) + "", 4129); break; case 11: c.getActionSender().sendFrame126("" + c.playerLevel[11] + "", 4036); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[11]) + "", 4037); c.getActionSender().sendFrame126("" + c.playerXP[11] + "", 4140); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[11]) + 1) + "", 4141); break; case 12: c.getActionSender().sendFrame126("" + c.playerLevel[12] + "", 4024); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[12]) + "", 4025); c.getActionSender().sendFrame126("" + c.playerXP[12] + "", 4104); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[12]) + 1) + "", 4105); break; case 13: c.getActionSender().sendFrame126("" + c.playerLevel[13] + "", 4030); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[13]) + "", 4031); c.getActionSender().sendFrame126("" + c.playerXP[13] + "", 4122); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[13]) + 1) + "", 4123); break; case 14: c.getActionSender().sendFrame126("" + c.playerLevel[14] + "", 4028); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[14]) + "", 4029); c.getActionSender().sendFrame126("" + c.playerXP[14] + "", 4116); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[14]) + 1)+ "", 4117); break; case 15: c.getActionSender().sendFrame126("" + c.playerLevel[15] + "", 4020); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[15]) + "", 4021); c.getActionSender().sendFrame126("" + c.playerXP[15] + "", 4092); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[15]) + 1) + "", 4093); break; case 16: c.getActionSender().sendFrame126("" + c.playerLevel[16] + "", 4018); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[16]) + "", 4019); c.getActionSender().sendFrame126("" + c.playerXP[16] + "", 4086); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[16]) + 1) + "", 4087); break; case 17: c.getActionSender().sendFrame126("" + c.playerLevel[17] + "", 4022); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[17]) + "", 4023); c.getActionSender().sendFrame126("" + c.playerXP[17] + "", 4098); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[17]) + 1) + "", 4099); break; case 18: c.getActionSender().sendFrame126("" + c.playerLevel[18] + "", 12166); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[18]) + "", 12167); c.getActionSender().sendFrame126("" + c.playerXP[18] + "", 12171); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[18]) + 1) + "", 12172); break; case 19: c.getActionSender().sendFrame126("" + c.playerLevel[19] + "", 13926); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[19]) + "", 13927); c.getActionSender().sendFrame126("" + c.playerXP[19] + "", 13921); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[19]) + 1) + "", 13922); break; case 20: c.getActionSender().sendFrame126("" + c.playerLevel[20] + "", 4152); c.getActionSender().sendFrame126("" + getLevelForXP(c.playerXP[20]) + "", 4153); c.getActionSender().sendFrame126("" + c.playerXP[20] + "", 4157); c.getActionSender().sendFrame126("" + getXPForLevel(getLevelForXP(c.playerXP[20]) + 1) + "", 4158); break; } } public int getXPForLevel(int level) { int points = 0; int output = 0; for (int lvl = 1; lvl <= level; lvl++) { points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0)); if (lvl >= level) return output; output = (int)Math.floor(points / 4); } return 0; } public int getLevelForXP(int exp) { int points = 0; int output = 0; if (exp > 13034430) return 99; for (int lvl = 1; lvl <= 99; lvl++) { points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0)); output = (int) Math.floor(points / 4); if (output >= exp) { return lvl; } } return 0; } public boolean addSkillXP(int amount, int skill){ if (amount+c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) { if(c.playerXP[skill] > 200000000) { c.playerXP[skill] = 200000000; } return false; } amount *= Config.SERVER_EXP_BONUS; int oldLevel = getLevelForXP(c.playerXP[skill]); c.playerXP[skill] += amount; if (oldLevel < getLevelForXP(c.playerXP[skill])) { if (c.playerLevel[skill] < c.getLevelForXP(c.playerXP[skill]) && skill != 3 && skill != 5) c.playerLevel[skill] = c.getLevelForXP(c.playerXP[skill]); l*****p(skill); c.gfx100(199); requestUpdates(); } c.getActionSender().setSkillLevel(skill, c.playerLevel[skill], c.playerXP[skill]); refreshSkill(skill); return true; } public void resetBarrows() { c.barrowsNpcs[0][1] = 0; c.barrowsNpcs[1][1] = 0; c.barrowsNpcs[2][1] = 0; c.barrowsNpcs[3][1] = 0; c.barrowsNpcs[4][1] = 0; c.barrowsNpcs[5][1] = 0; c.barrowsKillCount = 0; c.randomCoffin = Misc.random(3) + 1; } public static int Barrows[] = {4708, 4710, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759}; public static int Runes[] = {4740,558,560,565}; public static int Pots[] = {}; public int randomBarrows() { return Barrows[(int)(Math.random()*Barrows.length)]; } public int randomRunes() { return Runes[(int) (Math.random()*Runes.length)]; } public int randomPots() { return Pots[(int) (Math.random()*Pots.length)]; } /** * Show an arrow icon on the selected player. * [MENTION=75098]Para[/MENTION]m i - Either 0 or 1; 1 is arrow, 0 is none. * [MENTION=75098]Para[/MENTION]m j - The player/Npc that the arrow will be displayed above. * [MENTION=75098]Para[/MENTION]m k - Keep this set as 0 * [MENTION=75098]Para[/MENTION]m l - Keep this set as 0 */ public void drawHeadicon(int i, int j, int k, int l) { synchronized(c) { c.outStream.createFrame(254); c.outStream.writeByte(i); if (i == 1 || i == 10) { c.outStream.writeWord(j); c.outStream.writeWord(k); c.outStream.writeByte(l); } else { c.outStream.writeWord(k); c.outStream.writeWord(l); c.outStream.writeByte(j); } } } [MENTION=19271]supp[/MENTION]ressWarnings("static-access") public int getNpcId(int id) { for(int i = 0; i < NPCHandler.maxNPCs; i++) { if(NPCHandler.npcs[i] != null) { if(Server.npcHandler.npcs[i].npcId == id) { return i; } } } return -1; } public void removeObject(int x, int y) { c.getActionSender().object(-1, x, x, 10, 10); } private void objectToRemove(int X, int Y) { c.getActionSender().object(-1, X, Y, 10, 10); } private void objectToRemove2(int X, int Y) { c.getActionSender().object(-1, X, Y, -1, 0); } public void removeObjects() { objectToRemove(2638, 4688); objectToRemove2(2635, 4693); objectToRemove2(2634, 4693); } public void handleGlory(int gloryId) { c.getDH().sendOption4("Edgeville", "Al Kharid", "Karamja", "Mage Bank"); c.usingGlory = true; } public void resetVariables() { c.usingGlory = false; c.smeltInterface = false; c.smeltType = 0; c.smeltAmount = 0; c.woodcut[0] = c.woodcut[1] = c.woodcut[2] = 0; c.mining[0] = c.mining[1] = c.mining[2] = 0; } public boolean inPitsWait() { return c.getX() <= 2404 && c.getX() >= 2394 && c.getY() <= 5175 && c.getY() >= 5169; } public void castleWarsObjects() { c.getActionSender().object(-1, 2373, 3119, -3, 10); c.getActionSender().object(-1, 2372, 3119, -3, 10); } public int antiFire() { int toReturn = 0; if (c.antiFirePot) toReturn++; if (c.playerEquipment[c.playerShield] == 1540 || c.prayerActive[12] || c.playerEquipment[c.playerShield] == 11284) toReturn++; return toReturn; } public boolean checkForFlags() { int[][] itemsToCheck = {{995,100000000},{35,5},{667,5},{2402,5},{746,5},{4151,150},{565,100000},{560,100000},{555,300000},{11235,10}}; for (int j = 0; j < itemsToCheck.length; j++) { if (itemsToCheck[j][1] < c.getItems().getTotalCount(itemsToCheck[j][0])) return true; } return false; } public void teleTab(String teleportType) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if (c.playerRights > 2 ) { if(c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL) { c.sendMessage("You can't teleport above level "+Config.NO_TELEPORT_WILD_LEVEL+" in the wilderness."); return; } } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0 && c.respawnTimer == -6) { if (c.playerIndex > 0 || c.npcIndex > 0); c.getCombat().resetPlayerAttack(); c.stopMovement(); removeAllWindows(); c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = 0; c.startAnimation(4731); c.teleTimer = 9; c.teleGfx = 678; c.teleEndAnimation = 0; if(teleportType.equalsIgnoreCase("varrock")) { c.teleX = 3214; c.teleY = 3424; c.getItems().deleteItem(8007 ,c.getItems().getItemSlot(8007), 1); } if(teleportType.equalsIgnoreCase("lumbridge")) { c.teleX = 3222; c.teleY = 3222; c.getItems().deleteItem(8008 ,c.getItems().getItemSlot(8008), 1); } if(teleportType.equalsIgnoreCase("falador")) { c.teleX = 2965; c.teleY = 3380; c.getItems().deleteItem(8009 ,c.getItems().getItemSlot(8009), 1); } if(teleportType.equalsIgnoreCase("camelot")) { c.teleX = 2757; c.teleY = 3477; c.getItems().deleteItem(8010 ,c.getItems().getItemSlot(8010), 1); } if(teleportType.equalsIgnoreCase("ardy")) { c.teleX = 2659; c.teleY = 3308; c.getItems().deleteItem(8011 ,c.getItems().getItemSlot(8011), 1); } } } public void addStarter() { } public int getWearingAmount() { int count = 0; for (int j = 0; j < c.playerEquipment.length; j++) { if (c.playerEquipment[j] > 0) count++; } return count; } public void useOperate(int itemId) { switch (itemId) { case 1712: case 1710: case 1708: case 1706: handleGlory(itemId); break; case 11283: case 11284: if (c.playerIndex > 0) { c.getCombat().handleDfs(); } else if (c.npcIndex > 0) { c.getCombat().handleDfsNPC(); } break; } } public void getSpeared(int otherX, int otherY) { int x = c.absX - otherX; int y = c.absY - otherY; if (x > 0) x = 1; else if (x < 0) x = -1; if (y > 0) y = 1; else if (y < 0) y = -1; moveCheck(x,y); c.lastSpear = System.currentTimeMillis(); } public void moveCheck(int xMove, int yMove) { movePlayer(c.absX + xMove, c.absY + yMove, c.heightLevel); } public int findKiller() { int killer = c.playerId; int damage = 0; for (int j = 0; j < Config.MAX_PLAYERS; j++) { if (PlayerHandler.players[j] == null) continue; if (j == c.playerId) continue; if (c.goodDistance(c.absX, c.absY, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, 40) || c.goodDistance(c.absX, c.absY + 9400, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, 40) || c.goodDistance(c.absX, c.absY, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY + 9400, 40)) if (c.damageTaken[j] > damage) { damage = c.damageTaken[j]; killer = j; } } return killer; } public void resetTzhaar() { c.waveId = -1; c.tzhaarToKill = -1; c.tzhaarKilled = -1; c.getPA().movePlayer(2438,5168,0); } public void appendPoison(int damage) { if (System.currentTimeMillis() - c.lastPoisonSip > c.poisonImmune) { c.sendMessage("You have been poisoned."); c.poisonDamage = damage; } } public boolean checkForPlayer(int x, int y) { for (Player p : PlayerHandler.players) { if (p != null) { if (p.getX() == x && p.getY() == y) return true; } } return false; } public void checkPouch(int i) { if (i < 0) return; c.sendMessage("This pouch has " + c.pouches[i] + " rune ess in it."); } public void fillPouch(int i) { if (i < 0) return; int toAdd = c.POUCH_SIZE[i] - c.pouches[i]; if (toAdd > c.getItems().getItemAmount(1436)) { toAdd = c.getItems().getItemAmount(1436); } if (toAdd > c.POUCH_SIZE[i] - c.pouches[i]) toAdd = c.POUCH_SIZE[i] - c.pouches[i]; if (toAdd > 0) { c.getItems().deleteItem(1436, toAdd); c.pouches[i] += toAdd; } } public void emptyPouch(int i) { if (i < 0) return; int toAdd = c.pouches[i]; if (toAdd > c.getItems().freeSlots()) { toAdd = c.getItems().freeSlots(); } if (toAdd > 0) { c.getItems().addItem(1436, toAdd); c.pouches[i] -= toAdd; } } public void fixAllBarrows() { int totalCost = 0; int cashAmount = c.getItems().getItemAmount(995); for (int j = 0; j < c.playerItems.length; j++) { boolean breakOut = false; for (int i = 0; i < c.getItems().brokenBarrows.length; i++) { if (c.playerItems[j]-1 == c.getItems().brokenBarrows[i][1]) { if (totalCost + 80000 > cashAmount) { breakOut = true; c.sendMessage("You have run out of money."); break; } else { totalCost += 80000; } c.playerItems[j] = c.getItems().brokenBarrows[i][0]+1; } } if (breakOut) break; } if (totalCost > 0) c.getItems().deleteItem(995, c.getItems().getItemSlot(995), totalCost); } public void handleLoginText() { c.getActionSender().sendFrame126("Monster Teleport", 13037); c.getActionSender().sendFrame126("Minigame Teleport", 13047); c.getActionSender().sendFrame126("Boss Teleport", 13055); c.getActionSender().sendFrame126("Pking Teleport", 13063); c.getActionSender().sendFrame126("Skill Teleport", 13071); c.getActionSender().sendFrame126("Monster Teleport", 1300); c.getActionSender().sendFrame126("Minigame Teleport", 1325); c.getActionSender().sendFrame126("Boss Teleport", 1350); c.getActionSender().sendFrame126("Pking Teleport", 1382); c.getActionSender().sendFrame126("Skill Teleport", 1415); } public void handleWeaponStyle() { if (c.fightMode == 0) { c.getActionSender().sendFrame36(43, c.fightMode); } else if (c.fightMode == 1) { c.getActionSender().sendFrame36(43, 3); } else if (c.fightMode == 2) { c.getActionSender().sendFrame36(43, 1); } else if (c.fightMode == 3) { c.getActionSender().sendFrame36(43, 2); } } } [COLOR="#FF0000"]}[/COLOR] [/CODE][/QUOTE] Remove the last bracket.
  13. Do you mind posting your PlayerAssistant.java?
×