• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Programmer Add the command pvpe exp in config

abdala ragab

Veteran OT User
Joined
Aug 18, 2018
Messages
458
Solutions
11
Reaction score
338
Location
gamelaot.sytes.net

Can it be added in config to control combat levels?
will need to add something similar to ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE in source
like ConfigManager::pVPENFO_CONFIG
and i can add something like PVPENFO_CONFIG = 0.75
and in script return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * ConfigManager::pVPENFO_CONFIG));

but i need to declare something before it will work
ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE
later i will dont need to recompile everytime when u want to change this 0.75

cuz it will be changable in config.lua
I hope so
i use tfs 1.2 windows
 
Last edited:

Can it be added in config to control combat levels?
will need to add something similar to ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE in source
like ConfigManager::pVPENFO_CONFIG
and i can add something like PVPENFO_CONFIG = 0.75
and in script return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * ConfigManager::pVPENFO_CONFIG));

but i need to declare something before it will work
ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE
later i will dont need to recompile everytime when u want to change this 0.75

cuz it will be changable in config.lua
I hope so
i use tfs 1.2 windows
How much do you want in this job?

configmanager.h

Below of:

Lua:
EXP_FROM_PLAYERS_LEVEL_RANGE,

Add:

Lua:
EXP_FROM_PLAYERS_RATIO_PERCENT,

---

configmanager.cpp

Below of:

Lua:
integer[EXP_FROM_PLAYERS_LEVEL_RANGE] = getGlobalNumber(L, "expFromPlayersLevelRange", 75);

Add:

Lua:
integer[EXP_FROM_PLAYERS_RATIO_PERCENT] = getGlobalNumber(L, "expFromPlayersRatioPercent", 75);

---

luascript.cpp

Below of:

Lua:
registerEnumIn("configKeys", ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE)

Add:

Lua:
registerEnumIn("configKeys", ConfigManager::EXP_FROM_PLAYERS_RATIO_PERCENT)

---

player.cpp

Overwrite this line:

Lua:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));

By this line:

Lua:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * (g_config.getNumber(ConfigManager::EXP_FROM_PLAYERS_RATIO_PERCENT) / 100.)));

---

config.lua (if you want to commit it in your repository, put it also in config.lua.dist)

Below of:

Lua:
expFromPlayersLevelRange = 75

Add:

Lua:
expFromPlayersRatioPercent = 75

---

Note: 75 means 75%.
 
configmanager.h

Below of:

Lua:
EXP_FROM_PLAYERS_LEVEL_RANGE,

Add:

Lua:
EXP_FROM_PLAYERS_RATIO_PERCENT,

---

configmanager.cpp

Below of:

Lua:
integer[EXP_FROM_PLAYERS_LEVEL_RANGE] = getGlobalNumber(L, "expFromPlayersLevelRange", 75);

Add:

Lua:
integer[EXP_FROM_PLAYERS_RATIO_PERCENT] = getGlobalNumber(L, "expFromPlayersRatioPercent", 75);

---

luascript.cpp

Below of:

Lua:
registerEnumIn("configKeys", ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE)

Add:

Lua:
registerEnumIn("configKeys", ConfigManager::EXP_FROM_PLAYERS_RATIO_PERCENT)

---

player.cpp

Overwrite
this line:

Lua:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));

By this line:

Lua:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * (g_config.getNumber(ConfigManager::EXP_FROM_PLAYERS_RATIO_PERCENT) / 100.)));

---

config.lua (if you want to commit it in your repository, put it also in config.lua.dist)

Below of:

Lua:
expFromPlayersLevelRange = 75

Add:

Lua:
expFromPlayersRatioPercent = 75

---

Note: 75 means 75%.
Overwrite this line:
=To add this line above this?
 
configmanager.h

Below of:

Lua:
EXP_FROM_PLAYERS_LEVEL_RANGE,

Add:

Lua:
EXP_FROM_PLAYERS_RATIO_PERCENT,

---

configmanager.cpp

Below of:

Lua:
integer[EXP_FROM_PLAYERS_LEVEL_RANGE] = getGlobalNumber(L, "expFromPlayersLevelRange", 75);

Add:

Lua:
integer[EXP_FROM_PLAYERS_RATIO_PERCENT] = getGlobalNumber(L, "expFromPlayersRatioPercent", 75);

---

luascript.cpp

Below of:

Lua:
registerEnumIn("configKeys", ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE)

Add:

Lua:
registerEnumIn("configKeys", ConfigManager::EXP_FROM_PLAYERS_RATIO_PERCENT)

---

player.cpp

Overwrite
this line:

Lua:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));

By this line:

Lua:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * (g_config.getNumber(ConfigManager::EXP_FROM_PLAYERS_RATIO_PERCENT) / 100.)));

---

config.lua (if you want to commit it in your repository, put it also in config.lua.dist)

Below of:

Lua:
expFromPlayersLevelRange = 75

Add:

Lua:
expFromPlayersRatioPercent = 75

---

Note: 75 means 75%.
Oh man, what you said didn't work I did it from the source 15.75 But I don't like it, I want to add it in config and it works properly
 
Oh man, what you said didn't work I did it from the source 15.75 But I don't like it, I want to add it in config and it works properly
im looking for the same for a war ot , can you explain what it should be done ?
 
Back
Top