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