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

Fix critical hit TFS 1.3

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,326
Solutions
68
Reaction score
999
So the issue is that you cannot go above 3x or so critical damage and its kind of difficult to understand how it works.

This will make it so: attribute="criticalhitamount" value="100" would be 100% more damage. So 2x the hit.
Another example: value = 35 would be 135% the normal damage.

Open Combat.cpp
Find:
Code:
 void Combat::checkCriticalHit(Player* caster, CombatDamage& damage)

Replace with this.
Code:
void Combat::checkCriticalHit(Player* caster, CombatDamage& damage)
{
    if (damage.critical || damage.origin == ORIGIN_CONDITION) {
        return;
    }

    if (damage.primary.value > 0 || damage.secondary.value > 0) {
        return;
    }

    uint16_t chance = caster->getSpecialSkill(SPECIALSKILL_CRITICALHITCHANCE);
    uint16_t criticalHit = caster->getSpecialSkill(SPECIALSKILL_CRITICALHITAMOUNT);
    if (criticalHit != 0 && chance != 0 && normal_random(1, 100) <= chance) {
        damage.primary.value += std::round(damage.primary.value + ((damage.primary.value * criticalHit)) / 100);
        damage.secondary.value += std::round(damage.secondary.value + ((damage.secondary.value * criticalHit) / 100));
        damage.critical = true;
    }
}
 
Back
Top