Jump to content

Search the Community

Showing results for tags 'programme'.



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 5 results

  1. Okay, i'm stuggling with adding a piece of coding. I'm not amazing at coding but i need some help. Basically i want this: private int combatExp() { int amount = 0; if (c.easyMode) { amount = 5000; } else if (c.mediumMode) { amount = 500; } else if (c.hardMode) { amount = 50; } else if (c.extremeMode) { amount = 10; } return amount; } Into the code below. Basically when the player hits it checks if it is on easyMode, mediumMode, hardMode, extremeMode and then it times the xp i given it in another file. Combat Assistant.java: [CODE] /** * Adding combat XP **/ public void addCombatXP(int attackType, int damage) { // Attack type is based on the kind of damage that is being done // (Ranged, mage, melee) Chaotic.degrade(c, getAttackDelay(c.getItems().getItemName(c.formerWeapon).toLowerCase())); c.getPA().addSkillXP((int) (damage * SkillHandler.XPRates.MELEE.getXPRate() / 3)- (damage * SkillHandler.XPRates.MELEE.getXPRate() / 4), 3); switch (attackType) { case 0: // Melee switch (c.fightMode) { case 0: // Accurate c.getPA().addSkillXP( (int) (damage * SkillHandler.XPRates.MELEE.getXPRate() / 3), 0); break; case 1: // Aggressive c.getPA().addSkillXP( (int) (damage * SkillHandler.XPRates.MELEE.getXPRate() / 3), 2); break; case 2: // Block c.getPA().addSkillXP( (int) (damage * SkillHandler.XPRates.MELEE.getXPRate() / 3), 1); break; case 3: // Controlled for (int i = 0; i < 3; i++) c.getPA().addSkillXP((int) (damage * SkillHandler.XPRates.MELEE.getXPRate() / 6), i);// 1.3 break; } break; case 1: // Ranged switch (c.fightMode) { case 0: // Accurate case 1: // Rapid c.getPA().addSkillXP( (int) (damage * SkillHandler.XPRates.RANGE.getXPRate() / 4), 4); break; case 3: // Block c.getPA().addSkillXP( (int) (damage * SkillHandler.XPRates.MELEE.getXPRate() / 2), 1); c.getPA().addSkillXP( (int) (damage * SkillHandler.XPRates.RANGE.getXPRate() / 2), 4); break; } break; case 2: // Magic int magicXP = (SkillHandler.XPRates.MAGIC.getXPRate() * damage)+ c.MAGIC_SPELLS[c.oldSpellId][7]; c.getPA().addSkillXP(magicXP, 6); break;[/CODE] Any tips or sugguestions - thanks, i will literally kiss someones foot if they sort this out for me! Thanks
  2. [CODE]package org.elixrr.game.player.content.loyalty; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.Map.Entry; import org.elixrr.cache.loaders.ItemDefinitions; import org.elixrr.game.item.Item; import org.elixrr.game.player.Player; import org.elixrr.utils.Utils; /** * @author Taylor Moon * * @version Elixrr 2 | update 3 */ public class LoyaltyProgramme implements Serializable { /** * The list of loyalty items */ private static final HashMap<Integer, LoyaltyItem> ITEMS = new HashMap<Integer, LoyaltyItem>(); /** * An array of available loyalty shop categories */ public static final String[] CATEGORIES = { "auras", "emotes", "outfits", "titles", "special-offers", "limmited-edition", "recolor", "effects" }; /** * The serial UID */ private static final long serialVersionUID = -111881367666488484L; /** * The loyalty shop interface */ public static final int INTERFACE_ID = 1143; /** * The tab switch config */ public static final int TAB_CONFIG = 2226; /** * The current tab */ private int currentTab; /** * The player using the programme */ private Player player; /** * Initiates the loyalty programme */ public LoyaltyProgramme() { ITEMS.put(0, new LoyaltyItem(2000, 0, 20957, "auras")); ITEMS.put(1, new LoyaltyItem(2750, 1, 20958, "auras")); } /** * Resets the loyalty shop * * @param boughtItems * True if reset this * @param favoritedItems * True if reset this * @param pointsDisplay * True if reset this */ public void reset(boolean boughtItems, boolean favoritedItems, boolean pointsDisplay) { if (boughtItems) { for (int i = 2229; i == 2232; i++) player.getPackets().sendConfig(i, -1); } if (favoritedItems) { for (int i = 2391; i == 2394; i++) player.getPackets().sendConfig(i, -1); } if (pointsDisplay) { player.getPackets().sendIComponentText(INTERFACE_ID, 127, "" + Utils.formatTypicalInteger(player.getLoyaltyPoints())); } } /** * Opens the loyalty shop interface */ public void openShop() { player.getInterfaceManager().sendScreenInterface(INTERFACE_ID, INTERFACE_ID); player.getPackets().sendConfig(TAB_CONFIG, -1); currentTab = -1; player.getPackets().sendIComponentText(INTERFACE_ID, 127, "" + Utils.formatTypicalInteger(player.getLoyaltyPoints())); for (int i = 0; i < 500; i++) player.getPackets().sendIComponentSettings(INTERFACE_ID, i, 0, 300, 2150); } /** * Opens a tab on the loyalty interface * * @param tab * The tab to open */ public void openTab(String tab) { switch (tab.toLowerCase()) { case "home": player.getPackets().sendConfig(TAB_CONFIG, -1); currentTab = -1; break; case "auras": player.getPackets().sendConfig(TAB_CONFIG, 1); currentTab = 1; break; case "emotes": player.getPackets().sendConfig(TAB_CONFIG, 2); currentTab = 2; break; case "outfits": player.getPackets().sendConfig(TAB_CONFIG, 3); currentTab = 3; break; case "titles": player.getPackets().sendConfig(TAB_CONFIG, 4); currentTab = 4; break; case "recolor": player.getPackets().sendConfig(TAB_CONFIG, 5); currentTab = 5; break; case "special-offers": player.getPackets().sendConfig(TAB_CONFIG, 6); currentTab = 6; break; case "limmited-edition": player.getPackets().sendConfig(TAB_CONFIG, 7); currentTab = 7; break; case "favorites": player.getPackets().sendConfig(TAB_CONFIG, 8); currentTab = 8; break; case "effects": player.getPackets().sendConfig(TAB_CONFIG, 9); currentTab = 9; break; default: player.getPackets().sendGameMessage( "This tab is currently un-available" + (player.getRights() >= 2 ? ": " + "\"" + tab + "\"" : ".")); } } /** * Handles any button clicks * * @param componentId * The clicked component * @param slotId * The clicked slot * @param slotId2 * The clicked slot (2) * @param packetId * The packet ID */ public void handleButtons(int componentId, int slotId, int slotId2, int packetId) { switch (componentId) { case 103: player.getInterfaceManager().closeScreenInterface(); player.closeInterfaces(); player.getPackets().closeInterface(INTERFACE_ID); break; case 3: openTab("favorites"); break; case 1: openTab("home"); break; case 7: openTab("auras"); break; case 8: openTab("effects"); break; case 9: openTab("emotes"); break; case 10: openTab("outfits"); break; case 11: openTab("titles"); break; case 12: openTab("recolor"); break; case 13: openTab("special-offers"); break; case 66: case 67: case 68: case 69: case 70: case 71: openConfirmPurchaseInterface(slotId); break; case 59: resetOverlayBox(true); break; case 169:// Buy //buyItem(slotId, "auras"); openPurchaseResultsInterface("auras", slotId);// will use attributes. break; } } /** * Favorites an item * * @param value * The item to favorite */ public void favorite(int value) { player.getPackets().sendConfig(2391, value); } /** * Opens the comfirm purchase hidden component * * @param slotId * The slot id */ public void openConfirmPurchaseInterface(int slotId) { //final int itemId = ITEMS.get(slotId).id; final String price = Utils .formatTypicalInteger(ITEMS.get(slotId).price); String loyaltyPoints = Utils.formatTypicalInteger(player .getLoyaltyPoints()); player.getPackets().sendHideIComponent(INTERFACE_ID, 16, false); player.getPackets().sendHideIComponent(INTERFACE_ID, 56, false); player.getPackets().sendIComponentText(INTERFACE_ID, 45, "My Points: " + loyaltyPoints); player.getPackets().sendIComponentText(INTERFACE_ID, 47, "Item Cost: " + price); player.getPackets().sendIComponentText(INTERFACE_ID, 48, ""); // player.getPackets().sendItemOnIComponent(INTERFACE_ID, 48, itemId, // 1); // player.getPackets().sendItemOnIComponent(INTERFACE_ID, 49, itemId, // 1); } /** * Opens the "join loyalty programme" hidden component */ public void openJoinLoyaltyProgrammeInterface() { player.getPackets().sendHideIComponent(INTERFACE_ID, 16, false); player.getPackets().sendHideIComponent(INTERFACE_ID, 57, false); } /** * Opens the "Error occured while purchasing" hidden component */ public void openErrorOccuredInterface() { player.getPackets().sendHideIComponent(INTERFACE_ID, 16, false); player.getPackets().sendHideIComponent(INTERFACE_ID, 58, false); } /** * Opens the purchase result interface * * @param category * The item category * @param slot * The slot */ public void openPurchaseResultsInterface(String category, int slotId) { try { player.getPackets().sendHideIComponent(INTERFACE_ID, 16, false); player.getPackets().sendHideIComponent(INTERFACE_ID, 58, false); player.getPackets().sendIComponentText(INTERFACE_ID, 161, "Your purchase was successful!"); switch (category) { case "emotes": player.getPackets().sendIComponentText(INTERFACE_ID, 162, "Xuan teaches you the emote: (emoteNameHere)"); break; case "outfits": player.getPackets().sendIComponentText(INTERFACE_ID, 162, "Xuan hands you the costume you purchased."); break; case "auras": player.getPackets().sendIComponentText( INTERFACE_ID, 162, "You recieved the aura: " + ItemDefinitions.getItemDefinitions( ITEMS.get(slotId).id).getName()); break; case "titles": player.getPackets().sendIComponentText(INTERFACE_ID, 162, "You have unlocked the title: (titleNameHere)"); break; } player.getPackets().sendIComponentText(INTERFACE_ID, 162, "\n \n Click 'Ok' to return to the shop."); } catch (Exception e) { openErrorOccuredInterface(); } } /** * Resets the loyalty programme overlay component * * @param close * If the component should be closed */ public void resetOverlayBox(boolean close) { if (close) player.getPackets().sendHideIComponent(INTERFACE_ID, 16, true); player.getPackets().sendHideIComponent(INTERFACE_ID, 56, true); player.getPackets().sendHideIComponent(INTERFACE_ID, 57, true); player.getPackets().sendHideIComponent(INTERFACE_ID, 58, true); } /** * Claims an item * * @param value * The item to claim */ public void claim(int value, String category) { player.purchaseLoyaltyItem(value, category); updateInterfaceSettings(category);// 33 34 } /** * Buys a loyalty item * * @param slot * The slot being clicked on * @param category * The category for this item */ public void buyItem(int slot, String category) { for (Entry<Integer, LoyaltyItem> stock : ITEMS.entrySet()) { if (stock.getKey() != slot) continue; if (player.getLoyaltyPoints() < stock.getValue().price) { player.getPackets().sendGameMessage( "You cannot afford this loyalty item."); return; } if (category != "auras" && player.getPurchasedLoyaltyItems(category)[slot] || category == "auras" && player.getPurchasedLoyaltyAuras().contains(slot)) return; player.decreaseLoyaltyPoints(stock.getValue().price); claim(slot, category); switch (category) { case "titles": player.getAppearence().setTitle(slot); player.getAppearence().generateAppearenceData(); break; case "auras": if (!player.getInventory().addItem(stock.getValue().id, 1)) player.getBank().addItem(stock.getValue().id, 1, true); break; case "outfits": for (Item item : getOutfit(slot)) { if (!player.getInventory().addItem(item)) player.getBank().addItem(item.getId(), 1, true); } break; case "emotes": break; } } } /** * Returns an outfit corresponding to the slot id * * @param slot * The slot ID of the outfit * @return The outfit items for the slot ID */ private Item[] getOutfit(int slot) { return null; } /** * Updates the loyalty interface settings * * @param category * The category to update */ public void updateInterfaceSettings(String category) { int hash = 0; int power = 2; boolean[] items = null; if (category != "auras") items = new boolean[player.getPurchasedLoyaltyItems(category).length]; final ArrayList<Integer> auras = player.getPurchasedLoyaltyAuras(); if (category != "auras") { for (int i = 1; i < items.length; i++) { if (items[i]) { hash += power; } power *= 2; } if (items[0]) hash += 1; player.getPackets().sendConfig(2232, hash); } else { hash = 0; if (auras.contains(0)) hash += 1; player.getPackets().sendConfig(getBuyConfig(category), hash); player.getPackets().sendConfig(TAB_CONFIG, currentTab); } player.getPackets().sendIComponentText(INTERFACE_ID, 127, "" + Utils.formatTypicalInteger(player.getLoyaltyPoints())); player.getPackets().sendConfig(TAB_CONFIG, currentTab); } /** * Returns the buy config for a specific category * * @param category * The category to get the buy config for * @return The config ID */ public int getBuyConfig(String category) { return (category == "titles" ? 2232 : category == "emotes" ? 2230 : category == "outfits" ? 2231 : category == "auras" ? 2229 : -1); } /** * Sets the player * * @param player * The player to set */ public void setPlayer(Player player) { this.player = player; for (int i = 0; i < CATEGORIES.length; i++) { if (CATEGORIES[i] != "special-offers" && CATEGORIES[i] != "limmited-edition" && CATEGORIES[i] != "recolor" && CATEGORIES[i] != "effects") { updateInterfaceSettings(CATEGORIES[i]); } } } } [/CODE] [CODE]package org.elixrr.game.player.content.loyalty; /** * @author Taylor Moon * * @version Elixrr 2 | update 3 */ public class LoyaltyItem { /** The price */ public int price; /** Favorited or not */ public boolean favorited; /** Bought or not */ public boolean bought; /** Slot id */ public int slot; /** Regular ID */ public int id; /** Hash ID */ public int hash; /** Category */ public String category; /** * Constructs a new loyalty item * * @param price * The price * @param slot * The slot */ public LoyaltyItem(int price, int slot, int id, String category) { this.price = price; this.slot = slot; this.category = category; this.id = id; } } [/CODE] [B][COLOR="#FF0000"]Lacks:[/COLOR][/B] [LIST] [*]All the implemented items [*][I]Working[/I] buy config system [*]Needs buttons implemented (Methods are there, just not applied to the button handler) [*]Favoriting [/LIST]
  3. Well I'm going to tell you how to add the loyalty programme ranks and on right click also! [B]Server Sided:[/B] Go to Player.java and declare this: [CODE]public int loyaltyRank;[/CODE] now find playerProps.writeByte(combatLevel); and replace [CODE]playerProps.writeWord(0);[/CODE] with: [CODE]playerProps.writeWord(loyaltyRank);[/CODE] Now save and exit and head to PlayerSave and add these in it (YOU SHOULD KNOW WHERE): [CODE]} else if (token.equals("loyalty-rank")) { p.loyaltyRank = Integer.parseInt(token2);[/CODE] [CODE]characterfile.write("loyalty-rank = ", 0, 15); characterfile.write(Integer.toString(p.loyaltyRank), 0, Integer .toString(p.loyaltyRank).length()); characterfile.newLine();[/CODE] Finished server sided Now... [B]Client Sided:[/B] Declare this in client.java [CODE] //thanks to Nouish for getting the titles and me for programming. public final String loyaltyRank(final int i) { switch (i) { case 1: return "Lord"; case 2: return "Lady"; case 3: return "Sir"; case 4: return "Dame"; case 5: return "Duderino"; case 6: return "Dudette"; case 7: return "Lionheart"; case 8: return "Crusader"; case 9: return "Hellraiser"; case 10: return "Desperado"; case 11: return "Baron"; case 12: return "Baroness"; case 13: return "Count"; case 14: return "Countess"; case 15: return "Overlord"; case 16: return "Overlordess"; case 17: return "Bandito"; case 18: return "Duke"; case 19: return "Duchess"; case 20: return "Big Cheese"; case 21: return "Bigwig"; case 22: return "King"; case 23: return "Queen"; case 24: return "Wunderkind"; default: return ""; } }[/CODE] now in the same class find [CODE]private void buildAtPlayerMenu[/CODE] and there should be [CODE]s = player.name + " (skill-" + player.skill + ")";[/CODE] after the else and replace that with: [CODE]s = "@[email protected]" + loyaltyRank(player.skill) + "@[email protected] " + player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";[/CODE] Preview: [img]http://i52.tinypic.com/314cyfb.jpg[/img] Post errors....
  4. need a programme that help me while coding by telling me where is the error exactly cause im not good at that. just gimme a good programme name and iwill downlod it :P anyways Ty guys :)
  5. My players of my server have reported this error while they try and load the servers download client. I can get on it on my computer, don't know whats happening. Please help! :(
×