[Bug Fix] Pick Lock was allowing skillups on doors above player skill (#1815)

* [Bux Fix] Pick Lock was allowing skillups on doors above player skill

* Fixed indentation

* Fix indentation #2 - I am not so bright :(

* Further refine messages for pick lock to match live

* sql to make pot pick locks book pickable by skill 1 and skillup
This commit is contained in:
Paul Coene 2021-12-23 14:56:06 -05:00 committed by GitHub
parent 6a77764f8b
commit 8c78a19c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1 @@
UPDATE doors SET lockpick=1 WHERE doorid=46 AND zone="potranquility";

View File

@ -154,6 +154,7 @@ Client::Client(EQStreamInterface* ieqs)
TaskPeriodic_Timer(RuleI(TaskSystem, PeriodicCheckTimer) * 1000),
charm_update_timer(6000),
rest_timer(1),
pick_lock_timer(1000),
charm_class_attacks_timer(3000),
charm_cast_timer(3500),
qglobal_purge_timer(30000),

View File

@ -1528,6 +1528,7 @@ public:
void UpdateMercLevel();
void CheckMercSuspendTimer();
Timer* GetMercTimer() { return &merc_timer; };
Timer* GetPickLockTimer() { return &pick_lock_timer; };
const char* GetRacePlural(Client* client);
const char* GetClassPlural(Client* client);
@ -1869,6 +1870,7 @@ private:
Timer consent_throttle_timer;
Timer dynamiczone_removal_timer;
Timer task_request_timer;
Timer pick_lock_timer;
Timer heroforge_wearchange_timer;

View File

@ -288,8 +288,11 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
/**
* Key required
* If using a lock_pick_item leave messaging to that code below
*/
sender->Message(Chat::LightBlue, "This is locked...");
if (lock_pick_item == nullptr && !IsDoorOpen()) {
sender->Message(Chat::LightBlue, "This is locked...");
}
/**
* GM can always open locks
@ -335,19 +338,30 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
*/
else if (lock_pick_item != nullptr) {
if (sender->GetSkill(EQ::skills::SkillPickLock)) {
Timer* pick_lock_timer = sender->GetPickLockTimer();
if (lock_pick_item->GetItem()->ItemType == EQ::item::ItemTypeLockPick) {
if (!pick_lock_timer->Check()) {
// Stop full scale mad spamming
safe_delete(outapp);
return;
}
float player_pick_lock_skill = sender->GetSkill(EQ::skills::SkillPickLock);
sender->CheckIncreaseSkill(EQ::skills::SkillPickLock, nullptr, 1);
LogSkills("Client has lockpicks: skill=[{}]", player_pick_lock_skill);
if (GetLockpick() <= player_pick_lock_skill) {
// Stop full scale spamming
pick_lock_timer->Start(1000, true);
if (!IsDoorOpen()) {
sender->CheckIncreaseSkill(EQ::skills::SkillPickLock, nullptr, 1);
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR);
sender->MessageString(Chat::LightBlue, DOORS_SUCCESSFUL_PICK);
} else {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR);
}
sender->MessageString(Chat::LightBlue, DOORS_SUCCESSFUL_PICK);
} else {
sender->MessageString(Chat::LightBlue, DOORS_INSUFFICIENT_SKILL);
safe_delete(outapp);