mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-14 07:42:29 +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)
|
||||||
|
|||||||
46
zone/npc.cpp
46
zone/npc.cpp
@ -2006,6 +2006,51 @@ void NPC::LevelScale() {
|
|||||||
|
|
||||||
float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
|
float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
|
||||||
|
|
||||||
|
if (RuleB(NPC, NewLevelScaling)) {
|
||||||
|
if (scalerate == 0 || maxlevel <= 25) {
|
||||||
|
// pre-pop seems to scale by 20 HP increments while newer by 100
|
||||||
|
// We also don't want 100 increments on newer noobie zones, check level
|
||||||
|
if (zone->GetZoneID() < 200 || level < 48) {
|
||||||
|
max_hp += (random_level - level) * 20;
|
||||||
|
base_hp += (random_level - level) * 20;
|
||||||
|
} else {
|
||||||
|
max_hp += (random_level - level) * 100;
|
||||||
|
base_hp += (random_level - level) * 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
cur_hp = max_hp;
|
||||||
|
max_dmg += (random_level - level) * 2;
|
||||||
|
} else {
|
||||||
|
uint8 scale_adjust = 1;
|
||||||
|
|
||||||
|
base_hp += (int)(base_hp * scaling);
|
||||||
|
max_hp += (int)(max_hp * scaling);
|
||||||
|
cur_hp = max_hp;
|
||||||
|
|
||||||
|
if (max_dmg) {
|
||||||
|
max_dmg += (int)(max_dmg * scaling / scale_adjust);
|
||||||
|
min_dmg += (int)(min_dmg * scaling / scale_adjust);
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// Compensate for scale rates at low levels so they don't add too much
|
// Compensate for scale rates at low levels so they don't add too much
|
||||||
uint8 scale_adjust = 1;
|
uint8 scale_adjust = 1;
|
||||||
if(level > 0 && level <= 5)
|
if(level > 0 && level <= 5)
|
||||||
@ -2044,6 +2089,7 @@ void NPC::LevelScale() {
|
|||||||
min_dmg += (int)(min_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