ZC_PROPERTY_PET
This commit is contained in:
parent
11d84fb634
commit
a47f868be0
@ -3192,7 +3192,7 @@ ACMD_FUNC(petfriendly) {
|
||||
}
|
||||
|
||||
pet_set_intimate(pd, friendly);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *pd );
|
||||
clif_displaymessage(fd, msg_txt(sd,182)); // Pet intimacy changed.
|
||||
return 0;
|
||||
}
|
||||
@ -3226,7 +3226,7 @@ ACMD_FUNC(pethungry)
|
||||
}
|
||||
|
||||
pd->pet.hungry = hungry;
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *pd );
|
||||
clif_displaymessage(fd, msg_txt(sd,185)); // Pet hunger changed.
|
||||
|
||||
return 0;
|
||||
@ -3251,7 +3251,7 @@ ACMD_FUNC(petrename)
|
||||
|
||||
pd->pet.rename_flag = 0;
|
||||
intif_save_petdata(sd->status.account_id, &pd->pet);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *pd );
|
||||
clif_displaymessage(fd, msg_txt(sd,187)); // You can now rename your pet.
|
||||
|
||||
return 0;
|
||||
|
||||
@ -8266,30 +8266,23 @@ void clif_send_petdata(map_session_data* sd, struct pet_data* pd, int type, int
|
||||
}
|
||||
|
||||
|
||||
/// Pet's base data (ZC_PROPERTY_PET).
|
||||
/// 01a2 <name>.24B <renamed>.B <level>.W <hunger>.W <intimacy>.W <accessory id>.W <class>.W
|
||||
void clif_send_petstatus(map_session_data *sd)
|
||||
{
|
||||
int fd;
|
||||
struct s_pet *pet;
|
||||
/// Pet's base data.
|
||||
/// 01a2 <name>.24B <renamed>.B <level>.W <hunger>.W <intimacy>.W <accessory id>.W <class>.W (ZC_PROPERTY_PET)
|
||||
void clif_send_petstatus( map_session_data& sd, pet_data& pd ){
|
||||
PACKET_ZC_PROPERTY_PET packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
nullpo_retv(sd->pd);
|
||||
|
||||
fd=sd->fd;
|
||||
pet = &sd->pd->pet;
|
||||
WFIFOHEAD(fd,packet_len(0x1a2));
|
||||
WFIFOW(fd,0)=0x1a2;
|
||||
safestrncpy(WFIFOCP(fd,2),pet->name,NAME_LENGTH);
|
||||
WFIFOB(fd,26)=battle_config.pet_rename?0:pet->rename_flag;
|
||||
WFIFOW(fd,27)=pet->level;
|
||||
WFIFOW(fd,29)=pet->hungry;
|
||||
WFIFOW(fd,31)=pet->intimate;
|
||||
WFIFOW(fd,33)=pet->equip;
|
||||
packet.PacketType = HEADER_ZC_PROPERTY_PET;
|
||||
safestrncpy( packet.szName, pd.pet.name, NAME_LENGTH );
|
||||
packet.bModified = battle_config.pet_rename ? 0 : pd.pet.rename_flag;
|
||||
packet.nLevel = pd.pet.level;
|
||||
packet.nFullness = pd.pet.hungry;
|
||||
packet.nRelationship = pd.pet.intimate;
|
||||
packet.ITID = static_cast<decltype(packet.ITID)>( pd.pet.equip );
|
||||
#if PACKETVER >= 20081126
|
||||
WFIFOW(fd,35)=pet->class_;
|
||||
packet.job = pd.pet.class_;
|
||||
#endif
|
||||
WFIFOSET(fd,packet_len(0x1a2));
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -10802,7 +10795,7 @@ void clif_parse_LoadEndAck(int fd,map_session_data *sd)
|
||||
return;
|
||||
clif_spawn(&sd->pd->bl);
|
||||
clif_send_petdata(sd,sd->pd,0,0);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *sd->pd );
|
||||
// skill_unit_move(&sd->pd->bl,gettick(),1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1090,7 +1090,7 @@ void clif_upgrademessage( map_session_data* sd, int result, t_itemid item_id );
|
||||
void clif_catch_process( map_session_data& sd );
|
||||
void clif_pet_roulette( map_session_data& sd, bool success );
|
||||
void clif_sendegg(map_session_data *sd);
|
||||
void clif_send_petstatus(map_session_data *sd);
|
||||
void clif_send_petstatus( map_session_data& sd, pet_data& pd );
|
||||
void clif_send_petdata(map_session_data* sd, struct pet_data* pd, int type, int param);
|
||||
#define clif_pet_equip(sd, pd) clif_send_petdata(sd, pd, 3, (pd)->vd.head_bottom)
|
||||
#define clif_pet_equip_area(pd) clif_send_petdata(nullptr, pd, 3, (pd)->vd.head_bottom)
|
||||
|
||||
@ -248,7 +248,6 @@
|
||||
parseable_packet(0x019d,6,clif_parse_GMHide,2);
|
||||
parseable_packet(0x019f,6,clif_parse_CatchPet,2);
|
||||
parseable_packet(0x01a1,3,clif_parse_PetMenu,2);
|
||||
packet(0x01a2,35);
|
||||
packet(0x01a3,5);
|
||||
packet(0x01a4,11);
|
||||
parseable_packet(0x01a5,26,clif_parse_ChangePetName,2);
|
||||
@ -1251,7 +1250,6 @@
|
||||
|
||||
// 2008-11-26aSakexe
|
||||
#if PACKETVER >= 20081126
|
||||
packet(0x01a2,37);
|
||||
packet(0x0441,4);
|
||||
#endif
|
||||
|
||||
@ -1330,7 +1328,6 @@
|
||||
|
||||
// 2008-12-17aRagexeRE
|
||||
#if PACKETVER >= 20081217
|
||||
packet(0x01a2,37);
|
||||
//packet(0x0441,4);
|
||||
//packet(0x0443,8);
|
||||
#endif
|
||||
|
||||
@ -1115,7 +1115,7 @@ int pet_birth_process(map_session_data *sd, struct s_pet *pet)
|
||||
clif_send_petdata(sd, sd->pd, 6, 1);
|
||||
#endif
|
||||
clif_pet_equip_area(sd->pd);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *sd->pd );
|
||||
clif_pet_autofeed_status(sd,true);
|
||||
}
|
||||
|
||||
@ -1173,7 +1173,7 @@ int pet_recv_petdata(uint32 account_id,struct s_pet *p,int flag)
|
||||
clif_send_petdata(sd,sd->pd,0,0);
|
||||
clif_send_petdata(sd,sd->pd,5,battle_config.pet_hair_style);
|
||||
clif_pet_equip_area(sd->pd);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *sd->pd );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1406,7 +1406,7 @@ int pet_menu(map_session_data *sd,int menunum)
|
||||
|
||||
switch(menunum) {
|
||||
case 0:
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *sd->pd );
|
||||
break;
|
||||
case 1:
|
||||
pet_food(sd, sd->pd);
|
||||
@ -1469,7 +1469,7 @@ int pet_change_name_ack(map_session_data *sd, char* name, int flag)
|
||||
|
||||
if ( !flag || !strlen(name) ) {
|
||||
clif_displaymessage(sd->fd, msg_txt(sd,280)); // You cannot use this name for your pet.
|
||||
clif_send_petstatus(sd); //Send status so client knows pet name change got rejected.
|
||||
clif_send_petstatus( *sd, *pd ); //Send status so client knows pet name change got rejected.
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1477,7 +1477,7 @@ int pet_change_name_ack(map_session_data *sd, char* name, int flag)
|
||||
clif_name_area(&pd->bl);
|
||||
pd->pet.rename_flag = 1;
|
||||
clif_pet_equip_area(pd);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *pd );
|
||||
|
||||
int index = pet_egg_search( sd, pd->pet.pet_id );
|
||||
|
||||
@ -2323,7 +2323,7 @@ void pet_evolution(map_session_data *sd, int16 pet_id) {
|
||||
clif_send_petdata(sd, sd->pd, 0, 0);
|
||||
clif_send_petdata(sd, sd->pd, 5, battle_config.pet_hair_style);
|
||||
clif_pet_equip_area(sd->pd);
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *sd->pd );
|
||||
clif_emotion(&sd->bl, ET_BEST);
|
||||
clif_specialeffect(&sd->pd->bl, EF_HO_UP, AREA);
|
||||
|
||||
|
||||
@ -19582,7 +19582,7 @@ BUILDIN_FUNC(setunitdata)
|
||||
clif_send_homdata( *hd, SP_ACK );
|
||||
break;
|
||||
case BL_PET:
|
||||
clif_send_petstatus(pd->master);
|
||||
clif_send_petstatus( *pd->master, *pd );
|
||||
break;
|
||||
case BL_MER:
|
||||
clif_mercenary_info(map_charid2sd(mc->mercenary.char_id));
|
||||
|
||||
@ -3014,7 +3014,7 @@ void status_calc_pet_(struct pet_data *pd, uint8 opt)
|
||||
status_calc_misc(&pd->bl, &pd->status, lv);
|
||||
|
||||
if (!(opt&SCO_FIRST)) // Not done the first time because the pet is not visible yet
|
||||
clif_send_petstatus(sd);
|
||||
clif_send_petstatus( *sd, *pd );
|
||||
}
|
||||
} else if (opt&SCO_FIRST) {
|
||||
status_calc_misc(&pd->bl, &pd->status, pd->db->lv);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user