[Commands] Cleanup #reloadzps Command. (#2129)

* [Commands] Cleanup #reloadzps Command.
- Cleanup messages and logic.
- Make reloading of zone points global instead of zone specific.

* Further cleanup.
- Add zone->GetZoneDescription().
- Add mob->GetTargetDescription(mob).

* Final cleanup.

* Typo.
This commit is contained in:
Kinglykrab
2022-05-07 03:23:15 -04:00
committed by GitHub
parent 0b3065d7a9
commit 7df9b2974b
111 changed files with 2035 additions and 2864 deletions
+17 -22
View File
@@ -65,7 +65,9 @@ void command_npcloot(Client *c, const Seperator *sep)
return;
}
c->GetTarget()->CastToNPC()->AddItem(
auto target = c->GetTarget();
target->CastToNPC()->AddItem(
item_id,
item_charges,
equip_item,
@@ -97,11 +99,10 @@ void command_npcloot(Client *c, const Seperator *sep)
c->Message(
Chat::White,
fmt::format(
"Added {} ({}) to {} ({}).",
"Added {} ({}) to {}.",
item_link,
item_id,
c->GetTarget()->GetCleanName(),
c->GetTarget()->GetID()
c->GetTargetDescription(target)
).c_str()
);
} else if (is_money) {
@@ -143,9 +144,8 @@ void command_npcloot(Client *c, const Seperator *sep)
c->Message(
Chat::White,
fmt::format(
"{} ({}) now has {}.",
target->GetCleanName(),
target->GetID(),
"{} now has {}.",
c->GetTargetDescription(target),
money_string
).c_str()
);
@@ -172,12 +172,11 @@ void command_npcloot(Client *c, const Seperator *sep)
c->Message(
Chat::White,
fmt::format(
"Removed {} {} ({}) from {} ({}).",
"Removed {} {} ({}) from {}.",
item_count,
database.CreateItemLink(item_id),
item_id,
target->GetCleanName(),
target->GetID()
c->GetTargetDescription(target)
).c_str()
);
@@ -188,20 +187,18 @@ void command_npcloot(Client *c, const Seperator *sep)
c->Message(
Chat::White,
fmt::format(
"{} ({}) has no items to remove.",
target->GetCleanName(),
target->GetID()
"{} has no items to remove.",
c->GetTargetDescription(target)
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"{} Item{} removed from {} ({}).",
"{} Item{} removed from {}.",
total_item_count,
total_item_count != 1 ? "s" : "",
target->GetCleanName(),
target->GetID()
c->GetTargetDescription(target)
).c_str()
);
}
@@ -214,21 +211,19 @@ void command_npcloot(Client *c, const Seperator *sep)
c->Message(
Chat::White,
fmt::format(
"Removed {} {} ({}) from {} ({}).",
"Removed {} {} ({}) from {}.",
item_count,
database.CreateItemLink(item_id),
item_id,
target->GetCleanName(),
target->GetID()
c->GetTargetDescription(target)
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"{} ({}) does not have any {} ({}).",
target->GetCleanName(),
target->GetID(),
"{} does not have any {} ({}).",
c->GetTargetDescription(target),
database.CreateItemLink(item_id),
item_id
).c_str()