Loading...   


int32 calculateEnduranceRegen() const {
    // TODO: Some parts of this are scaled by hunger/thirst.

    // Passive Bonus
    // BaseData.txt
    int32 passiveBonus = Services::getBaseData()->mEntries[mLevel - 1][mClass - 1].mEnduranceMod;

    // State Bonus
    // Hard Code in client
    bool moving = false;
    int32 stateBonus = 0;

    if (moving) stateBonus = -(getLevel() / 15);

    // Level Bonus
    // Hard Code in client
    uint32 levelBonus = 0;
    if (getLevel() >= 1 && getLevel() < 20) levelBonus = 2;
    if (getLevel() >= 20 && getLevel() < 28) levelBonus = 3;
    if (getLevel() >= 28 && getLevel() < 36) levelBonus = 4;
    if (getLevel() >= 36 && getLevel() < 44) levelBonus = 5;
    if (getLevel() >= 44 && getLevel() < 51) levelBonus = 6;
    if (getLevel() >= 51 && getLevel() < 56) levelBonus = 7;
    if (getLevel() >= 56 && getLevel() < 57) levelBonus = 8;
    if (getLevel() >= 57 && getLevel() < 64) levelBonus = 9;
    if (getLevel() >= 64 && getLevel() < 90) levelBonus = 10;
    if (getLevel() >= 90 && getLevel() < 100) levelBonus = 11;
    if (getLevel() >= 100) levelBonus = 12;

    // Heroic Bonus
    // Hard Code in client
    uint32 heroicBonus = (getHeroicStrength() + getHeroicStamina() + getHeroicDexterity() + getHeroicAgility()) / 200;

    int32 bonuses = mItems.getEnduranceRegen() + mSpells.getEnduranceRegen() + mAAs.getEnduranceRegen();

    return passiveBonus + stateBonus + levelBonus + heroicBonus + bonuses;
}

Raw Paste Data