mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-13 19:12:26 +00:00
Port EQMacEmu's improved NPC stat scaling formula
Old formula can be used by setting NPC::NewLevelSacling to false
This commit is contained in:
parent
1d12f92934
commit
d53d569020
@ -503,6 +503,7 @@ RULE_BOOL(NPC, EnableMeritBasedFaction, false) // If set to true, faction will g
|
|||||||
RULE_INT(NPC, NPCToNPCAggroTimerMin, 500)
|
RULE_INT(NPC, NPCToNPCAggroTimerMin, 500)
|
||||||
RULE_INT(NPC, NPCToNPCAggroTimerMax, 6000)
|
RULE_INT(NPC, NPCToNPCAggroTimerMax, 6000)
|
||||||
RULE_BOOL(NPC, UseClassAsLastName, true) // Uses class archetype as LastName for npcs with none
|
RULE_BOOL(NPC, UseClassAsLastName, true) // Uses class archetype as LastName for npcs with none
|
||||||
|
RULE_BOOL(NPC, NewLevelScaling, true) // Better level scaling, use old if new formulas would break your server
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Aggro)
|
RULE_CATEGORY(Aggro)
|
||||||
|
|||||||
116
zone/npc.cpp
116
zone/npc.cpp
@ -2006,44 +2006,90 @@ void NPC::LevelScale() {
|
|||||||
|
|
||||||
float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
|
float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
|
||||||
|
|
||||||
// Compensate for scale rates at low levels so they don't add too much
|
if (RuleB(NPC, NewLevelScaling)) {
|
||||||
uint8 scale_adjust = 1;
|
if (scalerate == 0 || maxlevel <= 25) {
|
||||||
if(level > 0 && level <= 5)
|
// pre-pop seems to scale by 20 HP increments while newer by 100
|
||||||
scale_adjust = 10;
|
// We also don't want 100 increments on newer noobie zones, check level
|
||||||
if(level > 5 && level <= 10)
|
if (zone->GetZoneID() < 200 || level < 48) {
|
||||||
scale_adjust = 5;
|
max_hp += (random_level - level) * 20;
|
||||||
if(level > 10 && level <= 15)
|
base_hp += (random_level - level) * 20;
|
||||||
scale_adjust = 3;
|
} else {
|
||||||
if(level > 15 && level <= 25)
|
max_hp += (random_level - level) * 100;
|
||||||
scale_adjust = 2;
|
base_hp += (random_level - level) * 100;
|
||||||
|
}
|
||||||
|
|
||||||
base_hp += (int)(base_hp * scaling);
|
cur_hp = max_hp;
|
||||||
max_hp += (int)(max_hp * scaling);
|
max_dmg += (random_level - level) * 2;
|
||||||
cur_hp = max_hp;
|
} else {
|
||||||
STR += (int)(STR * scaling / scale_adjust);
|
uint8 scale_adjust = 1;
|
||||||
STA += (int)(STA * scaling / scale_adjust);
|
|
||||||
AGI += (int)(AGI * scaling / scale_adjust);
|
base_hp += (int)(base_hp * scaling);
|
||||||
DEX += (int)(DEX * scaling / scale_adjust);
|
max_hp += (int)(max_hp * scaling);
|
||||||
INT += (int)(INT * scaling / scale_adjust);
|
cur_hp = max_hp;
|
||||||
WIS += (int)(WIS * scaling / scale_adjust);
|
|
||||||
CHA += (int)(CHA * scaling / scale_adjust);
|
if (max_dmg) {
|
||||||
if (MR)
|
max_dmg += (int)(max_dmg * scaling / scale_adjust);
|
||||||
MR += (int)(MR * scaling / scale_adjust);
|
min_dmg += (int)(min_dmg * scaling / scale_adjust);
|
||||||
if (CR)
|
}
|
||||||
CR += (int)(CR * scaling / scale_adjust);
|
|
||||||
if (DR)
|
STR += (int)(STR * scaling / scale_adjust);
|
||||||
DR += (int)(DR * scaling / scale_adjust);
|
STA += (int)(STA * scaling / scale_adjust);
|
||||||
if (FR)
|
AGI += (int)(AGI * scaling / scale_adjust);
|
||||||
FR += (int)(FR * scaling / scale_adjust);
|
DEX += (int)(DEX * scaling / scale_adjust);
|
||||||
if (PR)
|
INT += (int)(INT * scaling / scale_adjust);
|
||||||
PR += (int)(PR * scaling / scale_adjust);
|
WIS += (int)(WIS * scaling / scale_adjust);
|
||||||
|
CHA += (int)(CHA * scaling / scale_adjust);
|
||||||
|
if (MR)
|
||||||
|
MR += (int)(MR * scaling / scale_adjust);
|
||||||
|
if (CR)
|
||||||
|
CR += (int)(CR * scaling / scale_adjust);
|
||||||
|
if (DR)
|
||||||
|
DR += (int)(DR * scaling / scale_adjust);
|
||||||
|
if (FR)
|
||||||
|
FR += (int)(FR * scaling / scale_adjust);
|
||||||
|
if (PR)
|
||||||
|
PR += (int)(PR * scaling / scale_adjust);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Compensate for scale rates at low levels so they don't add too much
|
||||||
|
uint8 scale_adjust = 1;
|
||||||
|
if(level > 0 && level <= 5)
|
||||||
|
scale_adjust = 10;
|
||||||
|
if(level > 5 && level <= 10)
|
||||||
|
scale_adjust = 5;
|
||||||
|
if(level > 10 && level <= 15)
|
||||||
|
scale_adjust = 3;
|
||||||
|
if(level > 15 && level <= 25)
|
||||||
|
scale_adjust = 2;
|
||||||
|
|
||||||
|
base_hp += (int)(base_hp * scaling);
|
||||||
|
max_hp += (int)(max_hp * scaling);
|
||||||
|
cur_hp = max_hp;
|
||||||
|
STR += (int)(STR * scaling / scale_adjust);
|
||||||
|
STA += (int)(STA * scaling / scale_adjust);
|
||||||
|
AGI += (int)(AGI * scaling / scale_adjust);
|
||||||
|
DEX += (int)(DEX * scaling / scale_adjust);
|
||||||
|
INT += (int)(INT * scaling / scale_adjust);
|
||||||
|
WIS += (int)(WIS * scaling / scale_adjust);
|
||||||
|
CHA += (int)(CHA * scaling / scale_adjust);
|
||||||
|
if (MR)
|
||||||
|
MR += (int)(MR * scaling / scale_adjust);
|
||||||
|
if (CR)
|
||||||
|
CR += (int)(CR * scaling / scale_adjust);
|
||||||
|
if (DR)
|
||||||
|
DR += (int)(DR * scaling / scale_adjust);
|
||||||
|
if (FR)
|
||||||
|
FR += (int)(FR * scaling / scale_adjust);
|
||||||
|
if (PR)
|
||||||
|
PR += (int)(PR * scaling / scale_adjust);
|
||||||
|
|
||||||
|
if (max_dmg)
|
||||||
|
{
|
||||||
|
max_dmg += (int)(max_dmg * scaling / scale_adjust);
|
||||||
|
min_dmg += (int)(min_dmg * scaling / scale_adjust);
|
||||||
|
}
|
||||||
|
|
||||||
if (max_dmg)
|
|
||||||
{
|
|
||||||
max_dmg += (int)(max_dmg * scaling / scale_adjust);
|
|
||||||
min_dmg += (int)(min_dmg * scaling / scale_adjust);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
level = random_level;
|
level = random_level;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user