I made another thread because I just converted everything to json, didn't like the other way I did it (Some items might have the default sound id and you have to change but I haven't come across any)
Create a new class called equip_sounds.java in io.ruin.data.impl.items
equip_sounds.java:
Code:
package io.ruin.data.impl.items;
import com.google.gson.annotations.Expose;
import io.ruin.api.utils.JsonUtils;
import io.ruin.api.utils.ServerWrapper;
import io.ruin.cache.ItemDef;
import io.ruin.data.DataFile;
import io.ruin.model.achievements.Achievement;
import io.ruin.model.combat.RangedAmmo;
import io.ruin.model.combat.RangedWeapon;
import io.ruin.model.stat.StatType;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
public class equip_sounds extends DataFile {
@Override
public String path() {
return "items/equip_sounds.json";
}
@Override
public Object fromJson(String fileName, String json) {
List<Temp> temps = JsonUtils.fromJson(json, List.class, Temp.class);
temps.forEach(temp -> {
ItemDef def = ItemDef.get(temp.itemid);
if(def != null)
def.soundid = temp.soundid;
});
return temps;
}
public static final class Temp {
@ Expose public int itemid;
@ Expose public int soundid;
}
}
Go to io.ruin.cache > ItemDef
Add this with the other variables
Code:
public int soundid;
Add this return method
Code:
public int getSoundId() {
return soundid;
}
In io.ruin.model.item.containers > Equipment.java (delete old equip sounds if you added it from other thread)
You mean this?: C:\Users\HOME\Desktop\Kronos\Kronos-master\Kronos-master\kronos-server\build\classes\java\main\io\ruin\cache
If yes then it's gives me chines language in ItemDef.
You mean this?: C:\Users\HOME\Desktop\Kronos\Kronos-master\Kronos-master\kronos-server\build\classes\java\main\io\ruin\cache
If yes then it's gives me chines language in ItemDef.
There's 2 different files, "equip_sounds.java" and "equip_sounds.json" java and json two different files.
The java file goes to: io.ruin.data.impl.items (in the server files)
The json file goes to: data/items folder
What about the Lunge hit sound? Try to hit with Lunge it will show you incorrect sound attack
Chop + Slash + Block attack sound: 2500 it's fine and working
Lunge attack sound must be: 2501. I tried to change it, it's not working. You have any idea or way of make this button for 2501 sound ID?
[Only registered and activated users can see links. ]
What about the Lunge hit sound? Try to hit with Lunge it will show you incorrect sound attack
Chop + Slash + Block attack sound: 2500 it's fine and working
Lunge attack sound must be: 2501. I tried to change it, it's not working. You have any idea or way of make this button for 2501 sound ID?
[Only registered and activated users can see links. ]
You would have to code it in (add another setting in the weapon_types.json and then check what attack style you are using.)
Updated equip_sounds with more items
Originally Posted by Ilgaz
What about the Lunge hit sound? Try to hit with Lunge it will show you incorrect sound attack
Chop + Slash + Block attack sound: 2500 it's fine and working
Lunge attack sound must be: 2501. I tried to change it, it's not working. You have any idea or way of make this button for 2501 sound ID?
[Only registered and activated users can see links. ]
What you can do instead of what I said above is edit the attackAnim() method in PlayerCombat.java
Lunge is not the only attacksound I gonna add. There are much more items combat I will add. I don't think it's good idea to add this attack anim including the sound ID of the stab in attackAnim method.
Anyway bro' I appricate ur help