- Cleaned up some the pet armor display code.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11034 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
29a07a72e7
commit
1518e0240b
@ -1098,7 +1098,7 @@ static int clif_set007b(struct block_list *bl, struct view_data *vd, struct unit
|
|||||||
WBUFW(buf,46)=sc->opt3;
|
WBUFW(buf,46)=sc->opt3;
|
||||||
}
|
}
|
||||||
WBUFW(buf,14)=vd->class_;
|
WBUFW(buf,14)=vd->class_;
|
||||||
WBUFW(buf,16)=vd->hair_style; //For pets
|
WBUFW(buf,16)=vd->hair_style; //For pets (disables mob attack cursor)
|
||||||
//18W: Weapon
|
//18W: Weapon
|
||||||
WBUFW(buf,20)=vd->head_bottom; //Pet armor
|
WBUFW(buf,20)=vd->head_bottom; //Pet armor
|
||||||
WBUFL(buf,22)=gettick();
|
WBUFL(buf,22)=gettick();
|
||||||
@ -1315,13 +1315,12 @@ int clif_spawn(struct block_list *bl)
|
|||||||
WBUFW(buf,10)=sc->opt2;
|
WBUFW(buf,10)=sc->opt2;
|
||||||
WBUFW(buf,12)=sc->option;
|
WBUFW(buf,12)=sc->option;
|
||||||
}
|
}
|
||||||
WBUFW(buf,14)=vd->hair_style;
|
WBUFW(buf,14)=vd->hair_style; //For pets (disables mob attack cursor)
|
||||||
//14W: Hair Style
|
//14W: Hair Style
|
||||||
//16W: Weapon
|
//16W: Weapon
|
||||||
//18W: Head bottom
|
WBUFW(buf,18)=vd->head_bottom; //Pet armor (ignored by client)
|
||||||
WBUFW(buf,20)=vd->class_;
|
WBUFW(buf,20)=vd->class_;
|
||||||
//22W: Shield
|
//22W: Shield
|
||||||
WBUFW(buf,24)=vd->head_bottom; //Pet armor
|
|
||||||
//24W: Head top
|
//24W: Head top
|
||||||
//26W: Head mid
|
//26W: Head mid
|
||||||
//28W: Hair color
|
//28W: Hair color
|
||||||
@ -1365,12 +1364,8 @@ int clif_spawn(struct block_list *bl)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BL_PET:
|
case BL_PET:
|
||||||
if (vd->head_bottom) //Pet armor display fix.
|
if (vd->head_bottom) //Pet armor display fix.
|
||||||
{
|
clif_pet_equip_area((TBL_PET*)bl); // needed to display pet equip properly
|
||||||
TBL_PET* pd = (TBL_PET*)bl;
|
|
||||||
if (pd->vd.head_bottom) clif_pet_equip(pd); // needed to display pet equip properly
|
|
||||||
clif_send_petdata_area(pd, 5, battle_config.pet_hair_style); // removes the attack cursor
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -3745,22 +3740,8 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BL_PET:
|
case BL_PET:
|
||||||
if (vd->head_bottom) //Pet armor display fix.
|
if (vd->head_bottom) //Pet armor display fix.
|
||||||
{
|
clif_pet_equip(sd, (TBL_PET*)bl);
|
||||||
// needed to display pet equip properly
|
|
||||||
TBL_PET* pd = (TBL_PET*)bl;
|
|
||||||
if (pd->vd.head_bottom)
|
|
||||||
{
|
|
||||||
//TODO: adjust clif_pet_equip() to support a 'target', then rewrite this mess into a function call
|
|
||||||
int fd = sd->fd;
|
|
||||||
WFIFOHEAD(fd,packet_len(0x1a4));
|
|
||||||
WFIFOW(fd,0) = 0x1a4;
|
|
||||||
WFIFOB(fd,2) = 3;
|
|
||||||
WFIFOL(fd,3) = pd->bl.id;
|
|
||||||
WFIFOL(fd,7) = pd->vd.head_bottom;
|
|
||||||
WFIFOSET(fd,packet_len(0x1a4));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6132,37 +6113,21 @@ int clif_sendegg(struct map_session_data *sd)
|
|||||||
* type = 3 -> param = accessory id
|
* type = 3 -> param = accessory id
|
||||||
* type = 4 -> param = performance number (1-3:normal, 4:special)
|
* type = 4 -> param = performance number (1-3:normal, 4:special)
|
||||||
* type = 5 -> param = hairstyle number
|
* type = 5 -> param = hairstyle number
|
||||||
|
* If sd is null, the update is sent to nearby objects, otherwise it is sent only to that player.
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
int clif_send_petdata(struct map_session_data* sd, int type, int param)
|
int clif_send_petdata(struct map_session_data *sd, struct pet_data* pd, int type, int param)
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
|
||||||
nullpo_retr(0, sd->pd);
|
|
||||||
|
|
||||||
fd = sd->fd;
|
|
||||||
WFIFOHEAD(fd,packet_len(0x1a4));
|
|
||||||
WFIFOW(fd,0) = 0x1a4;
|
|
||||||
WFIFOB(fd,2) = type;
|
|
||||||
WFIFOL(fd,3) = sd->pd->bl.id;
|
|
||||||
WFIFOL(fd,7) = param;
|
|
||||||
WFIFOSET(fd,packet_len(0x1a4));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int clif_send_petdata_area(struct pet_data* pd, int type, int param)
|
|
||||||
{
|
{
|
||||||
uint8 buf[16];
|
uint8 buf[16];
|
||||||
|
|
||||||
nullpo_retr(0, pd);
|
nullpo_retr(0, pd);
|
||||||
|
|
||||||
WBUFW(buf,0) = 0x1a4;
|
WBUFW(buf,0) = 0x1a4;
|
||||||
WBUFB(buf,2) = type;
|
WBUFB(buf,2) = type;
|
||||||
WBUFL(buf,3) = pd->bl.id;
|
WBUFL(buf,3) = pd->bl.id;
|
||||||
WBUFL(buf,7) = param;
|
WBUFL(buf,7) = param;
|
||||||
clif_send(buf, packet_len(0x1a4), &pd->bl, AREA);
|
if (sd)
|
||||||
|
clif_send(buf, packet_len(0x1a4), &sd->bl, SELF);
|
||||||
|
else
|
||||||
|
clif_send(buf, packet_len(0x1a4), &pd->bl, AREA);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8061,7 +8026,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
if(sd->pd) {
|
if(sd->pd) {
|
||||||
map_addblock(&sd->pd->bl);
|
map_addblock(&sd->pd->bl);
|
||||||
clif_spawn(&sd->pd->bl);
|
clif_spawn(&sd->pd->bl);
|
||||||
clif_send_petdata(sd,0,0);
|
clif_send_petdata(sd,sd->pd,0,0);
|
||||||
clif_send_petstatus(sd);
|
clif_send_petstatus(sd);
|
||||||
// skill_unit_move(&sd->pd->bl,gettick(),1);
|
// skill_unit_move(&sd->pd->bl,gettick(),1);
|
||||||
}
|
}
|
||||||
|
@ -321,10 +321,10 @@ int clif_catch_process(struct map_session_data *sd);
|
|||||||
int clif_pet_roulette(struct map_session_data *sd,int data);
|
int clif_pet_roulette(struct map_session_data *sd,int data);
|
||||||
int clif_sendegg(struct map_session_data *sd);
|
int clif_sendegg(struct map_session_data *sd);
|
||||||
int clif_send_petstatus(struct map_session_data *sd);
|
int clif_send_petstatus(struct map_session_data *sd);
|
||||||
int clif_send_petdata(struct map_session_data* sd, int type, int param);
|
int clif_send_petdata(struct map_session_data *sd, struct pet_data* pd, int type, int param);
|
||||||
int clif_send_petdata_area(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(pd) clif_send_petdata_area(pd, 3, (pd)->vd.head_bottom)
|
#define clif_pet_equip_area(pd) clif_send_petdata(NULL, pd, 3, (pd)->vd.head_bottom)
|
||||||
#define clif_pet_performance(pd, param) clif_send_petdata_area(pd, 4, param)
|
#define clif_pet_performance(pd, param) clif_send_petdata(NULL, pd, 4, param)
|
||||||
int clif_pet_emotion(struct pet_data *pd,int param);
|
int clif_pet_emotion(struct pet_data *pd,int param);
|
||||||
int clif_pet_food(struct map_session_data *sd,int foodid,int fail);
|
int clif_pet_food(struct map_session_data *sd,int foodid,int fail);
|
||||||
|
|
||||||
|
@ -4859,7 +4859,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
pet->intimate -= sd->pd->petDB->die;
|
pet->intimate -= sd->pd->petDB->die;
|
||||||
if(pet->intimate < 0)
|
if(pet->intimate < 0)
|
||||||
pet->intimate = 0;
|
pet->intimate = 0;
|
||||||
clif_send_petdata(sd,1,pet->intimate);
|
clif_send_petdata(sd,sd->pd,1,pet->intimate);
|
||||||
}
|
}
|
||||||
if(sd->pd->target_id) // Unlock all targets...
|
if(sd->pd->target_id) // Unlock all targets...
|
||||||
pet_unlocktarget(sd->pd);
|
pet_unlocktarget(sd->pd);
|
||||||
|
@ -258,9 +258,9 @@ static int pet_hungry(int tid,unsigned int tick,int id,int data)
|
|||||||
pd->status.speed = pd->db->status.speed;
|
pd->status.speed = pd->db->status.speed;
|
||||||
}
|
}
|
||||||
status_calc_pet(pd, 0);
|
status_calc_pet(pd, 0);
|
||||||
clif_send_petdata(sd,1,pd->pet.intimate);
|
clif_send_petdata(sd,pd,1,pd->pet.intimate);
|
||||||
}
|
}
|
||||||
clif_send_petdata(sd,2,pd->pet.hungry);
|
clif_send_petdata(sd,pd,2,pd->pet.hungry);
|
||||||
|
|
||||||
if(battle_config.pet_hungry_delay_rate != 100)
|
if(battle_config.pet_hungry_delay_rate != 100)
|
||||||
interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100;
|
interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100;
|
||||||
@ -461,9 +461,9 @@ int pet_birth_process(struct map_session_data *sd, struct s_pet *pet)
|
|||||||
if(sd->bl.prev != NULL) {
|
if(sd->bl.prev != NULL) {
|
||||||
map_addblock(&sd->pd->bl);
|
map_addblock(&sd->pd->bl);
|
||||||
clif_spawn(&sd->pd->bl);
|
clif_spawn(&sd->pd->bl);
|
||||||
clif_send_petdata(sd,0,0);
|
clif_send_petdata(sd,sd->pd, 0,0);
|
||||||
clif_send_petdata(sd,5,battle_config.pet_hair_style);
|
clif_send_petdata(sd,sd->pd, 5,battle_config.pet_hair_style);
|
||||||
clif_pet_equip(sd->pd);
|
clif_pet_equip_area(sd->pd);
|
||||||
clif_send_petstatus(sd);
|
clif_send_petstatus(sd);
|
||||||
}
|
}
|
||||||
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd);
|
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd);
|
||||||
@ -503,9 +503,9 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
|
|||||||
if(sd->pd && sd->bl.prev != NULL) {
|
if(sd->pd && sd->bl.prev != NULL) {
|
||||||
map_addblock(&sd->pd->bl);
|
map_addblock(&sd->pd->bl);
|
||||||
clif_spawn(&sd->pd->bl);
|
clif_spawn(&sd->pd->bl);
|
||||||
clif_send_petdata(sd,0,0);
|
clif_send_petdata(sd,sd->pd,0,0);
|
||||||
clif_send_petdata(sd,5,battle_config.pet_hair_style);
|
clif_send_petdata(sd,sd->pd,5,battle_config.pet_hair_style);
|
||||||
clif_pet_equip(sd->pd);
|
clif_pet_equip_area(sd->pd);
|
||||||
clif_send_petstatus(sd);
|
clif_send_petstatus(sd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -690,7 +690,7 @@ int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
|
|||||||
memcpy(pd->pet.name, name, NAME_LENGTH);
|
memcpy(pd->pet.name, name, NAME_LENGTH);
|
||||||
clif_charnameack (0,&pd->bl);
|
clif_charnameack (0,&pd->bl);
|
||||||
pd->pet.rename_flag = 1;
|
pd->pet.rename_flag = 1;
|
||||||
clif_pet_equip(pd);
|
clif_pet_equip_area(pd);
|
||||||
clif_send_petstatus(sd);
|
clif_send_petstatus(sd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -714,7 +714,7 @@ int pet_equipitem(struct map_session_data *sd,int index)
|
|||||||
pc_delitem(sd,index,1,0);
|
pc_delitem(sd,index,1,0);
|
||||||
pd->pet.equip = nameid;
|
pd->pet.equip = nameid;
|
||||||
status_set_viewdata(&pd->bl, pd->pet.class_); //Updates view_data.
|
status_set_viewdata(&pd->bl, pd->pet.class_); //Updates view_data.
|
||||||
clif_pet_equip(pd);
|
clif_pet_equip_area(pd);
|
||||||
if (battle_config.pet_equip_required)
|
if (battle_config.pet_equip_required)
|
||||||
{ //Skotlex: start support timers if need
|
{ //Skotlex: start support timers if need
|
||||||
unsigned int tick = gettick();
|
unsigned int tick = gettick();
|
||||||
@ -743,7 +743,7 @@ static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd)
|
|||||||
nameid = pd->pet.equip;
|
nameid = pd->pet.equip;
|
||||||
pd->pet.equip = 0;
|
pd->pet.equip = 0;
|
||||||
status_set_viewdata(&pd->bl, pd->pet.class_);
|
status_set_viewdata(&pd->bl, pd->pet.class_);
|
||||||
clif_pet_equip(pd);
|
clif_pet_equip_area(pd);
|
||||||
memset(&tmp_item,0,sizeof(tmp_item));
|
memset(&tmp_item,0,sizeof(tmp_item));
|
||||||
tmp_item.nameid = nameid;
|
tmp_item.nameid = nameid;
|
||||||
tmp_item.identify = 1;
|
tmp_item.identify = 1;
|
||||||
@ -813,8 +813,8 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd)
|
|||||||
if(pd->pet.hungry > 100)
|
if(pd->pet.hungry > 100)
|
||||||
pd->pet.hungry = 100;
|
pd->pet.hungry = 100;
|
||||||
|
|
||||||
clif_send_petdata(sd,2,pd->pet.hungry);
|
clif_send_petdata(sd,pd,2,pd->pet.hungry);
|
||||||
clif_send_petdata(sd,1,pd->pet.intimate);
|
clif_send_petdata(sd,pd,1,pd->pet.intimate);
|
||||||
clif_pet_food(sd,pd->petDB->FoodID,1);
|
clif_pet_food(sd,pd->petDB->FoodID,1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -476,7 +476,7 @@ enum {
|
|||||||
OPT1_FREEZE,
|
OPT1_FREEZE,
|
||||||
OPT1_STUN,
|
OPT1_STUN,
|
||||||
OPT1_SLEEP,
|
OPT1_SLEEP,
|
||||||
//What is 5?
|
//Aegis uses OPT1 = 5 to identify undead enemies (which also grants them immunity to the other opt1 changes)
|
||||||
OPT1_STONEWAIT=6 //Petrifying
|
OPT1_STONEWAIT=6 //Petrifying
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user