Jump to content

Search the Community

Showing results for tags 'combat'.



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

  1. hi, i'm looking for just a base 317 preferably with newer client
  2. 24/7 - Website - ECO and PVP - Highscores - Website profiles - Auto donation - Tons of custom content coded by me and only me WEBSITE PLAY NOW RemotePvP is a 667 server that prides itself on unique and solid content. Unlike most servers, RemotePvP was not created for the money: Our goal is to create a fun and immersing game for you to get lost in. RemotePvP is a fun and invigorating server with a unique combat system and economy. Despite the name we are indeed an ECO and PVP server, I will explain more about the name and its origins later. From now on I am going to break up this thread into sections so you can more easily navigate without confusion. About me - The owner and developer I would like to start off by telling everyone a little bit about myself because I think it is good to know the background of the people in-charge. My name is Brandon and I am a young adult from the United States of America. I started making (or trying to make) private servers way back in 2010 at the age of 13 and as you can probably guess they were failures. The reason these servers failed was not because I did not have good intentions but because I had no knowledge of the java language and I was still very young. I started to get bored with playing by myself so I eventually moved on and gave up. I then grew older and realized what java was and more crucially what programming was, I started making minecraft plugins using the popular minecraft server API Bukkit and that is how I taught myself how to code Java; as a result, I am fluent in the language so I came back to the game I grew up playing to give private servers one more shot. My intentions and goals for RemotePvP As I stated above, I did not create RemotePvP to fill my wallet. I made RemotePvP so that I could once more enjoy the game I grew up playing with not only myself but other people. I do however hope that one day RemotePvP will be self sustainable in a sense that the donations will cover the server costs; until then, I personally fund RemotePvP. To get back on topic, the ultimate goal of the server is to have a fun memorable experience. Content I know this is really what everyone wants to see so lets not delay it any longer. https://www.youtube.com/watch?v=Cfs_5PkNnkU Here is a list of features we have (I left aligned to make it easier to read/navigate): - Clue scrolls - In chat emojis / emoticons - Completely Custom chat - Completely Custom Combat System - Integrated ingame voice chat (no need for skype) - Website profiles | View and show off your character out of the game on the website - Imbued items - Custom raid dungeons - Custom minigames - Working dwarf multicannon - Working gold dwarf multicannon - Working royal dwarf multicannon - Fully working glacors - Team dungeoneering - No scam dicing system - Every skill is trainable - Highscores - Forums - Auto vote - Auto donation - Fully working farming - Stable economy - Multiple bosses - Multiple custom bosses - Fully working duel arena - Stable staff team - Updates daily - We add what the community wants - Fully funded by our owners - Dedicated hosting - Fully working slayer - Multiple Agility courses (with advanced courses) - Increased XP limit to 999,999,999 instead of 200,000,000 - Monster/Boss kill count available - Monster/Boss kill count highscores - Custom pk kits (log in and pk) - Co-op Slayer - Elite Staking (Custom staking system) (We still have normal staking!) - Boss Pets I will now be taking some time to explain some of the features listed above. Some of the features are a little confusing so I will do my best to explain them as simply as possible. I will also provide pictures and in the future I will provide videos. Custom Combat System This is in my opinion the most important feature. This is the root of RemotePvP, the entire server is based upon this feature and it is very confusing so please read closely. (Please note that this system only applies to some items and not all) The custom combat system revolves around the more higher tier items in RemotePvP. If you are lucky enough to receive one of these items you will notice that it uses a completely custom stat system. Each item has a rarity class and a unique set of stats assigned to that item upon creation of the item. Before we go any further I would like to give you all of the rarity classes from least rarest to rarest: common, uncommon, rare, and unique. I know most people are probably still confused so I will give an example with pictures. There is an item named "Imbued Armadyl Godsword" in RemotePvP. This item follows the system above and this is the item I will be using in the example. Jerry goes to Armadyl and is lucky enough to receive an Imbued Armadyl Godsword. Jerry examines the Imbued AGS to find it has the rarity class of uncommon. Here is a picture of Jerry's Imbued AGS and its stats: Jerry being excited about his new item calls his friend David to tell him about it. David gets jealous and decides to camp Armadyl until he also gets one of these swords. After hours of Armadyl David is rewarded with an Imbued AGS just like Jerry, the only difference is that David's Imbued AGS has the rarity class of rare. Here is a picture of David's new Imbued AGS: As you can see, David's Imbued AGS is far better than Jerry's. I hope that example helped solve any confusion. I will also provide a picture of another uncommon Imbued AGS to show you that its stats are still different from Jerry's Imbued AGS. TLDR: One Imbued AGS can be better or worse than another Imbued AGS P.S. There is a ton of items that follow this system so I will not list them all. Integrated in-game voice chat This feature is in my opinion self explanatory but I feel it is an important feature and as far as I know it is revolutionary to the RSPS community; that being said, I will touch on the subject briefly. Integrated in=game voice chat is exactly what you think it is. It is a way to talk to your friends with only the use of your voice and a microphone. This feature is completely integrated into the game so there is no need to download any third party software. The only requirement is that you have a microphone, a voice, and you are in a friends chat: once those requirements are met just hold down CTRL to let your friends hear you. Website Profiles Website profiles are very neat in a sense that you can view your character online from the website. At this moment you can only view your gear and stats (stats including boss kills and other custom tracked stats) but we have plans to include as many aspects of your character as we can. At this point in time everyone can view your character but we will soon be making it optional to be private. Imbued Items When I say imbued items I am not talking about an imbued berserker ring. I am talking about a higher tier of items that are considered "Imbued." This feature is in many ways similar to the upgradeable items in TizenX and this feature was inspired by TizenX; although, I can assure you this feature is an improved verson. I will use an Armadyl Godsword as an example. An Armadyl Godsword is an item in most private servers. When you receive an Armadyl godsword you have the option to "Imbue" it to make it stronger. The imbueing process can be done one of two different ways. The first method to imbue your items is to gain the specified number of imbued shards and use those to imbue your item, imbued shards can be obtained by killing people in the wild. The second method to imbue your items involves you bringing the unimbued version of the item to its respective boss while killing that boss. If you have the unimbued version of an item when you kill that items respective boss there is a small chance that the boss will imbue your item. No scam dicing system RemotePvP offers a no-scam gambling system to protect your items as a gambler. This means that there is no way for you to get scammed while dicing if you choose to use the system. Here is how it works: once you find a dice host you right click on them and choose the option "Dice." The host will do the same back to you and then an interface will open allowing you both to put up your items. Once you both accept the dice is locked in, you then move to a second interface where the dice are rolled. Once the dice are finished rolling the game determines who won and awards that person the items. I would like to point out that the traditional gambling methods are still available but these of course run you the risk of being scammed. Emojis / Emoticons Emoticons are just a small feature I added to help add emotion to the game. To type these emoticons just type a face and it will automatically be replaced with an emoticon. ;) Elite Staking Elite staking is the last feature that I will be explaining. Elite staking is a variant of staking that allows players to stake their items in a fight that is more based upon skill and not luck or RNG. The elite staking system is not too complicated so I hope no one gets confused. The elite staking system requires both people to stake ALL of their items on their person: this means, neither person may take any gear into the stake to use. This stake is not a box as you might think, the server supplies both people with a matching set of random gear to use during the fight. Both players get the same gear and the same inventory. I would like to mention that all other aspects of elite staking are the same as a normal stake and all the rules of a normal stake may be applied to the elite stake. Thank you for reading I have spent a lot of time making this server the best I can and I will continue to make new content as RemotePvP's community grows. I hope you decide to give RemotePvP a shot. Here are some other random images of other features or just of the server itself. Here is a gif of my version of the rainbow partyhat. Sorry for the bad quality. WEBSITE PLAY NOW
  3. This is really a design show-off since it doesn't have many features but it is the most flexible combat design i have seen yet. [I]Note: Due to deadlines this system wont be fully implemented upon beta release. After beta I'll get it up to par and implement it wide scale.[/I] Files: [IMG]http://oi57.tinypic.com/20qkrhl.jpg[/IMG] As you can tell the [I]locks[/I] package closely resembles the [I]java.util.concurrent.locks[/I] package. The main difference between the two is that the combat locks do not produce a concurrent lock on the mobile entity, they produce an in-game "busy" lock. The provided [I]CombatLock[/I] currently supports the following actions: [CODE] [I]lock(Boolean)[/I] [I]tryLock()[/I] [I]unlock()[/I] [I]getHoldCount()[/I] [I]isLocked()[/I] [I]getOwner() (<- net.ar.world.mob.Mob)[/I] [I]getAttackers()[/I][/CODE] Unimplemented: [CODE][I]newCombatCondition()[/I] [I]hasWaitingAttackers(CombatCondition)[/I] [I]getWaitQueueLength(CombatCondition)[/I] [I]EntityList<Mob> getWaitingAttackers(CombatCondition)[/I][/CODE] Each [I]Mob[/I] has an [I]AttackBuilder[/I] assigned to them by default however you can optionally create new attack builder instances if need be. One of the several measures of flexibility this provides is that you can build an attack with an [B]anonymous attacker[/B]! The reason this would be useful is for quests like Dragon Slayer where the deck hand needs to die without actually being attacked by a registered mobile entity. You could also use a system like this to create custom features like dealing one damage when you walk over a fire on the ground, or whatever else when really nothing attacked you, it was a landscape based attack. Here is an example of configuring an anonymous attack: [CODE]Mob self = ... AttackBuilder bldr = new AttackBuilder(null).setVictim(self); Attack attack = bldr.setAttackStrategy(MeleeAttackStrategy.getInstance()).setPoisonPotential(70).build(); ...[/CODE] Here is an example of an attack on another player: [CODE]Mob victim = ... Attack attack = attacker.getAttackBuilder().setVictim(victim).setAttackStrategy(RangedAttackStrategy.getInstance()).build(); ...[/CODE] By design the [I]AttackBuilder[/I] is the only link between a [I]Mob[/I] and the combat system making this flexible, compact, and conventionally correct because we are not using every class in the combat system in a thousand unnecessary places and referencing everything in a static context like most combat systems do. As you can tell I have provided methods for manually configuring pieces of the combat formula because for things like anonymous attacks we cannot grab a poison chance from a configuration file or whatever and use it like we can for mob vs mob combat. Unfortunately as stated above this system wont be able to be implemented until after the beta release since it will take some time to perfect the system. [HR][/HR] [SIZE=3]Q&A:[/SIZE] [QUOTE]How do the locks effect Npc combat with multi, and non-multi combat Npcs?[/QUOTE] A [I]CombatLock[/I] is produced by the attacker every time the combat sequence is initiated no matter what. These locks can be configured to restrict mobs to 1v1 combat or 1vMany combat and are also useful if the victim can be attacked by multiple mobs but the attacker cannot or vice versa. The combat locks can also be used internally to grab damage statistics such as which mob has done the most damage to the npc and have the npc switch its primary target accordingly (would be a nice feature for bossing), as well as an assortment of other things that would normally be dealt with in a bulky unprofessional fashion (methods in Player, Npc, and Mob classes). [HR][/HR] [B][FONT=Comic Sans MS]Please subscribe to this thread because it will be updated as the combat system moves through development.[/FONT][/B] Thank you for your continued support! -IYAOYAS
  4. [SIZE=3][FONT=tahoma]This is pure simple and basic. I think it could be useful to some people. I think this is more of a tutorial but I'll go with it being a snippet since its short. Allows you to reset your combat level, combat and skilling stats instead of having it look like: [CODE] player.getSkills().set(Skills.ATTACK, 1); player.getSkills().setXp(Skills.ATTACK, Skills.getXPForLevel(1)); player.getSkills().set(Skills.STRENGTH, 1); player.getSkills().setXp(Skills.STRENGTH, Skills.getXPForLevel(1)); player.getSkills().set(Skills.DEFENCE, 1); player.getSkills().setXp(Skills.DEFENCE, Skills.getXPForLevel(1)); player.getSkills().set(Skills.RANGE, 1); player.getSkills().setXp(Skills.RANGE, Skills.getXPForLevel(1)); player.getSkills().set(Skills.PRAYER, 1); player.getSkills().setXp(Skills.PRAYER, Skills.getXPForLevel(1)); player.getSkills().set(Skills.MAGIC, 1); player.getSkills().setXp(Skills.MAGIC, Skills.getXPForLevel(1)); player.getSkills().set(Skills.HITPOINTS, 10); player.getSkills().setXp(Skills.HITPOINTS, Skills.getXPForLevel(10)); [/CODE] You can have it look like: [CODE] player.getSkills().resetCombatStats(); player.getSkills().resetSkillStats(); player.getSkills().resetCombatLevel(); [/CODE] [U][B]But lets start. Open up Skills.java and replace your getCombatLevel() int with this one: [/B][/U] [CODE] public int getCombatLevel() { int attack = getLevelForXp(0); int defence = getLevelForXp(1); int strength = getLevelForXp(2); int hp = getLevelForXp(3); int prayer = getLevelForXp(5); int ranged = getLevelForXp(4); int magic = getLevelForXp(6); combatLevel = (int) ((defence + hp + Math.floor(prayer / 2)) * 0.25) + 1; double melee = (attack + strength) * 0.325; double ranger = Math.floor(ranged * 1.5) * 0.325; double mage = Math.floor(magic * 1.5) * 0.325; if (melee >= ranger && melee >= mage) { combatLevel += melee; } else if (ranger >= melee && ranger >= mage) { combatLevel += ranger; } else if (mage >= melee && mage >= ranger) { combatLevel += mage; } int summoning = getLevelForXp(Skills.SUMMONING); summoning /= 8; return combatLevel + summoning; } [/CODE] Add this somewhere: [CODE] public int combatLevel = 3; [/CODE] Then add these voids to the same class: [CODE] /** * Resets combat level. * @[B][URL="http://www.runelocus.com/forums/member.php?u=75098"]Para[/URL][/B]m */ public void resetCombatLevel() { combatLevel = 3; player.getAppearence().generateAppearenceData(); } /** * Resets all combat stats. */ public void resetCombatStats() { player.getSkills().set(Skills.ATTACK, 1); player.getSkills().setXp(Skills.ATTACK, Skills.getXPForLevel(1)); player.getSkills().set(Skills.STRENGTH, 1); player.getSkills().setXp(Skills.STRENGTH, Skills.getXPForLevel(1)); player.getSkills().set(Skills.DEFENCE, 1); player.getSkills().setXp(Skills.DEFENCE, Skills.getXPForLevel(1)); player.getSkills().set(Skills.RANGE, 1); player.getSkills().setXp(Skills.RANGE, Skills.getXPForLevel(1)); player.getSkills().set(Skills.PRAYER, 1); player.getSkills().setXp(Skills.PRAYER, Skills.getXPForLevel(1)); player.getSkills().set(Skills.MAGIC, 1); player.getSkills().setXp(Skills.MAGIC, Skills.getXPForLevel(1)); player.getSkills().set(Skills.HITPOINTS, 10); player.getSkills().setXp(Skills.HITPOINTS, Skills.getXPForLevel(10)); player.getAppearence().generateAppearenceData(); } /** * Resets all skill stats. */ public void resetSkillStats() { player.getSkills().set(Skills.SLAYER, 1); player.getSkills().setXp(Skills.SLAYER, Skills.getXPForLevel(1)); player.getSkills().set(Skills.AGILITY, 1); player.getSkills().setXp(Skills.AGILITY, Skills.getXPForLevel(1)); player.getSkills().set(Skills.WOODCUTTING, 1); player.getSkills().setXp(Skills.WOODCUTTING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.THIEVING, 1); player.getSkills().setXp(Skills.THIEVING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.FARMING, 1); player.getSkills().setXp(Skills.FARMING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.SUMMONING, 1); player.getSkills().setXp(Skills.SUMMONING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.DUNGEONEERING, 1); player.getSkills().setXp(Skills.DUNGEONEERING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.MINING, 1); player.getSkills().setXp(Skills.MINING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.SMITHING, 1); player.getSkills().setXp(Skills.SMITHING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.COOKING, 1); player.getSkills().setXp(Skills.COOKING, Skills.getXPForLevel(1)); player.getSkills().set(Skills.HERBLORE, 1); player.getSkills().setXp(Skills.HERBLORE, Skills.getXPForLevel(1)); player.getSkills().set(Skills.FIREMAKING, 1); player.getSkills().setXp(Skills.FIREMAKING, Skills.getXPForLevel(1)); player.getAppearence().generateAppearenceData(); } [/CODE] How to use? Add this to whatever and it will reset everything. [CODE] player.getSkills().resetCombatStats(); player.getSkills().resetSkillStats(); player.getSkills().resetCombatLevel(); [/CODE][/FONT][/SIZE]
  5. Hey RuneLocus! I'm a new programmer to RSPS's, and I've got a little question. I downloaded a blank source (pi), because everyone says it's the best for beginners. By now, I came to the point of adding skills, the first thing I want to do, is just add combat skills, but I don't have any idea how I would do this. I've been searching over the internet for tutorials, but I couldn't find those. So my question is: How would I start of making (combat) skills for my server. Thank you very much.
  6. DirtyBubble

    combat system

    The source i'm using has some messed up combat. when u click to train att, it trains def, def trains str, str trains att. how would i go about fixing that? or can someone give me a decent combat system? i'm using a blank pi.
  7. I'm sorry if this type of thing has been posted elsewhere, but i couldn't find anything anywhere, maybe i wasn't looking hard enough, anyways. Upon loading up the server, logging in, i tested the combat system and realized that the ranged combat style tends to be close range only (just like melee) and for melee, it seems like if i turn my attack style to attack or strength xp, it acts like a whip giving xp to all 3 skills. I'm newer to java coding and definitely new to 718's coding. So if you keep help me out the best you can, that would be great. I'll do my best to understand what you tell me to do, but I'm sorry if i don't get it right away.
  8. My combat assistant: [url]http://pastebin.com/kuWJwAjU[/url] [SIZE=5]THIS IS V2 IM JUST USING OLD VIDS OF MINE TO SHOW V1 AND COMPARE TO V2[/SIZE] Features Include: No More Non-Stop 0's. Enriched Calculations Including Max hit, Defense, Block, Attack, Mage, Range Calculations To The Nearest Degree. Tested On Runescape to get these degree's!! Dharoks Not Over-Powered. Most Weapon Effects. Specific Gear Bonuses Projectiles Improved Weapon Speeds Are Corrected MUCH MUCH MORE Enjoy Sloppy. Although very very good :) [video=youtube;c0kCEZHjO8Q]http://www.youtube.com/watch?v=c0kCEZHjO8Q[/video] [video=youtube;n_9KOWD6WF8]http://www.youtube.com/watch?v=n_9KOWD6WF8&feature=related[/video] [video=youtube;yLXKT-uQRxE]http://www.youtube.com/watch?v=yLXKT-uQRxE&feature=related[/video] [video=youtube;6aC31OsCcek]http://www.youtube.com/watch?v=6aC31OsCcek[/video] [video=youtube;dGNtxXLkFO0]http://www.youtube.com/watch?v=dGNtxXLkFO0&feature=related[/video] [video=youtube;0PMn9rRzapU]http://www.youtube.com/watch?v=0PMn9rRzapU[/video] [video=youtube;if2m6aomlGI]http://www.youtube.com/watch?v=if2m6aomlGI[/video] [video=youtube;OYw3TKhm7no]http://www.youtube.com/watch?v=OYw3TKhm7no[/video] [video=youtube;heWO3iSWFoE]http://www.youtube.com/watch?v=heWO3iSWFoE[/video] [video=youtube;0rY7NruXWm0]http://www.youtube.com/watch?v=0rY7NruXWm0[/video]
  9. hello, i am try to make a good server but i found a problem and dont know whare to look, this i found out, combat vs monsters = perfect pvp combat = isn't good i have a chaotic crossbow and it works fine on monsters but when i try to attack my frend in wildy it says "you can't use *** bolts, doesn't matter what bolts i use. also the special attack giving problems in pvp, when attacking monster with spec= 100% good but when attacking another player it does spec +normal hit if someone can tell me what file i need to have and perhaps an idea how to fix shall be nice :D "thanks" for who helps me out :D
  10. i did fix this before. but was a long while ago. i do remember it was something to do with these in combatmovement.java. [CODE] int maximumDistance = type.getDistance(); if ((type == CombatType.MELEE || type == CombatType.DEFAULT) && canMelee(mob, other)) { if (diagonal(mob.getLocation(), other.getLocation())) { mob.requestClippedWalk(other.getLocation().getX(), mob.getLocation().getY()); return true; } if (mob.size() > 1 || other.size() > 1 || checkWall(mob, other)) { return true; } } else { if (type == CombatType.RANGE && mob.isPlayer() && mob.getPlayer().getSettings().getCombatStyle() == WeaponInterface.STYLE_LONG_RANGE) { maximumDistance += 2; } if (distance > 0 && distance <= maximumDistance) { mob.getWalkingQueue().reset(); return canSendProjectile(mob, other); } } if (mob.isPlayer()) { if (other.getWalkingQueue().getLastLocation() != null) { Location victimLocation = getNearest(mob, other)[1]; int followX = victimLocation.getX(); int followY = victimLocation.getY(); World.getWorld().doPath(new DefaultPathFinder(), mob, followX, followY); }[/CODE] can anyone jog my memory? im abit rusty :P
  11. I'm having several problems. First of all my Magic only gives 1-10 xp as I mentioned before. Second of all my Squeal of Fortune is an issue. It puts the wrong items you win in your bank. For example if you win Bandos Chestplate, it will put a Iron ore sometimes. Squeal.java: [code]package com.rs.game.player.content; import java.util.concurrent.TimeUnit; import com.rs.Settings; import com.rs.cores.CoresManager; import com.rs.game.item.Item; import com.rs.game.item.ItemsContainer; import com.rs.game.player.Player; import com.rs.utils.Logger; import com.rs.utils.Utils; public class Squeal { public static void openWindow(Player player) { if (player.getRights() >= 2) { if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis()) { player.getPackets() .sendGameMessage( "You cannot open Squeal of Fortune while in combat."); return; } if (player.getInterfaceManager().containsScreenInter()) { player.getPackets() .sendGameMessage( "Please finish what you're doing before opening Squeal of Fortune."); return; } player.isSpining = false; player.stopAll(); player.getPackets().sendRunScript(5879); player.getPackets().sendConfigByFile(11155, 3); player.getPackets().sendWindowsPane(1253, 0); sendItems(player); refresh(player); } else { player.sm("Not available."); } } public static void sendTicket(Player player) { player.sm("Congratulations! You have earned a spin on the Squeal of Fortune!"); player.squealSpins += 1; refresh(player); //TODO find config for this. } public static void sendRandomTicket(Player player, int chance) { if(Utils.random(chance) == 1) { if(player.squealSpins > 10) { player.sm("You must have no more than 10 spins to be eligible to recieve random activity spins."); return; } player.sm("Congratulations! You've earned a ticket for a free spin on the Squeal of Fortune!"); if(!player.getInventory().hasFreeSlots()) { player.squealSpins += 1; refresh(player); player.sm("Your inventory was full, so your spin ticket was automatically redeemed into spins.", true); } else player.getInventory().addItem(24154, 1); } } public static void sendButton(Player player) { if (player.getRights() >= 2) { if (player.squealSpins >= 1) { player.getInterfaceManager().sendOverlay(1252, true); refresh(player); } else { player.getInterfaceManager().closeOverlay(true); refresh(player); } } } public static void closeButton(Player player) { player.getInterfaceManager().closeOverlay(true); player.sm("You can access the Squeal of Fortune from the side panel, and you can show the button again by logging out and back in."); } public static void close(Player player) { player.getPackets().sendWindowsPane( player.getInterfaceManager().hasRezizableScreen() ? 746 : 548, 0); Squeal.sendButton(player); } public static void decreaseSpins(Player player) { player.squealSpins -= 1; refresh(player); } public static void increaseSpins(Player player, int i) { player.squealSpins += i; refresh(player); } public static void refresh(Player player) { player.getPackets().sendConfigByFile(11026, player.squealSpins + 1); } public static void sendDailySpins(Player player) { if (player.squealSpins >= 2) { //int hours = (int) ((player.getSqueal() / (1000*60*60)) % 24); if (player.getSqueal() < Utils.currentTimeMillis()) { player.setSqueal(Utils.currentTimeMillis() + (24 * 60 * 60 * 1000)); player.squealSpins += 2; refresh(player); player.sm("You have received your daily spins for Squeal of Fortune!", true); /*} else { player.sm("You will receive your daily spins for Squeal of Fortune in "+hours * 2+" hours.", true);TODO }*/ } } } public static void buySpins(final Player player) { close(player); sendDelayedLogout(player); } public static void spin(Player player) { if(player.squealSpins < 1) { close(player); player.getPackets().sendGameMessage("You do not have enough spins to continue."); return; } else { if(player.isSpining == true) return; player.isSpining = true; decreaseSpins(player); int reward = Utils.random(1, 1000); int slot = 0; int slotchange = Utils.getRandom(6); if (reward >= 1 && reward <= 920) { if (slotchange == 1) { slot = 1; } else if (slotchange == 2) { slot = 3; } else if (slotchange == 3) { slot = 5; } else if (slotchange == 4) { slot = 7; } else if (slotchange == 5) { slot = 10; } else if (slotchange == 6) { slot = 12; } } else if (reward >= 921 && reward <= 987) { if (slotchange >= 5) { slot = 6; } else if (slotchange <= 2) { slot = 9; } else if (slotchange >= 3 && slotchange < 5) { slot = 11; } } else if (reward >= 988 && reward <= 997) { if (slotchange >= 5) { slot = 0; } else if (slotchange <= 2) { slot = 4; } else if (slotchange >= 3 && slotchange < 5) { slot = 8; } } else if (reward >= 998) { slot = 2; } //Logger.log("Squeal", player.getDisplayName()+" has used a spin. Spins remaining: "+player.squealSpins); player.getPackets().sendConfigByFile(10860, slot); // Squeal Reward player.getPackets().sendGlobalConfig(1781, 0); player.getPackets().sendGlobalConfig(1781, 0); player.getPackets().sendGlobalConfig(1781, Utils.getRandom(13)); player.getPackets().sendConfigByFile(10860, itemWon); player.getPackets().sendGlobalConfig(1790, 1); player.getPackets().sendConfigByFile(10861, itemWon); itemWon = slotchange; } } public static void claimItem(Player player) { int amount = getBox().getAmount(); int id = getBox().getId(); player.isSpining = false; if (id == 995) { player.getMoneyPouch().addMoney(amount, amount, true, true); close(player); } else { player.getBank().addItem(id, amount, true); close(player); player.getPackets().sendGameMessage( ""+amount+" " + getBox().getName() +(amount == 1 ? " " : "s ")+(amount == 1 ? "has" : "have")+" been added to your bank."); } } public static void discardItem(Player player) { player.sm("You discard your prize."); close(player); } public static void sendDelayedLogout(final Player player) { int LOGOUT_ALERT = 1254; int LOGGING_OUT = 1255; [MENTION=19271]supp[/MENTION]ressWarnings("unused") int LOGOUT_REQUEST = 1256; if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis()) { player.getInterfaceManager().sendInterface(LOGOUT_ALERT); return; } player.getInterfaceManager().sendInterface(LOGGING_OUT); CoresManager.slowExecutor.schedule(new Runnable() { [MENTION=15855]Over[/MENTION]ride public void run() { player.getPackets().sendOpenURL(Settings.PAYMENTS_LINK); player.forceLogout(); } }, 5, TimeUnit.SECONDS); } public static void sendItems(Player player) { items.clear(); items.add(getRare(1)); // Rare items.add(getCommon(1)); // Common items.add(getSRare()); // Super-Rare items.add(getCommon(2)); // Common items.add(getRare(2)); // Rare items.add(getCommon(3)); // Common items.add(getUnCommon(1)); // UnCommon items.add(getCommon(4)); // Common items.add(getRare(3)); // Rare items.add(getUnCommon(2)); // UnCommon items.add(getCommon(5)); // Com items.add(getUnCommon(3)); // UnCom items.add(getCommon(6)); // Common player.getPackets().sendItems(665, false, items); } public static Item getBox() { Item[] box = items.getItems(); return box[itemWon]; } private static int itemWon; static ItemsContainer<Item> items = new ItemsContainer<Item>(13, true); private static Item[] SUPER_RARE_ITEM = { new Item(995, 200000000), new Item(995, 10000000), new Item(989, 5), new Item(24440, 1), new Item(23716, 1), new Item(23671, 1), new Item(23674) }; private static Item[] RARE_SLOT1 = { new Item(23715), new Item(23679), new Item(23680), new Item(23681), new Item(23682), new Item(23683), new Item(23690) }, RARE_SLOT2 = { new Item(23684), new Item(23685), new Item(23686), new Item(23687), new Item(23688), new Item(23689) }, RARE_SLOT3 = { new Item(23691), new Item(23692), new Item(23693), new Item(23694), new Item(23695), new Item(23696), new Item(23697), new Item(23698), new Item(23699), new Item(23700) }; private static Item[] UNCOMMON_SLOT1 = { new Item(9181), new Item(9183), new Item(857) }, UNCOMMON_SLOT2 = { new Item(1119), new Item(1121), new Item(1123), new Item(1127) }, UNCOMMON_SLOT3 = { new Item(12976), new Item(1133), new Item(23714) }; private static Item[] COMMON_SLOT1 = { new Item(23713), new Item(9177), new Item(9179), new Item(9174) }, COMMON_SLOT2 = { new Item(2, 30), new Item(886, 300) }, COMMON_SLOT3 = { new Item(1515, 15), new Item(444, 20) }, COMMON_SLOT4 = { new Item(563, 40), new Item(843), new Item(1325), new Item(1313), new Item(1361) }, COMMON_SLOT5 = { new Item(1367), new Item(1297), new Item(1327), new Item(1205) }, COMMON_SLOT6 = { new Item(853), new Item(1311), new Item(1365), new Item(1353), new Item(1295), new Item(1325) }; public static Item getSRare() { return SUPER_RARE_ITEM[(int) (Math.random() * SUPER_RARE_ITEM.length)]; } public static Item getRare(int slot) { if (slot == 2) { return RARE_SLOT2[(int) (Math.random() * RARE_SLOT2.length)]; } else if (slot == 3) { return RARE_SLOT3[(int) (Math.random() * RARE_SLOT3.length)]; } else { //System.out.println("" //+ RARE_SLOT1[(int) (Math.random() * RARE_SLOT1.length)]); return RARE_SLOT1[(int) (Math.random() * RARE_SLOT1.length)]; } } public static Item getCommon(int slot) { if (slot == 2) { return COMMON_SLOT1[(int) (Math.random() * COMMON_SLOT1.length)]; } else if (slot == 3) { return COMMON_SLOT2[(int) (Math.random() * COMMON_SLOT2.length)]; } else if (slot == 4) { return COMMON_SLOT3[(int) (Math.random() * COMMON_SLOT3.length)]; } else if (slot == 5) { return COMMON_SLOT4[(int) (Math.random() * COMMON_SLOT4.length)]; } else if (slot == 6) { return COMMON_SLOT5[(int) (Math.random() * COMMON_SLOT5.length)]; } else { return COMMON_SLOT6[(int) (Math.random() * COMMON_SLOT6.length)]; } } public static Item getUnCommon(int slot) { if (slot == 2) { return UNCOMMON_SLOT1[(int) (Math.random() * UNCOMMON_SLOT1.length)]; } else if (slot == 3) { return UNCOMMON_SLOT2[(int) (Math.random() * UNCOMMON_SLOT2.length)]; } else { return UNCOMMON_SLOT3[(int) (Math.random() * UNCOMMON_SLOT3.length)]; } } }[/code] The last problem I have is every weapon says "kick, punch, and block" instead of the proper attacks. All I ask is someone to help please.
  12. I create new accounts on my server and my combat level is 0 + 3, if i get maxed stats, my combat level would be 0 + 138. My combat level stays at 0, does anyone know how to fix?
  13. hello i dont know whats the problem.... when i use mage or range the combat icon will always be melee. i need help with this ASAP Thank you
  14. [CENTER][SIZE=7]Calculating Player vs Player Combat Accuracy[/SIZE][/CENTER] When calculating PVP combat accuracy there are 3 major steps: [LIST] [*]Effective Attack & Effective Defence Calculation [*]Augmented Attack & Augmented Defence Calculation [*]Hit & Block Chance Calculation [/LIST] [CODE] Variable key: off - denotes 'offensive', this prefix implies variable belongs to offensive entity. def - denotes 'defensive', this prefix implies variable belongs to defensive entity.[/CODE] [SIZE=5]Effective Attack[/SIZE] Effective Attack is a base stat level with invisible level modifiers applied (level modifiers that are not displayed via ui). This value is calculated as off_current_*_level with the following modifiers applied depending on combat type: [LIST] [*]Melee combat: [LIST] [*][*]off_attack_prayer_bonus [*][*]off_additional_bonus [*][*]off_stance_bonus [*][*]off_weapon_bonus [/LIST] [/LIST] [LIST] [*]Ranged combat: [LIST] [*][*]off_ranged_prayer_bonus [*][*]off_additional_bonus [*][*]off_stance_bonus [*][*]off_weapon_bonus [/LIST] [/LIST] [LIST] [*]Magic combat: [LIST] [*][*]off_magic_prayer_bonus [*][*]off_additional_bonus [*][*]off_spell_bonus [/LIST] [/LIST] This value is then rounded down. Effective Attack is the offensive entities "effective attack level" after base stat modifiers have been applied. A base stat modifier is a bonus that directly modifies entity (attack, ranged, magic) levels. These modifiers include bonuses from prayers, bonuses granted by special equipment(Black Mask, Salve Amulet, Dragon Slayer Gloves, etc), bonuses granted by equipment/spell mastery and bonuses granted by chosen attack stance(Accurate, Defensive and so on..). Below you will find documentation for each of the above variables. [CODE]Name: off_base_*_level Type: Base value Description: Base stat level pre any modifiers. This value can be calculated using entity current xp. Max value: 99 Examples: 80/99 = 99 base level 116/95 = 95 base level[/CODE] [CODE]Name: off_current_*_level Type: Base value Description: Base stat level post visible stat modifiers. Examples: 80/99 = 80 current level 116/95 = 116 current level[/CODE] [CODE]Name: off_*_prayer_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on chosen prayer(s), relevent to current calculation. This bonus is granted for both physical and magic attacks. Default value: 1.0 Melee prayer offence: Clarity of Thought - 1.05 (5%) Improved Reflexes - 1.10 (10%) Incredible Reflexes - 1.15 (15%) Chivalry - 1.15 (15%) Piety - 1.20 (20%) Ranged prayer offence: Sharp Eye - 1.05 (5%) Hawk Eye - 1.10 (10%) Eagle Eye - 1.15 (15%) Rigour - 1.20 (20%) Magic prayer offence: Mystic Will - 1.05 (5%) Mystic Lore - 1.10 (10%) Mystic Might - 1.15 (15%) Augury - 1.20 (20$)[/CODE] [CODE]Name: off_additional_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on worn equipment, relevent to current calculation. This bonus is granted for both physical and magic attacks. This bonus is only granted to the offensive entity. In the case that more than one of these conditions is met, modifiers are added together before being applied. Default value: 1.0 Versus general slayer task: Melee: Black Mask - 1.125 (12.5%) Slayer Helmet - 1.125 (12.5%) Full Slayer Helmet - 1.125 (12.5%) Ranged: Focus Sight - 1.125 (12.5%) Slayer Helmet - 1.125 (12.5%) Full Slayer Helmet - 1.125 (12.5%) Magic: Hexcrest - 1.125 (12.5%) Slayer Helmet - 1.125 (12.5%) Full Slayer Helmet - 1.125 (12.5%) Versus dragon slayer task: Melee: Dragon Slayer Gloves - 1.10 (10%) Versus undead: Melee & Magic & Ranged: Salve Amulet - 1.15 (15%) Salve Amulet (e) - 1.20 (20%) Examples: Items: Salve Amulet, Black Mask Versus: Undead, Slayer Task Modifier: 1.275 (27.5%) Items: Full Slayer Helmet, Dragon Slayer Gloves Versus: Dragon, Slayer Task Modifier: 1.225 (22.5%)[/CODE] [CODE]Name: off_stance_bonus Type: Additive Bonus Description: Additive stat level modifier depending on chosen combat stance, relevent to current calculation. This bonus is only granted for physical attacks (melee and ranged). Melee weapon offence: Accurate - 3 level(s) Aggressive - 0 level(s) Controlled - 1 level(s) Defensive - 0 level(s) Ranged weapon offence: Accurate - 3 level(s) Rapid - 0 level(s) Long Ranged - 0 level(s)[/CODE] [CODE]Name: off_spell_bonus Type: Additive Bonus Description: Additive stat level modifier depending on 'experience' using a spell. "When you cast combat-related spells, there is a chance of failure. This is dependent on a few factors such as your magical attack bonuses, the magical Defence bonuses of your opponent and your Magic experience." This bonus is calculated as .3 bonus level(s) per level above spell requirement. This modifier uses BASE level, not CURRENT level. (ie. 112/99 = 99 base level) Examples: Current Magic Level: 99 Spell: Ice Blitz (Level 82) Effective Magic Level: 104 Current Magic Level: 99 Spell: Fire Blast (Level 59) Effective Magic Level: 111[/CODE] [CODE]Name: off_weapon_bonus Type: Additive Bonus Description: Additive stat level modifier depending on 'experience' using a weapon. This is an experimental stat modifier based on the logic provided in the *_spell_bonus documentation. This addition is justified by the observation that "dragon" weapons appear to be more accurate than their higher level counterparts at the exchange of worse equipment stats when used by high level characters. This is an important balance point as part of the Runescape accuracy algorithm. This modifier provides a benefit to the attack stat level beyond weapon equip requirements, and an important trade off for those who choose to level their attack stat level further versus those who do not. In addition low tier weaponry in currently utilised versions of the algorithm become completely obsolete and outclassed by high tier defence equipment giving the outcome of seemingly "overpowered" defence. High level characters utilising high tier defence equipment against eachother will find lower tier weaponry a more viable choice, and will find it much more powerful against low tier armour. These characters will also be granted a benefit versus characters with an inferior attack stat level. This bonus is calculated as .3 bonus level(s) per level above weapon requirement. This modifier uses BASE level, not CURRENT level. (ie. 112/99 = 99 base level) Examples: Current Attack Level: 99 Weapon: Dragon Dagger (Level 60) Effective Attack Level: 110 Current Attack Level: 99 Weapon Abyssal Whip (Level 70) Effective Attack Level: 107 Current Attack Level: 84 Weapon Abyssal Whip (Level 70) Effective Attack Level: 88[/CODE] Using the above modifiers Effective Attack is calculated as: [CODE]String off_combat_type = "melee"; //melee, ranged, magic switch(off_combat_type) { case "melee": effective_attack = Math.floor(((off_current_attack_level * off_attack_prayer_bonus) * off_additional_bonus) + off_stance_bonus + off_weapon_bonus); break; case "ranged": effective_attack = Math.floor(((off_current_ranged_level * off_ranged_prayer_bonus) * off_additional_bonus) + off_stance_bonus + off_weapon_bonus); break; case "magic": effective_attack = Math.floor(((off_current_magic_level * off_magic_prayer_bonus) * off_additional_bonus) + off_spell_bonus); break; }[/CODE] [SIZE=5]Effective Defence[/SIZE] Effective Defence is a base stat level with invisible level modifiers applied (level modifiers that are not displayed via ui). For Melee and Ranged combat this value is calculated as off_current_defence_level with the following modifiers applied: [LIST] [*]def_defence_prayer_bonus [*]def_defence_stance_bonus [/LIST] For Magic combat there is a special case, this value is calculated using a combination of two values: [LIST] [*]effective_defence [*]effective_magic [/LIST] [QUOTE]For Magic combat def_current_defence_level has the following modifiers applied: [LIST] [*]def_defence_prayer_bonus [/LIST] These values are then multiplied by .3 and .7 respectively. Composing the final whole value using these two values combined. Magic defence is a special case as defence level and stat modifiers should only play a small part in the final value used to calculate magic defence. In currently utilised versions of the algorithm it is common for magic attacks to miss(or "splash") a lot because melee defence levels and modifiers are used for the calculation of defence against magic spells but this is not their intended use. Rather, they are intended for defence against melee and ranged attacks. It is worth noting the incredibly high effective_attack and effective_defence levels when using melee & ranged attacks in comparison to the pitiful effective_attack of magic attacks. These melee/ranged defence steroids were not intended as defence against magic, and the effective_attack of magic spells simply can not compare. This implementation of magic defence creates the desired effect of magic hitting often versus characters with great melee and ranged defences (melee equipment) in addition to current magic level playing a much greater role in defence against magic attacks as intended. Characters are required to raise their magic level as defence against magic attacks.[/QUOTE] This value is rounded down. Effective Defence is the defensive entities "effective defence level" after base stat modifiers have been applied. A base stat modifier is a bonus that directly modifies entity (Defence, Magic) levels. These modifiers include bonuses from prayers and bonuses granted by chosen attack stance(Accurate, Defensive and so on..). Below you will find documentation for each of the above variables. [CODE]Name: effective_magic Type: Base Value Description: Additive stat level modifier depending on defending entity magic level. Magic defence is calculated as 3 shares physical defence (or effective_defence) and 7 shares magic defence (or effective_magic). In other words, this value makes up 70% of defence against magic spells. With the other 30% coming from effective_defence. This value is def_current_magic_level multiplied by .7, or 70%. This value is rounded down.[/CODE] [CODE]Name: def_current_defence_level Type: Base value Description: Base stat level post visible stat modifiers. Examples: 80/99 = 80 current level 116/95 = 116 current level[/CODE] [CODE]Name: def_defence_prayer_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on chosen prayer(s), relevent to current calculation. This bonus is granted for both physical and magic attacks. Default value: 1.0 General prayer defence: Thick Skin - 1.05 (5%) Rock Skin - 1.10 (10%) Steel Skin - 1.15 (15%) Chivalry - 1.20 (20%) Piety - 1.25 (25%)[/CODE] [CODE]Name: def_stance_bonus Type: Additive Bonus Description: Additive stat level modifier depending on chosen combat stance, relevent to current calculation. This bonus is only granted for physical attacks (melee and ranged). Melee weapon defence: Accurate - 0 level(s) Aggressive - 0 level(s) Controlled - 1 level(s) Defensive - 3 level(s) Ranged weapon defence: Accurate - 0 level(s) Rapid - 0 level(s) Long Ranged - 3 level(s)[/CODE] Using the above modifiers Effective Defence is calculated as: [CODE]String off_combat_type = "melee"; //melee, ranged, magic switch(off_combat_type) { case "melee": effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) + def_stance_bonus); break; case "ranged": effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) + def_stance_bonus); break; case "magic": effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) * .3); effective_magic = Math.floor(def_current_magic_level * .7); effective_defence = effective_defence + effective_magic; break; }[/CODE] [SIZE=5]Augmented Attack[/SIZE] Augmented attack is a base stat level with equipment stat value modifiers applied (modifiers retrieved from offensive entities worn equipment). This value is calculated as: [CODE]Math.floor(((effective_attack + 8) * (off_equipment_bonus + 64)) / 10);[/CODE] effective_attack and off_equipment_bonus have 8 and 64 added to their values respectively before multiplication. These values are also added to augmented_defence and act as means of eliminating negetive numbers. Negetive numbers create a lot of issues and strange behaviour within the algorithm. We can eliminate these easily by giving both values identical amounts that exceed the max possible negetive value they can contain. A negetive off_equipment_bonus value would be corrected to a positive value, for example, and 64 exceeds the max possible negetive equipment bonus achievable within the game. Following the multiplication of the two values, we divide by 10 for no reason other than to make small, more easily digestable numbers. This value is rounded down. Augmented attack is the offensive entities "augmented attack level" after equipment stat modifiers have been applied. Equipment stat modifiers include bonuses from worn equipment. Below you will find documentation for each of the above variables. [CODE]Name: off_equipment_*_attack Type: Base Value Description: Base equipment stat value of offensive entity. Examples: Stab Attack: 150 Slash Attack: 190 Crush Attack: 120 Ranged Attack: 5 Magic Attack: 70 off_equipment_magic_attack = 70 Stab Attack: 150 Slash Attack: 190 Crush Attack: 120 Ranged Attack: 5 Magic Attack: 70 off_equipment_stab_attack = 150[/CODE] [CODE]Name: off_equipment_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on combat type and attack style, relevant to current calculation. This bonus is granted for both physical and magic attacks. Default value: 1.0 Examples: Combat Type: Magic Attack Style: n/a off_equipment_bonus = off_equipment_magic_attack Combat Type: Melee Attack Style: Slash off_equipment_bonus = off_equipment_slash_attack[/CODE] Using the above modifiers Augmented Attack is calculated as: [CODE]augmented_attack = Math.floor(((effective_attack + 8) * (off_equipment_bonus + 64)) / 10);[/CODE] [SIZE=5]Augmented Defence[/SIZE] Augmented defence is a base stat level with equipment stat value modifiers applied (modifiers retrieved from defensive entities worn equipment). This value is calculated as: [CODE]Math.floor(((effective_defence +8) * (def_equipment_bonus + 64)) / 10);[/CODE] The same safety operations and readability optimisations are made here as mentioned above. Augmented defence is the defensive entities "augmented defence level" after equipment stat modifiers have been applied. Equipment stat modifiers include bonuses from worn equipment. Below you will find documentation for each of the above variables. [CODE]Name: def_equipment_*_defence Type: Base Value Description: Base equipment stat value of defensive entity. Examples: Stab Defence: 80 Slash Defence: 320 Crush Defence: 250 Ranged Defence: 400 Magic Defence: 130 def_equipment_magic_defence = 130 Stab Defence: 80 Slash Defence: 320 Crush Defence: 250 Ranged Defence: 400 Magic Defence: 130 def_equipment_stab_defence = 80[/CODE] [CODE]Name: def_equipment_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on combat type and attack style, relevant to current calculation. This bonus is granted for both physical and magic attacks. Default value: 1.0 Examples: Combat Type: Magic Attack Style: n/a def_equipment_bonus = def_equipment_magic_defence Combat Type: Melee Attack Style: Slash def_equipment_bonus = def_equipment_slash_defence[/CODE] Using the above modifiers Augmented Defence is calculated as: [CODE]augmented_defence = Math.floor(((effective_defence +8) * (def_equipment_bonus + 64)) / 10);[/CODE] [SIZE=5]Hit & Block Chance[/SIZE] Hit Chance and Block Chance are base probabilities to hit or miss with chance modifiers applied (modifiers applied directly to the chance calculation post all other modifiers). These values are calculated as hit_chance with the following modifiers applied: [LIST] [*]off_special_attack_bonus [*]off_void_bonus [*]def_protect_from_* [/LIST] hit_chance is the base probability to hit calculated as a fraction of the lesser value (of augmented_attack and augmented_defence). If augmented_attack has a lesser value than augmented_defence this means the value will be below 50%. Therefore: [CODE]hit_chance = augmented_attack / (augmented_defence * 2)[/CODE] This calculation will provide us with a value sub 0.5, providing the chance to hit versus a superior equipped opponent. If augmented_attack has a greater value than augmented_defence this means the value will be above 50%. Therefore: [CODE]hit_chance = augmented_defence / (augmented_attack * 2)[/CODE] This calculation will provide us with a value sur 0.5, providing the chance to hit versus a inferior equipped opponent. In addition to these calculations we subtract or add 1 to the value depending on whether augmented_attack is greater or lesser than augmented_defence. This small modification ensures that the lesser entity always has a value greater than 0 so we can ensure a minimum chance to block or hit of 1% at all times. Using the above logic hit_chance can be calculated as: [CODE]if(augmented_attack < augmented_defence) { hit_chance = (augmented_attack - 1) / (augmented_defence * 2); } else { hit_chance = 1 - ((augmented_defence + 1) / (augmented_attack * 2)); }[/CODE] Below you will find documentation for each of the above variables. [CODE]Name: off_special_attack_bonus Type: Multiplicative Bonus Description: Multiplicative hit chance modifier depending on offensive entity special attack. This is an experimental chance modifier based on the assumption that certain special attacks modify offensive entity chance to hit post all other modifiers similar to how void equipment works. Please note this is a delicate value and brash modifiers will break the balance of the the algorithm completely. Default value: 1.0 Below are recomendations for this modifiers value depending on special attack being used: Dragon Dagger - 1.15 (+15%) Dragon Scimitar - 1.15 (+15%) Dragon Mace - 0.85 (-15%) Dragon Battleaxe - 0.90 (-10%) Rune Claw - 1.15 (+15%) Vesta's Longsword - 1.20 (+20%) Brackish Blade - 2.0 (+100%) Magic Shortbow - 0.85 (-15%) Magic Shieldbow - 1.15 (+15%) Hand Cannon - 1.75 (+75%) Please note: Anything not listed above DOES NOT have a specal attack accuracy modifier. Korasi Sword is an exception to this and requires a special case which sets the off_hit_chance roll to 100. I have not had the opportunity to test these values, however they are educated guesses based on observations made regarding simularities in max hit and accuracy calculations. These values unless stated otherwise, are NOT meant to be dramatic modifiers. Other systems present in this algorithm will do much of the heavy lifting with securing a hit when using special attacks.[/CODE] [CODE]Name: off_void_bonus Type: Multiplicative Bonus Description: Multiplicative hit chance modifier depending on if a full set of void equipment is worn, and which type. Default value: 1.0 Void Set Modifier Values: Melee - 1.10 (10%) Ranged - 1.10 (10%) Magic - 1.30 (30%)[/CODE] [CODE]Name: def_protect_from_* Type: Multiplicative Bonus Description: Multiplicative hit chance modifier depending on if the defensive entity is using a protect from * prayer that matches the offensive entities combat type. Prior to the dice being rolled, if the defensive entity is using a protect from * prayer that corresponds with the offensive entities combat type hit_chance is multiplied by .6 reducing the offensive entities chance to hit, and increasing the defensive entities chance to block. Protect from * prayers reduce damage and chance to hit by 60% in player vs player combat.[/CODE] Using the above modifiers Hit Chance can be calculated as: [CODE]String off_combat_type = "melee"; //melee, ranged, magic switch(off_combat_type) { case "melee": if(def_protect_from_melee == true) { off_hit_chance = Math.floor((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100); } else { off_hit_chance = Math.floor(((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100); } break; case "ranged": if(def_protect_from_ranged == true) { off_hit_chance = Math.floor((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100); } else { off_hit_chance = Math.floor(((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100); } break; case "magic": if(def_protect_from_magic == true) { off_hit_chance = Math.floor(((hit_chance * off_void_bonus) * .6) * 100); } else { off_hit_chance = Math.floor((hit_chance * off_void_bonus) * 100); } break; } System.out.println("\nYour chance to hit is: " + off_hit_chance + "%");[/CODE] Using the above modifiers Block Chance can be calculated as: [CODE]String off_combat_type = "melee"; //melee, ranged, magic switch(off_combat_type) { case "melee": if(def_protect_from_melee == true) { def_block_chance = Math.floor(101 - ((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100)); } else { def_block_chance = Math.floor(101 - (((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100)); } break; case "ranged": if(def_protect_from_ranged == true) { def_block_chance = Math.floor(101 - ((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100)); } else { def_block_chance = Math.floor(101 - (((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100)); } break; case "magic": if(def_protect_from_magic == true) { def_block_chance = Math.floor(101 - (((hit_chance * off_void_bonus) * .6) * 100)); } else { def_block_chance = Math.floor(101 - ((hit_chance * off_void_bonus) * 100)); } break; } System.out.println("Your opponents chance to block is: " + def_block_chance + "%");[/CODE] Following this we use these values to generate two dice rolls and determine if the offensive entity is granted a hit or not. This is calculated as: [CODE]math.random(0, off_hit_chance) math.random(0, def_block_chance) if(off_hit_chance > def_block_chance) { //hit } else { //block }[/CODE] Both entities roll a dice between 0 and their calculated chance to hit or block, whoever has the greatest value is successful. This provides a chance for the defensive entity to fail a block, as opposed to the defensive entity being ensured a block if the offensive entity does not successfully hit. This is another problem present in the currently utilised version of the algorithm that gives the illusion of "overpowered defence". Giving the defensive entity an ensured block puts the offensive entity at a huge disadvantage. Using the above logic we calculate whether the offensive entity is granted a hit or not as: [CODE]off_hit_chance = 0 + (int)(Math.random() * off_hit_chance); def_block_chance = 0 + (int)(Math.random() * def_block_chance); System.out.println("\nYou rolled: " + (int) off_hit_chance); System.out.println("Your opponent rolled: " + (int) def_block_chance); if(off_hit_chance > def_block_chance) { System.out.print("\nYou hit your opponent!"); } else { System.out.print("\nYour opponent blocked your hit."); }[/CODE] [SIZE=5]What does this algorithm ensure?[/SIZE] [LIST] [*]Entity combat type, stance and attack style have significant effects on chance to hit. [*]Weapons/spells with requirements that fall beneath base stat level grant an accuracy bonus. [*]Magic defence is more heavily weighted towards effective magic, than effective defence. [*]Two entities with equal levels and no equipment will have a 60% chance to hit, and a 40% chance to block. [*]Regardless of equipment or levels, the offensive entity always has >=1% chance to hit. [*]Regardless of equipment or levels, the defensive entity always has >=1% chance to block. [*]The offensive entity has a chance to successfully hit. [*]The offensive entity has a chance to fail a hit. [*]The defensive entity has a chance to successfully block. [*]The defensive entity has a chance to fail a block. [/LIST] For a more in-depth analysis of the algorithm see below for a heavily documented example written in Java for you to play with: [CODE]public class accuracy { public static void main(String args[]) { /* off denotes 'offensive', this prefix implies variable belongs to offensive entity. def denotes 'defensive', this prefix implies variable belongs to defensive entity. */ String off_combat_type = "melee"; //melee, ranged, magic String off_style = "stab"; //stab, slash, crush, ranged, magic int off_weapon_requirement = 1; //weapon attack level requirement int off_spell_requirement = 1; //spell magic level requirement /* Name: off_base_*_level Type: Base value Description: Base stat level pre any modifiers. This value can be calculated using entity current xp. Max value: 99 Examples: 80/99 = 99 base level 116/95 = 95 base level */ int off_base_attack_level = 99; int off_base_ranged_level = 99; int off_base_magic_level = 99; /* Name: *_current_*_level Type: Base value Description: Base stat level post visible stat modifiers. Examples: 80/99 = 80 current level 116/95 = 116 current level */ double off_current_attack_level = 99; double off_current_ranged_level = 99; double off_current_magic_level = 99; double def_current_defence_level = 99; double def_current_magic_level = 99; /* Name: *_*_prayer_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on chosen prayer(s), relevent to current calculation. This bonus is granted for both physical and magic attacks. Default value: 1.0 Melee prayer offence: Clarity of Thought - 1.05 (5%) Improved Reflexes - 1.10 (10%) Incredible Reflexes - 1.15 (15%) Chivalry - 1.15 (15%) Piety - 1.20 (20%) Ranged prayer offence: Sharp Eye - 1.05 (5%) Hawk Eye - 1.10 (10%) Eagle Eye - 1.15 (15%) Rigour - 1.20 (20%) Magic prayer offence: Mystic Will - 1.05 (5%) Mystic Lore - 1.10 (10%) Mystic Might - 1.15 (15%) Augury - 1.20 (20$) General prayer defence: Thick Skin - 1.05 (5%) Rock Skin - 1.10 (10%) Steel Skin - 1.15 (15%) Chivalry - 1.20 (20%) Piety - 1.25 (25%) */ double off_attack_prayer_bonus = 1.0; double off_ranged_prayer_bonus = 1.0; double off_magic_prayer_bonus = 1.0; double def_defence_prayer_bonus = 1.0; /* Name: off_additional_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on worn equipment, relevent to current calculation. This bonus is granted for both physical and magic attacks. This bonus is only granted to the offensive entity. In the case that more than one of these conditions is met, modifiers are added together before being applied. Default value: 1.0 Versus general slayer task: Melee: Black Mask - 1.125 (12.5%) Slayer Helmet - 1.125 (12.5%) Full Slayer Helmet - 1.125 (12.5%) Ranged: Focus Sight - 1.125 (12.5%) Slayer Helmet - 1.125 (12.5%) Full Slayer Helmet - 1.125 (12.5%) Magic: Hexcrest - 1.125 (12.5%) Slayer Helmet - 1.125 (12.5%) Full Slayer Helmet - 1.125 (12.5%) Versus dragon slayer task: Melee: Dragon Slayer Gloves - 1.10 (10%) Versus undead: Melee & Magic & Ranged: Salve Amulet - 1.15 (15%) Salve Amulet (e) - 1.20 (20%) Examples: Items: Salve Amulet, Black Mask Versus: Undead, Slayer Task Modifier: 1.275 (27.5%) Items: Full Slayer Helmet, Dragon Slayer Gloves Versus: Dragon, Slayer Task Modifier: 1.225 (22.5%) */ double off_additional_bonus = 1.0; /* Name: *_stance_bonus Type: Additive Bonus Description: Additive stat level modifier depending on chosen combat stance, relevent to current calculation. This bonus is only granted for physical attacks (melee and ranged). Melee weapon offence: Accurate - 3 level(s) Aggressive - 0 level(s) Controlled - 1 level(s) Defensive - 0 level(s) Ranged weapon offence: Accurate - 3 level(s) Rapid - 0 level(s) Long Ranged - 0 level(s) Melee weapon defence: Accurate - 0 level(s) Aggressive - 0 level(s) Controlled - 1 level(s) Defensive - 3 level(s) Ranged weapon defence: Accurate - 0 level(s) Rapid - 0 level(s) Long Ranged - 3 level(s) */ int off_stance_bonus = 0; int def_stance_bonus = 0; /* Name: off_spell_bonus Type: Additive Bonus Description: Additive stat level modifier depending on 'experience' using a spell. "When you cast combat-related spells, there is a chance of failure. This is dependent on a few factors such as your magical attack bonuses, the magical Defence bonuses of your opponent and your Magic experience." This bonus is calculated as .3 bonus level(s) per level above spell requirement. This modifier uses BASE level, not CURRENT level. (ie. 112/99 = 99 base level) Examples: Current Magic Level: 99 Spell: Ice Blitz (Level 82) Effective Magic Level: 104 Current Magic Level: 99 Spell: Fire Blast (Level 59) Effective Magic Level: 111 */ double off_spell_bonus = 0; switch(off_combat_type){ case "magic": if(off_base_magic_level > off_spell_requirement) { off_spell_bonus = (off_base_magic_level - off_spell_requirement) * .3; } break; } /* Name: off_weapon_bonus Type: Additive Bonus Description: Additive stat level modifier depending on 'experience' using a weapon. This is an experimental stat modifier based on the logic provided in the *_spell_bonus documentation. This addition is justified by the observation that "dragon" weapons appear to be more accurate than their higher level counterparts at the exchange of worse equipment stats when used by high level characters. This is an important balance point as part of the Runescape accuracy algorithm. This modifier provides a benefit to the attack stat level beyond weapon equip requirements, and an important trade off for those who choose to level their attack stat level further versus those who do not. In addition low tier weaponry in currently utilised versions of the algorithm become completely obsolete and outclassed by high tier defence equipment giving the outcome of seemingly "overpowered" defence. High level characters utilising high tier defence equipment against eachother will find lower tier weaponry a more viable choice, and will find it much more powerful against low tier armour. These characters will also be granted a benefit versus characters with an inferior attack stat level. This bonus is calculated as .3 bonus level(s) per level above weapon requirement. This modifier uses BASE level, not CURRENT level. (ie. 112/99 = 99 base level) Examples: Current Attack Level: 99 Weapon: Dragon Dagger (Level 60) Effective Attack Level: 110 Current Attack Level: 99 Weapon Abyssal Whip (Level 70) Effective Attack Level: 107 Current Attack Level: 84 Weapon Abyssal Whip (Level 70) Effective Attack Level: 88 */ double off_weapon_bonus = 0; switch(off_combat_type){ case "melee": if(off_base_attack_level > off_weapon_requirement) { off_weapon_bonus = (off_base_attack_level - off_weapon_requirement) * .3; } break; case "ranged": if(off_base_ranged_level > off_weapon_requirement) { off_weapon_bonus = (off_base_ranged_level - off_weapon_requirement) * .3; } break; } /* Name: effective_attack Type: Base Value Description: Base stat level post invisible stat modifiers. This value is off_current_*_level with the following modifiers applied depending on combat type: Melee combat: * off_attack_prayer_bonus * off_additional_bonus * off_stance_bonus * off_weapon_bonus Ranged combat: * off_ranged_prayer_bonus * off_additional_bonus * off_stance_bonus * off_weapon_bonus Magic combat: * off_magic_prayer_bonus * off_additional_bonus * off_spell_bonus This value is rounded down. */ double effective_attack = 0; switch(off_combat_type) { case "melee": effective_attack = Math.floor(((off_current_attack_level * off_attack_prayer_bonus) * off_additional_bonus) + off_stance_bonus + off_weapon_bonus); break; case "ranged": effective_attack = Math.floor(((off_current_ranged_level * off_ranged_prayer_bonus) * off_additional_bonus) + off_stance_bonus + off_weapon_bonus); break; case "magic": effective_attack = Math.floor(((off_current_magic_level * off_magic_prayer_bonus) * off_additional_bonus) + off_spell_bonus); break; } /* Name: effective_magic Type: Base Value Description: Additive stat level modifier depending on defending entity magic level. Magic defence is calculated as 3 shares physical defence (or effective_defence) and 7 shares magic defence (or effective_magic). In other words, this value makes up 70% of defence against magic spells. With the other 30% coming from effective_defence. This value is def_current_magic_level multiplied by .7, or 70%. This value is rounded down. */ double effective_magic = 0; switch(off_combat_type) { case "magic": effective_magic = Math.floor(def_current_magic_level * .7); break; } /* Name: effective_defence Type: Base Value Description: Base stat level post invisible stat modifiers. For Melee and Ranged combat this value is def_current_defence_level with the following modifiers applied: * def_defence_prayer_bonus * def_defence_stance_bonus For magic combat there is a special case, this value is composed of two values combined: * effective_defence * effective_magic For magic combat def_current_defence_level has the following modifiers applied: * def_defence_prayer_bonus These values are then multiplied by .3, and .7 respectively. Composing the final whole value using two values combined. Magic defence is a special case as defence level and stat modifiers should only play a small part in the final value used to calculate magic defence. In currently utilised versions of the algorithm it is common for magic attacks to miss(or "splash") a lot because melee defence levels and modifiers are used for the calculation of defence against magic spells but this is not their intended use. Rather, they are intended for defence against melee and ranged attacks. It is worth noting the incredibly high effective_attack and effective_defence levels when using melee & ranged attacks in comparison to the pitiful effective_attack of magic attacks. These melee/ranged defence steroids were not intended as defence against magic, and the effective_attack of magic spells simply can not compare. This new implementation of magic defence creates the desired effect of magic hitting often versus characters with great melee and ranged defences (melee equipment) in addition to current magic level playing a much greater role in defence against magic attacks as intended. Characters are required to raise their magic level as defence against magic attacks. This value is rounded down. */ double effective_defence = 0; switch(off_combat_type) { case "melee": effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) + def_stance_bonus); break; case "ranged": effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) + def_stance_bonus); break; case "magic": effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) * .3); effective_defence = effective_defence + effective_magic; break; } /* Name: off_equipment_*_attack Type: Base Value Description: Base equipment stat value of offensive entity. Examples: Stab Attack: 150 Slash Attack: 190 Crush Attack: 120 Ranged Attack: 5 Magic Attack: 70 off_equipment_magic_attack = 70 Stab Attack: 150 Slash Attack: 190 Crush Attack: 120 Ranged Attack: 5 Magic Attack: 70 off_equipment_stab_attack = 150 */ int off_equipment_stab_attack = 0; int off_equipment_slash_attack = 0; int off_equipment_crush_attack = 0; int off_equipment_ranged_attack = 0; int off_equipment_magic_attack = 0; /* Name: def_equipment_*_defence Type: Base Value Description: Base equipment stat value of defensive entity. Examples: Stab Defence: 80 Slash Defence: 320 Crush Defence: 250 Ranged Defence: 400 Magic Defence: 130 def_equipment_magic_defence = 130 Stab Defence: 80 Slash Defence: 320 Crush Defence: 250 Ranged Defence: 400 Magic Defence: 130 def_equipment_stab_defence = 80 */ int def_equipment_stab_defence = 0; int def_equipment_slash_defence = 0; int def_equipment_crush_defence = 0; int def_equipment_ranged_defence = 0; int def_equipment_magic_defence = 0; /* Name: *_equipment_bonus Type: Multiplicative Bonus Description: Multiplicative stat level modifier depending on combat type and attack style, relevant to current calculation. This bonus is granted for both physical and magic attacks. Default value: 1.0 Examples: Combat Type: Magic Attack Style: n/a off_equipment_bonus = off_equipment_magic_attack def_equipment_bonus = def_equipment_magic_defence Combat Type: Melee Attack Style: Slash off_equipment_bonus = off_equipment_slash_attack def_equipment_bonus = def_equipment_slash_defence */ int off_equipment_bonus = 0; int def_equipment_bonus = 0; switch(off_combat_type) { case "melee": switch(off_style) { case "stab": off_equipment_bonus = off_equipment_stab_attack; def_equipment_bonus = def_equipment_stab_defence; break; case "slash": off_equipment_bonus = off_equipment_slash_attack; def_equipment_bonus = def_equipment_slash_defence; break; case "crush": off_equipment_bonus = off_equipment_crush_attack; def_equipment_bonus = def_equipment_crush_defence; break; } break; case "ranged": off_equipment_bonus = off_equipment_ranged_attack; def_equipment_bonus = def_equipment_ranged_defence; break; case "magic": off_equipment_bonus = off_equipment_magic_attack; def_equipment_bonus = def_equipment_magic_defence; break; } /* Name: augmented_attack Type: Base Value Description: Base stat level post equipment stat value modifiers. This value is calculated as: math.floor(((effective_attack + 8) * (off_equipment_bonus + 64)) / 10) effective_attack and off_equipment_bonus have 8 and 64 added to their values respectively before multiplication. These values are also added to augmented_defence and act as means of eliminating negetive numbers. Negetive numbers create a lot of issues and strange behaviour within the algorithm. We can eliminate these easily by giving both values identical amounts that exceed the max possible negetive value they can contain. A negetive off_equipment_bonus value would be corrected to a positive value, for example, and 64 exceeds the max possible negetive equipment bonus achievable within the game. Following the multiplication of the two values, we divide by 10 for no reason other than to make small, more easily digestable numbers. This value is rounded down. */ double augmented_attack = 0; augmented_attack = Math.floor(((effective_attack + 8) * (off_equipment_bonus + 64)) / 10); /* Name augmented_defence Type: Base Value Description: Base stat level post equipment stat value modifiers. This value is calculated as: math.floor(((effective_defence + 8) * (def_equipment_bonus + 64)) / 10) The same safety operations and readability optimisations are made here as mentioned above. */ double augmented_defence = 0; augmented_defence = Math.floor(((effective_defence +8) * (def_equipment_bonus + 64)) / 10); /* Name: hit_chance Type: Base Value Description: Base probability to hit calculated as a fraction of the lesser value. If augmented_attack has a lesser value than augmented_defence this means the value will be below 50%. Therefore: hit_chance = augmented_attack / (augmented_defence * 2) This calculation will provide us with a value sub 0.5, providing the chance to hit vs a superior equiped opponent. If augmented_attack has a greater value than augmented_defence this means the value will be above 50%. Therefore: hit_chance = augmented_defence / (augmented_attack * 2) This calculation will provide us with a value sur 0.5, providing the chance to hit vs a inferior equiped opponent. In addition to these calculations we subtract or add 1 to the value depending on whether augmented_attack is greater or lesser than augmented_defence. This small modification ensures that the lesser entity always has a value greater than 0 so we can ensure a minimum chance to block or hit of 1% at all times. */ double hit_chance = 0; if(augmented_attack < augmented_defence) { hit_chance = (augmented_attack - 1) / (augmented_defence * 2); } else { hit_chance = 1 - ((augmented_defence + 1) / (augmented_attack * 2)); } /* Name: off_special_attack_bonus Type: Multiplicative Bonus Description: Multiplicative hit chance modifier depending on offensive entity special attack. This is an experimental chance modifier based on the assumption that certain special attacks modify offensive entity chance to hit post all other modifiers similar to how void equipment works. Please note this is a delicate value and brash modifiers will break the balance of the the algorithm completely. Default value: 1.0 Below are recomendations for this modifiers value depending on special attack being used: Dragon Dagger - 1.15 (+15%) Dragon Scimitar - 1.15 (+15%) Dragon Mace - 0.85 (-15%) Dragon Battleaxe - 0.90 (-10%) Rune Claw - 1.15 (+15%) Vesta's Longsword - 1.20 (+20%) Brackish Blade - 2.0 (+100%) Magic Shortbow - 0.85 (-15%) Magic Shieldbow - 1.15 (+15%) Hand Cannon - 1.75 (+75%) Please note: Anything not listed above DOES NOT have a specal attack accuracy modifier. Korasi Sword is an exception to this and requires a special case which sets the off_hit_chance roll to 100. I have not had the opportunity to test these values, however they are educated guesses based on observations made regarding simularities in max hit and accuracy calculations. These values unless stated otherwise, are NOT meant to be dramatic modifiers. Other systems present in this algorithm will do much of the heavy lifting with securing a hit when using special attacks. */ double off_special_attack_bonus = 1.0; /* Name: off_void_bonus Type: Multiplicative Bonus Description: Multiplicative hit chance modifier depending on if a full set of void equipment is worn, and which type. Default value: 1.0 Void Set Modifier Values: Melee - 1.10 (10%) Ranged - 1.10 (10%) Magic - 1.30 (30%) */ double off_void_bonus = 1.0; /* Name: def_protect_from_* Type: Multiplicative Bonus Description: Multiplicative hit chance modifier depending on if the defensive entity is using a protect from * prayer that matches the offensive entities combat type. Prior to the dice being rolled, if the defensive entity is using a protect from * prayer that corresponds with the offensive entities combat type hit_chance is multiplied by .6 reducing the offensive entities chance to hit, and increasing the defensive entities chance to block. Protect from * prayers reduce damage and chance to hit by 60% in player vs player combat. */ boolean def_protect_from_melee = false; boolean def_protect_from_ranged = false; boolean def_protect_from_magic = false; /* Name: off_hit_chance Type: Base Value Description: Base probability to hit post chance modifiers. This value is used to roll a dice and determine if the offensive entity is granted a hit or not. This is calculated as: math.random(0, off_hit_chance) math.random(0, def_block_chance) if(off_hit_chance > def_block_chance) { //hit } else { //block } Both entities roll a dice between 0 and their calculated chance to hit or block, whoever has the greatest value is successful. This provides a chance for the defensive entity to fail a block, as opposed to the defensive entity being ensured a block if the offensive entity does not successfully hit. This is another problem present in the currently utilised version of the algorithm that gives the illusion of "overpowered defence". Giving the defensive entity an ensured block puts the offensive entity at a huge disadvantage. */ double off_hit_chance = 0; switch(off_combat_type) { case "melee": if(def_protect_from_melee == true) { off_hit_chance = Math.floor((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100); } else { off_hit_chance = Math.floor(((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100); } break; case "ranged": if(def_protect_from_ranged == true) { off_hit_chance = Math.floor((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100); } else { off_hit_chance = Math.floor(((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100); } break; case "magic": if(def_protect_from_magic == true) { off_hit_chance = Math.floor(((hit_chance * off_void_bonus) * .6) * 100); } else { off_hit_chance = Math.floor((hit_chance * off_void_bonus) * 100); } break; } System.out.println("\nYour chance to hit is: " + off_hit_chance + "%"); off_hit_chance = 0 + (int)(Math.random() * off_hit_chance); /* Name: def_block_chance Type: Base Value Description: Base probability to block post chance modifiers. This value is used to roll a dice and determine if the defensive entity is granted a block or not. See above for details on calculation. */ double def_block_chance = 0; switch(off_combat_type) { case "melee": if(def_protect_from_melee == true) { def_block_chance = Math.floor(101 - ((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100)); } else { def_block_chance = Math.floor(101 - (((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100)); } break; case "ranged": if(def_protect_from_ranged == true) { def_block_chance = Math.floor(101 - ((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100)); } else { def_block_chance = Math.floor(101 - (((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100)); } break; case "magic": if(def_protect_from_magic == true) { def_block_chance = Math.floor(101 - (((hit_chance * off_void_bonus) * .6) * 100)); } else { def_block_chance = Math.floor(101 - ((hit_chance * off_void_bonus) * 100)); } break; } System.out.println("Your opponents chance to block is: " + def_block_chance + "%"); def_block_chance = 0 + (int)(Math.random() * def_block_chance); System.out.println("\nYou rolled: " + (int) off_hit_chance); System.out.println("Your opponent rolled: " + (int) def_block_chance); if(off_hit_chance > def_block_chance) { System.out.print("\nYou hit your opponent!"); } else { System.out.print("\nYour opponent blocked your hit."); } } //end main } //end class[/CODE] Here is how a working version might look with the above readability taken out: [CODE]public class accuracy_sm { public static void main(String args[]) { /* S E T T I N G S S T A R T */ //attack types String off_combat_type = "melee"; //melee, ranged, magic String off_style = "stab"; //stab, slash, crush, ranged, magic //attack stances int off_stance_bonus = 0; //accurate, aggressive, controlled, defensive int def_stance_bonus = 0; //accurate, aggressive, controlled, defensive //requirements int off_weapon_requirement = 1; //weapon attack level requirement int off_spell_requirement = 1; //spell magic level requirement //base levels int off_base_attack_level = 99; int off_base_ranged_level = 99; int off_base_magic_level = 99; //current levels double off_current_attack_level = 99; double off_current_ranged_level = 99; double off_current_magic_level = 99; double def_current_defence_level = 99; double def_current_magic_level = 99; //prayer bonuses double off_attack_prayer_bonus = 1.0; double off_ranged_prayer_bonus = 1.0; double off_magic_prayer_bonus = 1.0; double def_defence_prayer_bonus = 1.0; //additional bonus double off_additional_bonus = 1.0; //equipment bonuses int off_equipment_stab_attack = 0; int off_equipment_slash_attack = 0; int off_equipment_crush_attack = 0; int off_equipment_ranged_attack = 0; int off_equipment_magic_attack = 0; int def_equipment_stab_defence = 0; int def_equipment_slash_defence = 0; int def_equipment_crush_defence = 0; int def_equipment_ranged_defence = 0; int def_equipment_magic_defence = 0; //protect from * prayers boolean def_protect_from_melee = false; boolean def_protect_from_ranged = false; boolean def_protect_from_magic = false; //chance bonuses double off_special_attack_bonus = 1.0; double off_void_bonus = 1.0; /* S E T T I N G S E N D */ /* C A L C U L A T E D V A R I A B L E S S T A R T */ //experience bonuses double off_spell_bonus = 0; double off_weapon_bonus = 0; //effective levels double effective_attack = 0; double effective_magic = 0; double effective_defence = 0; //relevent equipment bonuses int off_equipment_bonus = 0; int def_equipment_bonus = 0; //augmented levels double augmented_attack = 0; double augmented_defence = 0; //hit chances double hit_chance = 0; double off_hit_chance = 0; double def_block_chance = 0; /* C A L C U L A T E D V A R I A B L E S E N D */ //determine effective attack switch(off_combat_type){ case "melee": if(off_base_attack_level > off_weapon_requirement) { off_weapon_bonus = (off_base_attack_level - off_weapon_requirement) * .3; } effective_attack = Math.floor(((off_current_attack_level * off_attack_prayer_bonus) * off_additional_bonus) + off_stance_bonus + off_weapon_bonus); effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) + def_stance_bonus); switch(off_style) { case "stab": off_equipment_bonus = off_equipment_stab_attack; def_equipment_bonus = def_equipment_stab_defence; break; case "slash": off_equipment_bonus = off_equipment_slash_attack; def_equipment_bonus = def_equipment_slash_defence; break; case "crush": off_equipment_bonus = off_equipment_crush_attack; def_equipment_bonus = def_equipment_crush_defence; break; } break; case "ranged": if(off_base_ranged_level > off_weapon_requirement) { off_weapon_bonus = (off_base_ranged_level - off_weapon_requirement) * .3; } effective_attack = Math.floor(((off_current_ranged_level * off_ranged_prayer_bonus) * off_additional_bonus) + off_stance_bonus + off_weapon_bonus); effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) + def_stance_bonus); off_equipment_bonus = off_equipment_ranged_attack; def_equipment_bonus = def_equipment_ranged_defence; break; case "magic": if(off_base_magic_level > off_spell_requirement) { off_spell_bonus = (off_base_magic_level - off_spell_requirement) * .3; } effective_attack = Math.floor(((off_current_magic_level * off_magic_prayer_bonus) * off_additional_bonus) + off_spell_bonus); effective_magic = Math.floor(def_current_magic_level * .7); effective_defence = Math.floor((def_current_defence_level * def_defence_prayer_bonus) * .3); effective_defence = effective_defence + effective_magic; off_equipment_bonus = off_equipment_magic_attack; def_equipment_bonus = def_equipment_magic_defence; break; } //determine augmented levels augmented_attack = Math.floor(((effective_attack + 8) * (off_equipment_bonus + 64)) / 10); augmented_defence = Math.floor(((effective_defence +8) * (def_equipment_bonus + 64)) / 10); //determine hit chance if(augmented_attack < augmented_defence) { hit_chance = (augmented_attack - 1) / (augmented_defence * 2); } else { hit_chance = 1 - ((augmented_defence + 1) / (augmented_attack * 2)); } switch(off_combat_type) { case "melee": if(def_protect_from_melee == true) { off_hit_chance = Math.floor((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100); def_block_chance = Math.floor(101 - ((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100)); } else { off_hit_chance = Math.floor(((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100); def_block_chance = Math.floor(101 - (((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100)); } break; case "ranged": if(def_protect_from_ranged == true) { off_hit_chance = Math.floor((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100); def_block_chance = Math.floor(101 - ((((hit_chance * off_special_attack_bonus) * off_void_bonus) * .6) * 100)); } else { off_hit_chance = Math.floor(((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100); def_block_chance = Math.floor(101 - (((hit_chance * off_special_attack_bonus) * off_void_bonus) * 100)); } break; case "magic": if(def_protect_from_magic == true) { off_hit_chance = Math.floor(((hit_chance * off_void_bonus) * .6) * 100); def_block_chance = Math.floor(101 - (((hit_chance * off_void_bonus) * .6) * 100)); } else { off_hit_chance = Math.floor((hit_chance * off_void_bonus) * 100); def_block_chance = Math.floor(101 - ((hit_chance * off_void_bonus) * 100)); } break; } //print hit chance System.out.println("\nYour chance to hit is: " + off_hit_chance + "%"); System.out.println("Your opponents chance to block is: " + def_block_chance + "%"); //roll dice off_hit_chance = 0 + (int)(Math.random() * off_hit_chance); def_block_chance = 0 + (int)(Math.random() * def_block_chance); //print roll System.out.println("\nYou rolled: " + (int) off_hit_chance); System.out.println("Your opponent rolled: " + (int) def_block_chance); //determine hit if(off_hit_chance > def_block_chance) { //print hit System.out.print("\nYou hit your opponent!"); } else { //print block System.out.print("\nYour opponent blocked your hit."); } } //end main } //end class[/CODE] [SIZE=5]Test Cases[/SIZE] Unarmed vs unarmed, same stats (99): [CODE] Chance 60.0% & 40.0% || Rolled: 1 & 28 || BLOCK Chance 60.0% & 40.0% || Rolled: 33 & 17 || HIT Chance 60.0% & 40.0% || Rolled: 28 & 29 || BLOCK Chance 60.0% & 40.0% || Rolled: 18 & 27 || BLOCK Chance 60.0% & 40.0% || Rolled: 12 & 10 || HIT Chance 60.0% & 40.0% || Rolled: 15 & 12 || HIT Chance 60.0% & 40.0% || Rolled: 36 & 20 || HIT Chance 60.0% & 40.0% || Rolled: 49 & 28 || HIT Chance 60.0% & 40.0% || Rolled: 24 & 22 || HIT Chance 60.0% & 40.0% || Rolled: 25 & 35 || BLOCK[/CODE] Rune-whip vs rune w/shield, 118 attack vs 99 defence, piety: [CODE] Chance 32.0% & 68.0% || Rolled: 28 & 47 || BLOCK Chance 32.0% & 68.0% || Rolled: 23 & 1 || HIT Chance 32.0% & 68.0% || Rolled: 27 & 11 || HIT Chance 32.0% & 68.0% || Rolled: 26 & 25 || HIT Chance 32.0% & 68.0% || Rolled: 15 & 27 || BLOCK Chance 32.0% & 68.0% || Rolled: 30 & 11 || HIT Chance 32.0% & 68.0% || Rolled: 0 & 62 || BLOCK Chance 32.0% & 68.0% || Rolled: 11 & 34 || BLOCK Chance 32.0% & 68.0% || Rolled: 31 & 22 || HIT Chance 32.0% & 68.0% || Rolled: 1 & 9 || BLOCK[/CODE] Rune-whip vs adamant w/shield, 118 attack vs 30 defence, both piety: [CODE] Chance 78.0% & 22.0% || Rolled: 45 & 2 || HIT Chance 78.0% & 22.0% || Rolled: 70 & 13 || HIT Chance 78.0% & 22.0% || Rolled: 8 & 15 || BLOCK Chance 78.0% & 22.0% || Rolled: 41 & 19 || HIT Chance 78.0% & 22.0% || Rolled: 62 & 10 || HIT Chance 78.0% & 22.0% || Rolled: 67 & 13 || HIT Chance 78.0% & 22.0% || Rolled: 2 & 15 || BLOCK Chance 78.0% & 22.0% || Rolled: 63 & 9 || HIT Chance 78.0% & 22.0% || Rolled: 49 & 19 || HIT Chance 78.0% & 22.0% || Rolled: 70 & 2 || HIT[/CODE] rune-defender whip vs rune-defender rune armour, 118 attack vs 80 defence, both incredible reflexes: [CODE]Chance 59.0% & 41.0% || Rolled: 0 & 11 || BLOCK Chance 59.0% & 41.0% || Rolled: 49 & 21 || HIT Chance 59.0% & 41.0% || Rolled: 41 & 12 || HIT Chance 59.0% & 41.0% || Rolled: 4 & 11 || BLOCK Chance 59.0% & 41.0% || Rolled: 28 & 20 || HIT Chance 59.0% & 41.0% || Rolled: 12 & 25 || BLOCK Chance 59.0% & 41.0% || Rolled: 18 & 38 || BLOCK Chance 59.0% & 41.0% || Rolled: 17 & 6 || HIT Chance 59.0% & 41.0% || Rolled: 8 & 2 || HIT Chance 59.0% & 41.0% || Rolled: 27 & 4 || HIT[/CODE] rune-defender dragon scimitar vs rune-defender rune armour, 118 attack vs 80 defence, both incredible reflexes: [CODE] Chance 55.0% & 45.0% || Rolled: 42 & 34 || HIT Chance 55.0% & 45.0% || Rolled: 13 & 36 || BLOCK Chance 55.0% & 45.0% || Rolled: 7 & 7 || BLOCK Chance 55.0% & 45.0% || Rolled: 36 & 3 || HIT Chance 55.0% & 45.0% || Rolled: 7 & 28 || BLOCK Chance 55.0% & 45.0% || Rolled: 52 & 2 || HIT Chance 55.0% & 45.0% || Rolled: 30 & 23 || HIT Chance 55.0% & 45.0% || Rolled: 25 & 6 || HIT Chance 55.0% & 45.0% || Rolled: 26 & 23 || HIT Chance 55.0% & 45.0% || Rolled: 31 & 40 || BLOCK[/CODE] full mystic ancient staff ice blitz vs rune armour defender, 99 magic vs 99 magic&80 defence: [CODE]Chance 81.0% & 19.0% || Rolled: 11 & 15 || BLOCK Chance 81.0% & 19.0% || Rolled: 48 & 16 || HIT Chance 81.0% & 19.0% || Rolled: 7 & 16 || BLOCK Chance 81.0% & 19.0% || Rolled: 47 & 3 || HIT Chance 81.0% & 19.0% || Rolled: 30 & 9 || HIT Chance 81.0% & 19.0% || Rolled: 23 & 11 || HIT Chance 81.0% & 19.0% || Rolled: 33 & 18 || HIT Chance 81.0% & 19.0% || Rolled: 74 & 11 || HIT Chance 81.0% & 19.0% || Rolled: 76 & 6 || HIT Chance 81.0% & 19.0% || Rolled: 58 & 13 || HIT[/CODE] full mystic ancient staff ice blitz vs black dragonhide, 99 magic vs 99 magic&99 defence: [CODE]Chance 43.0% & 57.0% || Rolled: 37 & 4 || HIT Chance 43.0% & 57.0% || Rolled: 5 & 28 || BLOCK Chance 43.0% & 57.0% || Rolled: 27 & 19 || HIT Chance 43.0% & 57.0% || Rolled: 35 & 51 || BLOCK Chance 43.0% & 57.0% || Rolled: 10 & 9 || HIT Chance 43.0% & 57.0% || Rolled: 23 & 20 || HIT Chance 43.0% & 57.0% || Rolled: 27 & 5 || HIT Chance 43.0% & 57.0% || Rolled: 23 & 33 || BLOCK Chance 43.0% & 57.0% || Rolled: 32 & 39 || BLOCK Chance 43.0% & 57.0% || Rolled: 17 & 44 || BLOCK[/CODE] ice blitz, full rune, abyssal whip vs full rune, 99 magic vs 99 magic 99 defence: [CODE]Chance 34.0% & 66.0% || Rolled: 30 & 21 || HIT Chance 34.0% & 66.0% || Rolled: 23 & 32 || BLOCK Chance 34.0% & 66.0% || Rolled: 28 & 10 || HIT Chance 34.0% & 66.0% || Rolled: 24 & 10 || HIT Chance 34.0% & 66.0% || Rolled: 29 & 55 || BLOCK Chance 34.0% & 66.0% || Rolled: 6 & 43 || BLOCK Chance 34.0% & 66.0% || Rolled: 12 & 18 || BLOCK Chance 34.0% & 66.0% || Rolled: 6 & 12 || BLOCK Chance 34.0% & 66.0% || Rolled: 33 & 34 || BLOCK Chance 34.0% & 66.0% || Rolled: 21 & 7 || HIT[/CODE] ice blitz, full rune, abyssal whip vs black dragonhide, 99 magic vs 99 magic 99 defence: [CODE]Chance 11.0% & 89.0% || Rolled: 8 & 12 || BLOCK Chance 11.0% & 89.0% || Rolled: 2 & 20 || BLOCK Chance 11.0% & 89.0% || Rolled: 10 & 40 || BLOCK Chance 11.0% & 89.0% || Rolled: 0 & 72 || BLOCK Chance 11.0% & 89.0% || Rolled: 9 & 71 || BLOCK Chance 11.0% & 89.0% || Rolled: 1 & 44 || BLOCK Chance 11.0% & 89.0% || Rolled: 0 & 32 || BLOCK Chance 11.0% & 89.0% || Rolled: 9 & 1 || HIT Chance 11.0% & 89.0% || Rolled: 5 & 76 || BLOCK Chance 11.0% & 89.0% || Rolled: 2 & 74 || BLOCK[/CODE] [SIZE=4]FAQ[/SIZE] [I]Can this be applied to Non Player Characters?[/I] Yes. I've developed a method of estimating non player character stat levels, and in doing this we can treat them just like player characters for the purpose of accuracy calculation. This has obvious benefits too, which result in emulation closer to Runescape and provide additional utility to armour for both player and non player characters. Coming soon. [SIZE=4]Postface[/SIZE] Earlier this year my good friend Alex, or Light232 passed away. This brings an unfortunate end to our work together. In light of the situation I'd like to release some of my research, enjoy. I'll be posting more threads like this soon.
  15. Hey! I am working on a Server again, and I'm having a problem that I never had before. Chaotics Stats works more than fine, only the combat styles are glitched. Example: Spawn 18353 (chaotic maul), I wear it and I can't choose a Combat Style. There are only "Punch, kick &' block". The problem with a maul, is that your Char doesn't even use the maul to attack. Is there any way to fix it? -World
  16. Well theres a small bug bothering me, sometimes when im in combat with an npc you will DD ontop of them and it will stop combat until you manually move from under them and continue attacking.. well put quite simply I want it to stop.. Im using Project Exile, which I believe is a PI base? Im not so sure. help is appreciated, thanks
  17. You have my permission to release this :)
  18. [CENTER][SIZE=3][COLOR="#0000FF"] NPC Editor - A Better Way To Edit [/COLOR][/SIZE] [SIZE=3][COLOR="#0000FF"]Private version available on my site, you NEED TO REGISTER to see the download. [/COLOR][/SIZE][/CENTER] [SIZE=2][COLOR="#FF0000"]This application was made to better organize and edit unpacked..txts. There are instructions on the GUI. The easiest way to run this application is in your server folder. It will assume default "data/npcs/". Please make sure you always back up your server![/COLOR][/SIZE] Download: [url]www.trinityx.org/NPCEditor.jar[/url] This application is not being publicly updated, you will need to sign up at my site [url=http://www.trinityx.org/forums]Trinity X • Index page[/url] to receive the next few updates which include drop editor functions. I'm also using this application to develop my server. As some of you might request I've included some pictures below, Note that the SOURCE CODE is public at my website in addition the application is not obfuscated so any java decompiler will decompile it fine. The application is self explanatory just edit the tables by clicking on them then save. To add new NPC def or NPC bonus just click the button and follow the directions on the popup. The only difference is when you try to delete a spawn, just select the one you want to delete and click button. The application will save automatically if you delete or add but to be safe you can save again. WARNING, running 2 instances will cause a error that will delete your unpacked...txt please be careful. [IMG]http://i.imgur.com/FOkYnPL.png[/IMG] [IMG]http://i.imgur.com/SPt4k3C.png[/IMG] [IMG]http://i.imgur.com/zXQVzMk.png[/IMG] [COLOR="#FF0000"][CENTER][SIZE=3]Features & Pictures of private editor [/SIZE][/CENTER][/COLOR] This version is downloadable at my website if you are registered! [COLOR="#FF0000"]You can have the list to left show NPC ids or you can switch to show drop Ids, you can use most options to add and remove elements from list or table! More instructions in application![/COLOR] [IMG]http://i.imgur.com/ZvU4rvE.png[/IMG] [IMG]http://i.imgur.com/ImZAATw.png[/IMG]
  19. Hello guys, I've been working on the original matrix base for several months now. I've fixed many issues and bugs over that period of time. Now i have come across a major issue especially for hybridders. When both players are frozen diagonally from each other and switch to melee combating you can then fight diagonally until one of the players are unfrozen. I am not asking to be spoon fed with some snippet or anything like that i have tried multiple times to fix the issue myself, tried to search for answers all across rune-server, Google, Bing etc.. i have seen a few threads with people trying to solve the same issue but cannot find the least bit of information on solving this problem correctly. would anyone with a greater knowledge of java have any tips or hints on how to go about resolving this in the matrix base? i would be willing to offer cash/rep/thanks as a reward to help me figure this out. I appreciate your time if you have read my post and would be willing to provide a little assistance. I know alot of other people need a little boost aswell.
  20. deoinl

    614 combat

    can someone help me remove delays before spec
  21. Hi, If i try to add a combat script to a npc, it doesnt load. I putted it into the right location (src/com/rs/game/npc/combat/impl) Did i do something wrong ? im using the zenith 667 source if your wondering. Kind regards, Kon
  22. I am trying to create a new npc but how do I give it a range, def, str level? I looked in the combatdifinitions.xml and all it ask for is health, max hit and the animations you are using?. I have combat added to my npc but it seems too weak so I want to make it stronger in its mage range and melee attacks but cant find out how to increase those parameters. were and how do i increase the str range and def of an npc. Thank you
  23. Go To Client.java And Find: [CODE]getCombatLevel()[/CODE] Replace The Whole Method With: [CODE]public int getCombatLevel() { int mag = (int) ((getLevelForXP(playerXP[6]))); int ran = (int) ((getLevelForXP(playerXP[4]))); int strl = (int) ((getLevelForXP(playerXP[2]))); int att = (int) ((getLevelForXP(playerXP[0]))); int def = (int) ((getLevelForXP(playerXP[1]))); if (ran > mag && ran > strl && ran > att) { combatLevel = (ran) + (def) + 2; } else if (mag > ran && mag > strl && mag > att) { combatLevel = (mag) + (def) + 2; } else if (strl > ran && strl > mag && strl > att) { combatLevel = (strl) + (def) + 2; } else if (att > ran && att > mag && att > strl) { combatLevel = (att) + (def) + 2; } else { combatLevel = (strl) + (def) + 2; } return combatLevel; }[/CODE] This Will Add The New Combat Formula That Is In Runescape Beta Servers. Max Combat Level: 200 How To Calculate: X + Defence Level + 2. X = The Highest Of Ranged, Strength, Attack And Magic.
  24. So my problem is when a player is maxed combat lvl 126 he can't attack a lvl 138cb because the player with 138cb has 99summoning.My question is.How can i prevent summoning as a non-comabt skill?Like it'll show the player 138cb but they can still atk lvl 126cb in the wilderness.But if the player was 125cb and the player is 138cb,the only way they can fight in the wilderness is if they go to level 2 wilderness.HELP! THX! :D!
  25. [code] /* * int hitModifier: * increases by the postive difference between the * npcs attack bonuses and the players defence bonuses * it then increases by the positive difference between the * npcs attack level and the players defence level * it is then decreased by the players combat level * it is then increased by the npcs strength level then divided by ten * * the final hit is then based on * if lastHit isnt initial * if lasthit is greater then threequarters of the npcs max hit * there is a 50% chance it will hit 25% less then its max hit * else if lasthit is less then a quarter of the npcs max hit * there is a 50% chance that it will hit 25% more then its max hit * else * there will be a random chance of hitting its max hit * else * there will be a random chance of hitting its max hit * */ public int calculateNpcHit(Player player){ int = 0; for(int i = 0; i <=2; i++){ hitModifier += getBonuses()[i] > player.playerBonus[i+5] ? getBonuses()[i] - player.playerBonus[i+5] : 0; } hitModifier += getStats()[0] > player.playerLevel[1] ? getStats()[0] - player.playerLevel[1] : 0; hitModifier -= hitModifier > player.combatLevel ? player.combatLevel : hitModifier; int maxHit = (hitModifier + getStats()[2]) / 10; int hit = 0; hit = lastHit > -1 ? lastHit > (maxHit * .75) && (rand.nextInt(10) >= 5) ? (int) (maxHit * .75) : lastHit < (maxHit * .25) && (rand.nextInt(10) >= 5) ? (int) (maxHit + (maxHit * .10)) : Misc.random(maxHit ) : Misc.random(maxHit ); System.out.println("HitMod: " + hitModifier + ", max: " + maxHit + ", last: " + lastHit + ", hit: " + hit); lastHit = hit; return hit; } [/code] for melee combat only, calculation actually makes sense unlike most servers npc hit calculations, actually takes into account players defence bonuses, notice you'll have to figure out how to give npcs stats and bonuses, i'm not going to tell you how to do that as its pretty easy also added some sort of adrenaline effect, if the npc is hitting low it will have a chance to hit higher then normal, and vice versa
×