• 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 0.3.7 Defense not work.

Dibis

Member
Joined
Dec 1, 2022
Messages
73
Reaction score
16
Location
POLAND
Hello.
Have problem with defense in TFS 0.3.7.
If have chain armor and cyclop attack me 50HP and when have MPA too.
Whats wrong with sources?


[EDIT]
ARMORS DEFENSE WORK BUT SHIELDING NOT WORKING.
I HAVE 10 SHIELDING AND 35 SHIELDING AND THE SAME HITS BY MONSTERS!
 
Last edited:
Are your sources based on OTX ?

Yes - OTX2.
I found this on: Formulae (https://tibia.fandom.com/wiki/Formulae#Armor_and_Defense)

Armor and Defense​

  • Damage reduction
Min:
{\displaystyle totalArmor\cdot 0.475}

Max:
{\displaystyle totalArmor\cdot 0.95-1}


In creature cpp have:

C++:
minArmorReduction = (int32_t)std::ceil(armorValue * 0.475);
                maxArmorReduction = (int32_t)std::ceil(
                    ((armorValue * 0.475) - 1) + minArmorReduction);

Formula MAX is to low? Maybe:
((armorValue * 0.95) - 1) + minArmorReduction);
 
Last edited:
Yes - OTX2.
I found this on: Formulae (https://tibia.fandom.com/wiki/Formulae#Armor_and_Defense)

Armor and Defense​

  • Damage reduction
Min:
{\displaystyle totalArmor\cdot 0.475}

Max:
{\displaystyle totalArmor\cdot 0.95-1}


In creature cpp have:

C++:
minArmorReduction = (int32_t)std::ceil(armorValue * 0.475);
                maxArmorReduction = (int32_t)std::ceil(
                    ((armorValue * 0.475) - 1) + minArmorReduction);

Formula MAX is to low? Maybe:
((armorValue * 0.95) - 1) + minArmorReduction);
edit: this wont work ~ I will post another formula
 
Last edited:
Back
Top