summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/map/battle/client.conf4
-rw-r--r--db/pre-re/item_db.conf8
-rw-r--r--db/re/item_db.conf13
-rw-r--r--db/stylist_db.conf12
-rw-r--r--doc/constants.md1
-rw-r--r--sql-files/item_db.sql2
-rw-r--r--sql-files/item_db_re.sql3
-rw-r--r--sql-files/main.sql1
-rw-r--r--sql-files/upgrades/2018-07-24--03-23.sql22
-rw-r--r--sql-files/upgrades/index.txt1
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/clif.c13
-rw-r--r--src/map/packets.h4
-rw-r--r--src/map/packets_struct.h3
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/pet.c14
-rw-r--r--src/map/script.c12
-rw-r--r--src/map/script.h2
-rw-r--r--src/map/skill.c7
-rw-r--r--src/map/skill.h2
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc39
25 files changed, 151 insertions, 36 deletions
diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf
index dfdb7740c..35c585bf6 100644
--- a/conf/map/battle/client.conf
+++ b/conf/map/battle/client.conf
@@ -111,9 +111,7 @@ wedding_modifydisplay: false
save_clothcolor: true
// Save body styles? (Note 1)
-// Note: Don't turn this on unless you know what your doing.
-// Sprites are not released officially.
-save_body_style: false
+save_body_style: true
// Do not display cloth colors for the wedding costume?
// Note: Both save_clothcolor and wedding_modifydisplay have to be enabled
diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf
index 75629c45a..3f3b6d622 100644
--- a/db/pre-re/item_db.conf
+++ b/db/pre-re/item_db.conf
@@ -34566,10 +34566,10 @@ item_db: (
Weight: 10
Loc: "EQP_ACC"
Script: <"
- bonus2 bAddItemHealRate,Sushi,50;
- bonus2 bAddItemHealRate,Fish_Slice,50;
- bonus3 bAddMonsterDropItem,551,RC_Fish,300;
- bonus3 bAddMonsterDropItem,544,RC_Fish,300;
+ bonus2(bAddItemHealRate, Shusi, 50);
+ bonus2(bAddItemHealRate, Fish_Slice, 50);
+ bonus3(bAddMonsterDropItem, Shusi, RC_Fish, 300);
+ bonus3(bAddMonsterDropItem, Fish_Slice, RC_Fish, 300);
">
},
{
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index 26f46d0ea..093fc4868 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -45098,10 +45098,10 @@ item_db: (
Weight: 10
Loc: "EQP_ACC"
Script: <"
- bonus2 bAddItemHealRate,Sushi,50;
- bonus2 bAddItemHealRate,Fish_Slice,50;
- bonus3 bAddMonsterDropItem,551,RC_Fish,300;
- bonus3 bAddMonsterDropItem,544,RC_Fish,300;
+ bonus2(bAddItemHealRate, Shusi, 50);
+ bonus2(bAddItemHealRate, Fish_Slice, 50);
+ bonus3(bAddMonsterDropItem, Shusi, RC_Fish, 300);
+ bonus3(bAddMonsterDropItem, Fish_Slice, RC_Fish, 300);
">
},
{
@@ -74533,6 +74533,11 @@ item_db: (
}
},
{
+ Id: 6959
+ AegisName: "Costume_Change_Ticket"
+ Name: "Costume Change Ticket"
+},
+{
Id: 7001
AegisName: "Mould_Powder"
Name: "Mould Powder"
diff --git a/db/stylist_db.conf b/db/stylist_db.conf
index f11bf016a..70d7162f5 100644
--- a/db/stylist_db.conf
+++ b/db/stylist_db.conf
@@ -306,4 +306,16 @@ stylist_db: (
Id: "Granpa_Beard"
Zeny: 5000
},
+{
+ Type: "LOOK_BODY2"
+ Id: 0
+ ItemID: "Costume_Change_Ticket"
+ BoxItemID: "Costume_Change_Ticket"
+},
+{
+ Type: "LOOK_BODY2"
+ Id: 1
+ ItemID: "Costume_Change_Ticket"
+ BoxItemID: "Costume_Change_Ticket"
+},
)
diff --git a/doc/constants.md b/doc/constants.md
index 000e58ebe..490d393f2 100644
--- a/doc/constants.md
+++ b/doc/constants.md
@@ -12324,6 +12324,7 @@
- `Sacred_Rosary`: 6913
- `Black_Soul`: 6914
- `Captured_Soul`: 6915
+- `Costume_Change_Ticket`: 6959
- `Mould_Powder`: 7001
- `Ogre_Tooth`: 7002
- `Anolian_Skin`: 7003
diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql
index bfd6d20ba..7bd5a5012 100644
--- a/sql-files/item_db.sql
+++ b/sql-files/item_db.sql
@@ -1971,7 +1971,7 @@ REPLACE INTO `item_db` VALUES ('4322','High_Orc_Card','High Orc Card','6','0','2
REPLACE INTO `item_db` VALUES ('4323','Garm_Baby_Card','Hatii Babe Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAutoSpell,MG_FROSTDIVER,3,50;','','');
REPLACE INTO `item_db` VALUES ('4324','Garm_Card','Hatii Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','16','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddEffWhenHit,Eff_Freeze,5000;','','');
REPLACE INTO `item_db` VALUES ('4325','Harpy_Card','Harpy Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','4','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Neutral,15; bonus2 bSkillAtk,MG_NAPALMBEAT,5;','','');
-REPLACE INTO `item_db` VALUES ('4326','See_Otter_Card','Sea-Otter Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','136','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddItemHealRate,Sushi,50; bonus2 bAddItemHealRate,Fish_Slice,50; bonus3 bAddMonsterDropItem,551,RC_Fish,300; bonus3 bAddMonsterDropItem,544,RC_Fish,300;','','');
+REPLACE INTO `item_db` VALUES ('4326','See_Otter_Card','Sea-Otter Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','136','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2(bAddItemHealRate, Shusi, 50); bonus2(bAddItemHealRate, Fish_Slice, 50); bonus3(bAddMonsterDropItem, Shusi, RC_Fish, 300); bonus3(bAddMonsterDropItem, Fish_Slice, RC_Fish, 300);','','');
REPLACE INTO `item_db` VALUES ('4327','Blood_Butterfly_Card','Bloody Butterfly Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','136','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bCastrate,30; bonus bNoCastCancel,0; bonus2 bSkillAtk,MG_FIREWALL,5;','','');
REPLACE INTO `item_db` VALUES ('4328','Hyegun_Card','Yao Jun Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','4','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bFlee,15; bonus bCritical,1;','','');
REPLACE INTO `item_db` VALUES ('4329','Phendark_Card','Phendark Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSPGainRace,RC_DemiPlayer,5;','','heal 0,-5;');
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index 7bd8fba12..2d62a7a1e 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -2436,7 +2436,7 @@ REPLACE INTO `item_db` VALUES ('4322','High_Orc_Card','High Orc Card','6','0','2
REPLACE INTO `item_db` VALUES ('4323','Garm_Baby_Card','Hatii Bebe Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAutoSpell,MG_FROSTDIVER,3,50;','','');
REPLACE INTO `item_db` VALUES ('4324','Garm_Card','Hatii Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','16','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddEffWhenHit,Eff_Freeze,5000;','','');
REPLACE INTO `item_db` VALUES ('4325','Harpy_Card','Harpy Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','4','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_Formless,15; bonus2 bSkillAtk,MG_NAPALMBEAT,5;','','');
-REPLACE INTO `item_db` VALUES ('4326','See_Otter_Card','Sea-Otter Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','136','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddItemHealRate,Sushi,50; bonus2 bAddItemHealRate,Fish_Slice,50; bonus3 bAddMonsterDropItem,551,RC_Fish,300; bonus3 bAddMonsterDropItem,544,RC_Fish,300;','','');
+REPLACE INTO `item_db` VALUES ('4326','See_Otter_Card','Sea-Otter Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','136','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2(bAddItemHealRate, Shusi, 50); bonus2(bAddItemHealRate, Fish_Slice, 50); bonus3(bAddMonsterDropItem, Shusi, RC_Fish, 300); bonus3(bAddMonsterDropItem, Fish_Slice, RC_Fish, 300);','','');
REPLACE INTO `item_db` VALUES ('4327','Blood_Butterfly_Card','Bloody Butterfly Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','136','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bVariableCastrate,30; bonus bNoCastCancel,0; bonus2 bSkillAtk,MG_FIREWALL,5;','','');
REPLACE INTO `item_db` VALUES ('4328','Hyegun_Card','Yao Jun Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','4','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bFlee,15; bonus bCritical,1;','','');
REPLACE INTO `item_db` VALUES ('4329','Phendark_Card','Phendark Card','6','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSPGainRace,RC_DemiPlayer,5;','','heal 0,-5;');
@@ -4596,6 +4596,7 @@ REPLACE INTO `item_db` VALUES ('6821','Solo_Troops_Badge','Single Union Badge','
REPLACE INTO `item_db` VALUES ('6913','Sacred_Rosary','Sacred Rosary','3','0','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6914','Black_Soul','Black Soul','3','0','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6915','Captured_Soul','Captured Soul','3','0','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6959','Costume_Change_Ticket','Costume Change Ticket','3','0','0','0','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','','','');
REPLACE INTO `item_db` VALUES ('7001','Mould_Powder','Mould Powder','3','0','466','233','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7002','Ogre_Tooth','Ogre Tooth','3','0','658','329','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7003','Anolian_Skin','Anolian Skin','3','0','968','484','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 277000df3..d29f05a2e 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -920,6 +920,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1520654809); -- 2018-03-1
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1527964800); -- 2018-06-03--00-10.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528026381); -- 2018-06-03--17-16.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528180320); -- 2018-06-05--12-02.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1532403228); -- 2018-07-24--03-23.sql
--
-- Table structure for table `storage`
--
diff --git a/sql-files/upgrades/2018-07-24--03-23.sql b/sql-files/upgrades/2018-07-24--03-23.sql
new file mode 100644
index 000000000..a8d2d8f77
--- /dev/null
+++ b/sql-files/upgrades/2018-07-24--03-23.sql
@@ -0,0 +1,22 @@
+#1532403228
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 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/>.
+
+UPDATE `inventory` SET `identify` = 1, `attribute` = 1 WHERE `card0` = -256 and `identify` = 0;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1532403228);
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index f6bdada63..705234d01 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -48,3 +48,4 @@
2018-06-03--00-10.sql
2018-06-03--17-16.sql
2018-06-05--12-02.sql
+2018-07-24--03-23.sql
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 6dff3f698..52bf64e87 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4228,6 +4228,8 @@ ACMD(repairall)
count = 0;
for (i = 0; i < MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if (sd->status.inventory[i].nameid && (sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
sd->status.inventory[i].attribute |= ATTR_BROKEN;
sd->status.inventory[i].attribute ^= ATTR_BROKEN;
diff --git a/src/map/clif.c b/src/map/clif.c
index 3379369c4..80cd44aaf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7245,6 +7245,7 @@ static void clif_sendegg(struct map_session_data *sd)
/// 3 = accessory
/// 4 = performance (data = 1~3: normal, 4: special)
/// 5 = hairstyle
+/// 6 = close egg selection ui and update egg in inventory (PACKETVER >= 20180704)
///
/// If sd is null, the update is sent to nearby objects, otherwise it is sent only to that player.
static void clif_send_petdata(struct map_session_data *sd, struct pet_data *pd, int type, int param)
@@ -21420,7 +21421,7 @@ static bool clif_stylist_read_db_libconfig_sub(struct config_setting_t *it, int
ShowWarning("clif_stylist_read_db_libconfig_sub: Invalid or missing Type (%d) in \"%s\", entry #%d, skipping.\n", type, source, idx);
return false;
}
- if (!itemdb->lookup_const(it, "Id", &i32) || i32 <= 0) {
+ if (!itemdb->lookup_const(it, "Id", &i32) || i32 < 0) {
ShowWarning("clif_stylist_read_db_libconfig_sub: Invalid or missing Id (%d) in \"%s\", entry #%d, skipping.\n", i32, source, idx);
return false;
}
@@ -21457,7 +21458,7 @@ static bool clif_style_change_validate_requirements(struct map_session_data *sd,
entry = &VECTOR_INDEX(stylist_data[type], idx);
- if (entry->id != 0) {
+ if (entry->id >= 0) {
if (entry->zeny != 0) {
if (sd->status.zeny < entry->zeny)
return false;
@@ -21515,7 +21516,13 @@ static void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd)
clif->cz_req_style_change_sub(sd, LOOK_HEAD_MID, p->MidAccessory, true);
if (p->BottomAccessory > 0)
clif->cz_req_style_change_sub(sd, LOOK_HEAD_BOTTOM, p->BottomAccessory, true);
-
+#if PACKETVER_RE_NUM >= 20180718
+ if (p->BodyStyle > 0) {
+ if (pc->has_second_costume(sd)) {
+ clif->cz_req_style_change_sub(sd, LOOK_BODY2, p->BodyStyle, false);
+ }
+ }
+#endif
clif->style_change_response(sd, STYLIST_SHOP_SUCCESS);
return;
}
diff --git a/src/map/packets.h b/src/map/packets.h
index a8ebccc6b..61bf625cf 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -4121,7 +4121,7 @@ packet(0x96e,-1,clif->ackmergeitems);
// 2018-05-16cRagexe, 2018-05-16cRagexeRE
#if PACKETVER >= 20180516
// new packets
- packet(0x0afc,16,clif->pDull/*,XXX*/);
+ packet(0x0afc,16,clif->pReqStyleChange);
// changed packet sizes
#endif
#endif // PACKETVER_ZERO
@@ -4130,7 +4130,7 @@ packet(0x96e,-1,clif->ackmergeitems);
// 2018-05-23aRagexe_zero
#if PACKETVER >= 20180523
// new packets
- packet(0x0afc,16,clif->pDull/*,XXX*/);
+ packet(0x0afc,16,clif->pReqStyleChange);
// changed packet sizes
#endif
#endif // PACKETVER_ZERO
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 6c08d634a..5f6443ef3 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -1875,6 +1875,9 @@ struct PACKET_CZ_REQ_STYLE_CHANGE {
int16 TopAccessory;
int16 MidAccessory;
int16 BottomAccessory;
+#if PACKETVER_RE_NUM >= 20180718
+ int16 BodyStyle;
+#endif
} __attribute__((packed));
struct PACKET_ZC_STYLE_CHANGE_RES {
diff --git a/src/map/pc.c b/src/map/pc.c
index 6f9347113..ff8f18489 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -12321,6 +12321,15 @@ static void pc_init_exp_groups(void)
}
}
+static bool pc_has_second_costume(struct map_session_data *sd)
+{
+ nullpo_retr(false, sd);
+
+ if ((sd->job & JOBL_THIRD) != 0)
+ return true;
+ return false;
+}
+
static void do_final_pc(void)
{
@@ -12722,4 +12731,5 @@ void pc_defaults(void)
pc->check_basicskill = pc_check_basicskill;
pc->isDeathPenaltyJob = pc_isDeathPenaltyJob;
+ pc->has_second_costume = pc_has_second_costume;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 84de4d745..17a9b8200 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -1185,6 +1185,7 @@ END_ZEROED_BLOCK; /* End */
void (*check_supernovice_call) (struct map_session_data *sd, const char *message);
bool (*check_basicskill) (struct map_session_data *sd, int level);
bool (*isDeathPenaltyJob) (uint16 job);
+ bool (*has_second_costume) (struct map_session_data *sd);
};
#ifdef HERCULES_CORE
diff --git a/src/map/pet.c b/src/map/pet.c
index 678972f14..cfb3e8253 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -346,10 +346,13 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
pd->pet.pet_id == MakeDWord(sd->status.inventory[i].card[1], sd->status.inventory[i].card[2]));
if (i != MAX_INVENTORY) {
- sd->status.inventory[i].identify = 1;
+ sd->status.inventory[i].attribute &= ~ATTR_BROKEN;
sd->status.inventory[i].bound = IBT_NONE;
}
-
+#if PACKETVER >= 20180704
+ clif->inventorylist(sd);
+ clif->send_petdata(sd, pd, 6, 0);
+#endif
pd->pet.incubate = 1;
unit->free(&pd->bl,CLR_OUTSIGHT);
@@ -463,6 +466,9 @@ static int pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo)
clif->spawn(&sd->pd->bl);
clif->send_petdata(sd,sd->pd, 0,0);
clif->send_petdata(sd,sd->pd, 5,battle_config.pet_hair_style);
+#if PACKETVER >= 20180704
+ clif->send_petdata(sd, sd->pd, 6, 1);
+#endif
clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
clif->send_petstatus(sd);
}
@@ -497,8 +503,8 @@ static int pet_recv_petdata(int account_id, struct s_pet *p, int flag)
if (!pet->birth_process(sd,p)) {
- // Pet Evolution, Hide the egg by setting identify to 0 [Dastgir/Hercules]
- sd->status.inventory[i].identify = 0;
+ // Pet Evolution, Hide the egg by setting broken attribute (0x2) [Asheraf]
+ sd->status.inventory[i].attribute |= ATTR_BROKEN;
// bind the egg to the character to avoid moving it via forged packets [Asheraf]
sd->status.inventory[i].bound = IBT_CHARACTER;
}
diff --git a/src/map/script.c b/src/map/script.c
index 200a43ba0..e38aae562 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4930,7 +4930,7 @@ static void script_setarray_pc(struct map_session_data *sd, const char *varname,
{
int key;
- if( idx >= SCRIPT_MAX_ARRAYSIZE ) {
+ if (idx > SCRIPT_MAX_ARRAYSIZE) {
ShowError("script_setarray_pc: Variable '%s' has invalid index '%u' (char_id=%d).\n", varname, idx, sd->status.char_id);
return;
}
@@ -7541,7 +7541,7 @@ static BUILDIN(getelementofarray)
id = reference_getid(data);
i = script_getnum(st, 3);
- if (i < 0 || i >= SCRIPT_MAX_ARRAYSIZE) {
+ if (i < 0 || i > SCRIPT_MAX_ARRAYSIZE) {
ShowWarning("script:getelementofarray: index out of range (%"PRId64")\n", i);
script->reportdata(data);
script_pushnil(st);
@@ -9246,6 +9246,8 @@ static BUILDIN(getbrokenid)
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
brokencounter++;
if(num==brokencounter) {
@@ -9271,6 +9273,8 @@ static BUILDIN(getbrokencount)
return true;
for (i = 0; i < MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0)
counter++;
}
@@ -9293,6 +9297,8 @@ static BUILDIN(repair)
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
repaircounter++;
if(num==repaircounter) {
@@ -9321,6 +9327,8 @@ static BUILDIN(repairall)
for(i = 0; i < MAX_INVENTORY; i++)
{
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if (sd->status.inventory[i].nameid && (sd->status.inventory[i].attribute & ATTR_BROKEN) != 0)
{
sd->status.inventory[i].attribute |= ATTR_BROKEN;
diff --git a/src/map/script.h b/src/map/script.h
index fe8bcf00b..9a8425ed2 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -50,7 +50,7 @@ struct item_data;
#define NUM_WHISPER_VAR 10
/// Maximum amount of elements in script arrays
-#define SCRIPT_MAX_ARRAYSIZE (UINT_MAX - 1)
+#define SCRIPT_MAX_ARRAYSIZE (INT_MAX - 1)
#define SCRIPT_BLOCK_SIZE 512
diff --git a/src/map/skill.c b/src/map/skill.c
index ed69b8c0f..745cdb7bc 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -16106,6 +16106,9 @@ static void skill_repairweapon(struct map_session_data *sd, int idx)
if( item->nameid <= 0 || (item->attribute & ATTR_BROKEN) == 0 )
return; //Again invalid item....
+ if (item->card[0] == CARD0_PET)
+ return;
+
if( sd != target_sd && !battle->check_range(&sd->bl,&target_sd->bl, skill->get_range2(&sd->bl, sd->menuskill_id,sd->menuskill_val2) ) ){
clif->item_repaireffect(sd,idx,1);
return;
@@ -19427,7 +19430,7 @@ static void skill_init_unit_layout(void)
}
break;
default:
- skill->init_unit_layout_unknown(i);
+ skill->init_unit_layout_unknown(i, pos);
break;
}
if (!skill->dbs->unit_layout[pos].count)
@@ -19528,7 +19531,7 @@ static void skill_init_unit_layout(void)
}
-static void skill_init_unit_layout_unknown(int skill_idx)
+static void skill_init_unit_layout_unknown(int skill_idx, int pos)
{
Assert_retv(skill_idx >= 0 && skill_idx < MAX_SKILL_DB);
ShowError("unknown unit layout at skill %d\n", skill->dbs->db[skill_idx].nameid);
diff --git a/src/map/skill.h b/src/map/skill.h
index 736417649..97134224e 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -2093,7 +2093,7 @@ struct skill_interface {
int (*unit_timer) (int tid, int64 tick, int id, intptr_t data);
int (*unit_timer_sub) (union DBKey key, struct DBData *data, va_list ap);
void (*init_unit_layout) (void);
- void (*init_unit_layout_unknown) (int skill_idx);
+ void (*init_unit_layout_unknown) (int skill_idx, int pos);
void (*validate_hittype) (struct config_setting_t *conf, struct s_skill_db *sk);
void (*validate_skilltype) (struct config_setting_t *conf, struct s_skill_db *sk);
void (*validate_attacktype) (struct config_setting_t *conf, struct s_skill_db *sk);
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 6b6c4d4e7..7f1145146 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -6086,6 +6086,8 @@ typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, i
typedef bool (*HPMHOOK_post_pc_check_basicskill) (bool retVal___, struct map_session_data *sd, int level);
typedef bool (*HPMHOOK_pre_pc_isDeathPenaltyJob) (uint16 *job);
typedef bool (*HPMHOOK_post_pc_isDeathPenaltyJob) (bool retVal___, uint16 job);
+typedef bool (*HPMHOOK_pre_pc_has_second_costume) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_pc_has_second_costume) (bool retVal___, struct map_session_data *sd);
#endif // MAP_PC_H
#ifdef MAP_NPC_H /* libpcre */
typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr);
@@ -7064,8 +7066,8 @@ typedef int (*HPMHOOK_pre_skill_unit_timer_sub) (union DBKey *key, struct DBData
typedef int (*HPMHOOK_post_skill_unit_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
typedef void (*HPMHOOK_pre_skill_init_unit_layout) (void);
typedef void (*HPMHOOK_post_skill_init_unit_layout) (void);
-typedef void (*HPMHOOK_pre_skill_init_unit_layout_unknown) (int *skill_idx);
-typedef void (*HPMHOOK_post_skill_init_unit_layout_unknown) (int skill_idx);
+typedef void (*HPMHOOK_pre_skill_init_unit_layout_unknown) (int *skill_idx, int *pos);
+typedef void (*HPMHOOK_post_skill_init_unit_layout_unknown) (int skill_idx, int pos);
typedef void (*HPMHOOK_pre_skill_validate_hittype) (struct config_setting_t **conf, struct s_skill_db **sk);
typedef void (*HPMHOOK_post_skill_validate_hittype) (struct config_setting_t *conf, struct s_skill_db *sk);
typedef void (*HPMHOOK_pre_skill_validate_skilltype) (struct config_setting_t **conf, struct s_skill_db **sk);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 7d0e12e93..6ab215bfc 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4682,6 +4682,8 @@ struct {
struct HPMHookPoint *HP_pc_check_basicskill_post;
struct HPMHookPoint *HP_pc_isDeathPenaltyJob_pre;
struct HPMHookPoint *HP_pc_isDeathPenaltyJob_post;
+ struct HPMHookPoint *HP_pc_has_second_costume_pre;
+ struct HPMHookPoint *HP_pc_has_second_costume_post;
struct HPMHookPoint *HP_libpcre_compile_pre;
struct HPMHookPoint *HP_libpcre_compile_post;
struct HPMHookPoint *HP_libpcre_study_pre;
@@ -11103,6 +11105,8 @@ struct {
int HP_pc_check_basicskill_post;
int HP_pc_isDeathPenaltyJob_pre;
int HP_pc_isDeathPenaltyJob_post;
+ int HP_pc_has_second_costume_pre;
+ int HP_pc_has_second_costume_post;
int HP_libpcre_compile_pre;
int HP_libpcre_compile_post;
int HP_libpcre_study_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 53a8f55a0..43c9c8e6d 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2397,6 +2397,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) },
{ HP_POP(pc->check_basicskill, HP_pc_check_basicskill) },
{ HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) },
+ { HP_POP(pc->has_second_costume, HP_pc_has_second_costume) },
/* pcre_interface */
{ HP_POP(libpcre->compile, HP_libpcre_compile) },
{ HP_POP(libpcre->study, HP_libpcre_study) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index ab60f701c..ca35225c6 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -62356,6 +62356,33 @@ bool HP_pc_isDeathPenaltyJob(uint16 job) {
}
return retVal___;
}
+bool HP_pc_has_second_costume(struct map_session_data *sd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_has_second_costume_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_has_second_costume_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_has_second_costume_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.has_second_costume(sd);
+ }
+ if (HPMHooks.count.HP_pc_has_second_costume_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_has_second_costume_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_has_second_costume_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd);
+ }
+ }
+ return retVal___;
+}
/* pcre_interface */
pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) {
int hIndex = 0;
@@ -75059,14 +75086,14 @@ void HP_skill_init_unit_layout(void) {
}
return;
}
-void HP_skill_init_unit_layout_unknown(int skill_idx) {
+void HP_skill_init_unit_layout_unknown(int skill_idx, int pos) {
int hIndex = 0;
if (HPMHooks.count.HP_skill_init_unit_layout_unknown_pre > 0) {
- void (*preHookFunc) (int *skill_idx);
+ void (*preHookFunc) (int *skill_idx, int *pos);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_init_unit_layout_unknown_pre[hIndex].func;
- preHookFunc(&skill_idx);
+ preHookFunc(&skill_idx, &pos);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -75074,13 +75101,13 @@ void HP_skill_init_unit_layout_unknown(int skill_idx) {
}
}
{
- HPMHooks.source.skill.init_unit_layout_unknown(skill_idx);
+ HPMHooks.source.skill.init_unit_layout_unknown(skill_idx, pos);
}
if (HPMHooks.count.HP_skill_init_unit_layout_unknown_post > 0) {
- void (*postHookFunc) (int skill_idx);
+ void (*postHookFunc) (int skill_idx, int pos);
for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_init_unit_layout_unknown_post[hIndex].func;
- postHookFunc(skill_idx);
+ postHookFunc(skill_idx, pos);
}
}
return;