mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 20:51:29 +00:00
NPC::ModifyNPCStat function bloat cleanup
This commit is contained in:
parent
9f4167a65c
commit
dedd1fc70d
283
zone/npc.cpp
283
zone/npc.cpp
@ -1787,252 +1787,49 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue)
|
|||||||
{
|
{
|
||||||
std::string id = identifier;
|
std::string id = identifier;
|
||||||
std::string val = newValue;
|
std::string val = newValue;
|
||||||
for(int i = 0; i < id.length(); ++i)
|
for(int i = 0; i < id.length(); ++i) {
|
||||||
{
|
|
||||||
id[i] = std::tolower(id[i]);
|
id[i] = std::tolower(id[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(id == "ac")
|
if(id == "ac") { AC = atoi(val.c_str()); return; }
|
||||||
{
|
else if(id == "str") { STR = atoi(val.c_str()); return; }
|
||||||
AC = atoi(val.c_str());
|
else if(id == "sta") { STA = atoi(val.c_str()); return; }
|
||||||
return;
|
else if(id == "agi") { AGI = atoi(val.c_str()); return; }
|
||||||
}
|
else if(id == "dex") { DEX = atoi(val.c_str()); return; }
|
||||||
|
else if(id == "wis") { WIS = atoi(val.c_str()); CalcMaxMana(); return; }
|
||||||
if(id == "str")
|
else if(id == "int" || id == "_int") { INT = atoi(val.c_str()); CalcMaxMana(); return; }
|
||||||
{
|
else if(id == "cha") { CHA = atoi(val.c_str()); return; }
|
||||||
STR = atoi(val.c_str());
|
else if(id == "max_hp") { base_hp = atoi(val.c_str()); CalcMaxHP(); if (cur_hp > max_hp) { cur_hp = max_hp; } return; }
|
||||||
return;
|
else if(id == "max_mana") { npc_mana = atoi(val.c_str()); CalcMaxMana(); if (cur_mana > max_mana){ cur_mana = max_mana; } return; }
|
||||||
}
|
else if(id == "mr") { MR = atoi(val.c_str()); return; }
|
||||||
|
else if(id == "fr") { FR = atoi(val.c_str()); return; }
|
||||||
if(id == "sta")
|
else if(id == "cr") { CR = atoi(val.c_str()); return; }
|
||||||
{
|
else if(id == "pr") { PR = atoi(val.c_str()); return; }
|
||||||
STA = atoi(val.c_str());
|
else if(id == "dr") { DR = atoi(val.c_str()); return; }
|
||||||
return;
|
else if(id == "PhR") { PhR = atoi(val.c_str()); return; }
|
||||||
}
|
else if(id == "runspeed") { runspeed = (float)atof(val.c_str()); CalcBonuses(); return; }
|
||||||
|
else if(id == "special_attacks") { NPCSpecialAttacks(val.c_str(), 0, 1); return; }
|
||||||
if(id == "agi")
|
else if(id == "attack_speed") { attack_speed = (float)atof(val.c_str()); CalcBonuses(); return; }
|
||||||
{
|
else if(id == "atk") { ATK = atoi(val.c_str()); return; }
|
||||||
AGI = atoi(val.c_str());
|
else if(id == "accuracy") { accuracy_rating = atoi(val.c_str()); return; }
|
||||||
return;
|
else if(id == "avoidance") { avoidance_rating = atoi(val.c_str()); return; }
|
||||||
}
|
else if(id == "trackable") { trackable = atoi(val.c_str()); return; }
|
||||||
|
else if(id == "min_hit") { min_dmg = atoi(val.c_str()); return; }
|
||||||
if(id == "dex")
|
else if(id == "max_hit") { max_dmg = atoi(val.c_str()); return; }
|
||||||
{
|
else if(id == "attack_count") { attack_count = atoi(val.c_str()); return; }
|
||||||
DEX = atoi(val.c_str());
|
else if(id == "see_invis") { see_invis = atoi(val.c_str()); return; }
|
||||||
return;
|
else if(id == "see_invis_undead") { see_invis_undead = atoi(val.c_str()); return; }
|
||||||
}
|
else if(id == "see_hide") { see_hide = atoi(val.c_str()); return; }
|
||||||
|
else if(id == "see_improved_hide") { see_improved_hide = atoi(val.c_str()); return; }
|
||||||
if(id == "wis")
|
else if(id == "hp_regen") { hp_regen = atoi(val.c_str()); return; }
|
||||||
{
|
else if(id == "mana_regen") { mana_regen = atoi(val.c_str()); return; }
|
||||||
WIS = atoi(val.c_str());
|
else if(id == "level") { SetLevel(atoi(val.c_str())); return; }
|
||||||
CalcMaxMana();
|
else if(id == "aggro") { pAggroRange = atof(val.c_str()); return; }
|
||||||
return;
|
else if(id == "assist") { pAssistRange = atof(val.c_str()); return; }
|
||||||
}
|
else if(id == "slow_mitigation") { slow_mitigation = atoi(val.c_str()); return; }
|
||||||
|
else if(id == "loottable_id") { loottable_id = atof(val.c_str()); return; }
|
||||||
if(id == "int" || id == "_int")
|
else if(id == "healscale") { healscale = atof(val.c_str()); return; }
|
||||||
{
|
else if(id == "spellscale") { spellscale = atof(val.c_str()); return; }
|
||||||
INT = atoi(val.c_str());
|
|
||||||
CalcMaxMana();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "cha")
|
|
||||||
{
|
|
||||||
CHA = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "max_hp")
|
|
||||||
{
|
|
||||||
base_hp = atoi(val.c_str());
|
|
||||||
CalcMaxHP();
|
|
||||||
if(cur_hp > max_hp)
|
|
||||||
cur_hp = max_hp;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "max_mana")
|
|
||||||
{
|
|
||||||
npc_mana = atoi(val.c_str());
|
|
||||||
CalcMaxMana();
|
|
||||||
if(cur_mana > max_mana)
|
|
||||||
cur_mana = max_mana;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "mr")
|
|
||||||
{
|
|
||||||
MR = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "fr")
|
|
||||||
{
|
|
||||||
FR = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "cr")
|
|
||||||
{
|
|
||||||
CR = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "pr")
|
|
||||||
{
|
|
||||||
PR = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "dr")
|
|
||||||
{
|
|
||||||
DR = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "PhR")
|
|
||||||
{
|
|
||||||
PhR = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "runspeed")
|
|
||||||
{
|
|
||||||
runspeed = (float)atof(val.c_str());
|
|
||||||
CalcBonuses();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "special_attacks")
|
|
||||||
{
|
|
||||||
//Added reset flag.
|
|
||||||
NPCSpecialAttacks(val.c_str(), 0, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "attack_speed")
|
|
||||||
{
|
|
||||||
attack_speed = (float)atof(val.c_str());
|
|
||||||
CalcBonuses();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "atk")
|
|
||||||
{
|
|
||||||
ATK = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "accuracy")
|
|
||||||
{
|
|
||||||
accuracy_rating = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "avoidance")
|
|
||||||
{
|
|
||||||
avoidance_rating = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "trackable")
|
|
||||||
{
|
|
||||||
trackable = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "min_hit")
|
|
||||||
{
|
|
||||||
min_dmg = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "max_hit")
|
|
||||||
{
|
|
||||||
max_dmg = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "attack_count")
|
|
||||||
{
|
|
||||||
attack_count = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "see_invis")
|
|
||||||
{
|
|
||||||
see_invis = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "see_invis_undead")
|
|
||||||
{
|
|
||||||
see_invis_undead = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "see_hide")
|
|
||||||
{
|
|
||||||
see_hide = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "see_improved_hide")
|
|
||||||
{
|
|
||||||
see_improved_hide = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "hp_regen")
|
|
||||||
{
|
|
||||||
hp_regen = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "mana_regen")
|
|
||||||
{
|
|
||||||
mana_regen = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "level")
|
|
||||||
{
|
|
||||||
SetLevel(atoi(val.c_str()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "aggro")
|
|
||||||
{
|
|
||||||
pAggroRange = atof(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "assist")
|
|
||||||
{
|
|
||||||
pAssistRange = atof(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id == "slow_mitigation")
|
|
||||||
{
|
|
||||||
slow_mitigation = atoi(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(id == "loottable_id")
|
|
||||||
{
|
|
||||||
loottable_id = atof(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(id == "healscale")
|
|
||||||
{
|
|
||||||
healscale = atof(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(id == "spellscale")
|
|
||||||
{
|
|
||||||
spellscale = atof(val.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::LevelScale() {
|
void NPC::LevelScale() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user