mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
[Commands] Cleanup #disarmtrap Command (#3713)
# Notes - Cleanup messages and logic.
This commit is contained in:
parent
62532c6bdd
commit
aa0fbb8b45
@ -2,24 +2,27 @@
|
|||||||
|
|
||||||
void command_disarmtrap(Client *c, const Seperator *sep)
|
void command_disarmtrap(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
Mob *target = c->GetTarget();
|
Mob *t = c->GetTarget();
|
||||||
|
if (!t || !t->IsNPC()) {
|
||||||
if (!target) {
|
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||||
c->Message(Chat::Red, "You must have a target.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target->IsNPC()) {
|
if (!c->HasSkill(EQ::skills::SkillDisarmTraps)) {
|
||||||
if (c->HasSkill(EQ::skills::SkillDisarmTraps)) {
|
c->Message(Chat::White, "You do not have the Disarm Trap skill.");
|
||||||
if (DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) {
|
|
||||||
c->Message(Chat::Red, "%s is too far away.", target->GetCleanName());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->HandleLDoNDisarm(target->CastToNPC(), c->GetSkill(EQ::skills::SkillDisarmTraps), LDoNTypeMechanical);
|
|
||||||
}
|
if (DistanceSquaredNoZ(c->GetPosition(), t->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) {
|
||||||
else {
|
c->Message(
|
||||||
c->Message(Chat::Red, "You do not have the disarm trap skill.");
|
Chat::White,
|
||||||
}
|
fmt::format(
|
||||||
|
"{} is too far away.",
|
||||||
|
t->GetCleanName()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c->HandleLDoNDisarm(t->CastToNPC(), c->GetSkill(EQ::skills::SkillDisarmTraps), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user