• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

tfs 1.0 config.lua less exhaustion

frock1337

New Member
Joined
Aug 31, 2014
Messages
35
Reaction score
0
Can anyone help me make a global line to reduce exhaustion for all spells?
I can do it 1 by 1 I know but I want to do it all together with something in config.lua so I can choose how much less exhaustion I get (now its like real tibia)
 
The only way I see this happening is if you edit the functions that handle spells and exhaustion, specifically the section that reads the xml files for the exhaust values. Remove the part that reads the exhaust from the xml, and replace it with a variable that is read from config.lua.

All of this is C++ work.
 
The only way I see this happening is if you edit the functions that handle spells and exhaustion, specifically the section that reads the xml files for the exhaust values. Remove the part that reads the exhaust from the xml, and replace it with a variable that is read from config.lua.

All of this is C++ work.
hmm how long does it take do you think for an experienced programmer to do that?
 
30-60 minutes maybe. Contact @Fallen I'm sure he can do it for you.
whoever needs that long for this, is working like a snail ^^

so you want a variable to decrease the spell exhaustion right?
example:
in config:
decreaseSpellExhaust = 1000

Spell A = 3000 exhaust (original in spells.xml)
after
Spell A = 2000 exhaust

If you want it like this, then I can help you, it's not really that hard to do.
 
Last edited:
configmanager.h
search:
Code:
MAX_PACKETS_PER_SECOND = 30,
add after:
Code:
DECREASE_SPELL_EXHAUST = 31,

configmanager.cpp
search:
Code:
m_confInteger[MAX_PACKETS_PER_SECOND] = getGlobalNumber(L, "maxPacketsPerSecond", 25);
add after:
Code:
m_confInteger[DECREASE_SPELL_EXHAUST] = getGlobalNumber(L, "decreaseSpellExhaust", 0);

config.lua
Code:
decreaseSpellExhaust = 0
change the 0 to 1000 for 1 second less exhaustion (don't put a - infront !)

spells.cpp
edit this only, if you want groupCooldown to be effected aswell.
search:
Code:
groupCooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
groupCooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

edit this only, if you want secondaryGroupCooldown to be effected aswell.
search:
Code:
secondaryGroupCooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
secondaryGroupCooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

this is for the main exhaustion / cooldown
search:
Code:
cooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
cooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));
 
configmanager.h
search:
Code:
MAX_PACKETS_PER_SECOND = 30,
add after:
Code:
DECREASE_SPELL_EXHAUST = 31,

configmanager.cpp
search:
Code:
m_confInteger[MAX_PACKETS_PER_SECOND] = getGlobalNumber(L, "maxPacketsPerSecond", 25);
add after:
Code:
m_confInteger[DECREASE_SPELL_EXHAUST] = getGlobalNumber(L, "decreaseSpellExhaust", 0);

config.lua
Code:
decreaseSpellExhaust = 0
change the 0 to 1000 for 1 second less exhaustion (don't put a - infront !)

spells.cpp
edit this only, if you want groupCooldown to be effected aswell.
search:
Code:
groupCooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
groupCooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

edit this only, if you want secondaryGroupCooldown to be effected aswell.
search:
Code:
secondaryGroupCooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
secondaryGroupCooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

this is for the main exhaustion / cooldown
search:
Code:
cooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
cooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

I do have to compile the server for this to work right?
I do not understand btw what compiling is will anything change when I compile it?
 
configmanager.h
search:
Code:
MAX_PACKETS_PER_SECOND = 30,
add after:
Code:
DECREASE_SPELL_EXHAUST = 31,

configmanager.cpp
search:
Code:
m_confInteger[MAX_PACKETS_PER_SECOND] = getGlobalNumber(L, "maxPacketsPerSecond", 25);
add after:
Code:
m_confInteger[DECREASE_SPELL_EXHAUST] = getGlobalNumber(L, "decreaseSpellExhaust", 0);

config.lua
Code:
decreaseSpellExhaust = 0
change the 0 to 1000 for 1 second less exhaustion (don't put a - infront !)

spells.cpp
edit this only, if you want groupCooldown to be effected aswell.
search:
Code:
groupCooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
groupCooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

edit this only, if you want secondaryGroupCooldown to be effected aswell.
search:
Code:
secondaryGroupCooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
secondaryGroupCooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));

this is for the main exhaustion / cooldown
search:
Code:
cooldown = pugi::cast<uint32_t>(attr.value());
replace with:
Code:
cooldown = (pugi::cast<uint32_t>(attr.value()) - g_config.getNumber(ConfigManager::DECREASE_SPELL_EXHAUST));
Lel, that's nice. This should be added to the main repository for sure x)
 
Back
Top