mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 17:26:30 +00:00
[Commands] Cleanup #nukebuffs Command. (#1795)
* [Commands] Cleanup #nukebuffs Command. - Cleanup messages and logic. - #nukebuffs now allows you to nuke all, beneficial, or detrimental buffs, also added a help menu. - Add BuffFadeBeneficial(). - Cleanup logic in some buff fade methods. - Fix several spots where we were using CalcBonuses() when it was unnecessary, i.e when you fade no buffs you do not need to recalculate bonuses. * Update spells.cpp
This commit is contained in:
@@ -1,12 +1,47 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_nukebuffs(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c->GetTarget() == 0) {
|
||||
c->BuffFadeAll();
|
||||
{
|
||||
Mob* target = c;
|
||||
if (c->GetTarget()) {
|
||||
target = c->GetTarget();
|
||||
}
|
||||
else {
|
||||
c->GetTarget()->BuffFadeAll();
|
||||
|
||||
std::string buff_identifier = str_tolower(sep->arg[1]);
|
||||
std::string buff_type;
|
||||
bool is_beneficial = buff_identifier.find("beneficial") != std::string::npos;
|
||||
bool is_detrimental = buff_identifier.find("detrimental") != std::string::npos;
|
||||
bool is_help = buff_identifier.find("help") != std::string::npos;
|
||||
if (is_beneficial) {
|
||||
target->BuffFadeBeneficial();
|
||||
buff_type = " beneficial";
|
||||
} else if (is_detrimental) {
|
||||
target->BuffFadeDetrimental();
|
||||
buff_type = " detrimental";
|
||||
} else if (is_help) {
|
||||
c->Message(Chat::White, "Usage: #nukebuffs");
|
||||
c->Message(Chat::White, "Usage: #nukebuffs beneficial");
|
||||
c->Message(Chat::White, "Usage: #nukebuffs detrimental");
|
||||
return;
|
||||
} else {
|
||||
target->BuffFadeAll();
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faded all{} buffs for {}.",
|
||||
buff_type,
|
||||
(
|
||||
c == target ?
|
||||
"yourself" :
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
)
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user