Jump to content
View in the app

A better way to browse. Learn more.

RuneSuite RSPS Development

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Elvarg/OSRS Pk] Fixed regular magic projectiles aswell as trident base.

Featured Replies

Posted
comment_13273

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


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:

3d737613162af493fc111cc19e15e341.gif

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.)

b5ad94d48a5f5f419ebff0e1876b4601.gif

41dee72673f9d860bf277c0364c3afb2.gif

  • 2 years later...
  • 1 year later...

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.