diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/pc.c | 23 | ||||
-rw-r--r-- | src/map/pc.h | 32 | ||||
-rw-r--r-- | src/map/script.c | 21 |
3 files changed, 45 insertions, 31 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 1d8da86e2..6f8ba91fb 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -66,7 +66,7 @@ struct fame_list smith_fame_list[MAX_FAME_LIST]; struct fame_list chemist_fame_list[MAX_FAME_LIST]; struct fame_list taekwon_fame_list[MAX_FAME_LIST]; -static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_LOW,EQP_AMMO}; +static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_GARMENT,EQP_AMMO}; #define MOTD_LINE_SIZE 128 static char motd_text[MOTD_LINE_SIZE][CHAT_SIZE_MAX]; // Message of the day buffer [Valaris] @@ -7511,7 +7511,7 @@ int pc_equiplookall(struct map_session_data *sd) clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); - clif_changelook(&sd->bl, LOOK_ROBE, sd->status.robe); + clif_changelook(&sd->bl,LOOK_ROBE, sd->status.robe); return 0; } @@ -8554,14 +8554,20 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) sd->status.head_bottom = 0; clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); } + if(pos & EQP_SHOES) clif_changelook(&sd->bl,LOOK_SHOES,0); - if( pos&EQP_GARMENT ) - { + if( pos&EQP_GARMENT ) { sd->status.robe = id ? id->look : 0; clif_changelook(&sd->bl, LOOK_ROBE, sd->status.robe); } + if(pos & EQP_COSTUME_GARMENT) { + sd->status.robe = id ? id->look : 0; + clif_changelook(&sd->bl,LOOK_ROBE,sd->status.robe); + } + + pc_checkallowskill(sd); //Check if status changes should be halted. iflag = sd->npc_item_flag; @@ -8696,12 +8702,17 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) { if(sd->status.inventory[n].equip & EQP_SHOES) clif_changelook(&sd->bl,LOOK_SHOES,0); - if( sd->status.inventory[n].equip&EQP_GARMENT ) - { + + if( sd->status.inventory[n].equip&EQP_GARMENT && pc_checkequip(sd,EQP_COSTUME_GARMENT) == -1 ) { sd->status.robe = 0; clif_changelook(&sd->bl, LOOK_ROBE, 0); } + if(sd->status.inventory[n].equip & EQP_COSTUME_GARMENT) { + sd->status.robe = ( pc_checkequip(sd,EQP_GARMENT) >= 0 ) ? sd->inventory_data[pc_checkequip(sd,EQP_GARMENT)]->look : 0; + clif_changelook(&sd->bl,LOOK_ROBE,sd->status.robe); + } + clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1); if((sd->status.inventory[n].equip & EQP_ARMS) && diff --git a/src/map/pc.h b/src/map/pc.h index d62c6359e..cc120c0cc 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -537,20 +537,21 @@ enum ammo_type { //Equip position constants enum equip_pos { - EQP_HEAD_LOW = 0x0001, - EQP_HEAD_MID = 0x0200, //512 - EQP_HEAD_TOP = 0x0100, //256 - EQP_HAND_R = 0x0002, - EQP_HAND_L = 0x0020, //32 - EQP_ARMOR = 0x0010, //16 - EQP_SHOES = 0x0040, //64 - EQP_GARMENT = 0x0004, - EQP_ACC_L = 0x0008, - EQP_ACC_R = 0x0080, //128 - EQP_COSTUME_HEAD_TOP = 0x0400, - EQP_COSTUME_HEAD_MID = 0x0800, - EQP_COSTUME_HEAD_LOW = 0x1000, - EQP_AMMO = 0x8000, //32768 + EQP_HEAD_LOW = 0x0001, + EQP_HEAD_MID = 0x0200, //512 + EQP_HEAD_TOP = 0x0100, //256 + EQP_HAND_R = 0x0002, //2 + EQP_HAND_L = 0x0020, //32 + EQP_ARMOR = 0x0010, //16 + EQP_SHOES = 0x0040, //64 + EQP_GARMENT = 0x0004, //4 + EQP_ACC_L = 0x0008, //8 + EQP_ACC_R = 0x0080, //128 + EQP_COSTUME_HEAD_TOP = 0x0400, //1024 + EQP_COSTUME_HEAD_MID = 0x0800, //2048 + EQP_COSTUME_HEAD_LOW = 0x1000, //4096 + EQP_COSTUME_GARMENT = 0x2000, //8192 + EQP_AMMO = 0x8000, //32768 }; #define EQP_WEAPON EQP_HAND_R @@ -558,7 +559,7 @@ enum equip_pos { #define EQP_ARMS (EQP_HAND_R|EQP_HAND_L) #define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP) #define EQP_ACC (EQP_ACC_L|EQP_ACC_R) -#define EQP_COSTUME (EQP_COSTUME_HEAD_TOP|EQP_COSTUME_HEAD_MID|EQP_COSTUME_HEAD_LOW) +#define EQP_COSTUME (EQP_COSTUME_HEAD_TOP|EQP_COSTUME_HEAD_MID|EQP_COSTUME_HEAD_LOW|EQP_COSTUME_GARMENT) /// Equip positions that use a visible sprite #if PACKETVER < 20110111 @@ -583,6 +584,7 @@ enum equip_index { EQI_COSTUME_TOP, EQI_COSTUME_MID, EQI_COSTUME_LOW, + EQI_COSTUME_GARMENT, EQI_AMMO, EQI_MAX }; diff --git a/src/map/script.c b/src/map/script.c index 0e45f4821..dcaeacf5b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7349,7 +7349,7 @@ BUILDIN_FUNC(strnpcinfo) // aegis->athena slot position conversion table -static unsigned int equip[] = {EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_GARMENT,EQP_SHOES,EQP_ACC_L,EQP_ACC_R,EQP_HEAD_MID,EQP_HEAD_LOW,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_TOP}; +static unsigned int equip[] = {EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_GARMENT,EQP_SHOES,EQP_ACC_L,EQP_ACC_R,EQP_HEAD_MID,EQP_HEAD_LOW,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_GARMENT}; /*========================================== * GetEquipID(Pos); Pos: 1-10 @@ -12987,15 +12987,16 @@ BUILDIN_FUNC(getlook) type=script_getnum(st,2); val=-1; switch(type) { - case LOOK_HAIR: val=sd->status.hair; break; //1 - case LOOK_WEAPON: val=sd->status.weapon; break; //2 - case LOOK_HEAD_BOTTOM: val=sd->status.head_bottom; break; //3 - case LOOK_HEAD_TOP: val=sd->status.head_top; break; //4 - case LOOK_HEAD_MID: val=sd->status.head_mid; break; //5 - case LOOK_HAIR_COLOR: val=sd->status.hair_color; break; //6 - case LOOK_CLOTHES_COLOR: val=sd->status.clothes_color; break; //7 - case LOOK_SHIELD: val=sd->status.shield; break; //8 - case LOOK_SHOES: break; //9 + case LOOK_HAIR: val=sd->status.hair; break; //1 + case LOOK_WEAPON: val=sd->status.weapon; break; //2 + case LOOK_HEAD_BOTTOM: val=sd->status.head_bottom; break; //3 + case LOOK_HEAD_TOP: val=sd->status.head_top; break; //4 + case LOOK_HEAD_MID: val=sd->status.head_mid; break; //5 + case LOOK_HAIR_COLOR: val=sd->status.hair_color; break; //6 + case LOOK_CLOTHES_COLOR:val=sd->status.clothes_color; break; //7 + case LOOK_SHIELD: val=sd->status.shield; break; //8 + case LOOK_SHOES: break; //9 + case LOOK_ROBE: val=sd->status.robe; break; //12 } script_pushint(st,val); |