From 0ad1e08ee15ac0112cad6d94e67584a5ce571c53 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Tue, 17 Jul 2018 19:33:32 +0100 Subject: Correct wrong attribute used for pet evolution egg hiding --- src/map/atcommand.c | 2 ++ src/map/pet.c | 6 +++--- src/map/script.c | 8 ++++++++ src/map/skill.c | 3 +++ 4 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 79bd92213..3ec709b57 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -4222,6 +4222,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/pet.c b/src/map/pet.c index e544905c0..5d0e5b9e3 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -345,7 +345,7 @@ 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; } @@ -496,8 +496,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 9a5d33604..1e635b622 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9245,6 +9245,8 @@ static BUILDIN(getbrokenid) num=script_getnum(st,2); for(i=0; istatus.inventory[i].card[0] == CARD0_PET) + continue; if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) { brokencounter++; if(num==brokencounter) { @@ -9270,6 +9272,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++; } @@ -9292,6 +9296,8 @@ static BUILDIN(repair) num=script_getnum(st,2); for(i=0; istatus.inventory[i].card[0] == CARD0_PET) + continue; if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) { repaircounter++; if(num==repaircounter) { @@ -9320,6 +9326,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/skill.c b/src/map/skill.c index ed69b8c0f..524769873 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; -- cgit v1.2.3-70-g09d2 From c64b3517fb085e34f6c3c2ab83a3290b1726fc95 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Tue, 17 Jul 2018 19:57:51 +0100 Subject: add support for PACKETVER >= 20180704 pet evolution --- src/map/clif.c | 1 + src/map/pet.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index 2a2d87ccc..f222240e4 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7244,6 +7244,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) diff --git a/src/map/pet.c b/src/map/pet.c index 5d0e5b9e3..d1d8a5a33 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -348,7 +348,10 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) 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); @@ -462,6 +465,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); } -- cgit v1.2.3-70-g09d2