mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 17:31:30 +00:00
[Commands] Cleanup #showspellslist Command. (#1703)
- Cleanup messages and display.
This commit is contained in:
parent
a64e326c68
commit
e306059f43
@ -13991,19 +13991,11 @@ void command_object(Client *c, const Seperator *sep)
|
|||||||
void command_showspellslist(Client *c, const Seperator *sep)
|
void command_showspellslist(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
Mob *target = c->GetTarget();
|
Mob *target = c->GetTarget();
|
||||||
|
if (!target || !target->IsNPC()) {
|
||||||
if (!target) {
|
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||||
c->Message(Chat::White, "Must target an NPC.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target->IsNPC()) {
|
|
||||||
c->Message(Chat::White, "%s is not an NPC.", target->GetName());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
target->CastToNPC()->AISpellsList(c);
|
target->CastToNPC()->AISpellsList(c);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2818,12 +2818,90 @@ void NPC::RemoveSpellFromNPCList(uint16 spell_id)
|
|||||||
|
|
||||||
void NPC::AISpellsList(Client *c)
|
void NPC::AISpellsList(Client *c)
|
||||||
{
|
{
|
||||||
if (!c)
|
if (!c) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto it = AIspells.begin(); it != AIspells.end(); ++it)
|
if (AIspells.size() > 0) {
|
||||||
c->Message(Chat::White, "%s (%d): Type %d, Priority %d, Recast Delay %d, Resist Adjust %d, Min HP %d, Max HP %d",
|
c->Message(
|
||||||
spells[it->spellid].name, it->spellid, it->type, it->priority, it->recast_delay, it->resist_adjust, it->min_hp, it->max_hp);
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"{} has {} AI spells.",
|
||||||
|
GetCleanName(),
|
||||||
|
AIspells.size()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
int spell_slot = 1;
|
||||||
|
for (const auto& ai_spell : AIspells) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Spell {} | Name: {} ({}) Type: {} Mana Cost: {}",
|
||||||
|
spell_slot,
|
||||||
|
GetSpellName(ai_spell.spellid),
|
||||||
|
ai_spell.spellid,
|
||||||
|
ai_spell.type,
|
||||||
|
ai_spell.manacost
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Spell {} | Priority: {} Recast Delay: {}",
|
||||||
|
spell_slot,
|
||||||
|
ai_spell.priority,
|
||||||
|
ai_spell.recast_delay
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (ai_spell.time_cancast) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Spell {} | Time Can Cast : {}",
|
||||||
|
spell_slot,
|
||||||
|
ai_spell.time_cancast
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ai_spell.resist_adjust) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Spell {} | Resist Adjust : {}",
|
||||||
|
spell_slot,
|
||||||
|
ai_spell.resist_adjust
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ai_spell.min_hp || ai_spell.max_hp) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Spell {} | Min HP: {} Max HP: {}",
|
||||||
|
spell_slot,
|
||||||
|
ai_spell.min_hp,
|
||||||
|
ai_spell.max_hp
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
spell_slot++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"{} has no AI spells.",
|
||||||
|
GetCleanName()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user