diff options
-rw-r--r-- | CHANGELOG.md | 31 | ||||
-rw-r--r-- | db/re/item_db.conf | 48 | ||||
-rw-r--r-- | doc/constants.md | 6 | ||||
-rw-r--r-- | sql-files/item_db_re.sql | 6 | ||||
-rw-r--r-- | src/map/clif.c | 41 | ||||
-rw-r--r-- | src/map/mob.c | 3 | ||||
-rw-r--r-- | src/map/refine.c | 2 | ||||
-rw-r--r-- | src/map/status.h | 4 | ||||
-rwxr-xr-x | tools/HPMHookGen/HPMHookGen.pl | 3 |
9 files changed, 135 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f50287544..00251f987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,33 @@ and this project does not adhere to [Semantic Versioning](http://semver.org/spec If you are reading this in a text editor, simply ignore this section --> +## [v2019.05.05+4] `May 5 2019` `PATCH 4` + +### Fixed + +- Fixed a reading error in refine database caused refine chances to be incorrectly read. (#2481) + +## [v2019.05.05+3] `May 5 2019` `PATCH 3` + +### Fixed + +- Fixed a calculation error in the ASPD (and/or other substats) when the maximum stats have values higher than default. (#2419) +- Fixed a parsing error in the HPM Hooks Generator. (#2467) + +## [v2019.05.05+2] `May 5 2019` `PATCH 2` + +### Fixed + +- Fixed a packet generation issue that caused the Guild Storage to appear empty. (#2464, issue #2463) +- Fixed use of `ZC_SE_PC_BUY_CASHITEM_RESULT` on old packet versions that didn't support it. (#2465) + +## [v2019.05.05+1] `May 5 2019` `PATCH 1` + +### Fixed + +- Fixed an issue in the player name packet causing names not to be sent correctly. (#2460, issue #2459) +- Fixed a null pointer error on MVP drops. (#2461) + ## [v2019.05.05] `May 5 2019` ### Added @@ -741,6 +768,10 @@ If you are reading this in a text editor, simply ignore this section - New versioning scheme and project changelogs/release notes (#1853) [Unreleased]: https://github.com/HerculesWS/Hercules/compare/stable...master +[v2019.05.05+4]: https://github.com/HerculesWS/Hercules/compare/v2019.05.05+3...v2019.05.05+4 +[v2019.05.05+3]: https://github.com/HerculesWS/Hercules/compare/v2019.05.05+2...v2019.05.05+3 +[v2019.05.05+2]: https://github.com/HerculesWS/Hercules/compare/v2019.05.05+1...v2019.05.05+2 +[v2019.05.05+1]: https://github.com/HerculesWS/Hercules/compare/v2019.05.05...v2019.05.05+1 [v2019.05.05]: https://github.com/HerculesWS/Hercules/compare/v2019.04.07+1...v2019.05.05 [v2019.04.07+1]: https://github.com/HerculesWS/Hercules/compare/v2019.04.07...v2019.04.07+1 [v2019.04.07]: https://github.com/HerculesWS/Hercules/compare/v2019.03.10...v2019.04.07 diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 961fa102e..6c0bea7f0 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -148002,6 +148002,54 @@ item_db: ( Script: <" percentheal 5,5; "> }, { + Id: 22702 + AegisName: "STR_Soul_Potion" + Name: "STR Reduction Potion" + Type: "IT_DELAYCONSUME" + Buy: 10 + Script: <" callfunc("F_CashReduceStat", bStr, -1, STR_Soul_Potion); "> +}, +{ + Id: 22703 + AegisName: "AGI_Soul_Potion" + Name: "AGI Reduction Potion" + Type: "IT_DELAYCONSUME" + Buy: 10 + Script: <" callfunc("F_CashReduceStat", bAgi, -1, AGI_Soul_Potion); "> +}, +{ + Id: 22704 + AegisName: "VIT_Soul_Potion" + Name: "VIT Reduction Potion" + Type: "IT_DELAYCONSUME" + Buy: 10 + Script: <" callfunc("F_CashReduceStat", bVit, -1, VIT_Soul_Potion); "> +}, +{ + Id: 22705 + AegisName: "INT_Soul_Potion" + Name: "INT Reduction Potion" + Type: "IT_DELAYCONSUME" + Buy: 10 + Script: <" callfunc("F_CashReduceStat", bInt, -1, INT_Soul_Potion); "> +}, +{ + Id: 22706 + AegisName: "DEX_Soul_Potion" + Name: "DEX Reduction Potion" + Type: "IT_DELAYCONSUME" + Buy: 10 + Script: <" callfunc("F_CashReduceStat", bDex, -1, DEX_Soul_Potion); "> +}, +{ + Id: 22707 + AegisName: "LUK_Soul_Potion" + Name: "LUK Reduction Potion" + Type: "IT_DELAYCONSUME" + Buy: 10 + Script: <" callfunc("F_CashReduceStat", bLuk, -1, LUK_Soul_Potion); "> +}, +{ Id: 22737 AegisName: "Bullet_Case_Blood_" Name: "Bloody Bullet Case" diff --git a/doc/constants.md b/doc/constants.md index d5dbf7afd..5a670063b 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -17895,6 +17895,12 @@ - `Chest_Of_Death`: 22679 - `Solo_Christmas_Gift`: 22685 - `Solo_Cookie`: 22686 +- `STR_Soul_Potion`: 22702 +- `AGI_Soul_Potion`: 22703 +- `VIT_Soul_Potion`: 22704 +- `INT_Soul_Potion`: 22705 +- `DEX_Soul_Potion`: 22706 +- `LUK_Soul_Potion`: 22707 - `Bullet_Case_Blood_`: 22737 - `Bullet_Case_Silver_`: 22738 - `Sphere_Case_Wind_`: 22739 diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql index c2a017a8d..933ef3815 100644 --- a/sql-files/item_db_re.sql +++ b/sql-files/item_db_re.sql @@ -9956,6 +9956,12 @@ REPLACE INTO `item_db` VALUES ('22676','Hangul_Day_Event_Box','Hangul Day Event REPLACE INTO `item_db` VALUES ('22679','Chest_Of_Death','Death Bin','18','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','170',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','',''); REPLACE INTO `item_db` VALUES ('22685','Solo_Christmas_Gift','Single Union Christmas Gift','2','0','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','',''); REPLACE INTO `item_db` VALUES ('22686','Solo_Cookie','Single Cookie','0','0','0','0','50','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 5,5;','',''); +REPLACE INTO `item_db` VALUES ('22702','STR_Soul_Potion','STR Reduction Potion','11','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','callfunc(\"F_CashReduceStat\", bStr, -1, STR_Soul_Potion);','',''); +REPLACE INTO `item_db` VALUES ('22703','AGI_Soul_Potion','AGI Reduction Potion','11','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','callfunc(\"F_CashReduceStat\", bAgi, -1, AGI_Soul_Potion);','',''); +REPLACE INTO `item_db` VALUES ('22704','VIT_Soul_Potion','VIT Reduction Potion','11','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','callfunc(\"F_CashReduceStat\", bVit, -1, VIT_Soul_Potion);','',''); +REPLACE INTO `item_db` VALUES ('22705','INT_Soul_Potion','INT Reduction Potion','11','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','callfunc(\"F_CashReduceStat\", bInt, -1, INT_Soul_Potion);','',''); +REPLACE INTO `item_db` VALUES ('22706','DEX_Soul_Potion','DEX Reduction Potion','11','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','callfunc(\"F_CashReduceStat\", bDex, -1, DEX_Soul_Potion);','',''); +REPLACE INTO `item_db` VALUES ('22707','LUK_Soul_Potion','LUK Reduction Potion','11','0','10','5','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','callfunc(\"F_CashReduceStat\", bLuk, -1, LUK_Soul_Potion);','',''); REPLACE INTO `item_db` VALUES ('22737','Bullet_Case_Blood_','Bloody Bullet Case','2','0','2','1','250','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem Shell_Of_Blood_, 500;','',''); REPLACE INTO `item_db` VALUES ('22738','Bullet_Case_Silver_','Silver Bullet Case','2','0','2','1','250','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem Silver_Bullet_, 500;','',''); REPLACE INTO `item_db` VALUES ('22739','Sphere_Case_Wind_','Lightning Sphere Pack','2','0','2','1','350','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem Lighting_Sphere_, 500;','',''); diff --git a/src/map/clif.c b/src/map/clif.c index 12e6a06c2..721d2f5b5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2978,7 +2978,8 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t nullpo_retv(sd); nullpo_retv(items); - for (int i = 0, normal_count = 0, equip_count = 0; i < items_length; ++i) { + int normal_count = 0, equip_count = 0; + for (int i = 0; i < items_length; ++i) { if (items[i].nameid == 0) continue; @@ -3019,6 +3020,36 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t equip_count = 0; } } + + if (normal_count > 0) { + storelist_normal.PacketType = storageListNormalType; + storelist_normal.PacketLength = (sizeof(storelist_normal) - sizeof(storelist_normal.list)) + (sizeof(struct NORMALITEM_INFO) * normal_count); + +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 + storelist_normal.invType = type; +#endif +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 && PACKETVER_MAIN_NUM < 20181002 + safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH); +#endif + + clif->send(&storelist_normal, storelist_normal.PacketLength, &sd->bl, SELF); + normal_count = 0; + } + + if (equip_count > 0) { + storelist_equip.PacketType = storageListEquipType; + storelist_equip.PacketLength = (sizeof(storelist_equip) - sizeof(storelist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip_count); + +#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 + storelist_equip.invType = type; +#endif +#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 && PACKETVER_MAIN_NUM < 20181002 + safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH); +#endif + + clif->send(&storelist_equip, storelist_equip.PacketLength, &sd->bl, SELF); + equip_count = 0; + } } static void clif_cartList(struct map_session_data *sd) @@ -9270,11 +9301,11 @@ static void clif_pcname_ack(int fd, struct block_list *bl) int ps = -1; if (ssd->fakename[0] != '\0' && ssd->disguise != -1) { - packet.packet_id = HEADER_ZC_ACK_REQNAMEALL; - len = sizeof(struct PACKET_ZC_ACK_REQNAMEALL); - } else { packet.packet_id = reqName; len = sizeof(struct packet_reqname_ack); + } else { + packet.packet_id = HEADER_ZC_ACK_REQNAMEALL; + len = sizeof(struct PACKET_ZC_ACK_REQNAMEALL); } //Requesting your own "shadow" name. [Skotlex] @@ -19522,6 +19553,7 @@ static void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) static void clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result) { +#if PACKETVER_MAIN_NUM >= 20101123 || PACKETVER_RE_NUM >= 20120328 || defined(PACKETVER_ZERO) nullpo_retv(sd); WFIFOHEAD(fd, sizeof(struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT)); struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT *p = WFIFOP(fd, 0); @@ -19531,6 +19563,7 @@ static void clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, p->cashPoints = sd->cashPoints; p->kafraPoints = sd->kafraPoints; WFIFOSET(fd, sizeof(struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT)); +#endif } static void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); diff --git a/src/map/mob.c b/src/map/mob.c index 8dac1ea43..aa938a1e7 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2699,7 +2699,8 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) item.nameid = mdrop[i].nameid; item.identify = itemdb->isidentified2(data); - mob->setdropitem_options(&item, mdrop[i].options); + if (mdrop[i].options != NULL) + mob->setdropitem_options(&item, mdrop[i].options); clif->mvp_item(mvp_sd, item.nameid); log_mvp[0] = item.nameid; diff --git a/src/map/refine.c b/src/map/refine.c index 1ff893c56..4fe6e73c4 100644 --- a/src/map/refine.c +++ b/src/map/refine.c @@ -528,7 +528,7 @@ static int refine_readdb_refine_libconfig_sub(struct config_setting_t *r, const chance[i][j] = 100; // default value for all rates. struct config_setting_t *t = NULL; - for (int i = 0; (t = libconfig->setting_get_elem(rate, i++)) != NULL && config_setting_is_group(t); ++i) { + for (int i = 0; (t = libconfig->setting_get_elem(rate, i)) != NULL && config_setting_is_group(t); ++i) { int level = 0, i32; char *rlvl = config_setting_name(t); memset(&lv, 0, sizeof(lv)); diff --git a/src/map/status.h b/src/map/status.h index a70687b67..5f53b715a 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2064,8 +2064,8 @@ struct status_data { matk_min, matk_max, speed, amotion, adelay, dmotion, - mode, - hit, flee, cri, flee2, + mode; + int32 hit, flee, cri, flee2, def2, mdef2, #ifdef RENEWAL_ASPD aspd_rate2, diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl index e5a5c1914..46cae36cb 100755 --- a/tools/HPMHookGen/HPMHookGen.pl +++ b/tools/HPMHookGen/HPMHookGen.pl @@ -371,7 +371,8 @@ foreach my $file (@files) { # Loop through the xml files $t = ')(int fd, struct login_session_data *sd)'; # typedef LoginParseFunc $def =~ s/^LoginParseFunc\s*\*\s*(.*)$/enum parsefunc_rcode(* $1) (int fd, struct login_session_data *sd)/; } - next unless ref $t ne 'HASH' and $t =~ /^[^\[]/; # If it's not a string, or if it starts with an array subscript, we can skip it + next if ref $t eq 'HASH'; # Skip if it's not a string + next if $t =~ /^\)?\[.*\]$/; # Skip arrays or pointers to array my $if = parse($t, $def); next unless scalar keys %$if; # If it returns an empty hash reference, an error must've occurred |