Thread: Adding a special attack bar to a new weapon

Results 1 to 3 of 3
  1. #1  
    Project Asgardia

    Gandalf's Avatar
    Join Date
    Nov 2011
    Posts
    789
    Thanks given
    32
    Thanks received
    396
    Discord
    View profile
    Rep Power
    2474
    Did you update your weapon (11588) in weapon_interface.json?

    Did you update your weapon (11588) in weapon_interface.json?
    Reply With Quote  
     

  2. #2 Adding a special attack bar to a new weapon 
    Learning...

    Mathy's Avatar
    Join Date
    Jul 2013
    Posts
    230
    Thanks given
    30
    Thanks received
    12
    Rep Power
    82
    Spoiler for Problem with Spec Bar RUSE:
    Hey everyone,

    I'm trying to add a spec bar to a weapon on my Ruse based server. I looked around, found that needed to add the infos of the spec in CombatSpecial.java, so I added this. I based it off of the Korasi's sword which I put below.
    Spoiler for CombatSpecial.java:
    Code:
     
    	/*weapon item id
    	 *spec % used
    	 *strength bonus
    	 *accuracy bonus
    	 * combat type - melee - mage - range
    	 * weapon interface
    	 */
       REAPER_SCYTHE(new int[]{11588}, 10, 9.8, 9.8, CombatType.MELEE, WeaponInterface.SCYTHE) {
        		@Override
        			public CombatContainer container(Player player, Character target) {
        				player.performAnimation(new Animation(2062));
        				player.performGraphic(new Graphic(1958));
                
        				return new CombatContainer(player, target, 2, CombatType.MELEE, true) { 
        					@Override
        						public void onHit(int damage, boolean accurate) {
        							target.performGraphic(new Graphic(1194));
        			}				
        		};
            }  
        },
    
        KORASIS_SWORD(new int[]{19780}, 60, 1.55, 10, CombatType.MELEE, WeaponInterface.SWORD) {
                    @Override
                    public CombatContainer container(Player player, Character target) {
    
                        player.performAnimation(new Animation(14788));
                        player.performGraphic(new Graphic(1729));
    
                        return new CombatContainer(player, target, 1, 1, CombatType.MAGIC, true) {
                            @Override
                            public void onHit(int damage, boolean accurate) {
                                target.performGraphic(new Graphic(1730));
                            }
                        };
                    }
                },


    Which didn't change anything, still no spec bar.

    I then tried looking for any other custom weapons with a spec that were added, I found a razor whip, so I tried looking for that Item ID to see if I missed some place where I needed to add my custom weapon's ID, couldn't find a thing for that weapon spec, nor for any other specs.

    I then tried switching the Korasi's Sword's ID with my custom weapon, switched it everywhere I could find, still no spec for the weapon when I spawned my weapon which had all the Korasi's infos.

    I then found that it can be changed in the cache, so I tried Tom's Cache Suite, but when I look in the first index which are for items, I went to 11588 (my custom weapon's ID) and found this:
    Spoiler for Tom's Cache Suite:


    I then tried Frosty's Cache editor, but when I try to load items I get this:
    Spoiler for Frosty's cache editor:
    Code:
    [Console]: Console Started.
    [Main]: ToolSelection Started
    [Main]: FrostyCacheEditor v0.5
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 19
    	at com.alex.utils.Utils.getItemDefinitionsSize(Utils.java:67)
    	at com.editor.item.ItemSelection.addAllItems(ItemSelection.java:223)
    	at com.editor.item.ItemSelection.initComponents(ItemSelection.java:188)
    	at com.editor.item.ItemSelection.<init>(ItemSelection.java:48)
    	at com.editor.ToolSelection.submitButtonActionPerformed(ToolSelection.java:133)
    	at com.editor.ToolSelection.access$0(ToolSelection.java:130)
    	at com.editor.ToolSelection$1.actionPerformed(ToolSelection.java:76)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$500(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)


    And here are what the cache files look like:
    Spoiler for Cache file indexes:

    Which I'm pretty sure is the right way to have them named.

    I am stumped, please help me

    Thanks!

    FIXED! In weaponinterfaces.java, I located this:
    Code:
    						SCYTHE(776, 779, 6, new FightType[] { FightType.SCYTHE_REAP,
    								FightType.SCYTHE_CHOP, FightType.SCYTHE_JAB,
    								FightType.SCYTHE_BLOCK },
    Which is for all scythes, but it's fine for now.
    I then looked for another wep that I know has a spec bar, e.g. Dragon Halberd:
    Code:
    HALBERD(8460, 8463, 6, new FightType[] { FightType.HALBERD_JAB,
    FightType.HALBERD_SWIPE, FightType.HALBERD_FEND }, 8493, 8505),
    , so I changed the SCYTHE code to this:
    Code:
    						SCYTHE(8460, 8463, 6, new FightType[] { FightType.SCYTHE_REAP,
    								FightType.SCYTHE_CHOP, FightType.SCYTHE_JAB,
    								FightType.SCYTHE_BLOCK }, 8493, 8505),
    Which made the button appear!
    The only thing is now the buttons are for the Dragon Halberd (Jab, Swipe, Fend), but the spec I set for the scythe works!
    If anyone knows another way or how I can make it so it is the actual scythe buttons, otherwise this'll do until I learn more.

    Hope this can help someone.
    Last edited by Mathy; 03-31-2020 at 06:52 PM.
    Spoiler for Vouches:
    Quote Originally Posted by StrayDog View Post
    Thanks Mathy for helping me with my server
    Quote Originally Posted by triscool1987 View Post
    Great Help, thanks Mathy_!
    Reply With Quote  
     

  3. #3  
    Learning...

    Mathy's Avatar
    Join Date
    Jul 2013
    Posts
    230
    Thanks given
    30
    Thanks received
    12
    Rep Power
    82
    Quote Originally Posted by Gandalf View Post
    Did you update your weapon (11588) in weapon_interface.json?

    Did you update your weapon (11588) in weapon_interface.json?
    Yes, put it near the top alongside other spec weapons
    Code:
      {
        "hash": 11588,
        "item-id": 11588,
        "interface": "SCYTHE"
      },
    Btw how did you comment on my thread 30 minutes before I posted it lol
    Spoiler for Vouches:
    Quote Originally Posted by StrayDog View Post
    Thanks Mathy for helping me with my server
    Quote Originally Posted by triscool1987 View Post
    Great Help, thanks Mathy_!
    Reply With Quote  
     


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: 7
    Last Post: 03-30-2016, 04:49 PM
  2. Replies: 1
    Last Post: 11-09-2014, 01:55 AM
  3. Replies: 2
    Last Post: 03-08-2014, 08:52 AM
  4. Replies: 2
    Last Post: 04-08-2013, 04:59 PM
  5. My New Special Attack Bar
    By TheElveAge in forum Show-off
    Replies: 23
    Last Post: 10-02-2012, 11:44 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •