diff --git a/common/ruletypes.h b/common/ruletypes.h index 3135b892a..f1e66349a 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -637,6 +637,7 @@ RULE_BOOL(Bots, OldRaceRezEffects, false, "Older clients had ID 757 for races wi RULE_BOOL(Bots, ResurrectionSickness, true, "Use Resurrection Sickness based on Resurrection spell cast, set to false to disable Resurrection Sickness.") RULE_INT(Bots, OldResurrectionSicknessSpell, 757, "757 is Default Old Resurrection Sickness Spell") RULE_INT(Bots, ResurrectionSicknessSpell, 756, "756 is Default Resurrection Sickness Spell") +RULE_BOOL(Bots, AllowPickpocketCommand, true, "Allows the use of the bot command 'pickpocket'") RULE_CATEGORY_END() RULE_CATEGORY(Chat) diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index f1c214a44..fef0f99c3 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -9170,7 +9170,7 @@ bool helper_cast_standard_spell(Bot* casting_bot, Mob* target_mob, int spell_id, bool helper_command_disabled(Client* bot_owner, bool rule_value, const char* command) { - if (rule_value) { + if (!rule_value) { bot_owner->Message(Chat::White, "Bot command %s is not enabled on this server.", command); return true; } @@ -9999,6 +9999,10 @@ void bot_command_caster_range(Client* c, const Seperator* sep) void bot_command_pickpocket(Client *c, const Seperator *sep) { + if (helper_command_disabled(c, RuleB(Bots, AllowPickpocketCommand), "pickpocket")) { + return; + } + if (helper_command_alias_fail(c, "bot_command_pickpocket", sep->arg[0], "pickpocket")) { return; } @@ -10032,7 +10036,9 @@ void bot_command_pickpocket(Client *c, const Seperator *sep) glm::vec4 mob_distance = (c->GetPosition() - target_mob->GetPosition()); float mob_xy_distance = ((mob_distance.x * mob_distance.x) + (mob_distance.y * mob_distance.y)); float mob_z_distance = (mob_distance.z * mob_distance.z); - if (mob_z_distance >= 25 || mob_xy_distance > 250) { + float z_offset_diff = target_mob->GetZOffset() - c->GetZOffset(); + + if (mob_z_distance >= (35-z_offset_diff) || mob_xy_distance > 250) { c->Message(Chat::White, "You must be closer to an enemy to use this command"); return; }