"Arm" (Armor) formula in Sources TFS 0.4.0

Tadelho

New Member
Joined
Aug 12, 2007
Messages
38
Best answers
1
Reaction score
2
Where do I find in TFS 0.4.0 sources the "Arm" formula for equipments? I'm trying to reformulate the Arm formula in my server, but I'm not sure where it is. All I've found is in "player.cpp" the following code:

C++:
int32_t Player::getArmor() const
{
    int32_t i = SLOT_FIRST, armor = 0;
    for(; i < SLOT_LAST; ++i)
    {
        if(Item* item = getInventoryItem((slots_t)i))
            armor += item->getArmor();
    }
    if(vocation->getMultiplier(MULTIPLIER_ARMOR) != 1.0)
        return int32_t(armor * vocation->getMultiplier(MULTIPLIER_ARMOR));
    return armor;
}
But it seems like there's something else... right?
Thanks!
 

Ziker

Well-Known Member
Joined
May 7, 2017
Messages
184
Best answers
6
Reaction score
50
Location
Edinburgh
you should look for Creature::blockHit method in creature.cpp, also check if your Player class does not override it. If you want your changes to only apply to players, then you will have to override this method in Player class.
 
OP
T

Tadelho

New Member
Joined
Aug 12, 2007
Messages
38
Best answers
1
Reaction score
2
Thank you guys for helping me.
Static_, it was exactly what I want. Thanks!
 
Top