mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
29 lines
690 B
C++
Executable File
29 lines
690 B
C++
Executable File
#include "../client.h"
|
|
|
|
void command_disarmtrap(Client *c, const Seperator *sep)
|
|
{
|
|
Mob *t = c->GetTarget();
|
|
if (!t || !t->IsNPC()) {
|
|
c->Message(Chat::White, "You must target an NPC to use this command.");
|
|
return;
|
|
}
|
|
|
|
if (!c->HasSkill(EQ::skills::SkillDisarmTraps)) {
|
|
c->Message(Chat::White, "You do not have the Disarm Trap skill.");
|
|
return;
|
|
}
|
|
|
|
if (DistanceSquaredNoZ(c->GetPosition(), t->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) {
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"{} is too far away.",
|
|
t->GetCleanName()
|
|
).c_str()
|
|
);
|
|
return;
|
|
}
|
|
|
|
c->HandleLDoNDisarm(t->CastToNPC(), c->GetSkill(EQ::skills::SkillDisarmTraps), LDoNTypeMechanical);
|
|
}
|