Jump to content

Search the Community

Showing results for tags 'skill'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 61 results

  1. I have everything working except once someone gets 99 in one stat it announces they got 99 in every other stat...
  2. Saw on r-s people calling crap like this [url]http://paste.ofcode.org/bMMTT9kzMJsrXK2Vapbf5v[/url] good hunter skill, decided to copy the enum and delete some useless stuff from it and make better imp catching in overall. [code]package com.argon.player.skills; import com.Server; import com.argon.player.Client; /** * * @author Fuzen Seth * [MENTION=98951]infor[/MENTION]mation RS2 Hunter skill. */ public class Hunter { //Animation when you catch an impling private static final int CATCH_ANIMATION = 6999; //Holds the catching net item id. private static final int CATCHING_NET = 10010; //The skill modifier. private static final double SKILL_MODIFIER = 1211.303D; /** * [MENTION=42293]imp[/MENTION]ling -enum * holds the data used in imp catching. * credits to some random kid at mopar for this enum * */ public enum Impling { BABY_IMPLING(6055, 11238,20,1), YOUNG_IMPLING(6056, 11240, 48, 20), GOURMET_IMPLING(6057, 11242, 82, 20), EARTH_IMPLING(6058, 11244, 126, 34), ESSENCE_IMPLING(6059, 11246, 160, 40), ELECTRIC_IMPLING(6060, 11248, 205, 50), NATURE_IMPLING(6061, 11250, 250, 58), MAGPIE_IMPLING(6062, 11252, 289, 65), NINJA_IMPLING(6063, 11254, 339, 74), DRAGON_IMPLING(6064, 11256, 390, 90); private Impling(int npcId, int itemId, int experience, int Req) { this.npcId = npcId; this.itemId = itemId; this.experience = experience; this.requirement = Req; } private int npcId, itemId, experience, requirement; public int getNpcId(){ return npcId; } public int getItemId(){ return itemId; } public int getExperience(){ return experience; } public int getRequirement(){ return requirement; } public static Impling forId(int npcId) { for (Impling impling : Impling.values()) { if (impling.getNpcId() == npcId) { return impling; } } return null; } } /** * Calculates the level based on player's hunter level * and modifier and of course the impling's exp. * */ private static int getCalculatedExperience(Client player, int npc) { Impling imp = Impling.forId(npc); int totalExperience = (int) Math.floor(player.playerLevel[20]) * imp.getExperience() * (int) SKILL_MODIFIER; return totalExperience; } /** * Checks if the impling exists. */ public static final boolean isImpling(final int id) { for (Impling imp : Impling.values()) if (id == imp.getNpcId()) return true; return false; } /** * Catches a imp when called. * [MENTION=75098]Para[/MENTION]m player * [MENTION=75098]Para[/MENTION]m npc * [MENTION=75098]Para[/MENTION]m level */ public static final void catchImpling(Client player, int npc) { if (player.isDead || player.inDuel) return; if (Server.npcHandler.getNPCs()[npc] != null) { final Impling imp = Impling.forId(npc); final String name = Server.npcHandler.getNpcListName(npc).toLowerCase(); if (player.playerLevel[21] < imp.getRequirement()) { player.sendMessage("You need a hunter level of "+imp.getRequirement()+" to catch the "+name+"."); return; } /** * todo - containsitem check * inv+eq * */ Server.npcHandler.getNPCs()[npc].isDead = true; player.startAnimation(CATCH_ANIMATION); player.sendMessage("You succesfully catch the "+name+" in your net."); player.getPlayerAssistant().addSkillXP(20, getCalculatedExperience(player, npc)); } } }[/code] you need to change the skill id since mine is fucked im sure 20 is runecrafting skill and not hunter.
  3. [CODE]package server.model.players.skills.slayer; import java.util.ArrayList; import java.util.List; import server.util.Misc; import server.util.TextUtils; /** * @author FUZENSETH * [MENTION=98951]infor[/MENTION]mation Slayer resources. */ public enum SlayerTask { /** The elite tasks */ GENERAL_GRAARDOR(27, Difficulty.ELITE, 1, 1100, 6260), /** The hard tasks */ BLACK_DEMON(4,Difficulty.HARD, 1, 170, 84), HELL_HOUND(6,Difficulty.HARD, 1, 119, 6210, 49), DARK_BEAST(7,Difficulty.HARD, 95, 347, 2783), ABYSSAL_DEMON(8,Difficulty.HARD, 85, 240, 2783, 1615), GARGOYLE(9,Difficulty.HARD, 75, 190, 1610), STEEL_DRAGON(10,Difficulty.HARD, 1, 263, 1592), BLACK_DRAGON(29, Difficulty.HARD, 1, 490, 54), BRONZE_DRAGON(31, Difficulty.HARD, 1, 560, 1590), /** Medium tasks */ ABERANT_SPECTRES(31, Difficulty.DIFFICULT, 60, 500, 1606), ORK(30, Difficulty.DIFFICULT, 1, 320, 6272, 6271, 6273), GREATER_DEMON(26, Difficulty.DIFFICULT, 1, 210, 83), JELLY(14,Difficulty.DIFFICULT, 52, 102, 1637, 1638, 1640), FIRE_GIANT(12,Difficulty.DIFFICULT, 1, 353, 1582, 110, 1583, 1584), BLOOD_VELD(13,Difficulty.MEDIUM, 50, 277, 6215, 1618, 1619), CHAOS_DWARF(24, Difficulty.MEDIUM, 1, 150, 119), MAGIC_AXE(23, Difficulty.MEDIUM, 1, 180, 127), BLUE_DRAGON(15,Difficulty.MEDIUM, 1, 205, 55, 52), LESSER_DEMON(25, Difficulty.MEDIUM, 1, 150, 82), POISON_SPIDERS(28, Difficulty.MEDIUM, 1, 130, 134), /** Easy tasks */ SKELETON(16,Difficulty.EASY, 1, 45, 92, 89,459), EXPERIMENT(17,Difficulty.EASY, 1, 42, 1678, 1677), ROCK_CRAB(18,Difficulty.EASY, 1, 57, 1265,1266), CHAOS_DRUID(19,Difficulty.EASY, 1, 60, 181), GIANT_BAT(20,Difficulty.EASY, 1, 35, 78), GHOST(21, Difficulty.EASY, 1, 50, 103); private final Difficulty difficulty; private final int slayerLevel, slayerXP, index; private final List<Integer> ids = new ArrayList<>(); private static final int EXP_MULTIPLIER = 14; private SlayerTask(final int index,final Difficulty difficulty, final int slayerLevel, final int slayerXP, final int... ids) { this.difficulty = difficulty; this.slayerLevel = slayerLevel; this.slayerXP = slayerXP * EXP_MULTIPLIER; this.index = index; for(int i : ids) this.ids.add(i ); } public Difficulty getDifficulty() { return difficulty; } public List<Integer> getIds() { return ids; } public int getXP() { return slayerXP; } public int getId() { return index; } public static SlayerTask forLevel(final int slayerLevel) { final SlayerTask task = values()[Misc.random(values().length - 1)]; if(slayerLevel >= task.slayerLevel && Math.abs(slayerLevel - task.difficulty.slayerLevel) <= 25) //ensure task is not too easy and they have the level for it return task; else return forLevel(slayerLevel); } static enum Difficulty { EASY(10, 40, 0, 4), MEDIUM(20, 80, 26, 6), DIFFICULT(40, 100, 50, 7), HARD(60, 150, 75, 8), ELITE(5, 10, 99, 8); private final int minAmount, maxAmount, slayerLevel, slayerPoints; private Difficulty(final int minAmount, final int maxAmount, final int slayerLevel, final int slayerPoints) { this.minAmount = minAmount; this.maxAmount = maxAmount; this.slayerLevel = slayerLevel; this.slayerPoints = slayerPoints; } public int getAmount() { return minAmount + Misc.random(maxAmount - minAmount); } public int getSlayerPoints() { return slayerPoints; } } [MENTION=15855]Over[/MENTION]ride public String toString() { return TextUtils.titleCase(super.toString().replaceAll("_", " ").toLowerCase()); } /** * Get all npc ids for slayer npc death for contenttemplate * [MENTION=184045]return[/MENTION] all slayer task npc ids */ public static final int[] getTasks() { final List<Integer> list = new ArrayList<>(); for(final SlayerTask tasks : SlayerTask.values()) { for(final int i : tasks.ids) list.add(i); } final int[] n = new int[list.size()]; for(int i = 0; i < n.length; i++) { n[i] = list.get(i); } return n; } public static SlayerTask taskForId(int npcID) { for(final SlayerTask task : SlayerTask.values()) { if(task.ids.contains(npcID)) return task; } return null; } public static SlayerTask load(final int index) { for(SlayerTask task : SlayerTask.values()) if(index == task.index) return task; return null; } public static int getLevelById(int npcID) { SlayerTask task = taskForId(npcID); if(task != null) return task.slayerLevel; else return 0; } }[/CODE] [CODE]package server.model.players.skills.slayer; import server.model.players.Client; /** * @author FUZENSETH * [MENTION=98951]infor[/MENTION]mation RS2 Slayer task holder * [MENTION=3199]Sin[/MENTION]ce 4.12.2014 */ public class SlayerHolder { //the ints needs to be initialized to client private int taskAmount, totalTasks, slayerPoints; /** * SlayerHolder that they have, save the ordinal */ private SlayerTask task; public SlayerHolder(final Client player) { } public boolean assignTask(final int slayerLevel) { if(taskAmount > 0) return false; task = SlayerTask.forLevel(slayerLevel); taskAmount = task.getDifficulty().getAmount(); return true; } public int killedTask(final int npcid) { if(task == null) return 0; if(isTask(npcid)) { if(--taskAmount == 0) { totalTasks++; slayerPoints += task.getDifficulty().getSlayerPoints() + handleTotalTasks(); } return task.getXP(); } return 0; } public boolean isTask(final int npcId) { return task != null && task.getIds().contains(npcId) && taskAmount > 0; } public boolean resetTask() { if(slayerPoints < 20) return false; slayerPoints -= 20; taskAmount = 0; return true; } public void removeTask() { taskAmount = 0; totalTasks = 0; slayerPoints -= 3; } public int handleTotalTasks() { int pointsToAdd =0; if(totalTasks%250 == 0) pointsToAdd = 180; else if(totalTasks%100 == 0) pointsToAdd = 100; else if(totalTasks %50 == 0) pointsToAdd = 50; else if(totalTasks%10 == 0) pointsToAdd = 20; return pointsToAdd; } public void load(final String string) { try { final String[] split = string.split(","); task = SlayerTask.load(Integer.parseInt(split[0])); taskAmount = Integer.parseInt(split[1]); slayerPoints = Integer.parseInt(split[2]); totalTasks = Integer.parseInt(split[3]); } catch (Exception e) { //fail safe e.printStackTrace(); } } public void setPoints(int value) { slayerPoints = value; } [MENTION=15855]Over[/MENTION]ride public String toString() { return String.format("%d,%d,%d,%d", task == null ? -1 : task.getId(), taskAmount, slayerPoints, totalTasks); } public int getTotalTasks() { return totalTasks; } public int getTaskAmount() { return taskAmount; } public SlayerTask getTask() { return task; } public int getSlayerPoints() { return slayerPoints; } } [/CODE]
  4. Hello I've looked all over for a firemaking coding but they don't really work. My problem is: my character will do the lighting animation but he will just keep bending and acting as if he is lighting. NO FIRE will come out! or log starting to get fire.... please take a look at mine and tell me what is missing and what I've done wrong. Thank you! [CODE]package server.model.players.skills; import server.Config; import server.model.players.Client; import server.model.objects.Objects; import server.Server; /** * Firemaking.java * * @author Sanity * **/ public class Firemaking { private Client c; private int[] logs = {1511,1521,1519,1517,1515,1513}; private int[] exp = {1,3,4,5,7,8}; private int[] level = {1,15,30,45,60,75}; public long lastLight; private int DELAY = 1250; public boolean resetAnim = true; public Firemaking(Client c) { this.c = c; } public void checkLogType(int logType, int otherItem) { for (int j = 0; j < logs.length;j++) { if (logs[j] == logType || logs[j] == otherItem) { lightFire(j); return; } } } public void lightFire(int slot) { if (c.duelStatus >= 5) { c.sendMessage("Why am I trying to light a fire in the duel arena?"); return; } if (c.playerLevel[c.playerFiremaking] >= level[slot]) { if (c.getItems().playerHasItem(590) && c.getItems().playerHasItem(logs[slot])) { if (System.currentTimeMillis() - lastLight > DELAY) { c.startAnimation(733,0); c.getItems().deleteItem(logs[slot], c.getItems().getItemSlot(logs[slot]), 1); c.getPA().addSkillXP(logs[slot] * Config.FIREMAKING_EXPERIENCE, c.playerFiremaking); Objects fire = new Objects(2732,c.getX(),c.getY(), 0, -1, 10, 3); Objects fire2 = new Objects(-1,c.getX(),c.getY(), 0, -1, 10, 60); c.sendMessage("You light the fire."); this.lastLight = System.currentTimeMillis(); //c.getPA().frame1(); resetAnim = true; } } } } }[/CODE]
  5. Thorin

    Skill tele dialogue

    I feel like im missing something somewhere, but i don't see it and neither does eclipse... When the person hits the skill tele button it pulls up the dialogue fine, but no matter what option they choose, it takes them to the falconry(hunter minigame) tele. [CODE] package com.rs.game.player.dialogues; import com.rs.Settings; import com.rs.cache.loaders.NPCDefinitions; import com.rs.game.WorldTile; import com.rs.game.minigames.CastleWars; import com.rs.game.player.Skills; import com.rs.game.player.content.Magic; import com.rs.game.player.controlers.FightCaves; import com.rs.game.player.controlers.FightKiln; public class SkillTeleports extends Dialogue { private int npcId; [MENTION=15855]Over[/MENTION]ride public void start() { npcId = (Integer) parameters[0]; sendEntityDialogue(SEND_2_TEXT_CHAT, new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "Time for some skilling, Eh?" }, IS_NPC, npcId, 9827); } [MENTION=15855]Over[/MENTION]ride public void run(int interfaceId, int componentId) { if (stage == -1) { sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "Yup, Gotta get the comp cape..." }, IS_PLAYER, player.getIndex(), 9827); stage = 1; } else if (stage == 1) { sendOptionsDialogue("What skill will you do?", "Hunter", "Mining", "WoodCutting", "Fishing", "More Options"); stage = 2; } else if (stage == 2) { if (componentId == OPTION_1) { if(player.getEquipment().getWeaponId() != -1 || player.getEquipment().getShieldId() != -1) stage = 1; sendNPCDialogue(npcId, 9827, "Please remove your weapon and shield first, or they will be deleted."); return; }else if(player.getEquipment().getWeaponId() == -1 || player.getEquipment().getShieldId() == -1) { player.getControlerManager().startControler("Falconry"); }else if (componentId == OPTION_2) Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4382, 5912, 2)); else if (componentId == OPTION_3) Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3306, 5289, 0)); else if (componentId == OPTION_4) Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2862, 2584, 0)); [/CODE] thats the part that teles them, any ideas?
  6. So how do i get rid of hard coded skill tab i searched thru rsinterface and deleted the skill folder in the cache. Im adding in a diffrent skill tab and when i first login it shows the hard coded one but if i go to my client options and switch it between game frames it will eventually load the new one i added [URL="http://gyazo.com/bcad31b8fc2bda90f33dc798ccc0d91f"]Picture of when i first login[/URL]
  7. I know you can put more exp to skilling / combat But i was wondering if i could add extra xp rates to a certain skill thanks if you could help!
  8. I am looking through this base I found for PI and I found out that you are allowed to wear all items, even though your skill is 1. I was wondering how can I accurately check the players skill level? In ItemAssistant for level req: [CODE] synchronized(c) { int targetSlot=0; boolean canWearItem = true; if(c.playerItems[slot] == wearID+1) { getRequirements(getItemName(wearID).toLowerCase(), wearID); targetSlot = Item.targetSlots[wearID]; if(itemType(wearID).equalsIgnoreCase("cape")) { targetSlot=1; } else if(itemType(wearID).equalsIgnoreCase("hat")) { targetSlot=0; } else if(itemType(wearID).equalsIgnoreCase("amulet")) { targetSlot=2; } else if(itemType(wearID).equalsIgnoreCase("arrows")) { targetSlot=13; } else if(itemType(wearID).equalsIgnoreCase("body")) { targetSlot=4; } else if(itemType(wearID).equalsIgnoreCase("shield")) { targetSlot=5; } else if(itemType(wearID).equalsIgnoreCase("legs")) { targetSlot=7; } else if(itemType(wearID).equalsIgnoreCase("gloves")) { targetSlot=9; } else if(itemType(wearID).equalsIgnoreCase("boots")) { targetSlot=10; } else if(itemType(wearID).equalsIgnoreCase("ring")) { targetSlot=12; } else { targetSlot = 3; } if(c.duelRule[11] && targetSlot == 0) { c.sendMessage("Wearing hats has been disabled in this duel!"); return false; } if(c.duelRule[12] && targetSlot == 1) { c.sendMessage("Wearing capes has been disabled in this duel!"); return false; } if(c.duelRule[13] && targetSlot == 2) { c.sendMessage("Wearing amulets has been disabled in this duel!"); return false; } if(c.duelRule[14] && targetSlot == 3) { c.sendMessage("Wielding weapons has been disabled in this duel!"); return false; } if(c.duelRule[15] && targetSlot == 4) { c.sendMessage("Wearing bodies has been disabled in this duel!"); return false; } if(c.duelRule[16] && targetSlot == 5 || c.duelRule[16] && is2handed(getItemName(wearID).toLowerCase(), wearID)) { c.sendMessage("Wearing shield has been disabled in this duel!"); return false; } if(c.duelRule[17] && targetSlot == 7) { c.sendMessage("Wearing legs has been disabled in this duel!"); return false; } if(c.duelRule[18] && targetSlot == 9) { c.sendMessage("Wearing gloves has been disabled in this duel!"); return false; } if(c.duelRule[19] && targetSlot == 10) { c.sendMessage("Wearing boots has been disabled in this duel!"); return false; } if(c.duelRule[20] && targetSlot == 12) { c.sendMessage("Wearing rings has been disabled in this duel!"); return false; } if(c.duelRule[21] && targetSlot == 13) { c.sendMessage("Wearing arrows has been disabled in this duel!"); return false; } if(Config.itemRequirements) { if(targetSlot == 10 || targetSlot == 7 || targetSlot == 5 || targetSlot == 4 || targetSlot == 0 || targetSlot == 9 || targetSlot == 10) { if(c.defenceLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[1]) < c.defenceLevelReq) { c.sendMessage("You need a defence level of "+c.defenceLevelReq+" to wear this item."); canWearItem = false; } } if(c.rangeLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[4]) < c.rangeLevelReq) { c.sendMessage("You need a range level of "+c.rangeLevelReq+" to wear this item."); canWearItem = false; } } if(c.magicLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[6]) < c.magicLevelReq) { c.sendMessage("You need a magic level of "+c.magicLevelReq+" to wear this item."); canWearItem = false; } } } if(targetSlot == 3) { if(c.attackLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[0]) < c.attackLevelReq) { c.sendMessage("You need an attack level of "+c.attackLevelReq+" to wield this weapon."); canWearItem = false; } } if(c.rangeLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[4]) < c.rangeLevelReq) { c.sendMessage("You need a range level of "+c.rangeLevelReq+" to wield this weapon."); canWearItem = false; } } if(c.magicLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[6]) < c.magicLevelReq) { c.sendMessage("You need a magic level of "+c.magicLevelReq+" to wield this weapon."); canWearItem = false; } } } } if(!canWearItem) { return false; } final int wearAmount = c.playerItemsN[slot]; if (wearAmount < 1) { return false; } if (targetSlot == c.playerWeapon) { c.autocasting = false; c.autocastId = 0; c.getPA().sendFrame36(108, 0); } if(slot >= 0 && wearID >= 0) { final int toEquip = c.playerItems[slot]; final int toEquipN = c.playerItemsN[slot]; int toRemove = c.playerEquipment[targetSlot]; int toRemoveN = c.playerEquipmentN[targetSlot]; if (toEquip == toRemove + 1 && Item.itemStackable[toRemove]) { deleteItem(toRemove, getItemSlot(toRemove), toEquipN); c.playerEquipmentN[targetSlot] += toEquipN; } else if (targetSlot != 5 && targetSlot != 3) { c.playerItems[slot] = toRemove + 1; c.playerItemsN[slot] = toRemoveN; c.playerEquipment[targetSlot] = toEquip - 1; c.playerEquipmentN[targetSlot] = toEquipN; } else if (targetSlot == 5) { final boolean wearing2h = is2handed(getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase(), c.playerEquipment[c.playerWeapon]); if (wearing2h) { toRemove = c.playerEquipment[c.playerWeapon]; toRemoveN = c.playerEquipmentN[c.playerWeapon]; c.playerEquipment[c.playerWeapon] = -1; c.playerEquipmentN[c.playerWeapon] = 0; updateSlot(c.playerWeapon); } c.playerItems[slot] = toRemove + 1; c.playerItemsN[slot] = toRemoveN; c.playerEquipment[targetSlot] = toEquip - 1; c.playerEquipmentN[targetSlot] = toEquipN; } else if (targetSlot == 3) { final boolean is2h = is2handed(getItemName(wearID).toLowerCase(), wearID); final boolean wearingShield = c.playerEquipment[c.playerShield] > 0; final boolean wearingWeapon = c.playerEquipment[c.playerWeapon] > 0; if (is2h) { if (wearingShield && wearingWeapon) { if (freeSlots() > 0) { c.playerItems[slot] = toRemove + 1; c.playerItemsN[slot] = toRemoveN; c.playerEquipment[targetSlot] = toEquip - 1; c.playerEquipmentN[targetSlot] = toEquipN; removeItem(c.playerEquipment[c.playerShield], c.playerShield); } else { c.sendMessage("You do not have enough inventory space to do this."); return false; } } else if (wearingShield && !wearingWeapon) { c.playerItems[slot] = c.playerEquipment[c.playerShield] + 1; c.playerItemsN[slot] = c.playerEquipmentN[c.playerShield]; c.playerEquipment[targetSlot] = toEquip - 1; c.playerEquipmentN[targetSlot] = toEquipN; c.playerEquipment[c.playerShield] = -1; c.playerEquipmentN[c.playerShield] = 0; updateSlot(c.playerShield); } else { c.playerItems[slot] = toRemove + 1; c.playerItemsN[slot] = toRemoveN; c.playerEquipment[targetSlot] = toEquip - 1; c.playerEquipmentN[targetSlot] = toEquipN; } } else { c.playerItems[slot] = toRemove + 1; c.playerItemsN[slot] = toRemoveN; c.playerEquipment[targetSlot] = toEquip - 1; c.playerEquipmentN[targetSlot] = toEquipN; } } resetItems(3214); } if(targetSlot == 3) { c.usingSpecial = false; addSpecialBar(wearID); } if(c.getOutStream() != null && c != null ) { c.getOutStream().createFrameVarSizeWord(34); c.getOutStream().writeWord(1688); c.getOutStream().writeByte(targetSlot); c.getOutStream().writeWord(wearID+1); if (c.playerEquipmentN[targetSlot] > 254) { c.getOutStream().writeByte(255); c.getOutStream().writeDWord(c.playerEquipmentN[targetSlot]); } else { c.getOutStream().writeByte(c.playerEquipmentN[targetSlot]); } c.getOutStream().endFrameVarSizeWord(); c.flushOutStream(); } sendWeapon(c.playerEquipment[c.playerWeapon], getItemName(c.playerEquipment[c.playerWeapon])); resetBonus(); getBonus(); writeBonus(); c.getCombat().getPlayerAnimIndex(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()); c.getPA().requestUpdates(); return true; } else { return false; } } [/CODE] For attack level specifically its [CODE]if(targetSlot == 3) { if(c.attackLevelReq > 0) { if(c.getPA().getLevelForXP(c.playerXP[0]) < c.attackLevelReq) { c.sendMessage("You need an attack level of "+c.attackLevelReq+" to wield this weapon."); canWearItem = false; } }[/CODE] So I looked into the if check statement for player.xp[0] and this is what that class had: [CODE]package game.player; import engine.util.ISAACRandomGen; import engine.util.Misc; import engine.util.Stream; import game.Client; import game.Config; import game.item.Item; import game.npc.NPC; import game.npc.NPCHandler; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /* * Project Insanity - Evolved v.3 * Player.java */ public abstract class Player { public Map<String, Integer> killedPlayers = new HashMap<String, Integer>(); public ArrayList <Integer>attackedPlayers = new ArrayList<Integer> (); public long lastButton; public ArrayList<String> lastKilledPlayers = new ArrayList<String>(); public long lastCast = 0; public boolean initialized = false, disconnected = false, ruleAgreeButton = false, RebuildNPCList = false, isActive = false, isKicked = false, isSkulled = false, friendUpdate = false, newPlayer = false, hasMultiSign = false, saveCharacter = false, mouseButton = false, splitChat = false, chatEffects = true, acceptAid = false, nextDialogue = false, autocasting = false, usedSpecial = false, mageFollow = false, dbowSpec = false, craftingLeather = false, properLogout = false, secDbow = false, maxNextHit = false, ssSpec = false, vengOn = false, addStarter = false, accountFlagged = false, msbSpec = false ; public int saveDelay, playerKilled, pkPoints, totalPlayerDamageDealt, killedBy, lastChatId = 1, privateChat, friendSlot = 0, dialogueId, randomCoffin, newLocation, specEffect, specBarId, attackLevelReq, defenceLevelReq, strengthLevelReq, rangeLevelReq, magicLevelReq, followId, skullTimer, nextChat = 0, talkingNpc = -1, dialogueAction = 0, autocastId, followDistance, followId2, barrageCount = 0, delayedDamage = 0, delayedDamage2 = 0, pcPoints = 0, magePoints = 0, desertTreasure = 0, lastArrowUsed = -1, clanId = -1, autoRet = 0, pcDamage = 0, xInterfaceId = 0, xRemoveId = 0, xRemoveSlot = 0, tzhaarToKill = 0, tzhaarKilled = 0, waveId, frozenBy = 0, poisonDamage = 0, teleAction = 0, bonusAttack = 0, lastNpcAttacked = 0, killCount = 0 ; public String clanName, properName; public int[] voidStatus = new int[5]; public int[] itemKeptId = new int [4]; public int[] pouches = new int[4]; public final int[] POUCH_SIZE = {3,6,9,12}; public boolean[] invSlot = new boolean[28], equipSlot = new boolean[14]; public long friends[] = new long[200]; public double specAmount = 0; public double specAccuracy = 1; public double specDamage = 1; public double prayerPoint = 1.0; public long ignores[] = new long[200]; public boolean usingbook = false; public boolean sarabook = false; public boolean zambook = false; public boolean guthbook = false; public int teleGrabItem, teleGrabX, teleGrabY, duelCount, underAttackBy, underAttackBy2, wildLevel, teleTimer, respawnTimer, saveTimer = 0, teleBlockLength, poisonDelay ; public long lastPlayerMove, lastPoison, lastPoisonSip, poisonImmune, lastSpear, lastProtItem, dfsDelay, lastVeng, lastYell, teleGrabDelay, protMageDelay, protMeleeDelay, protRangeDelay, lastAction, lastThieve, lastLockPick, alchDelay, specDelay = System.currentTimeMillis(), duelDelay, teleBlockDelay, godSpellDelay, singleCombatDelay, singleCombatDelay2, reduceStat, restoreStatsDelay, logoutDelay, buryDelay, foodDelay, potDelay, restoreDelay ; public boolean canChangeAppearance = false; public boolean mageAllowed; public byte poisonMask = 0; public final int[] BOWS = {9185,839,845,847,851,855,859,841,843,849,853,857,861,4212,4214,4215,11235,4216,4217,4218,4219,4220,4221,4222,4223,6724,4734,4934,4935,4936,4937}; public final int[] ARROWS = {882,884,886,888,890,892,4740,11212,9140,9141,4142,9143,9144,9240,9241,9242,9243,9244,9245}; public final int[] NO_ARROW_DROP = {4212,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4734,4934,4935,4936,4937}; public final int[] OTHER_RANGE_WEAPONS = {863,864,865,866,867,868,869,806,807,808,809,810,811,825,826,827,828,829,830,800,801,802,803,804,805,6522}; public final int[][] MAGIC_SPELLS = { // {magicId,level req,animation,startGFX,projectile Id,endGFX,maxhit,exp gained,rune 1,rune 1 amount,rune 2,rune 2 amount,rune 3,rune 3 amount,rune 4,rune 4 amount} // Modern Spells {1152,1,711,90,91,92,2,5,556,1,558,1,0,0,0,0}, //wind strike {1154,5,711,93,94,95,4,7,555,1,556,1,558,1,0,0}, // water strike {1156,9,711,96,97,98,6,9,557,2,556,1,558,1,0,0},// earth strike {1158,13,711,99,100,101,8,11,554,3,556,2,558,1,0,0}, // fire strike {1160,17,711,117,118,119,9,13,556,2,562,1,0,0,0,0}, // wind bolt {1163,23,711,120,121,122,10,16,556,2,555,2,562,1,0,0}, // water bolt {1166,29,711,123,124,125,11,20,556,2,557,3,562,1,0,0}, // earth bolt {1169,35,711,126,127,128,12,22,556,3,554,4,562,1,0,0}, // fire bolt {1172,41,711,132,133,134,13,25,556,3,560,1,0,0,0,0}, // wind blast {1175,47,711,135,136,137,14,28,556,3,555,3,560,1,0,0}, // water blast {1177,53,711,138,139,140,15,31,556,3,557,4,560,1,0,0}, // earth blast {1181,59,711,129,130,131,16,35,556,4,554,5,560,1,0,0}, // fire blast {1183,62,711,158,159,160,17,36,556,5,565,1,0,0,0,0}, // wind wave {1185,65,711,161,162,163,18,37,556,5,555,7,565,1,0,0}, // water wave {1188,70,711,164,165,166,19,40,556,5,557,7,565,1,0,0}, // earth wave {1189,75,711,155,156,157,20,42,556,5,554,7,565,1,0,0}, // fire wave {1153,3,716,102,103,104,0,13,555,3,557,2,559,1,0,0}, // confuse {1157,11,716,105,106,107,0,20,555,3,557,2,559,1,0,0}, // weaken {1161,19,716,108,109,110,0,29,555,2,557,3,559,1,0,0}, // curse {1542,66,729,167,168,169,0,76,557,5,555,5,566,1,0,0}, // vulnerability {1543,73,729,170,171,172,0,83,557,8,555,8,566,1,0,0}, // enfeeble {1562,80,729,173,174,107,0,90,557,12,555,12,556,1,0,0}, // stun {1572,20,711,177,178,181,0,30,557,3,555,3,561,2,0,0}, // bind {1582,50,711,177,178,180,2,60,557,4,555,4,561,3,0,0}, // snare {1592,79,711,177,178,179,4,90,557,5,555,5,561,4,0,0}, // entangle {1171,39,724,145,146,147,15,25,556,2,557,2,562,1,0,0}, // crumble undead {1539,50,708,87,88,89,25,42,554,5,560,1,0,0,0,0}, // iban blast {12037,50,1576,327,328,329,19,30,560,1,558,4,0,0,0,0}, // magic dart {1190,60,811,0,0,76,20,60,554,2,565,2,556,4,0,0}, // sara strike {1191,60,811,0,0,77,20,60,554,1,565,2,556,4,0,0}, // cause of guthix {1192,60,811,0,0,78,20,60,554,4,565,2,556,1,0,0}, // flames of zammy {12445,85,1819,0,344,345,0,65,563,1,562,1,560,1,0,0}, // teleblock {-1,80,811,301,0,0,0,0,554,3,565,3,556,3,0,0}, // charge {-1,21,712,112,0,0,0,10,554,3,561,1,0,0,0,0}, // low alch {-1,55,713,113,0,0,0,20,554,5,561,1,0,0,0,0}, // high alch {-1,33,728,142,143,144,0,35,556,1,563,1,0,0,0,0}, // telegrab // Ancient Spells {12939,50,1978,0,384,385,13,30,560,2,562,2,554,1,556,1}, // smoke rush {12987,52,1978,0,378,379,14,31,560,2,562,2,566,1,556,1}, // shadow rush {12901,56,1978,0,0,373,15,33,560,2,562,2,565,1,0,0}, // blood rush {12861,58,1978,0,360,361,16,34,560,2,562,2,555,2,0,0}, // ice rush {12963,62,1979,0,0,389,19,36,560,2,562,4,556,2,554,2}, // smoke burst {13011,64,1979,0,0,382,20,37,560,2,562,4,556,2,566,2}, // shadow burst {12919,68,1979,0,0,376,21,39,560,2,562,4,565,2,0,0}, // blood burst {12881,70,1979,0,0,363,22,40,560,2,562,4,555,4,0,0}, // ice burst {12951,74,1978,0,386,387,23,42,560,2,554,2,565,2,556,2}, // smoke blitz {12999,76,1978,0,380,381,24,43,560,2,565,2,556,2,566,2}, // shadow blitz {12911,80,1978,0,374,375,25,45,560,2,565,4,0,0,0,0}, // blood blitz {12871,82,1978,366,0,367,26,46,560,2,565,2,555,3,0,0}, // ice blitz {12975,86,1979,0,0,391,27,48,560,4,565,2,556,4,554,4}, // smoke barrage {13023,88,1979,0,0,383,28,49,560,4,565,2,556,4,566,3}, // shadow barrage {12929,92,1979,0,0,377,29,51,560,4,565,4,566,1,0,0}, // blood barrage {12891,94,1979,0,0,369,30,52,560,4,565,2,555,6,0,0} // ice barrage }; public int[] autocastIds = { 51133,32,51185,33,51091,34,24018,35,51159,36,51211,37,51111,38,51069,39,51146,40,51198,41,51102,42,51058,43,51172,44,51224,45,51122,46,51080,47,7038,0,7039,1, 7040,2,7041,3,7042,4,7043,5,7044,6,7045,7,7046,8,7047,9,7048,10,7049,11,7050,12,7051,13,7052,14,7053,15,47019,27,47020,25,47021,12,47022,13,47023,14,47024,15 }; public int[][] barrowsNpcs = { {2030, 0}, //verac {2029, 0}, //toarg {2028, 0}, // karil {2027, 0}, // guthan {2026, 0}, // dharok {2025, 0} // ahrim }; public int barrowsKillCount; public int reduceSpellId; public final int[] REDUCE_SPELL_TIME = {250000, 250000, 250000, 500000,500000,500000}; // how long does the other player stay immune to the spell public long[] reduceSpellDelay = new long[6]; public final int[] REDUCE_SPELLS = {1153,1157,1161,1542,1543,1562}; public boolean[] canUseReducingSpell = {true, true, true, true, true, true}; public int slayerTask,taskAmount; public int prayerId = -1; public int headIcon = -1; public int bountyIcon = 0; public long stopPrayerDelay, prayerDelay; public boolean usingPrayer; public final int[] PRAYER_DRAIN_RATE = {500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500}; public final int[] PRAYER_LEVEL_REQUIRED = {1,4,7,8,9,10,13,16,19,22,25,26,27,28,31,34,37,40,43,44,45,46,49,52,60,70}; public final int[] PRAYER = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}; public final String[] PRAYER_NAME = { "Thick Skin", "Burst of Strength", "Clarity of Thought", "Sharp Eye", "Mystic Will", "Rock Skin", "Superhuman Strength", "Improved Reflexes","Rapid Restore", "Rapid Heal", "Protect Item", "Hawk Eye", "Mystic Lore", "Steel Skin", "Ultimate Strength", "Incredible Reflexes","Protect from Magic", "Protect from Missiles", "Protect from Melee","Eagle Eye", "Mystic Might", "Retribution", "Redemption", "Smite", "Chivalry", "Piety"}; public final int[] PRAYER_GLOW = {83,84,85,601,602,86,87,88,89,90,91,603,604,92,93,94,95,96,97,605,606,98,99,100,607,608}; public final int[] PRAYER_HEAD_ICONS = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,1,0,-1,-1,3,5,4,-1,-1}; public boolean[] prayerActive = {false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false}; public int duelTimer, duelTeleX, duelTeleY, duelSlot, duelSpaceReq, duelOption, duelingWith, duelStatus ; public int headIconPk = -1, headIconHints; public boolean duelRequested; public boolean[] duelRule = new boolean[22]; public final int[] DUEL_RULE_ID = {1, 2, 16, 32, 64, 128, 256, 512, 1024, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 2097152, 8388608, 16777216, 67108864, 134217728}; public boolean doubleHit, usingSpecial, npcDroppingItems, usingRangeWeapon, usingBow, usingMagic, castingMagic ; public int specMaxHitIncrease, freezeDelay, freezeTimer = -6, killerId, playerIndex, oldPlayerIndex, lastWeaponUsed, projectileStage, crystalBowArrowCount, playerMagicBook, teleGfx, teleEndAnimation, teleHeight, teleX, teleY, rangeItemUsed, killingNpcIndex, totalDamageDealt, oldNpcIndex, fightMode, attackTimer, npcIndex, npcClickIndex, npcType, castingSpellId, oldSpellId, spellId, hitDelay ; public int bowSpecShot, clickNpcType, clickObjectType, objectId, objectX, objectY, objectXOffset, objectYOffset, objectDistance ; public int pItemX, pItemY, pItemId; public boolean isMoving, walkingToItem; public boolean isShopping, updateShop; public int myShopId; public int tradeStatus, tradeWith; public boolean magicFailed, oldMagicFailed; public boolean forcedChatUpdateRequired, inDuel, tradeAccepted, goodTrade, inTrade, tradeRequested, tradeResetNeeded, tradeConfirmed, tradeConfirmed2, canOffer, acceptTrade, acceptedTrade ; public int attackAnim, animationRequest = -1,animationWaitCycles; public int[] playerBonus = new int[12]; public boolean isRunning2 = true; public boolean takeAsNote; public int combatLevel; public boolean saveFile = false; public int playerAppearance[] = new int[13]; public int apset; public int actionID; public int wearItemTimer, wearId, wearSlot, interfaceId; public int XremoveSlot, XinterfaceID, XremoveID, Xamount; public int tutorial = 15; public boolean usingGlory = false; public boolean isOperate; public int itemUsing; public long muteEnd; public long banStart; public long banEnd; public boolean antiFirePot = false; /** * Skill Variables */ public boolean stopPlayerSkill; public boolean isWc; public boolean wcing; public int treeX, treeY; public boolean isMining; public boolean mining; public int rockX, rockY; public boolean fishing = false; public int fishTimer = 0; public boolean playerIsFishing; public int[] fishingProp = new int[3]; public int smeltType; public int smeltAmount; public int smeltTimer = 0; public boolean smeltInterface; public boolean patchCleared; public int[] farm = new int[2]; /** * Mini-Ga,e Variables */ //Castle Wars public int castleWarsTeam; public boolean inCwGame; public boolean inCwWait; //Fight Pits public boolean inPits = false; public int pitsStatus = 0; public String connectedFrom=""; public String globalMessage=""; public int playerId = -1; public String playerName = null; public String playerName2 = null; public String playerPass = null; public int playerRights; public PlayerHandler handler = null; public int playerItems[] = new int[28]; public int playerItemsN[] = new int[28]; public int bankItems[] = new int[Config.BANK_SIZE]; public int bankItemsN[] = new int[Config.BANK_SIZE]; public boolean bankNotes = false; public int playerStandIndex = 0x328; public int playerTurnIndex = 0x337; public int playerWalkIndex = 0x333; public int playerTurn180Index = 0x334; public int playerTurn90CWIndex = 0x335; public int playerTurn90CCWIndex = 0x336; public int playerRunIndex = 0x338; public int playerHat=0; public int playerCape=1; public int playerAmulet=2; public int playerWeapon=3; public int playerChest=4; public int playerShield=5; public int playerLegs=7; public int playerHands=9; public int playerFeet=10; public int playerRing=12; public int playerArrows=13; public int playerAttack = 0; public int playerDefence = 1; public int playerStrength = 2; public int playerHitpoints = 3; public int playerRanged = 4; public int playerPrayer = 5; public int playerMagic = 6; public int playerCooking = 7; public int playerWoodcutting = 8; public int playerFletching = 9; public int playerFishing = 10; public int playerFiremaking = 11; public int playerCrafting = 12; public int playerSmithing = 13; public int playerMining = 14; public int playerHerblore = 15; public int playerAgility = 16; public int playerThieving = 17; public int playerSlayer = 18; public int playerFarming = 19; public int playerRunecrafting = 20; public int[] playerEquipment = new int[14]; public int[] playerEquipmentN = new int[14]; public int[] playerLevel = new int[25]; public int[] playerXP = new int[25]; public static final int maxPlayerListSize = Config.MAX_PLAYERS; public Player playerList[] = new Player[Player.maxPlayerListSize]; public int playerListSize = 0; public byte playerInListBitmap[] = new byte[Config.MAX_PLAYERS+7 >> 3]; public static final int maxNPCListSize = NPCHandler.maxNPCs; public NPC npcList[] = new NPC[Player.maxNPCListSize]; public int npcListSize = 0; public byte npcInListBitmap[] = new byte[NPCHandler.maxNPCs+7 >> 3]; public int mapRegionX, mapRegionY; public int absX, absY; public int currentX, currentY; public static int heightLevel; public int playerSE = 0x328; public int playerSEW = 0x333; public int playerSER = 0x334; public boolean updateRequired = true; public final int walkingQueueSize = 50; public int walkingQueueX[] = new int[walkingQueueSize], walkingQueueY[] = new int[walkingQueueSize]; public int wQueueReadPtr = 0; public int wQueueWritePtr = 0; public boolean isRunning = true; public int teleportToX = -1, teleportToY = -1; public boolean didTeleport = false; public boolean mapRegionDidChange = false; public int dir1 = -1, dir2 = -1; public boolean createItems = false; public int poimiX = 0, poimiY = 0; public byte cachedPropertiesBitmap[] = new byte[Config.MAX_PLAYERS+7 >> 3]; public int DirectionCount = 0; private boolean appearanceUpdateRequired = true; public int hitDiff2; private int hitDiff = 0; public boolean hitUpdateRequired2; private boolean hitUpdateRequired = false; public boolean isDead = false; protected static Stream playerProps; static { Player.playerProps = new Stream(new byte[100]); } private boolean chatTextUpdateRequired = false; private byte chatText[] = new byte[4096]; private byte chatTextSize = 0; private int chatTextColor = 0; private int chatTextEffects = 0; public String forcedText = "null"; /** *Graphics **/ public int mask100var1 = 0; public int mask100var2 = 0; protected boolean mask100update = false; /** *Face Update **/ protected boolean faceUpdateRequired = false; public int face = -1; public int FocusPointX = -1, FocusPointY = -1; private int newWalkCmdX[] = new int[walkingQueueSize]; private int newWalkCmdY[] = new int[walkingQueueSize]; public int newWalkCmdSteps = 0; private boolean newWalkCmdIsRunning = false; protected int travelBackX[] = new int[walkingQueueSize]; protected int travelBackY[] = new int[walkingQueueSize]; protected int numTravelBackSteps = 0; public int[] damageTaken = new int[Config.MAX_PLAYERS]; public Player(final int _playerId) { playerId = _playerId; playerRights = Config.START_PLAYER_RIGHT; for (int i=0; i<playerItems.length; i++) { playerItems[i] = 0; } for (int i=0; i<playerItemsN.length; i++) { playerItemsN[i] = 0; } for (int i=0; i<playerLevel.length; i++) { if (i == 3) { playerLevel[i] = 10; } else { playerLevel[i] = 1; } } for (int i=0; i<playerXP.length; i++) { if (i == 3) { playerXP[i] = 1300; } else { playerXP[i] = 0; } } for (int i=0; i < Config.BANK_SIZE; i++) { bankItems[i] = 0; } for (int i=0; i < Config.BANK_SIZE; i++) { bankItemsN[i] = 0; } playerAppearance[0] = 0; // gender playerAppearance[1] = 7; // head playerAppearance[2] = 25;// Torso playerAppearance[3] = 29; // arms playerAppearance[4] = 35; // hands playerAppearance[5] = 39; // legs playerAppearance[6] = 44; // feet playerAppearance[7] = 14; // beard playerAppearance[8] = 7; // hair colour playerAppearance[9] = 8; // torso colour playerAppearance[10] = 9; // legs colour playerAppearance[11] = 5; // feet colour playerAppearance[12] = 0; // skin colour apset = 0; actionID = 0; playerEquipment[playerHat]=-1; playerEquipment[playerCape]=-1; playerEquipment[playerAmulet]=-1; playerEquipment[playerChest]=-1; playerEquipment[playerShield]=-1; playerEquipment[playerLegs]=-1; playerEquipment[playerHands]=-1; playerEquipment[playerFeet]=-1; playerEquipment[playerRing]=-1; playerEquipment[playerArrows]=-1; playerEquipment[playerWeapon]=-1; Player.heightLevel = Config.START_HIGHT_LEVEL; teleportToX = Config.START_LOCATION_X; teleportToY = Config.START_LOCATION_Y; absX = absY = -1; mapRegionX = mapRegionY = -1; currentX = currentY = 0; resetWalkingQueue(); } public void addNewNPC(final NPC npc, final Stream str, final Stream updateBlock) { synchronized(this) { final int id = npc.npcId; npcInListBitmap[id >> 3] |= 1 << (id&7); npcList[npcListSize++] = npc; str.writeBits(14, id); int z = npc.absY-absY; if(z < 0) { z += 32; } str.writeBits(5, z); z = npc.absX-absX; if(z < 0) { z += 32; } str.writeBits(5, z); str.writeBits(1, 0); str.writeBits(12, npc.npcType); final boolean savedUpdateRequired = npc.updateRequired; npc.updateRequired = true; npc.appendNPCUpdateBlock(updateBlock); npc.updateRequired = savedUpdateRequired; str.writeBits(1, 1); } } /*public void addNewPlayer(Player plr, Stream str, Stream updateBlock) { synchronized(this) { if(playerListSize >= 255) { return; } int id = plr.playerId; playerInListBitmap[id >> 3] |= 1 << (id&7); playerList[playerListSize++] = plr; str.writeBits(11, id); str.writeBits(1, 1); boolean savedFlag = plr.isAppearanceUpdateRequired(); boolean savedUpdateRequired = plr.updateRequired; plr.setAppearanceUpdateRequired(true); plr.updateRequired = true; plr.appendPlayerUpdateBlock(updateBlock); plr.setAppearanceUpdateRequired(savedFlag); plr.updateRequired = savedUpdateRequired; str.writeBits(1, 1); int z = plr.absY-absY; if(z < 0) z += 32; str.writeBits(5, z); z = plr.absX-absX; if(z < 0) z += 32; str.writeBits(5, z); } }*/ public void addNewPlayer(final Player plr, final Stream str, final Stream updateBlock) { // memory // lea // fixed synchronized (this) { final int id = plr.playerId; playerInListBitmap[id >> 3] |= 1 << (id & 7); playerList[playerListSize++] = plr; str.writeBits(11, id); str.writeBits(1, 1); final boolean savedFlag = plr.isAppearanceUpdateRequired(); final boolean savedUpdateRequired = plr.updateRequired; plr.setAppearanceUpdateRequired(true); plr.updateRequired = true; plr.appendPlayerUpdateBlock(updateBlock); plr.setAppearanceUpdateRequired(savedFlag); plr.updateRequired = savedUpdateRequired; str.writeBits(1, 1); int z = plr.absY - absY; if (z < 0) { z += 32; } str.writeBits(5, z); z = plr.absX - absX; if (z < 0) { z += 32; } str.writeBits(5, z); } } public void addToWalkingQueue(final int x, final int y) { //if (VirtualWorld.I(heightLevel, absX, absY, x, y, 0)) { final int next = (wQueueWritePtr+1) % walkingQueueSize; if(next == wQueueWritePtr) { return; } walkingQueueX[wQueueWritePtr] = x; walkingQueueY[wQueueWritePtr] = y; wQueueWritePtr = next; //} } public void appendAnimationRequest(final Stream str) { synchronized(this) { str.writeWordBigEndian(animationRequest==-1 ? 65535 : animationRequest); str.writeByteC(animationWaitCycles); } } public void appendFaceUpdate(final Stream str) { synchronized(this) { str.writeWordBigEndian(face); } } public void appendForcedChat(final Stream str) { synchronized(this) { str.writeString(forcedText); } } /** *Hit Update **/ protected void appendHitUpdate(final Stream str) { synchronized(this) { str.writeByte(getHitDiff()); // What the perseon got 'hit' for if (poisonMask == 1) { str.writeByteA(2); } else if (getHitDiff() > 0) { str.writeByteA(1); // 0: red hitting - 1: blue hitting } else { str.writeByteA(0); // 0: red hitting - 1: blue hitting } if (playerLevel[3] <= 0) { playerLevel[3] = 0; isDead = true; } str.writeByteC(playerLevel[3]); // Their current hp, for HP bar str.writeByte(getLevelForXP(playerXP[3])); // Their max hp, for HP bar } } protected void appendHitUpdate2(final Stream str) { synchronized(this) { str.writeByte(hitDiff2); // What the perseon got 'hit' for if (poisonMask == 2) { str.writeByteS(2); poisonMask = -1; } else if (hitDiff2 > 0) { str.writeByteS(1); // 0: red hitting - 1: blue hitting } else { str.writeByteS(0); // 0: red hitting - 1: blue hitting } if (playerLevel[3] <= 0) { playerLevel[3] = 0; isDead = true; } str.writeByte(playerLevel[3]); // Their current hp, for HP bar str.writeByteC(getLevelForXP(playerXP[3])); // Their max hp, for HP bar } } public void appendMask100Update(final Stream str) { synchronized(this) { str.writeWordBigEndian(mask100var1); str.writeDWord(mask100var2); } } protected void appendPlayerAppearance(final Stream str) { synchronized(this) { Player.playerProps.currentOffset = 0; Player.playerProps.writeByte(playerAppearance[0]); Player.playerProps.writeByte(headIcon); Player.playerProps.writeByte(headIconPk); //playerProps.writeByte(headIconHints); //playerProps.writeByte(bountyIcon); if (playerEquipment[playerHat] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerHat]); } else { Player.playerProps.writeByte(0); } if (playerEquipment[playerCape] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerCape]); } else { Player.playerProps.writeByte(0); } if (playerEquipment[playerAmulet] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerAmulet]); } else { Player.playerProps.writeByte(0); } if (playerEquipment[playerWeapon] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerWeapon]); } else { Player.playerProps.writeByte(0); } if (playerEquipment[playerChest] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerChest]); } else { Player.playerProps.writeWord(0x100+playerAppearance[2]); } if (playerEquipment[playerShield] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerShield]); } else { Player.playerProps.writeByte(0); } if (!Item.isFullBody(playerEquipment[playerChest])) { Player.playerProps.writeWord(0x100+playerAppearance[3]); } else { Player.playerProps.writeByte(0); } if (playerEquipment[playerLegs] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerLegs]); } else { Player.playerProps.writeWord(0x100+playerAppearance[5]); } if (!Item.isFullHelm(playerEquipment[playerHat]) && !Item.isFullMask(playerEquipment[playerHat])) { Player.playerProps.writeWord(0x100 + playerAppearance[1]); } else { Player.playerProps.writeByte(0); } if (playerEquipment[playerHands] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerHands]); } else { Player.playerProps.writeWord(0x100+playerAppearance[4]); } if (playerEquipment[playerFeet] > 1) { Player.playerProps.writeWord(0x200 + playerEquipment[playerFeet]); } else { Player.playerProps.writeWord(0x100+playerAppearance[6]); } if (playerAppearance[0] != 1 && !Item.isFullMask(playerEquipment[playerHat])) { Player.playerProps.writeWord(0x100 + playerAppearance[7]); } else { Player.playerProps.writeByte(0); } Player.playerProps.writeByte(playerAppearance[8]); Player.playerProps.writeByte(playerAppearance[9]); Player.playerProps.writeByte(playerAppearance[10]); Player.playerProps.writeByte(playerAppearance[11]); Player.playerProps.writeByte(playerAppearance[12]); Player.playerProps.writeWord(playerStandIndex); // standAnimIndex Player.playerProps.writeWord(playerTurnIndex); // standTurnAnimIndex Player.playerProps.writeWord(playerWalkIndex); // walkAnimIndex Player.playerProps.writeWord(playerTurn180Index); // turn180AnimIndex Player.playerProps.writeWord(playerTurn90CWIndex); // turn90CWAnimIndex Player.playerProps.writeWord(playerTurn90CCWIndex); // turn90CCWAnimIndex Player.playerProps.writeWord(playerRunIndex); // runAnimIndex Player.playerProps.writeQWord(Misc.playerNameToInt64(playerName)); final int mag = (int) (getLevelForXP(playerXP[6]) * 1.5); final int ran = (int) (getLevelForXP(playerXP[4]) * 1.5); final int attstr = (int) ((double) getLevelForXP(playerXP[0]) + (double) getLevelForXP(playerXP[2])); combatLevel = 0; if (ran > attstr) { combatLevel = (int) (getLevelForXP(playerXP[1]) * 0.25 + getLevelForXP(playerXP[3]) * 0.25 + getLevelForXP(playerXP[5]) * 0.125 + getLevelForXP(playerXP[4]) * 0.4875); } else if (mag > attstr) { combatLevel = (int) (getLevelForXP(playerXP[1]) * 0.25 + getLevelForXP(playerXP[3]) * 0.25 + getLevelForXP(playerXP[5]) * 0.125 + getLevelForXP(playerXP[6]) * 0.4875); } else { combatLevel = (int) (getLevelForXP(playerXP[1]) * 0.25 + getLevelForXP(playerXP[3]) * 0.25 + getLevelForXP(playerXP[5]) * 0.125 + getLevelForXP(playerXP[0]) * 0.325 + getLevelForXP(playerXP[2]) * 0.325); } Player.playerProps.writeByte(combatLevel); // combat level Player.playerProps.writeWord(0); str.writeByteC(Player.playerProps.currentOffset); str.writeBytes(Player.playerProps.buffer, Player.playerProps.currentOffset, 0); } } protected void appendPlayerChatText(final Stream str) { synchronized(this) { str.writeWordBigEndian(((getChatTextColor()&0xFF) << 8) + (getChatTextEffects()&0xFF)); str.writeByte(playerRights); str.writeByteC(getChatTextSize()); str.writeBytes_reverse(getChatText(), getChatTextSize(), 0); } } public void appendPlayerUpdateBlock(final Stream str){ synchronized(this) { if(!updateRequired && !isChatTextUpdateRequired()) { return; // nothing required } int updateMask = 0; if(mask100update) { updateMask |= 0x100; } if(animationRequest != -1) { updateMask |= 8; } if(forcedChatUpdateRequired) { updateMask |= 4; } if(isChatTextUpdateRequired()) { updateMask |= 0x80; } if(isAppearanceUpdateRequired()) { updateMask |= 0x10; } if(faceUpdateRequired) { updateMask |= 1; } if(FocusPointX != -1) { updateMask |= 2; } if (isHitUpdateRequired()) { updateMask |= 0x20; } if(hitUpdateRequired2) { updateMask |= 0x200; } if(updateMask >= 0x100) { updateMask |= 0x40; str.writeByte(updateMask & 0xFF); str.writeByte(updateMask >> 8); } else { str.writeByte(updateMask); } // now writing the various update blocks itself - note that their order crucial if(mask100update) { appendMask100Update(str); } if(animationRequest != -1) { appendAnimationRequest(str); } if(forcedChatUpdateRequired) { appendForcedChat(str); } if(isChatTextUpdateRequired()) { appendPlayerChatText(str); } if(faceUpdateRequired) { appendFaceUpdate(str); } if(isAppearanceUpdateRequired()) { appendPlayerAppearance(str); } if(FocusPointX != -1) { appendSetFocusDestination(str); } if(isHitUpdateRequired()) { appendHitUpdate(str); } if(hitUpdateRequired2) { appendHitUpdate2(str); } } } private void appendSetFocusDestination(final Stream str) { synchronized(this) { str.writeWordBigEndianA(FocusPointX); str.writeWordBigEndian(FocusPointY); } } public boolean arenas() { if(absX > 3331 && absX < 3391 && absY > 3242 && absY < 3260) { return true; } return false; } public void assignAutocast(final int button) { for (int j = 0; j < autocastIds.length; j++) { if (autocastIds[j] == button) { Client c = (Client) PlayerHandler.players[playerId]; autocasting = true; autocastId = autocastIds[j+1]; c.getPA().sendFrame36(108, 1); c.setSidebarInterface(0, 328); c = null; break; } } } public void clearUpdateFlags(){ updateRequired = false; setChatTextUpdateRequired(false); setAppearanceUpdateRequired(false); setHitUpdateRequired(false); hitUpdateRequired2 = false; forcedChatUpdateRequired = false; mask100update = false; animationRequest = -1; FocusPointX = -1; FocusPointY = -1; poisonMask = -1; faceUpdateRequired = false; face = 65535; } public void dealDamage(final int damage) { if (teleTimer <= 0) { playerLevel[3] -= damage; } else { if (hitUpdateRequired) { hitUpdateRequired = false; } if (hitUpdateRequired2) { hitUpdateRequired2 = false; } } } public void destruct() { playerListSize = 0; for(int i = 0; i < Player.maxPlayerListSize; i++) { playerList[i] = null; } absX = absY = -1; mapRegionX = mapRegionY = -1; currentX = currentY = 0; resetWalkingQueue(); } public int distanceToPoint(final int pointX,final int pointY) { return (int) Math.sqrt(Math.pow(absX - pointX, 2) + Math.pow(absY - pointY, 2)); } public void faceUpdate(final int index) { face = index; faceUpdateRequired = true; updateRequired = true; } public void forcedChat(final String text) { forcedText = text; forcedChatUpdateRequired = true; updateRequired = true; setAppearanceUpdateRequired(true); } public boolean fullVoidMage() { return playerEquipment[playerHat] == 11663 && playerEquipment[playerLegs] == 8840 && playerEquipment[playerChest] == 8839 && playerEquipment[playerHands] == 8842; } public boolean fullVoidMelee() { return playerEquipment[playerHat] == 11665 && playerEquipment[playerLegs] == 8840 && playerEquipment[playerChest] == 8839 && playerEquipment[playerHands] == 8842; } public boolean fullVoidRange() { return playerEquipment[playerHat] == 11664 && playerEquipment[playerLegs] == 8840 && playerEquipment[playerChest] == 8839 && playerEquipment[playerHands] == 8842; } public byte[] getChatText() { return chatText; } public int getChatTextColor() { return chatTextColor; } public int getChatTextEffects() { return chatTextEffects; } public byte getChatTextSize() { return chatTextSize; } public int getHitDiff() { return hitDiff; } public boolean getHitUpdateRequired() { return hitUpdateRequired; } public boolean getHitUpdateRequired2() { return hitUpdateRequired2; } public int getId() { return playerId; } public int getLevelForXP(final int exp) { int points = 0; int output = 0; for (int lvl = 1; lvl <= 99; lvl++) { points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0)); output = (int)Math.floor(points / 4); if (output >= exp) { return lvl; } } return 99; } public int getLocalX() { return getX() - 8 * getMapRegionX(); } public int getLocalY() { return getY() - 8 * getMapRegionY(); } public int getMapRegionX() { return mapRegionX; } public int getMapRegionY() { return mapRegionY; } public int[] getNewWalkCmdX() { return newWalkCmdX; } public int[] getNewWalkCmdY() { return newWalkCmdY; } public synchronized void getNextPlayerMovement() { mapRegionDidChange = false; didTeleport = false; dir1 = dir2 = -1; if(teleportToX != -1 && teleportToY != -1) { mapRegionDidChange = true; if(mapRegionX != -1 && mapRegionY != -1) { final int relX = teleportToX-mapRegionX*8, relY = teleportToY-mapRegionY*8; if(relX >= 2*8 && relX < 11*8 && relY >= 2*8 && relY < 11*8) { mapRegionDidChange = false; } } if(mapRegionDidChange) { mapRegionX = (teleportToX>>3)-6; mapRegionY = (teleportToY>>3)-6; } currentX = teleportToX - 8*mapRegionX; currentY = teleportToY - 8*mapRegionY; absX = teleportToX; absY = teleportToY; resetWalkingQueue(); teleportToX = teleportToY = -1; didTeleport = true; } else { dir1 = getNextWalkingDirection(); if(dir1 == -1) { return; } if(isRunning) { dir2 = getNextWalkingDirection(); } //c.sendMessage("Cycle Ended"); int deltaX = 0, deltaY = 0; if(currentX < 2*8) { deltaX = 4*8; mapRegionX -= 4; mapRegionDidChange = true; } else if(currentX >= 11*8) { deltaX = -4*8; mapRegionX += 4; mapRegionDidChange = true; } if(currentY < 2*8) { deltaY = 4*8; mapRegionY -= 4; mapRegionDidChange = true; } else if(currentY >= 11*8) { deltaY = -4*8; mapRegionY += 4; mapRegionDidChange = true; } if(mapRegionDidChange/* && VirtualWorld.I(heightLevel, currentX, currentY, currentX + deltaX, currentY + deltaY, 0)*/) { currentX += deltaX; currentY += deltaY; for(int i = 0; i < walkingQueueSize; i++) { walkingQueueX[i] += deltaX; walkingQueueY[i] += deltaY; } } //CoordAssistant.processCoords(this); } } public int getNextWalkingDirection() { if(wQueueReadPtr == wQueueWritePtr) { return -1; } int dir; do { dir = Misc.direction(currentX, currentY, walkingQueueX[wQueueReadPtr], walkingQueueY[wQueueReadPtr]); if(dir == -1) { wQueueReadPtr = (wQueueReadPtr+1) % walkingQueueSize; } else if((dir&1) != 0) { println_debug("Invalid waypoint in walking queue!"); resetWalkingQueue(); return -1; } } while(dir == -1 && wQueueReadPtr != wQueueWritePtr); if(dir == -1) { return -1; } dir >>= 1; currentX += Misc.directionDeltaX[dir]; currentY += Misc.directionDeltaY[dir]; absX += Misc.directionDeltaX[dir]; absY += Misc.directionDeltaY[dir]; return dir; } public String getSpellName(final int id) { switch (id) { case 0: return "Air Strike"; case 1: return "Water Strike"; case 2: return "Earth Strike"; case 3: return "Fire Strike"; case 4: return "Air Bolt"; case 5: return "Water Bolt"; case 6: return "Earth Bolt"; case 7: return "Fire Bolt"; case 8: return "Air Blast"; case 9: return "Water Blast"; case 10: return "Earth Blast"; case 11: return "Fire Blast"; case 12: return "Air Wave"; case 13: return "Water Wave"; case 14: return "Earth Wave"; case 15: return "Fire Wave"; case 32: return "Shadow Rush"; case 33: return "Smoke Rush"; case 34: return "Blood Rush"; case 35: return "Ice Rush"; case 36: return "Shadow Burst"; case 37: return "Smoke Burst"; case 38: return "Blood Burst"; case 39: return "Ice Burst"; case 40: return "Shadow Blitz"; case 41: return "Smoke Blitz"; case 42: return "Blood Blitz"; case 43: return "Ice Blitz"; case 44: return "Shadow Barrage"; case 45: return "Smoke Barrage"; case 46: return "Blood Barrage"; case 47: return "Ice Barrage"; default: return "Select Spell"; } } public int getX() { return absX; } public int getY() { return absY; } public void gfx0(final int gfx) { mask100var1 = gfx; mask100var2 = 65536; mask100update = true; updateRequired = true; } public void gfx100(final int gfx) { mask100var1 = gfx; mask100var2 = 6553600; mask100update = true; updateRequired = true; } public boolean goodDistance(final int objectX, final int objectY, final int playerX, final int playerY, final int distance) { for (int i = 0; i <= distance; i++) { for (int j = 0; j <= distance; j++) { if (objectX + i == playerX && (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) { return true; } else if (objectX - i == playerX && (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) { return true; } else if (objectX == playerX && (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) { return true; } } } return false; } public void handleHitMask(final int damage) { if (!hitUpdateRequired) { hitUpdateRequired = true; hitDiff = damage; } else if (!hitUpdateRequired2) { hitUpdateRequired2 = true; hitDiff2 = damage; } updateRequired = true; } public boolean inArea(final int x, final int y, final int x1, final int y1) { if (absX > x && absX < x1 && absY < y && absY > y1) { return true; } return false; } public boolean inBarrows() { if(absX > 3520 && absX < 3598 && absY > 9653 && absY < 9750) { return true; } return false; } public boolean inDuelArena() { if(absX > 3322 && absX < 3394 && absY > 3195 && absY < 3291 || absX > 3311 && absX < 3323 && absY > 3223 && absY < 3248) { return true; } return false; } public boolean inFightCaves() { return absX >= 2360 && absX <= 2445 && absY >= 5045 && absY <= 5125; } public abstract void initialize(); public boolean inMulti() { if(absX >= 3136 && absX <= 3327 && absY >= 3519 && absY <= 3607 || absX >= 3190 && absX <= 3327 && absY >= 3648 && absY <= 3839 || absX >= 3200 && absX <= 3390 && absY >= 3840 && absY <= 3967 || absX >= 2992 && absX <= 3007 && absY >= 3912 && absY <= 3967 || absX >= 2946 && absX <= 2959 && absY >= 3816 && absY <= 3831 || absX >= 3008 && absX <= 3199 && absY >= 3856 && absY <= 3903 || absX >= 3008 && absX <= 3071 && absY >= 3600 && absY <= 3711 || absX >= 3072 && absX <= 3327 && absY >= 3608 && absY <= 3647 || absX >= 2624 && absX <= 2690 && absY >= 2550 && absY <= 2619 || absX >= 2371 && absX <= 2422 && absY >= 5062 && absY <= 5117 || absX >= 2896 && absX <= 2927 && absY >= 3595 && absY <= 3630 || absX >= 2892 && absX <= 2932 && absY >= 4435 && absY <= 4464 || absX >= 2256 && absX <= 2287 && absY >= 4680 && absY <= 4711) { return true; } return false; } public boolean inPcBoat() { return absX >= 2660 && absX <= 2663 && absY >= 2638 && absY <= 2643; } public boolean inPcGame() { return absX >= 2624 && absX <= 2690 && absY >= 2550 && absY <= 2619; } public boolean inPirateHouse() { return absX >= 3038 && absX <= 3044 && absY >= 3949 && absY <= 3959; } public boolean inWild() { if(absX > 2941 && absX < 3392 && absY > 3518 && absY < 3966 || absX > 2941 && absX < 3392 && absY > 9918 && absY < 10366) { return true; } return false; } public boolean isAppearanceUpdateRequired() { return appearanceUpdateRequired; } public boolean isAutoButton(final int button) { for (int j = 0; j < autocastIds.length; j += 2) { if (autocastIds[j] == button) { return true; } } return false; } public boolean isChatTextUpdateRequired() { return chatTextUpdateRequired; } public boolean isHitUpdateRequired() { return hitUpdateRequired; } /** * SouthWest, NorthEast, SouthWest, NorthEast */ public boolean isInTut() { if(absX >= 2625 && absX <= 2687 && absY >= 4670 && absY <= 4735) { return true; } return false; } public boolean isNewWalkCmdIsRunning() { return newWalkCmdIsRunning; } public synchronized void postProcessing() { if(newWalkCmdSteps > 0) { final int firstX = getNewWalkCmdX()[0], firstY = getNewWalkCmdY()[0]; int lastDir = 0; boolean found = false; numTravelBackSteps = 0; int ptr = wQueueReadPtr; int dir = Misc.direction(currentX, currentY, firstX, firstY); if(dir != -1 && (dir&1) != 0) { do { lastDir = dir; if(--ptr < 0) { ptr = walkingQueueSize-1; } travelBackX[numTravelBackSteps] = walkingQueueX[ptr]; travelBackY[numTravelBackSteps++] = walkingQueueY[ptr]; dir = Misc.direction(walkingQueueX[ptr], walkingQueueY[ptr], firstX, firstY); if(lastDir != dir) { found = true; break; } } while(ptr != wQueueWritePtr); } else { found = true; } if(!found) { println_debug("Fatal: couldn't find connection vertex! Dropping packet."); } else { wQueueWritePtr = wQueueReadPtr; addToWalkingQueue(currentX, currentY); if(dir != -1 && (dir&1) != 0) { for(int i = 0; i < numTravelBackSteps-1; i++) { addToWalkingQueue(travelBackX[i], travelBackY[i]); } final int wayPointX2 = travelBackX[numTravelBackSteps-1], wayPointY2 = travelBackY[numTravelBackSteps-1]; int wayPointX1, wayPointY1; if(numTravelBackSteps == 1) { wayPointX1 = currentX; wayPointY1 = currentY; } else { wayPointX1 = travelBackX[numTravelBackSteps-2]; wayPointY1 = travelBackY[numTravelBackSteps-2]; } dir = Misc.direction(wayPointX1, wayPointY1, wayPointX2, wayPointY2); if(dir == -1 || (dir&1) != 0) { println_debug("Fatal: The walking queue is corrupt! wp1=("+wayPointX1+", "+wayPointY1+"), "+"wp2=("+wayPointX2+", "+wayPointY2+")"); } else { dir >>= 1; found = false; int x = wayPointX1, y = wayPointY1; while(x != wayPointX2 || y != wayPointY2) { x += Misc.directionDeltaX[dir]; y += Misc.directionDeltaY[dir]; if((Misc.direction(x, y, firstX, firstY)&1) == 0) { found = true; break; } } if(!found) { println_debug("Fatal: Internal error: unable to determine connection vertex!"+ " wp1=("+wayPointX1+", "+wayPointY1+"), wp2=("+wayPointX2+", "+wayPointY2+"), "+ "first=("+firstX+", "+firstY+")"); } else { addToWalkingQueue(wayPointX1, wayPointY1); } } } else { for(int i = 0; i < numTravelBackSteps; i++) { addToWalkingQueue(travelBackX[i], travelBackY[i]); } } for(int i = 0; i < newWalkCmdSteps; i++) { addToWalkingQueue(getNewWalkCmdX()[i], getNewWalkCmdY()[i]); } } isRunning = isNewWalkCmdIsRunning() || isRunning2; } } public void preProcessing() { newWalkCmdSteps = 0; } public void println(final String str) { System.out.println("[player-"+playerId+"]: "+str); } public void println_debug(final String str) { System.out.println("[player-"+playerId+"]: "+str); } public abstract void process(); public abstract boolean processQueuedPackets(); public void putInCombat(final int attacker) { underAttackBy = attacker; logoutDelay = System.currentTimeMillis(); singleCombatDelay = System.currentTimeMillis(); } public void resetWalkingQueue() { wQueueReadPtr = wQueueWritePtr = 0; for(int i = 0; i < walkingQueueSize; i++) { walkingQueueX[i] = currentX; walkingQueueY[i] = currentY; } } public boolean samePlayer() { for (int j = 0; j < PlayerHandler.players.length; j++) { if (j == playerId) { continue; } if (PlayerHandler.players[j] != null) { if (PlayerHandler.players[j].playerName.equalsIgnoreCase(playerName)) { disconnected = true; return true; } } } return false; } public void setAppearanceUpdateRequired(final boolean appearanceUpdateRequired) { this.appearanceUpdateRequired = appearanceUpdateRequired; } public void setChatText(final byte chatText[]) { this.chatText = chatText; } public void setChatTextColor(final int chatTextColor) { this.chatTextColor = chatTextColor; } public void setChatTextEffects(final int chatTextEffects) { this.chatTextEffects = chatTextEffects; } public void setChatTextSize(final byte chatTextSize) { this.chatTextSize = chatTextSize; } public void setChatTextUpdateRequired(final boolean chatTextUpdateRequired) { this.chatTextUpdateRequired = chatTextUpdateRequired; } public void setHitDiff(final int hitDiff) { this.hitDiff = hitDiff; } public void setHitDiff2(final int hitDiff2) { this.hitDiff2 = hitDiff2; } public void setHitUpdateRequired(final boolean hitUpdateRequired) { this.hitUpdateRequired = hitUpdateRequired; } public void setHitUpdateRequired2(final boolean hitUpdateRequired2) { this.hitUpdateRequired2 = hitUpdateRequired2; } public void setInStreamDecryption(final ISAACRandomGen inStreamDecryption) { } public void setNewWalkCmdIsRunning(final boolean newWalkCmdIsRunning) { this.newWalkCmdIsRunning = newWalkCmdIsRunning; } public void setNewWalkCmdX(final int newWalkCmdX[]) { this.newWalkCmdX = newWalkCmdX; } public void setNewWalkCmdY(final int newWalkCmdY[]) { this.newWalkCmdY = newWalkCmdY; } public void setOutStreamDecryption(final ISAACRandomGen outStreamDecryption) { } /** *Animations **/ public void startAnimation(final int animId) { if (wearing2h() && animId == 829) { return; } animationRequest = animId; animationWaitCycles = 0; updateRequired = true; } public void startAnimation(final int animId, final int time) { animationRequest = animId; animationWaitCycles = time; updateRequired = true; } public void stopMovement() { if(teleportToX <= 0 && teleportToY <= 0) { teleportToX = absX; teleportToY = absY; } newWalkCmdSteps = 0; getNewWalkCmdX()[0] = getNewWalkCmdY()[0] = travelBackX[0] = travelBackY[0] = 0; getNextPlayerMovement(); } public void turnPlayerTo(final int pointX, final int pointY){ FocusPointX = 2*pointX+1; FocusPointY = 2*pointY+1; updateRequired = true; } public abstract void update(); public void updatePlayerMovement(final Stream str) { synchronized(this) { if(dir1 == -1) { if(updateRequired || isChatTextUpdateRequired()) { str.writeBits(1, 1); str.writeBits(2, 0); } else { str.writeBits(1, 0); } } else if(dir2 == -1) { str.writeBits(1, 1); str.writeBits(2, 1); str.writeBits(3, Misc.xlateDirectionToClient[dir1]); str.writeBits(1, updateRequired || isChatTextUpdateRequired() ? 1: 0); } else { str.writeBits(1, 1); str.writeBits(2, 2); str.writeBits(3, Misc.xlateDirectionToClient[dir1]); str.writeBits(3, Misc.xlateDirectionToClient[dir2]); str.writeBits(1, updateRequired || isChatTextUpdateRequired() ? 1: 0); } } } public void updateshop(final int i){ final Client p = (Client) PlayerHandler.players[playerId]; p.getShops().resetShop(i); } public void updateThisPlayerMovement(final Stream str) { synchronized(this) { if(mapRegionDidChange) { str.createFrame(73); str.writeWordA(mapRegionX+6); str.writeWord(mapRegionY+6); } if(didTeleport) { str.createFrameVarSizeWord(81); str.initBitAccess(); str.writeBits(1, 1); str.writeBits(2, 3); str.writeBits(2, Player.heightLevel); str.writeBits(1, 1); str.writeBits(1, updateRequired ? 1 : 0); str.writeBits(7, currentY); str.writeBits(7, currentX); return ; } if(dir1 == -1) { // don't have to update the character position, because we're just standing str.createFrameVarSizeWord(81); str.initBitAccess(); isMoving = false; if(updateRequired) { // tell client there's an update block appended at the end str.writeBits(1, 1); str.writeBits(2, 0); } else { str.writeBits(1, 0); } if (DirectionCount < 50) { DirectionCount++; } } else { DirectionCount = 0; str.createFrameVarSizeWord(81); str.initBitAccess(); str.writeBits(1, 1); if(dir2 == -1) { isMoving = true; str.writeBits(2, 1); str.writeBits(3, Misc.xlateDirectionToClient[dir1]); if(updateRequired) { str.writeBits(1, 1); } else { str.writeBits(1, 0); } } else { isMoving = true; str.writeBits(2, 2); str.writeBits(3, Misc.xlateDirectionToClient[dir1]); str.writeBits(3, Misc.xlateDirectionToClient[dir2]); if(updateRequired) { str.writeBits(1, 1); } else { str.writeBits(1, 0); } } } } } public boolean wearing2h() { final Client c = (Client)this; final String s = c.getItems().getItemName(c.playerEquipment[c.playerWeapon]); if (s.contains("2h")) { return true; } else if (s.contains("godsword")) { return true; } return false; } public boolean withinDistance(final NPC npc) { if (Player.heightLevel != npc.heightLevel) { return false; } if (npc.needRespawn == true) { return false; } final int deltaX = npc.absX-absX, deltaY = npc.absY-absY; return deltaX <= 15 && deltaX >= -16 && deltaY <= 15 && deltaY >= -16; } public boolean withinDistance(final Player otherPlr) { if(Player.heightLevel != Player.heightLevel) { return false; } final int deltaX = otherPlr.absX-absX, deltaY = otherPlr.absY-absY; return deltaX <= 15 && deltaX >= -16 && deltaY <= 15 && deltaY >= -16; } } [/CODE] Im too new at this to know what to fix so the level shows correctly, so any help with some explanation would be appreciated!
  9. link: [url=http://dzservers.org/ss/play.php][img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/play.png[/img][/url] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/1.gif[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/2.gif[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/3.gif[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/1.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/2.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/3.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/4.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/5.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/6.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/7.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/8.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/9.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/10.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/11.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/12.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/13.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/14.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/15.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/16.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/17.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/18.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/19.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/20.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/21.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/22.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/23.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/24.png[/img] [img]https://dl.dropboxusercontent.com/u/21911361/Skill%20Sector/images/25.png[/img]
  10. okay so I am trying to replace the skills with a nicer interface in my opinion. here is what happens when I try to change them [URL=http://imgur.com/h9wP9iK][IMG]http://i.imgur.com/h9wP9iK.png[/IMG][/URL]
  11. i need skill scripts for rev 317 they come as .py files i am mainly looking for firemaking , fishing , cooking , fletching and crafting please share what you have, it would be really appreciated and btw how do you change the experience rate? and im using the starter package of runelocus
  12. heloo i would like to ask if there is already a private server whit the new skill ? xD ore is there anyone that knows how far rsps are now?
  13. Hi, I need some help with my skill cape shop OK now I coded 120 Dungeoneering tho the problem is when I add the new Item ID for the Dungeoneering skill cape to the shop it freezes if anyone can help contact me on Skype majd_garyouti1996 thank you if you can help really appreciate it
  14. pretty simple to use, just copy and paste using Dreamweaver,filezilla,etc.. [url]http://uppit.com/7ozs4b2xvo8b/rs_skill_calculators.rar[/url] preview: [url]http://www.skillcalculators.comyr.com/testcalc/untitled.html[/url] credits to x-scape but there copyright is out of date
  15. I've gotten the entire skill menu concept down on the Starter Kit I got from Rune Locus. I've edited it some but want to complex it somewhat. The buttons on the side aren't showing text and I don't know how to add text to them... Here is a picture of what I want. [IMG]http://i782.photobucket.com/albums/yy104/countryboyaj/Untitled-1_zps61e6048f.png[/IMG] Here is my skill guide code: [code] package server.model.players; /** * * @author Sanity * */ public class SkillMenu { private static final int INTERFACE_ID = 8714; private static final int LEVEL_LINE = 8720; private static final int TEXT_LINE = 8760; private static final int TITLE_LINE = 8716; private static final int[][] items = {{1321,1323,1325,1327,1329,1331,1333,4153,4587,4151,4718,11694,9747}, {1117,1115,1119,1125,1121,6916,1123,1127,3751,2513,10348,11724,11720,4720,11283,9753}, {4153,6528,9750}, {9768}, {841,843,849,853,857,1135,861,2499,11235,6522,2501,9185,10330,4214,2503,4734,9756}, {9759}, {4099,6916,6889,7401,3387,4675,10338,4712}}; private static final String[][] LEVELS = {{"1","1","5","10","20","30","40","50","60","70","70","75","99"}, {"1","1","5","10","20","25","30","40","45","60","65","65","70","70","75","99"}, {"50","60","99"}, {"99"}, {"1","5","20","30","30","40","50","50","60","60","60","61","65","70","70","70","99"}, {"99"}, {"20","25","25","40","40","50","65","70"}}; private static final String[][] DESCRIPTION = {{"Bronze Weapons", "Iron Weapons", "Steel Weapons", "Black Weapons", "Mithril Weapons", "Adamant Weapons", "Rune Weapons", "Granite Maul", "Dragon Weapons", "Abyssal Whip", "Barrows Weapons", "Godswords", "Cape of Achievement"}, {"Bronze Armour", "Iron Armour", "Steel Armour", "Black Armour", "Mithril Armour", "Infinity", "Adamant Armour", "Rune Armour", "Fremennik Helmets", "Dragon Armour", "3rd Age Armour", "Bandos", "Armadyl", "Barrows Armour","Dragonfire Shield", "Cape of Achievement"}, {"Granite Items", "Obby Maul", "Cape of Achievement"}, {"Cape of Achievement"}, {"Normal Bows","Oak Bows", "Willow Bows", "Maple Bows","Yew Bows", "Green D'hide", "Magic Bows", "Blue D'hide","Dark Bow","Obby Ring", "Red D'hide","Rune C'bow","3rd age Range","Crystal Bow","Black D'hide","Karil's","Cape of Achievement"}, {"Cape of Achievement"}, {"Mystic ","Infinity ","Mage's book","Enchanted ","Splitbark ","Ancient staff","3rd age mage","Ahrims"}}; /** cooking * * 317,335,331,359,377,371,383,389,395,9801 * 1,15,25,30,40,45,80,91 * "Shrimp", "Trout", "Salmon", "Tuna", "Lobster", "Swordfish", "Shark", "Manta Ray","Cape of Achievement" */ /** fishing * * 317,335,331,359,377,371,383,389,395,9801 * 1,20,30,35,40,50,76,81 * "Shrimp", "Trout", "Salmon", "Tuna", "Lobster", "Swordfish", "Shark", "Manta Ray","Cape of Achievement" */ /** woodcutting * * 1351,1349,1511,1353,1521,1355,1519,1357,1517,1515,1359,1513,7797 * "1","1","1","6","15","21","30","31","41","45","60","61","75","99" * "Bronze Axe","Iron Axe","Logs","Steel Axe","Oak Logs","Mithril Axe","Willow Logs","Adamant Axe","Rune Axe","Maple Logs","Yew Logs","Dragon Axe","Magic Logs","Cape of Achievement" */ /** mining * * 1265,1267,1436,434,436,1269,440,442,1273,453,1271,444,1275,447,449,451,9792 * "1","1","1","1","1","1","6","15","20","21","30","31","40","41","65","70","85","99" * "Bronze pickaxe","Iron pickaxe","Rune essence","Clay","Copper","Tin","steel pickaxe","Iron ore","Silver ore","Mithril pickaxe","Coal ore","Adamant pickaxe","Gold ore","Rune pickaxe","Mithril ore","Adamanetite ore","Runite ore" */ /** * * 556,558,555,557,554,559,564,562,9075,561,563,560,565 * "1","2","5","9","14","20","27","35","40","44","54","65","77" * "Air rune","Mind rune","Water rune","Earth rune","Fire rune","Body rune","Cosmic rune","Chaos rune","Astral rune","Nature rune","Law rune","Death rune","Blood rune" */ private static final String[] SKILLS = {"Attack","Defence","Strength","Hitpoints","Ranged","Prayer","Magic"}; public static void openInterface(Client c, int skillType) { removeSidebars(c); writeItems(c,skillType); writeText(c,skillType); c.getPA().showInterface(INTERFACE_ID); } private static void removeSidebars(Client c) { int[] temp = {8849,8846,8823,8824,8827,8837,8840,8843,8859,8862,8865,15303,15306,15309}; for (int j = 0; j < temp.length; j++) { c.getPA().sendFrame126("",temp[j]); } } private static void writeItems(Client c, int skillType) { synchronized (c) { c.outStream.createFrameVarSizeWord(53); c.outStream.writeWord(8847); c.outStream.writeWord(items[skillType].length); for (int j = 0; j < items[skillType].length; j++) { c.outStream.writeByte(1); if (items[skillType][j] > 0) { c.outStream.writeWordBigEndianA(items[skillType][j] + 1); } else { c.outStream.writeWordBigEndianA(0); } } c.outStream.endFrameVarSizeWord(); c.flushOutStream(); } } private static void writeText(Client c, int skillType) { c.getPA().sendFrame126(SKILLS[skillType], TITLE_LINE); for (int j = 0; j < LEVELS[skillType].length; j++) { c.getPA().sendFrame126(LEVELS[skillType][j], LEVEL_LINE + j); } for (int j = 0; j < DESCRIPTION[skillType].length; j++) { c.getPA().sendFrame126(DESCRIPTION[skillType][j], TEXT_LINE + j); } for (int j = DESCRIPTION[skillType].length; j < 30; j++) { c.getPA().sendFrame126("", LEVEL_LINE + j); } for (int j = LEVELS[skillType].length; j < 30; j++) { c.getPA().sendFrame126("", TEXT_LINE + j); } } } [/code] If you require any further information or codes to see relating to this issue please repost and let me know and I'll have them online as soon as possible. Thanks in advance! -Country
  16. [CENTER][URL="http://www.runemix.com"][img]http://i.imgur.com/nYsFlHd.png[/img][/URL] [B]Website[/B]: [URL="http://www.runemix.com"]RuneMix.com[/URL] [B]Description[/B]: What is RuneMix? RuneMix is a recreation of RS, with unique features. At RM you will find a friendly staff and community, all working skills, a great combat system and much more. The economy is perfect, you will not see people running around with huge amounts of gold nor rares. Updates are consistent, always free for everyone. [B]Images[/B]: [img]http://i.imgur.com/AEkhhfs.png[/img] [img]http://i.imgur.com/JtWpmuG.png[/img] [img]http://i.imgur.com/HgM25ie.png[/img] [/CENTER]
  17. I am trying to find a tutorial that might help me learn how to make the skill books work. Right now when I click on the skill in the on its page. Such as a attack on my characters skill page. Right now it just says what my level is I wan to make it showthe guid so people can tell what they can wear. Any tutorials or guids to get this starter out there?
  18. I am trying to find a tutorial that might help me learn how to make the skill books work. Right now when I click on the skill in the on its page. Such as a attack on my characters skill page. Right now it just says what my level is I wan to make it showthe guid so people can tell what they can wear. Any tutorials or guids to get this starter out there?
  19. Hey Well im trying to use a teleport where you need a certain skill level to teleport.. For example: Fishing guild, you need 68 fishing.. Anybody would share the code would be appreciated Thanks :D
  20. I told myself I wouldn't release this but fuck it. This is basically a much eaiser way to do skill requirements, the anti-leech is getting it to work for yourself. Plus I don't feel like explaining shit, and this is a snippet. Heavily documented so you can somewhat understand what to do with this. Make the getters and setters yourself, also, make the cfg file load on startup yourself. [u][b]Skill class[/b][/u] [code]package server.rs2.players.skills; import server.rs2.Constants; import server.rs2.players.Client; /** * Absract class for skills, every skill should extend this class * * @author lare96 */ public abstract class Skill { /** * Skills constants and thier respective ids */ public enum Skills { ATTACK(Constants.PLAYER_ATTACK), DEFENCE(Constants.PLAYER_DEFENCE), STRENGTH(Constants.PLAYER_STRENGTH), HITPOINTS(Constants.PLAYER_HITPOINTS), RANGED(Constants.PLAYER_RANGED), PRAYER(Constants.PLAYER_PRAYER), MAGIC(Constants.PLAYER_MAGIC), COOKING(Constants.PLAYER_COOKING), WOODCUTTING(Constants.PLAYER_WOODCUTTING), FLETCHING(Constants.PLAYER_FLETCHING), FISHING(Constants.PLAYER_FISHING), FIREMAKING(Constants.PLAYER_FIREMAKING), CRAFTING(Constants.PLAYER_CRAFTING), SMITHING(Constants.PLAYER_SMITHING), MINING(Constants.PLAYER_MINING), HERBLORE(Constants.PLAYER_HERBLORE), AGILITY(Constants.PLAYER_AGILITY), THIEVING(Constants.PLAYER_THIEVING), SLAYER(Constants.PLAYER_SLAYER), FARMING(Constants.PLAYER_FARMING), RUNECRAFTING(Constants.PLAYER_RUNECRAFTING); private int id; Skills(int id) { this.id = id; } public int getId() { return id; } } /** * Adds exp to a specificed skill * * @param skill * the skill * @param amount * the amount * @param player * the player to add for */ public void exp(Skills skill, int amount, Client player) { player.getMethods().addSkillXP(amount, skill.getId()); } /** * Gets the level of a specified skill * * @param skill * the skill * @param player * the player to get the level for * * @return the level */ public int getLevel(Skills skill, Client player) { return player.playerLevel[skill.getId()]; } } [/code] [u][b]Requirements class[/b][/u] [code]package server.rs2.players; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import server.rs2.players.skills.Skill; import server.util.Misc; /** * Level requirements for wearing equipment, handled in a cfg file * * @see ./data/config/requirements.cfg * * @author lare96 */ public class Requirements extends Skill { /** * Our player */ private Client player; /** * Defines the player * * @param p * the player */ public Requirements(Client p) { this.player = p; } /** * Constants that represent the different parts of the item name you check * to set a requirement for */ public enum Name { STARTS_WITH, ENDS_WITH, EQUALS } /** * Fields that make up a requirement for a skill */ private String name; private int level; private Skills[] required; private Name concat; /** * All the requirements from the cfg file loaded into a list */ public static List<Requirements> requirements = new ArrayList<Requirements>(); /** * Constructs a requirement * * @param name * the name of the equipment * @param level * the level * @param required * the skills to make a requirement for */ public Requirements(String name, int level, Name concat, Skills... required) { setName(name); setLevel(level); setRequired(required); setConcat(concat); } /** * Constructor that loads the item requirements * * @param i * nothing lol, just so we aren't using a no-args constuctor, put * any integer here, it won't change anything */ public Requirements(int i) { loadRequirements(); } /** * Checks a requirement */ public boolean check(int id) { /** * Get the name of the item id */ String itemName2 = player.getMethods().getItemName(id); String itemName = itemName2.replaceAll("_", " "); /** * Loop through all the requirements loaded on startup */ for (Requirements all : requirements) { /** * Gets the requirement according to what part of the name of the * item its checking */ switch (all.getConcat()) { /** * Starts with */ case STARTS_WITH: if (itemName.startsWith(all.getName())) { if (player.playerLevel[all.getRequired().getId()] < all .getLevel()) { player.sendMessage("You are not a high enough level to equip this item."); player.sendMessage("You need a " + all.getRequired().name().toLowerCase() + " level of " + all.getLevel() + "."); return false; } return true; } break; /** * Ends with */ case ENDS_WITH: if (itemName.endsWith(all.getName())) { if (player.playerLevel[all.getRequired().getId()] < all .getLevel()) { player.sendMessage("You are not a high enough level to equip this item."); player.sendMessage("You need a " + all.getRequired().name().toLowerCase() + " level of " + all.getLevel() + "."); return false; } return true; } break; /** * Equals */ case EQUALS: if (itemName.equals(all.getName())) { if (player.playerLevel[all.getRequired().getId()] < all .getLevel()) { player.sendMessage("You are not a high enough level to equip this item."); player.sendMessage("You need a " + all.getRequired().name().toLowerCase() + " level of " + all.getLevel() + "."); return false; } return true; } break; } } return true; } /** * Loads the requirements into the 'requirements' arraylist, this might soon * be replaced with a primitive array because its faster * * @return if it can load or not */ @SuppressWarnings({ "resource", "unused" }) public boolean loadRequirements() { String line = ""; String token = ""; String token2 = ""; String token2_2 = ""; String[] token3 = new String[10]; boolean EndOfFile = false; int ReadMode = 0; BufferedReader characterfile = null; try { characterfile = new BufferedReader(new FileReader( "./data/config/requirements.cfg")); } catch (FileNotFoundException fileex) { Misc.println("requirements.cfg: file not found."); return false; } try { line = characterfile.readLine(); } catch (IOException ioexception) { Misc.println("requirements.cfg: error loading file."); return false; } while ((EndOfFile == false) && (line != null)) { line = line.trim(); int spot = line.indexOf("="); if (spot > -1) { token = line.substring(0, spot); token = token.trim(); token2 = line.substring(spot + 1); token2 = token2.trim(); token2_2 = token2.replaceAll("\t\t", "\t"); token2_2 = token2_2.replaceAll("\t\t", "\t"); token2_2 = token2_2.replaceAll("\t\t", "\t"); token2_2 = token2_2.replaceAll("\t\t", "\t"); token2_2 = token2_2.replaceAll("\t\t", "\t"); token3 = token2_2.split("\t"); if (token.equals("requirement")) { String name = token3[0]; int level = Integer.parseInt(token3[1]); String concat = token3[2]; String required = token3[3]; Name concat2 = null; Skills required2 = null; for (Name all : Name.values()) { if (all.name().equals(concat)) { concat2 = all; } } for (Skills all : Skills.values()) { if (all.name().equals(required)) { required2 = all; } } requirements.add(new Requirements(name, level, concat2, required2)); } } else { if (line.equals("[ENDOFREQUIREMENTS]")) { try { characterfile.close(); } catch (IOException ioexception) { ioexception.printStackTrace(); } return true; } } try { line = characterfile.readLine(); } catch (IOException ioexception1) { ioexception1.printStackTrace(); EndOfFile = true; } } try { characterfile.close(); } catch (IOException ioexception) { ioexception.printStackTrace(); } return false; } /** * @return the name */ public String getName() { return name; } /** * @param name * the name to set */ public void setName(String name) { this.name = name; } /** * @return the level */ public int getLevel() { return level; } /** * @param level * the level to set */ public void setLevel(int level) { this.level = level; } /** * @return the required */ public Skills getRequired() { for (Skills all : required) { return all; } return null; } /** * @param required2 * the required to set */ public void setRequired(Skills[] required) { this.required = required; } /** * @return the concat */ public Name getConcat() { return concat; } /** * @param concat * the concat to set */ public void setConcat(Name concat) { this.concat = concat; } }[/code] [u][b]Wherever you equip items[/b][/u] [code]if(!getRequirements().check(wearId)) { return false; }[/code] [u][b]CFG File[/b][/u] [code]// name, level, concat, skill requirement = whip 70 ENDS_WITH ATTACK requirement = Steel 5 STARTS_WITH ATTACK requirement = Black 10 STARTS_WITH ATTACK requirement = White 10 STARTS_WITH ATTACK requirement = Mithril 20 STARTS_WITH ATTACK requirement = Adamant 30 STARTS_WITH ATTACK requirement = Rune 40 STARTS_WITH ATTACK requirement = Dragon 60 STARTS_WITH ATTACK requirement = Steel 5 STARTS_WITH DEFENCE requirement = Black 10 STARTS_WITH DEFENCE requirement = White 10 STARTS_WITH DEFENCE requirement = Mithril 20 STARTS_WITH DEFENCE requirement = Adamant 30 STARTS_WITH DEFENCE requirement = Rune 40 STARTS_WITH DEFENCE requirement = Dragon 60 STARTS_WITH DEFENCE [ENDOFREQUIREMENTS][/code] Just so you can get a feel of how to do this ^^ Enjoy
  21. *fixed delete this*
  22. Was wondering how u add skill requirements on item on item. [CODE]else if (itemUsed.getId() == 8947 && usedWith.getId() == 1511){ player.getInventory().deleteItem(1511, 1); player.getInventory().addItem(960, 1); player.getSkills().addXp(22, 10); } else if (itemUsed.getId() == 8947 && usedWith.getId() == 1521){ player.getInventory().deleteItem(1521, 1); player.getInventory().addItem(8778, 1); player.getSkills().getLevelForXp(22,15) player.getSkills().addXp(22, 20); } else if (itemUsed.getId() == 8947 && usedWith.getId() == 6333){ player.getInventory().deleteItem(6333, 1); player.getInventory().addItem(8780, 1); player.getSkills().getLevelForXp(22,30) player.getSkills().addXp(22, 30); } [/CODE] Was wondering how u will add skill rquirements to the coding above like u need 15 construction to make Planks and 25 to make oak planks.
  23. hello when i try to add the woodcutting skill i got these error [CODE]src\server\model\players\ActionHandler.java:23: error: cannot find symbol c.getWoodcutting().startWoodcutting(0, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:26: error: cannot find symbol c.getWoodcutting().startWoodcutting(1, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:29: error: cannot find symbol c.getWoodcutting().startWoodcutting(2, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:32: error: cannot find symbol c.getWoodcutting().startWoodcutting(3, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:35: error: cannot find symbol c.getWoodcutting().startWoodcutting(4, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:38: error: cannot find symbol c.getWoodcutting().startWoodcutting(5, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:41: error: cannot find symbol c.getWoodcutting().startWoodcutting(6, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:44: error: cannot find symbol c.getWoodcutting().startWoodcutting(7, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:47: error: cannot find symbol c.getWoodcutting().startWoodcutting(8, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:50: error: cannot find symbol c.getWoodcutting().startWoodcutting(9, c.objectX, c.obje ctY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\ActionHandler.java:53: error: cannot find symbol c.getWoodcutting().startWoodcutting(10, c.objectX, c.obj ectY, c.clickObjectType); ^ symbol: method getWoodcutting() location: variable c of type Client src\server\model\players\skills\Woodcutting.java:82: error: cannot find symbol CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { ^ symbol: class CycleEvent location: class Woodcutting src\server\model\players\skills\Woodcutting.java:82: error: cannot find symbol CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { ^ symbol: variable CycleEventHandler location: class Woodcutting Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 13 errors[/CODE]
  24. Hey guys, first off I'd like to know if it's possible (and how) to change the name of a skill. This just means I want "Agility" to be called "Endurance" now. Is this possible, and how? I'd like it to be so that this also applies when you hover your mouse over agility in the skill tab, so it doesn't say "Agility exp: ####, Remaining: ####" etc. but rather "Endurance exp: ####" and so on, so forth. Secondly, I'm having a couple of issues with some item equips The first is "Skull sceptre." I'm unable to equip it. There's a wear option, but when I try to equip it, it just says "You can not equip that item." The next item is royal d'hide for whatever reason. I try to wear the legs, and they're quite glitchy. I then wear the top and it removes the legs and puts the top on. Any help would be much appreciated!
  25. first probelm: i am using a server and it has construction (my server) but when i go there it says "need to be in construction area first" well" theres no construction tele other than home tab "takes you directlyiin" and the estate guy... so i can construction stuff second probelm: I need a ::dice command that is something different so only people with the command with be able to type it like i don't want it just said HELp
×