• 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!

[c++][TFS 1.1]Where to remove monster resistances?

BloodGauntlet

Member
Joined
Jul 27, 2016
Messages
45
Reaction score
18
EDIT: This title is somewhat misleading and you can skip the paragraph below by knowing this is just an inquiry into changing calculations of armor, resistances, and def.

I've dug through players.cpp and combat.cpp, I'm searching for where the formulas that dictate how damage is mitigated by armor and resistances (for players and monsters). I don't pretend to really understand what the hell is happening the game logic in the server is way to complex for me but I just want to rewrite how applied damage is calculated. If anyone could point me to the area in which I could do so. Or crush my dreams and tell me that I have to change many areas of the source to accomplish this.
 
Last edited:
Sorry for the shameless double post, but I started looking over the blockHit methods, the one in creature.cpp is very clear about what's happening for armor, shield, and magic. The others handling items and fields. Does player.cpp and monster.cpp draw from creature.cpp, this is the only place I can find where the actual formulas are at.
 
your title says c++
But it is possible to rewrite entire damage system/formulas with lua (which means you don't have to compile the source)
 
It is, but its way slower, and so much more complicated. You can see in Creature::blockHit for example how armor works in this one line of code:
Code:
damage -= uniform_random(armor / 2, armor - (armor % 2 + 1));
 
Back
Top