Sanity 436 Posted September 28, 2017 Report Share Posted September 28, 2017 Noticed that when I redid projectiles on Elvarg, the magic ones were messed up. To fix it, simply replace CombatSpells.java with mine. It's quite a big class so I'll use pastebin. This is the hidden content, please Sign In or Sign Up Now, some people wanted help with adding tridents so I'll give you a proper base below. Let's make it so when we equip a trident, it will update our autocast spell. To do this, open EquipPacketListener.java and find "void resetWeapon(Player player)" At the bottom of this method, you should find: if(player.getCombat().getAutocastSpell() != null) { Autocasting.setAutocast(player, null); player.getPacketSender().sendMessage("Autocast spell cleared."); } If you examine the current code, you will see that it's currently reseting autocast everytime when switching weapon. Replace it with this: Item weapon = player.getEquipment().getItems()[Equipment.WEAPON_SLOT]; //Check if player is using a trident. If so, set autocast to respective spell.. if(weapon.getId() == 11905) { Autocasting.setAutocast(player, CombatSpells.TRIDENT_OF_THE_SEAS.getSpell()); } else if(weapon.getId() == 12899) { Autocasting.setAutocast(player, CombatSpells.TRIDENT_OF_THE_SWAMP.getSpell()); } else { //Otherwise always reset autocast when switching weapon if(player.getCombat().getAutocastSpell() != null) { Autocasting.setAutocast(player, null); player.getPacketSender().sendMessage("Autocast spell cleared."); } } Now, we're updating autocast if switching to a trident, and reseting autocast if not. Finally we need to make it so players can't choose a different autocast spell when using a trident, just like osrs. Simply open Autocasting.java, and find this code: if(cbSpell.levelRequired() > player.getSkillManager().getCurrentLevel(Skill.MAGIC)) { player.getPacketSender().sendMessage("You need a Magic level of at least "+cbSpell.levelRequired()+" to cast this spell."); setAutocast(player, null); return true; } Under it, add: Item weapon = player.getEquipment().getItems()[Equipment.WEAPON_SLOT]; //Check if player is using a trident. If so, do not allow player to change autocast spell. if(weapon.getId() == 11905 || weapon.getId() == 12899) { player.getPacketSender().sendMessage("You cannot change your autocast spell since you're wearing a trident."); return false; } And you're done! Magic projectiles: Tridents: (Fix the projectile for these two yourself by playing around with the start/end heights etc. For some reason same values as other projectiles didn't work.) 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...
Mevaderiseenhoer 1 Posted January 19, 2022 Report Share Posted January 19, 2022 Thanks 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