Comments (2)
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.
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)
- windows installer: Can't open new_server HOT 2
- Blocked Spells not working
- Using Encounters at a global level will cause random crashing when registering events.
- [CMake] Sodium vs SODIUM on Windows
- [CMake] Deprecation warnings on CMake versions < 3.5
- Database starting_items Table Incorrect Mapping HOT 2
- [Bug] Translocator Kurione in Iceclad TPs Character to Wrong Zone HOT 1
- [Crash] GM move in client_packet
- v22.40.0 Red letter error
- Global Forage items are not really global on live - need way to limit
- Repository generator error - skill_caps. HOT 2
- Cannot make a new froglok character on a fresh Akk-Stack server install - Repeatable
- After the death of a creature, NPC Emotes text will no longer be displayed.
- `GUILD_RANK_NONE` redefined HOT 1
- Recent database might be missing content_flags for Frostfell npcs (and more?) HOT 1
- [Tributes] Tier levels need rework HOT 1
- Lich-type spells not treated correctly HOT 1
- Disregard
- Feature Request: Add flag to prevent spawn from being sent to client. HOT 3
- CMake Error at CMakeLists.txt HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from server.