Hi,
Hope BDO is treating you all well ^^
So I decided to learn a bit about the server and while I don’t really have anything groundbreaking to share, I figured that someone can find those thingies at least useful. Or funny. It’s a collection of little quality-of-life changes – mostly additional configuration options.
Be advised, those are based on DevilSpeak’s server repack, but I expect it to be compatible with whatever gameserver.jar file you’re using. As always when editing any files, be caution and keep backups
At the end of the post you’ll find a link to archive with all modified files compiled into .class files. Please, before replacing any parts of your gameserver.jar read entire post and ensure that you’re replacing all required files, since some files contain more than one change. Don’t forget - you’ll also have to manually change required .properties files.
Now, I’m sure that implementation of some of those may be far from ideal, so if you know better ways and you feel like sharing your methods, I’ll be more than grateful.
One last note – line numbers may not be precise. Just try to look a bit around the spot to search for same-ish looking code.
1. /server sync
This is a new chat command I added as workaround for disappearing NPCs. In a nutshell, it asks server to re-sent list of Creatures that should be visible for you in your current location. This re-spawns all alive Creatures on clients. Now, to be clear – this is NOT a fix for the problem, but using chat command is just faster and more convenient than re-logging.
Implementation:
WorldMap.java (line 203):
ServerCommandHandler.java:
2. Adrenaline multiplier
This allows to set a multiplier for adrenaline gain. From level 35 you’ll be getting a 1% of adrenaline for each kill. This configuration option lets you multiply this by an INTEGER value. You can change it go gain 2, 3, 10 or whatever value up to 100 per kill. You can put 0 to stop adrenaline gain, too. What you can’t do is to put a fraction in there, so 0.5 to just slow down adrenaline gain will not work.
Implementation:
BattleOptionConfig.java:
AttackResult.java (line 600):
Battleoption.properties:
3. Attack damage multiplier
Let’s you modify the damage you do to monsters and other player and how much will monsters do to you. This adds a multiplier that influences the (more-or-less) final damage number that is later passed to the target to lower their health. I added it to tweak the combat into more hard-core PvE experience and use it with re-spawn delay described below.
Implementation:
BattleOptionConfig.java:
AttackResult.java (line 576):
Battleoption.properties:
4. Spawn delay
Allows for controlling respawn times of monsters. When you start the server all monsters are spawned, and when you kill them they will re-spawn after normal time PLUS value of this property. This is not a multiplier – this adds time (in milliseconds) to re-spawn timers.
Implementation:
BattleOptionConfig.java:
RespawnService.java (lines 40 and 47):
battleoption.properties:
5. Energy regen
This let’s you set the amount of energy regenerated per tick.
Implementation:
EtcOptionConfig.java:
PlayerStatTemplate.java (line 55):
etcoption.properties:
6. Drop quantity multiplier
Removed. New, fixed implementation was posted below.
If you have any question, ask away. Just keep in mind that I’m new to this, so please, be extra careful if you’ll try to implement any of those mods.
So… have fun
Hope BDO is treating you all well ^^
So I decided to learn a bit about the server and while I don’t really have anything groundbreaking to share, I figured that someone can find those thingies at least useful. Or funny. It’s a collection of little quality-of-life changes – mostly additional configuration options.
Be advised, those are based on DevilSpeak’s server repack, but I expect it to be compatible with whatever gameserver.jar file you’re using. As always when editing any files, be caution and keep backups
At the end of the post you’ll find a link to archive with all modified files compiled into .class files. Please, before replacing any parts of your gameserver.jar read entire post and ensure that you’re replacing all required files, since some files contain more than one change. Don’t forget - you’ll also have to manually change required .properties files.
Now, I’m sure that implementation of some of those may be far from ideal, so if you know better ways and you feel like sharing your methods, I’ll be more than grateful.
One last note – line numbers may not be precise. Just try to look a bit around the spot to search for same-ish looking code.
1. /server sync
This is a new chat command I added as workaround for disappearing NPCs. In a nutshell, it asks server to re-sent list of Creatures that should be visible for you in your current location. This re-spawns all alive Creatures on clients. Now, to be clear – this is NOT a fix for the problem, but using chat command is just faster and more convenient than re-logging.
Implementation:
WorldMap.java (line 203):
Code:
/* change method’s accessor from private to public */
public void notifyEnter(final Creature creature, final GameSector newSector, final boolean isNewSpawn, final boolean isRespawn) {}
ServerCommandHandler.java:
Code:
/* add method /*
@[I][B][URL="http://forum.ragezone.com/members/2000161204.html"]comman[/URL][/B][/I]dHandlerMethod
public static Object[] sync(final Player player, final String... params){
WorldMap worldMap = World.getInstance().getWorldMap();
worldMap.notifyEnter(player, worldMap.getGameSectorByCoords(player.getLocation().getX(), player.getLocation().getY()), false, false);
return new Object[]{EChatResponseType.Accepted, "Server synchronised."};
}
2. Adrenaline multiplier
This allows to set a multiplier for adrenaline gain. From level 35 you’ll be getting a 1% of adrenaline for each kill. This configuration option lets you multiply this by an INTEGER value. You can change it go gain 2, 3, 10 or whatever value up to 100 per kill. You can put 0 to stop adrenaline gain, too. What you can’t do is to put a fraction in there, so 0.5 to just slow down adrenaline gain will not work.
Implementation:
BattleOptionConfig.java:
Code:
/* add entry */
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Comments(comment = {"Adrenaline super skill progress multiplier", "Default: 1"})
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Property(name = "AdrenalineMultiplier", value = "1")
public static int ADRENALIN_SUPER_SKILL_MULTIPLIER;
AttackResult.java (line 600):
Code:
/* multiply (or replace) value in addAdrenaline() */
if (player.getLevel() >= BattleOptionConfig.ADRENALIN_SUPER_SKILL_MIN_LEVEL && target.isDead() && dmg > 0.0)
player.getGameStats().getAdrenalin().addAdrenalin(1 * BattleOptionConfig.ADRENALIN_SUPER_SKILL_MULTIPLIER, false);
Battleoption.properties:
Code:
# add entry
# Adrenaline super skill progress multiplier
# Default: 1
AdrenalineMultiplier = 2
3. Attack damage multiplier
Let’s you modify the damage you do to monsters and other player and how much will monsters do to you. This adds a multiplier that influences the (more-or-less) final damage number that is later passed to the target to lower their health. I added it to tweak the combat into more hard-core PvE experience and use it with re-spawn delay described below.
Implementation:
BattleOptionConfig.java:
Code:
/* add entries */
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Comments(comment = {"Final multiplier for damage done by monster to players", "Default: 1.0"})
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Property(name = "AttackDamageMultiMonsterToPlayer", value = "1.0")
public static float ATTACK_DAMAGE_MULTI_MONSTER_TO_PLAYER;
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Comments(comment = {"Final multiplier for damage done by player to monsters and other players", "Default: 1.0"})
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Property(name = "AttackDamageMultiPlayerToMonster", value = "1.0")
public static float ATTACK_DAMAGE_MULTI_PLAYER_TO_MONSTER;
AttackResult.java (line 576):
Code:
/* you need to add ‘Final multiplier assignment’ section between ‘Block calculation’ and ‘Health updates’. I include both those section in the snippet just to help with orientation. */
//////////////////////////////// Blocks Calculation
if (isFrontSideAttack && target.getActionStorage().getActionChartActionT().getGuardType().isDefence()) {
// If update is success, then deflect the damage.
if (target.getGameStats().getStunGauge().updateStunGauge(-dmg)) {
dmgType = EDmgType.Block;
dmg = 1;
}
}
//////////////////////////////// Final multiplier assignment
if (!isAttackerPlayerOrSummon() && target.isPlayer()) { // monster vs player
dmg = dmg * BattleOptionConfig.ATTACK_DAMAGE_MULTI_MONSTER_TO_PLAYER;
}else{ // player vs player, player vs monster
dmg = dmg * BattleOptionConfig.ATTACK_DAMAGE_MULTI_PLAYER_TO_MONSTER;
}
//////////////////////////////// Health updates
if (!Double.isNaN(dmg) && !Double.isInfinite(dmg)) {
if (dmg > 0)
target.getGameStats().getHp().updateHp(-dmg, attacker, true);
} else {
dmg = 0;
dmgType = EDmgType.Evasion;
return true;
}
Battleoption.properties:
Code:
# add entries
# Final multiplier for damage done by monster to players
# Default: 1.0
AttackDamageMultiMonsterToPlayer = 2.0
# Final multiplier for damage done by player to monsters and other players
# Default: 1.0
AttackDamageMultiPlayerToMonster = 0.05
4. Spawn delay
Allows for controlling respawn times of monsters. When you start the server all monsters are spawned, and when you kill them they will re-spawn after normal time PLUS value of this property. This is not a multiplier – this adds time (in milliseconds) to re-spawn timers.
Implementation:
BattleOptionConfig.java:
Code:
/* add entry */
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Comments(comment = {"Additional time in MILISECONDS that's added to all monsters re-spawn time.", "Default: 0"})
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Property(name = "AdditionalSpawnDelay", value = "0")
public static int ADDITIONAL_SPAWN_DELAY;
RespawnService.java (lines 40 and 47):
Code:
/* add the entry at the end of calculation lines. For clarity, I’m adding entire code to the snippet */
public void putBody(final DeadBody deadBody) {
if (deadBody.canRespawn()) {
final CreatureTemplate template = deadBody.getTemplate();
deadBody.setRespawnTime(System.currentTimeMillis() + template.getSpawnDelayTime() + Rnd.get(0, template.getSpawnVariableTime()) + BattleOptionConfig.ADDITIONAL_SPAWN_DELAY);
this.map.put(deadBody.getGameObjectId(), deadBody);
}
}
public void putCollect(final Collect collect) {
final CollectTemplate template = collect.getCollectTemplate();
collect.setRespawnTime(System.currentTimeMillis() + template.getSpawnDelayTime() + Rnd.get(0, template.getSpawnVariableTime()) + BattleOptionConfig.ADDITIONAL_SPAWN_DELAY);
this.map.put(collect.getGameObjectId(), collect);
}
battleoption.properties:
Code:
# add entry
# Additional time in MILISECONDS that's added to all monsters re-spawn time.
# Default: 0
# 18000000 = 5 hours
AdditionalSpawnDelay = 18000000
5. Energy regen
This let’s you set the amount of energy regenerated per tick.
Implementation:
EtcOptionConfig.java:
Code:
/* add entry */
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Comments(comment = {"Base WP regen per tick", "Default: 1.0"})
@[I][B][URL="http://forum.ragezone.com/members/1333384110.html"]Config[/URL][/B][/I]Property(name = "BaseWPRegen", value = "1.0")
public static float BASE_WP_REGEN;
PlayerStatTemplate.java (line 55):
Code:
/* change value in BaseElement constructor */
this.baseContainer.put(StatEnum.WPRegen, new BaseElement(EtcOptionConfig.BASE_WP_REGEN));
etcoption.properties:
Code:
# add entry
# Base WP regen per tick
# Default: 1.0
BaseWPRegen = 1000.0
6. Drop quantity multiplier
Removed. New, fixed implementation was posted below.
If you have any question, ask away. Just keep in mind that I’m new to this, so please, be extra careful if you’ll try to implement any of those mods.
So… have fun
Last edited: