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

monster armor and defense

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
hello guys i set my monster armor and defense 500 and monster still get higher damage
if set armor and defense 500 its same damage when set armor and defense 1
i think when add higher number its mean block damage right ?
how armor and defense formula for monster work ?
0.4
 
no

this check armor nice but why when changed armor and def for monster for 500 its same damage when set it 1
i took this formula from ur tfs 1.3 8.60
Lua:
{
    BlockType_t blockType = BLOCK_NONE;
    if(isImmune(combatType))
    {
        damage = 0;
        blockType = BLOCK_IMMUNITY;
    }
    else if(checkDefense || checkArmor)
    {
        bool hasDefense = false;
        if(blockCount > 0)
        {
            --blockCount;
            hasDefense = true;
        }

        if (checkDefense && hasDefense && canUseDefense)
        {
            int32_t defense = getDefense();
            damage -= random_range(defense / 2, defense);
            if (damage <= 0)
             {
                damage = 0;
                blockType = BLOCK_DEFENSE;
                checkArmor = false;
            }
        }

        if (checkArmor)
         {
            int32_t armor = getArmor();
            if (armor > 3)
            {
                damage -= random_range(armor / 2, armor - (armor % 2 + 1));
            }
            else if (armor > 0)
            {
                --damage;
            }

            if (damage <= 0) {
                damage = 0;
                blockType = BLOCK_ARMOR;
            }
        }

        if(hasDefense && blockType != BLOCK_NONE)
        {
            onBlockHit(blockType);
        }
    }

    if(attacker)
    {
        attacker->onAttackedCreature(this);
        attacker->onAttackedCreatureBlockHit(this, blockType);
    }

    onAttacked();
    return blockType;
}
maybe for this reason don't work?
 
Last edited:
Back
Top