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

Nostalrius 7.7

Based on the cipsoft engine, are these formulas correct?

C++:
int32_t Monster::getDefense()
{
    int32_t totalDefense = mType->info.defense;
    int32_t defenseSkill = mType->info.skill;

    /* fightMode_t attackMode = FIGHTMODE_BALANCED;

    if ((followCreature || !attackedCreature) && earliestAttackTime <= OTSYS_TIME()) {
        attackMode = FIGHTMODE_DEFENSE;
    }

    if (attackMode == FIGHTMODE_ATTACK) {
        totalDefense -= 4 * totalDefense / 10;
    } else if (attackMode == FIGHTMODE_DEFENSE) {
        totalDefense += 8 * totalDefense / 10;
    } */

    if (totalDefense) {
        int32_t formula = (5 * (defenseSkill) + 50) * totalDefense;
        int32_t randresult = rand() % 100;

        totalDefense = formula * ((rand() % 100 + randresult) / 2) / 10000.;
    }

    return totalDefense;
}

C++:
int32_t Combat::getTotalDamage(int32_t attackSkill, int32_t attackValue, fightMode_t fightMode)
{
    return -static_cast<int32_t>(ceil(((5 * attackSkill + 50) * attackValue *
        (fightMode == FIGHTMODE_ATTACK ? 1.2 : (fightMode == FIGHTMODE_BALANCED ? 1.0 : 0.6)) *
        (rand() % 100 + rand() % 100)) / 2.0 / 10000.0));
}

C++:
int32_t Player::getDefense()
{
    int32_t totalDefense = 5;
    int32_t defenseSkill = getSkillLevel(SKILL_FIST);

    const Item* weapon;
    const Item* shield;
    getShieldAndWeapon(shield, weapon);

    if (weapon) {
        totalDefense = weapon->getDefense() + 1;

        switch (weapon->getWeaponType()) {
            case WEAPON_AXE:
                defenseSkill = SKILL_AXE;
                break;
            case WEAPON_SWORD:
                defenseSkill = SKILL_SWORD;
                break;
            case WEAPON_CLUB:
                defenseSkill = SKILL_CLUB;
                break;
            case WEAPON_DISTANCE:
            case WEAPON_AMMO:
                defenseSkill = SKILL_DISTANCE;
                break;
            default:
                break;
        }

        defenseSkill = getSkillLevel(defenseSkill);
    }

    if (shield) {
        totalDefense = shield->getDefense() + 1;
        defenseSkill = getSkillLevel(SKILL_SHIELD);
    }

    fightMode_t attackMode = getFightMode();

    if ((followCreature || !attackedCreature) && earliestAttackTime <= OTSYS_TIME()) {
        attackMode = FIGHTMODE_DEFENSE;
    }

    float defenseMultiplier = 1.0f;
    
    switch (attackMode) {
        case FIGHTMODE_ATTACK:
            defenseMultiplier = 0.6f;
            break;
        case FIGHTMODE_DEFENSE:
            defenseMultiplier = 1.8f;
            break;
        default:
            defenseMultiplier = 1.0f;
            break;
    }
    
    if (totalDefense) {
        int32_t formula = static_cast<int32_t>((5 * (defenseSkill) + 50) * totalDefense * defenseMultiplier);
        int32_t randResult = rand() % 100;
        totalDefense = formula * ((rand() % 100 + randResult) / 2) / 10000;
    }

    return totalDefense;
}
 
I compiled correctly, but I can't log in to client 772 or 770, even after making the necessary changes to the IP. Could someone give me some tips?
 
The code execution cannot proceed because boost_filesystem-vc143-mt-x64-1_82.dll was not found.
Reinstalling the program may fix this problem.

I think everyone get this error when openning theforgottenserver.exe
You are right. And do you have the last corrected file theforgottenserver.exe?? can you share it?? Win 7 64
 
Cool. But can someone help?
Post automatically merged:

windows build please 64bits
Your error is because the gmp lib is missing, as Windows does not have direct gmp support, you have to install mpir via vcpkg!
powershell:
./vcpkg install --triplet x64-windows boost-iostreams boost-asio boost-system boost-filesystem boost-variant boost-lockfree luajit libmariadb pugixml cryptopp fmt mpir
 
Back
Top