mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-03 03:50:40 +00:00
[Build] Significantly Improve Build Times Using Unity Builds (#4948)
This commit is contained in:
@@ -1,63 +1,5 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_modifynpcstat(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
|
||||
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
|
||||
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
|
||||
|
||||
if (stat.empty() || value.empty()) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
auto stat_description = GetModifyNPCStatDescription(stat);
|
||||
if (!stat_description.length()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat '{}' does not exist.",
|
||||
stat
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
target->ModifyNPCStat(stat, value);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Target: {}",
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Stat: {} ({}) Value: {}",
|
||||
GetModifyNPCStatDescription(stat),
|
||||
stat,
|
||||
value
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> GetModifyNPCStatMap()
|
||||
{
|
||||
std::map<std::string, std::string> identifiers_map = {
|
||||
@@ -134,3 +76,61 @@ void ListModifyNPCStatMap(Client *c)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void command_modifynpcstat(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
|
||||
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
|
||||
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
|
||||
|
||||
if (stat.empty() || value.empty()) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
auto stat_description = GetModifyNPCStatDescription(stat);
|
||||
if (!stat_description.length()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat '{}' does not exist.",
|
||||
stat
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
target->ModifyNPCStat(stat, value);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Target: {}",
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Stat: {} ({}) Value: {}",
|
||||
GetModifyNPCStatDescription(stat),
|
||||
stat,
|
||||
value
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user