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

Lua Armor

Apoccalypse

New Member
Joined
Apr 15, 2017
Messages
114
Solutions
2
Reaction score
4
Hi,
Recently I noticed that an armor at Tibia 8.6 based on the engine "The Forgotten Server 0.3.6 (Crying Damson) V8" works very bad.
I mean that I almost see no diffrence when a cyclop hits my 600 lvl knight with or without the Magic Plate Armor (arm:17).
Being honest the only diffrence is that with the armor I avoid more hits.
To see a diffrence (the reduced damage) I have to set the armor value in armors in houndreds like 300,400,500 and so on.
Is there any possibility to change the armor properties?
 
Solution
You can increase the armor values for each vocation at vocation.xml, that could be useful for you.
A better idea would be to find another server distro where armor works normally.
You can increase the armor values for each vocation at vocation.xml, that could be useful for you.
A better idea would be to find another server distro where armor works normally.
 
Solution
Armor is generally pretty useless. If I remember correctly, it blocks a random amount of PHYSICAL damage up to and including the number of total armor you have. If the hit would result in 0 damage, it'll then display a "poff".
@Flatlander would know more about this subject as he recently did a lot of work regarding the armor system in tibia.
In short though armor has always sucked in tibia unless fighting very low level monsters. Boost the numeric value of armor through the roof, rewrite your own armor formula, or enjoy a useless item stat basically.
 
Hello!
I will now explain how stupid TFS works in regards to Shielding, Armor, and Defense. (Yes this is TFS 1.X, or 0.X, both use basically the same code)

First for Defense:
Code:
damage -= uniform_random(defense / 2, defense);
This means, if you have 20 defense, you will block a random amount of damage between 10-20.
(So basically, defense blocks physical damage, and is a random number between half of your defense, and your total defense.

Now for Armor: It is more complex (for no reason, it basically does the exact same thing)
If you want the long explanation it is here:
Code:
if (armor > 3) {
damage -= uniform_random(armor / 2, armor - (armor % 2 + 1));
} else if (armor > 0) {
--damage;
}
Now I am not an expert in C, but I believe --damage; simply subracts 1 damage. Meaning, if you have 3 or less armor, it just subtracts one damage. (Yes, having 1, 2, or 3 armor, does the same thing it appears)

Now, if you have 4 or more armor, it does something very similar to defense:
Code:
damage -= uniform_random(armor / 2, armor - (armor % 2 + 1));
So the minimum is (armor/2) and the maximum is (armor -( armor%2+1)).
Now you might look at this sand say "What the fuck does (armor%2+1) do?". And you are right in saying this, because seriously, what the fuck.
Armor%2+1 does the following.
Lets say your armor is 21: (21%2) = 1. Why? Because the highest whole number that can divide into 21 2 times, is 10. so 10x20=20. Then 21-20 = 1. (It basically is the remainder)

Then, you might think. "Hey, wait, so if they are doing armor%2, this means every OTHER number, will be 0, then 1. Then you are adding one to that too.
20 is 0
21 is 1
22 is 0
23 is 1
etc
And the total math is (to my understanding)
20-((20%2)+1) = 19
21-((21%2)+1) = 19
22-((22%2)+1) = 21
23-((23%2)+1) = 21

Why do all this extra work for almost no in-game difference? Who the hell knows, but that is how it is done.

Honestly, they both basically work the same way.
Defense is a random number between half your defense, and your total defense.
Code:
math.random(defense/2, defense)
and Armor is the same thing.
Code:
math.random(armor/2, armor)

Now, this is honestly a terrible way to handle armor. So what if you want to change this?

Go into creature.cpp and change how armor works in the blockHit function.
If you have any further questions, let me know.
 
Hello!
I will now explain how stupid TFS works in regards to Shielding, Armor, and Defense. (Yes this is TFS 1.X, or 0.X, both use basically the same code)

First for Defense:
Code:
damage -= uniform_random(defense / 2, defense);
This means, if you have 20 defense, you will block a random amount of damage between 10-20.
(So basically, defense blocks physical damage, and is a random number between half of your defense, and your total defense.

Now for Armor: It is more complex (for no reason, it basically does the exact same thing)
If you want the long explanation it is here:
Code:
if (armor > 3) {
damage -= uniform_random(armor / 2, armor - (armor % 2 + 1));
} else if (armor > 0) {
--damage;
}
Now I am not an expert in C, but I believe --damage; simply subracts 1 damage. Meaning, if you have 3 or less armor, it just subtracts one damage. (Yes, having 1, 2, or 3 armor, does the same thing it appears)

Now, if you have 4 or more armor, it does something very similar to defense:
Code:
damage -= uniform_random(armor / 2, armor - (armor % 2 + 1));
So the minimum is (armor/2) and the maximum is (armor -( armor%2+1)).
Now you might look at this sand say "What the fuck does (armor%2+1) do?". And you are right in saying this, because seriously, what the fuck.
Armor%2+1 does the following.
Lets say your armor is 21: (21%2) = 1. Why? Because the highest whole number that can divide into 21 2 times, is 10. so 10x20=20. Then 21-20 = 1. (It basically is the remainder)

Then, you might think. "Hey, wait, so if they are doing armor%2, this means every OTHER number, will be 0, then 1. Then you are adding one to that too.
20 is 0
21 is 1
22 is 0
23 is 1
etc
And the total math is (to my understanding)
20-((20%2)+1) = 19
21-((21%2)+1) = 19
22-((22%2)+1) = 21
23-((23%2)+1) = 21

Why do all this extra work for almost no in-game difference? Who the hell knows, but that is how it is done.

Honestly, they both basically work the same way.
Defense is a random number between half your defense, and your total defense.
Code:
math.random(defense/2, defense)
and Armor is the same thing.
Code:
math.random(armor/2, armor)

Now, this is honestly a terrible way to handle armor. So what if you want to change this?

Go into creature.cpp and change how armor works in the blockHit function.
If you have any further questions, let me know.
Thanks for that explanation! I honestly haven't even looked at the source for how defense works, so this tip will be helpful.
 
Back
Top