Tutus Frutus 352 Posted August 20, 2019 Report Share Posted August 20, 2019 (edited) Mornin fella's, this snippet is nothing special but a lot of people are not aware of how simple this could be done and therefor I release this snippet to show you/them. Received several requests to add this for 20-30$ whilst it's not even worth a dime... Example from OSRS Wiki I am talking about: https://oldschool.runescape.wiki/w/Dragonbane_weapons The base I use as example will be Ascend or SpecialPKz, a PI based 317... First, you want to declare a list of NPC's... you can do this anywhere you want but I personally prefer NPC.java as it's the most logic place to declare it (in my opinion).. public boolean isDemon() { switch (npcType) { case 1531: case 3134: case 2006: case 2026: case 7244: case 1432: case 415: case 7410: case 135: case 3133: case 484: case 1619: case 7276: case 3138: case 7397: case 7398: case 11: return true; } return false; } public boolean isDragon() { switch (npcType) { case 137: case 139: case 239: case 241: case 242: case 243: case 244: case 245: case 246: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: case 256: case 257: case 258: case 259: case 260: case 261: case 262: case 263: case 264: case 265: case 266: case 267: case 268: case 269: case 270: case 271: case 272: case 273: case 274: case 275: case 465: case 1871: case 1872: case 2642: case 2918: case 2919: case 4385: case 5194: case 5872: case 5873: case 5878: case 5879: case 5880: case 5881: case 5882: case 6502: case 6593: case 6636: case 6652: case 7039: case 7253: case 7254: case 7255: case 7273: case 7274: case 7275: case 8027: case 7553: case 7554: case 7555: return true; } return false; } Add it anywhere in the code... I removed a part of the list for 181, adapt it to your own ID's and add accordingly. Now, how does one apply this to an item? As simple as the Ctrl C + Ctrl V you did before... Go into AttackNPC.java Find switch (defender.npcType) { Underneath you see a bunch of cases.. Add a new case and declare the damage including the check for wether the NPC isDemon or isDragon... In my case I show you the preview of my Dragon Hunter Lance: case 22978: //Dragon Hunter Lance if (attacker.lastWeaponUsed == 22978 && defender.isDragon()) { damage *= 1.2; accuracy *= 1.2; } break; (can copy/paste it in) As you can see, the case & lastWeaponUsed correspond to the Item you're using to fight the NPC, the && defender.isDragon() check simply looks through all those cases... if the NPC you are fighting is any of these ID's then it amplifies the Damage & Accuracy.. This can be done for anything... just make one of those lists, name it accordingly and apply it this way. Enjoy. Edited August 20, 2019 by Tutus Frutus Link to comment Share on other sites More sharing options...
rabeax17 5 Posted August 20, 2019 Report Share Posted August 20, 2019 Thank you Link to comment Share on other sites More sharing options...
Tutus Frutus 352 Posted August 20, 2019 Author Report Share Posted August 20, 2019 5 minutes ago, rabeax17 said: Thank you Link to comment Share on other sites More sharing options...
Dome Fossil 0 Posted April 1, 2020 Report Share Posted April 1, 2020 Thank you!! It's kind of funny how I was looking for exactly this...and..here it is! Link to comment Share on other sites More sharing options...
Faz 0 Posted April 1, 2020 Report Share Posted April 1, 2020 Simple but htanks ............... Link to comment Share on other sites More sharing options...
Artur 0 Posted April 6, 2020 Report Share Posted April 6, 2020 Thank you for this release! Link to comment Share on other sites More sharing options...
CoinDozer 0 Posted April 21, 2020 Report Share Posted April 21, 2020 Thnx......................... Link to comment Share on other sites More sharing options...
nondairy 0 Posted April 25, 2020 Report Share Posted April 25, 2020 Nice looking and informative guide you have made. Nice work. Link to comment Share on other sites More sharing options...
bowlcutgod 16 Posted May 6, 2020 Report Share Posted May 6, 2020 nice but simple but goood i like it very much im venezuela Link to comment Share on other sites More sharing options...
SpiritOfTheLau 0 Posted May 9, 2020 Report Share Posted May 9, 2020 Good stuff. A long switch statement of IDs is quite difficult to maintain so it might be worth using the NPC cache definitions to use names of NPCs instead. I.e if the NPC name contains "wyrm" or "dragon" but it really isn't a super huge deal at this level. Well done Link to comment Share on other sites More sharing options...
Xan 0 Posted May 24, 2020 Report Share Posted May 24, 2020 cheers for this, haven't used a PI source in a long time. Link to comment Share on other sites More sharing options...
capriojp 0 Posted May 27, 2020 Report Share Posted May 27, 2020 thanks dude, definitely helpful Link to comment Share on other sites More sharing options...
Wintergreenrs413 0 Posted August 15, 2020 Report Share Posted August 15, 2020 This is going to help me out alot, cheers my mans! Link to comment Share on other sites More sharing options...
raellec7 0 Posted January 18, 2022 Report Share Posted January 18, 2022 thanks Link to comment Share on other sites More sharing options...
wulfite 0 Posted January 19, 2022 Report Share Posted January 19, 2022 thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now