mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
[Regen] Implement Per Second HP Regen for NPCs (#2086)
* Implement NPC per second regen * Add hp_regen_per_second to ModifyNPCStat * Take per second regen the rest of the way * Add #npcedit hp_regen_per_second * Add db migration
This commit is contained in:
@@ -28,6 +28,7 @@ void command_npcedit(Client *c, const Seperator *sep)
|
||||
c->Message(Chat::White, "#npcedit herosforgemodel - Sets an NPC's Hero's Forge Model");
|
||||
c->Message(Chat::White, "#npcedit size - Sets an NPC's Size");
|
||||
c->Message(Chat::White, "#npcedit hpregen - Sets an NPC's Hitpoints Regeneration Rate Per Tick");
|
||||
c->Message(Chat::White, "#npcedit hp_regen_per_second - Sets an NPC's HP regeneration per second");
|
||||
c->Message(Chat::White, "#npcedit manaregen - Sets an NPC's Mana Regeneration Rate Per Tick");
|
||||
c->Message(Chat::White, "#npcedit loottable - Sets an NPC's Loottable ID");
|
||||
c->Message(Chat::White, "#npcedit merchantid - Sets an NPC's Merchant ID");
|
||||
@@ -308,6 +309,23 @@ void command_npcedit(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcasecmp(sep->arg[1], "hp_regen_per_second") == 0) {
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"NPC ID {} now regenerates {} HP per second.",
|
||||
npc_id,
|
||||
atoi(sep->arg[2])).c_str()
|
||||
);
|
||||
std::string query = fmt::format(
|
||||
"UPDATE npc_types SET hp_regen_per_second = {} WHERE id = {}",
|
||||
atoi(sep->arg[2]),
|
||||
npc_id
|
||||
);
|
||||
content_db.QueryDatabase(query);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcasecmp(sep->arg[1], "manaregen") == 0) {
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
|
||||
Reference in New Issue
Block a user