Giter Club home page Giter Club logo

Comments (2)

emagi avatar emagi commented on May 14, 2024

Removed my CalcNPCRegen because it is incorrect if we want to address this issue properly, we need to start tracking default hp/mana regen and then use the hp_regen and mana_regen to calculate ACTUAL. Going to test my changes first.

from server.

emagi avatar emagi commented on May 14, 2024

Here is what my fixed CalcNPCRegen looks like
we have to add two variables to mob.h default_hp_regen and default_mana_regen, in the NPC::NPC and Mob::Mob constructors these should be set to the default values passed

default_hp_regen = hp_regen;
default_mana_regen = mana_regen;

there are also some other areas where hp_regen is set... you might want to either make default_hp_regen set to the same value or omit hp_regen, not sure how best you want to address it, but seems we have to change a few things around to make spell bonuses work properly for NPC's.

void NPC::CalcNPCRegen(sint16 hpRegenBonus,sint16 manaRegenBonus) {

// Fix for lazy db-updaters (regen values left at 0)
if (GetCasterClass() != 'N' && default_mana_regen == 0)
    mana_regen = (GetLevel() / 10) + 4;
else if(default_mana_regen < 0)
    mana_regen = 0;
else
    mana_regen = default_mana_regen;

mana_regen += manaRegenBonus;
// Gives low end monsters no regen if set to 0 in database. Should make low end monsters killable
// Might want to lower this to /5 rather than 10.
if(default_hp_regen == 0)
{
    if(GetLevel() <= 6)  
        hp_regen = 1;  
    else if(GetLevel() > 6 && GetLevel() <= 10)  
        hp_regen = 2;  
    else if(GetLevel() > 10 && GetLevel() <= 15)  
        hp_regen = 3;  
    else if(GetLevel() > 15 && GetLevel() <= 20)  
        hp_regen = 5;  
    else if(GetLevel() > 20 && GetLevel() <= 30)  
        hp_regen = 7;  
    else if(GetLevel() > 30 && GetLevel() <= 35)  
        hp_regen = 9;  
    else if(GetLevel() > 35 && GetLevel() <= 40)  
        hp_regen = 12;  
    else if(GetLevel() > 40 && GetLevel() <= 45)  
        hp_regen = 18;  
    else if(GetLevel() > 45 && GetLevel() <= 50)  
        hp_regen = 21;  
    else
        hp_regen = 30;
} else if(default_hp_regen < 0) {
    hp_regen = 0;
} else
    hp_regen = default_hp_regen;

hp_regen += hpRegenBonus;

return;

}

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.