• 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 combat formula

xydius

Just an otland wanderer
Joined
Feb 25, 2016
Messages
41
Reaction score
37
Hello my friends,
Im writting this post because im not really sure where i should edit the combat formula so the monsters do more damage, i want this because ill have custom items on my server which give more mana, more health and skills and regeneration and a lot of stuff so i want monsters to hit more without editing every single monster.

Thanks in advance

btw im using otxserver3 which is based on tfs 1.2 so it must have this src

in monster.cpp is it here?

Code:
bool Monster::getCombatValues(int32_t& min, int32_t& max)
{
    if (minCombatValue == 0 && maxCombatValue == 0) {
        return false;
    }

    min = minCombatValue;
    max = maxCombatValue;
    return true;
}

and here?

Code:
if (canUseSpell(myPos, targetPos, spellBlock, interval, inRange, resetTicks)) {
            if (spellBlock.chance >= static_cast<uint32_t>(uniform_random(1, 100))) {
                if (updateLook) {
                    updateLookDirection();
                    updateLook = false;
                }

                minCombatValue = spellBlock.minCombatValue;
                maxCombatValue = spellBlock.maxCombatValue;
                spellBlock.spell->castSpell(this, attackedCreature);
                if (!attackedCreature) {
                    break;
                }

                if (spellBlock.isMelee) {
                    extraMeleeAttack = false;
                }
            }

and in monsters.cpp

Code:
        if (!combatSpellPtr->loadScriptCombat()) {
            return false;
        }

        combatSpell = combatSpellPtr.release();
        combatSpell->getCombat()->setPlayerCombatValues(COMBAT_FORMULA_DAMAGE, sb.minCombatValue, 0, sb.maxCombatValue, 0);
    } else {

and here for melee
Code:
if ((attackAttribute = node.attribute("attack")) && (skillAttribute = node.attribute("skill"))) {
                sb.minCombatValue = 0;
                sb.maxCombatValue = -Weapons::getMaxMeleeDamage(pugi::cast<int32_t>(skillAttribute.value()), pugi::cast<int32_t>(attackAttribute.value()));
            }

i might have solved my own issue but i still want some confirmation lol i really need to know so i dont mess the source :C
 
Last edited:
Back
Top