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

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 [Elvarg/OSRS Pk] Fixed regular magic projectiles aswell as trident base. 
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    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. Click here to get it.

    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:
    Code:
    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:
    Code:
    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:
    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:
    Code:
    		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:
    Attached image

    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.)
    Attached image
    Attached image
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     


  2. #2  
    What's a sundial in the shade?

    Lumiere's Avatar
    Join Date
    May 2013
    Age
    27
    Posts
    543
    Thanks given
    224
    Thanks received
    100
    Rep Power
    113
    [SPOIL]
    Quote Originally Posted by Professor Oak View Post
    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. Click here to get it.

    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:
    Code:
    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:
    Code:
    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:
    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:
    Code:
    		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:
    Attached image

    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.)
    Attached image
    Attached image
    [/SPOIL]

    Thanks Oak

    Spoiler for Revy is perfect:
    Reply With Quote  
     

  3. #3  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Np, if someone manages to find the proper values for the trident projectiles please post them below.
    I tried the ones I used for all other magic projectiles but for some reason they didn't work at all haha.
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    🎶 As you're falling down 🎶


    uint32_t's Avatar
    Join Date
    Feb 2015
    Posts
    1,396
    Thanks given
    6,177
    Thanks received
    776
    Rep Power
    5000
    Quote Originally Posted by Professor Oak View Post
    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. Click here to get it.

    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:
    Code:
    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:
    Code:
    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:
    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:
    Code:
    		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:
    Attached image

    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.)
    Attached image
    Attached image
    Quoting because too many good things lost over the years plus I want to be able to easily find this.

    Good job!
    Quote Originally Posted by Idiot Bird View Post
    Quote Originally Posted by Velocity View Post
    lol np mate looks like the community brought ur rep down to ur IQ
    Not too sure about that, it's at 0 . It would have to go minus to even be remotely close to his IQ.
    Reply With Quote  
     

  6. #5  
    Registered Member r00tsecur's Avatar
    Join Date
    Apr 2017
    Posts
    20
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Currently the name tridnet of the swamps give me red sign, which wants me to create a enum in combat spells. Any fix?=
    Attached image
    Reply With Quote  
     

  7. #6  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by r00tsecur View Post
    Currently the name tridnet of the swamps give me red sign, which wants me to create a enum in combat spells. Any fix?=
    To fix it, simply replace CombatSpells.java with mine.
    It's quite a big class so I'll use pastebin. Click here to get it.
    ^ from the first part of the post lol
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  8. #7  
    Registered Member
    Join Date
    Feb 2013
    Age
    23
    Posts
    206
    Thanks given
    15
    Thanks received
    64
    Rep Power
    32
    I can't believe it's 2017 and people are still using the same shit design concept for retaining spell data on top of still hardcoding.

    1. I'm sorry, but overall this is terrible. You need to rethink your design.
    2. The code is seriously bloated, and the fact you're encapsulating anonymous classes within an enumeration is just disgusting.
    3. You're using Optional implementations pointlessly, and not even taking full advantage of it. Why even use them, you know the set data is never changing or has a possibility to be null so why even bother?
    4. There's plenty more cringe worthy about this post, but I cba to critique anymore.


    Seriously though, redesign this concept that was used in 2007. Just because it incorporates JDK8(terrible at that) and it's documented does not make this any better. I'm sorry to be blunt, but it's no different than the critiquing you do to others. I'll probably post an example on how this could be improved when I'm home so people don't complain about this post.


    Also, just because something works, doesn't mean it was done properly.
    Reply With Quote  
     

  9. #8  
    Registered Member
    Vippy's Avatar
    Join Date
    Oct 2014
    Age
    25
    Posts
    2,572
    Thanks given
    984
    Thanks received
    1,933
    Rep Power
    5000
    Cheers bud, you still working on this
    Reply With Quote  
     

  10. #9  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by Poolside Queer View Post
    I can't believe it's 2017 and people are still using the same shit design concept for retaining spell data on top of still hardcoding.

    1. I'm sorry, but overall this is terrible. You need to rethink your design.
    2. The code is seriously bloated, and the fact you're encapsulating anonymous classes within an enumeration is just disgusting.
    3. You're using Optional implementations pointlessly, and not even taking full advantage of it. Why even use them, you know the set data is never changing or has a possibility to be null so why even bother?
    4. There's plenty more cringe worthy about this post, but I cba to critique anymore.


    Seriously though, redesign this concept that was used in 2007. Just because it incorporates JDK8(terrible at that) and it's documented does not make this any better. I'm sorry to be blunt, but it's no different than the critiquing you do to others. I'll probably post an example on how this could be improved when I'm home so people don't complain about this post.


    Also, just because something works, doesn't mean it was done properly.
    Lol, why so mad? It's not even my code, it's from Asteria.
    I didn't post for feedback, I posted to help some people out who use the same system.
    I also don't like the way it's done but I don't work on this anymore so I couldn't care less.

    Quote Originally Posted by Poolside Queer View Post
    I'm sorry to be blunt, but it's no different than the critiquing you do to others.
    What? I for one very rarely post on anything except spam nowadays lol
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    thanks oak (Y)
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 399
    Last Post: 12-08-2021, 06:06 AM
  2. Replies: 6
    Last Post: 08-09-2010, 02:56 PM
  3. Replies: 55
    Last Post: 03-31-2009, 06:53 PM
  4. Fix 100% Magic Moderm on Npc
    By PrataKosong in forum Tutorials
    Replies: 15
    Last Post: 03-10-2009, 12:14 PM
  5. [ESPEON 508] Fixing Another Magic Bug
    By 4lch 2 B4rr4g3 in forum Tutorials
    Replies: 4
    Last Post: 01-30-2009, 04:32 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •