Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zeny substitution in stylist ui #3157

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql-files/logs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ CREATE TABLE IF NOT EXISTS `picklog` (
`id` INT NOT NULL AUTO_INCREMENT,
`time` DATETIME NULL,
`char_id` INT NOT NULL DEFAULT '0',
`type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2','3','4') NOT NULL DEFAULT 'P',
`type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2','3','4','5') NOT NULL DEFAULT 'P',
`nameid` INT NOT NULL DEFAULT '0',
`amount` INT NOT NULL DEFAULT '1',
`refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
Expand Down Expand Up @@ -178,7 +178,7 @@ CREATE TABLE IF NOT EXISTS `zenylog` (
`time` DATETIME NULL,
`char_id` INT NOT NULL DEFAULT '0',
`src_id` INT NOT NULL DEFAULT '0',
`type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K','4') NOT NULL DEFAULT 'S',
`type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K','4','5') NOT NULL DEFAULT 'S',
`amount` INT NOT NULL DEFAULT '0',
`map` VARCHAR(11) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
Expand Down
1 change: 1 addition & 0 deletions sql-files/main.sql
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1612286353); -- 2021-05-0
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1628121360); -- 2021-08-04--23-56.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1634838524); -- 2021-10-21--18-49.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1641405640); -- 2022-01-05--19-00.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1665257750); -- 2022-10-08--08-35.sql

--
-- Table structure for table `storage`
Expand Down
25 changes: 25 additions & 0 deletions sql-files/upgrades/2022-10-08--08-35.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#1665257750

-- This file is part of Hercules.
-- http://herc.ws - http://github.com/HerculesWS/Hercules
--
-- Copyright (C) 2022 Hercules Dev Team
--
-- Hercules is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.

ALTER TABLE `picklog` MODIFY `type` ENUM('M', 'P', 'L', 'T', 'V', 'S', 'N', 'C', 'A', 'R', 'G', 'E', 'B', 'O', 'I', 'X', 'D', 'U', 'K', 'Y', 'Z', 'W', 'Q', 'J', 'H', '@', '0', '1', '2', '3', '4','5') NOT NULL DEFAULT 'P';
ALTER TABLE `zenylog` MODIFY `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K','4','5') NOT NULL DEFAULT 'S';

INSERT INTO `sql_updates` (`timestamp`) VALUES (1665257750);

1 change: 1 addition & 0 deletions sql-files/upgrades/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@
2021-08-04--23-56.sql
2021-10-21--18-49.sql
2022-01-05--19-00.sql
2022-10-08--08-35.sql
1 change: 1 addition & 0 deletions src/map/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static char log_picktype2char(e_log_pick_type type)
case LOG_TYPE_OTHER: return 'X'; // Other
case LOG_TYPE_ACHIEVEMENT: return '3'; // Achievement
case LOG_TYPE_GRADE: return '4'; // Grade Enchant
case LOG_TYPE_STYLIST: return '5'; // Stylist UI
case LOG_TYPE_NONE: break;
case LOG_TYPE_ALL: break;
}
Expand Down
1 change: 1 addition & 0 deletions src/map/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ typedef enum e_log_pick_type {
LOG_TYPE_LOOT = 0x10000000,
LOG_TYPE_ACHIEVEMENT = 0x20000000,
LOG_TYPE_GRADE = 0x40000000,
LOG_TYPE_STYLIST = 0x80000000,

// all
LOG_TYPE_ALL = 0xFFFFFFFF,
Expand Down
8 changes: 2 additions & 6 deletions src/map/stylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,8 @@ static bool stylist_validate_requirements(struct map_session_data *sd, int type,
return false;

if (entry->id >= 0) {
if (entry->zeny != 0) {
if (sd->status.zeny < entry->zeny)
return false;

sd->status.zeny -= entry->zeny;
clif->updatestatus(sd, SP_ZENY);
if (entry->zeny != 0 && pc->payzeny(sd, entry->zeny, LOG_TYPE_STYLIST, NULL) != 0) {
return false;
} else if (entry->itemid != 0) {
it.nameid = entry->itemid;
it.amount = 1;
Expand Down