diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 57 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/clif.c | 54 | ||||
-rw-r--r-- | src/map/pc.c | 38 | ||||
-rw-r--r-- | src/map/script.c | 8 | ||||
-rw-r--r-- | src/map/skill.c | 2 | ||||
-rw-r--r-- | src/map/status.c | 642 | ||||
-rw-r--r-- | src/map/status.h | 51 |
9 files changed, 447 insertions, 407 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e9c8c5fba..e3b4077cb 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8504,12 +8504,12 @@ ACMD(charcommands) ACMD(mount2) { clif->message(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated. - if( !(sd->sc.option&OPTION_MOUNTING) ) { + if( !(sd->sc.data[SC_ALL_RIDING]) ) { clif->message(sd->fd,msg_txt(1363)); // You have mounted. - pc_setoption(sd, sd->sc.option|OPTION_MOUNTING); + sc_start(&sd->bl,SC_ALL_RIDING,100,0,-1); } else { clif->message(sd->fd,msg_txt(1364)); // You have released your mount. - pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING); + status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER); } return true; } @@ -9380,6 +9380,56 @@ ACMD(searchstore){ return true; } +ACMD(costume){ + const char* names[4] = { + "Wedding", + "Xmas", + "Summer", + "Hanbok", + }; + const int name2id[4] = { SC_WEDDING, SC_XMAS, SC_SUMMER, SC_HANBOK }; + unsigned short k = 0; + + if( !message || !*message ) { + for( k = 0; k < 4; k++ ) { + if( sd->sc.data[name2id[k]] ) { + sprintf(atcmd_output,msg_txt(1473),names[k]);//Costume '%s' removed. + clif->message(sd->fd,atcmd_output); + status_change_end(&sd->bl,name2id[k],INVALID_TIMER); + return true; + } + } + + clif->message(sd->fd,msg_txt(1472)); + for( k = 0; k < 4; k++ ) { + sprintf(atcmd_output,msg_txt(1471),names[k]);//-- %s + clif->message(sd->fd,atcmd_output); + } + return false; + } + + for( k = 0; k < 4; k++ ) { + if( sd->sc.data[name2id[k]] ) { + sprintf(atcmd_output,msg_txt(1470),names[k]);// You're already with a '%s' costume, type '@costume' to remove it. + clif->message(sd->fd,atcmd_output); + return false; + } + } + + for( k = 0; k < 4; k++ ) { + if( strcmpi(message,names[k]) == 0 ) + break; + } + if( k == 4 ) { + sprintf(atcmd_output,msg_txt(1469),message);// '%s' is not a known costume + clif->message(sd->fd,atcmd_output); + return false; + } + + sc_start(&sd->bl, name2id[k], 100, 0, -1); + + return true; +} /** * Fills the reference of available commands in atcommand DBMap **/ @@ -9644,6 +9694,7 @@ void atcommand_basecommands(void) { ACMD_DEF(channel), ACMD_DEF(fontcolor), ACMD_DEF(searchstore), + ACMD_DEF(costume), }; AtCommandInfo* cmd; int i; diff --git a/src/map/battle.c b/src/map/battle.c index 372616f83..7df79e772 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5682,6 +5682,7 @@ static const struct _battle_data { { "wedding_ignorepalette", &battle_config.wedding_ignorepalette, 0, 0, 1, }, { "xmas_ignorepalette", &battle_config.xmas_ignorepalette, 0, 0, 1, }, { "summer_ignorepalette", &battle_config.summer_ignorepalette, 0, 0, 1, }, + { "hanbok_ignorepalette", &battle_config.hanbok_ignorepalette, 0, 0, 1, }, { "natural_healhp_interval", &battle_config.natural_healhp_interval, 6000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_healsp_interval", &battle_config.natural_healsp_interval, 8000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_heal_skill_interval", &battle_config.natural_heal_skill_interval, 10000, NATURAL_HEAL_INTERVAL, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index 8b1f757f5..9305cb3eb 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -197,6 +197,7 @@ struct Battle_Config { int wedding_ignorepalette; //[Skotlex] int xmas_ignorepalette; // [Valaris] int summer_ignorepalette; // [Zephyrus] + int hanbok_ignorepalette; int natural_healhp_interval; int natural_healsp_interval; int natural_heal_skill_interval; diff --git a/src/map/clif.c b/src/map/clif.c index 7ada310e2..c026f1566 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -772,8 +772,7 @@ void clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int t void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand) { - if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER)) - { + if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK)) { *rhand = *lhand = 0; return; } @@ -1358,7 +1357,7 @@ int clif_spawn(struct block_list *bl) clif->specialeffect(bl,421,AREA); if( sd->bg_id && map[sd->bl.m].flag.battleground ) clif->sendbgemblem_area(sd); - if( sd->sc.option&OPTION_MOUNTING ) { + if( sd->sc.data[SC_ALL_RIDING] ) { //New Mounts are not complaint to the original method, so we gotta tell this guy that he is mounting. clif->sc_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0); } @@ -3244,15 +3243,24 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->shield = val; break; case LOOK_BASE: - vd->class_ = val; - if (vd->class_ == JOB_WEDDING || vd->class_ == JOB_XMAS || vd->class_ == JOB_SUMMER) + if( !sd ) break; + + if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK) ) vd->weapon = vd->shield = 0; - if (vd->cloth_color && ( - (vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) || - (vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette) || - (vd->class_ == JOB_SUMMER && battle_config.summer_ignorepalette) - )) - clif->changelook(bl,LOOK_CLOTHES_COLOR,0); + + if( !vd->cloth_color ) + break; + + if( sd ) { + if( sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette ) + vd->cloth_color = 0; + if( sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette ) + vd->cloth_color = 0; + if( sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette ) + vd->cloth_color = 0; + if( sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette ) + vd->cloth_color = 0; + } break; case LOOK_HAIR: vd->hair_style = val; @@ -3270,12 +3278,16 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->hair_color = val; break; case LOOK_CLOTHES_COLOR: - if (val && ( - (vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) || - (vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette) || - (vd->class_ == JOB_SUMMER && battle_config.summer_ignorepalette) - )) - val = 0; + if( val && sd ) { + if( sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette ) + val = 0; + if( sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette ) + val = 0; + if( sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette ) + val = 0; + if( sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette ) + val = 0; + } vd->cloth_color = val; break; case LOOK_SHOES: @@ -4297,7 +4309,7 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds if( dstsd->talisman[i] > 0 ) clif->talisman_single(sd->fd, dstsd, i); } - if( dstsd->sc.option&OPTION_MOUNTING ) { + if( dstsd->sc.data[SC_ALL_RIDING] ) { //New Mounts are not complaint to the original method, so we gotta tell this guy that I'm mounting. clif->sc_single(sd->fd,dstsd->bl.id,SI_ALL_RIDING,2,1,0,0); } @@ -10037,7 +10049,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, if( pc_cant_act(sd) || sd->sc.option&OPTION_HIDE ) return; - if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER) ) + if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK) ) return; if( sd->sc.data[SC_BASILICA] || sd->sc.data[SC__SHADOWFORM] ) @@ -11185,7 +11197,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) } } - if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER) ) + if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK) ) return; if( sd->sc.data[SC_BASILICA] && (skill_id != HP_BASILICA || sd->sc.data[SC_BASILICA]->val4 != sd->bl.id) ) @@ -11269,7 +11281,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski } } - if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER) ) + if( sd->sc.option&(OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK) ) return; if( sd->sc.data[SC_BASILICA] && (skill_id != HP_BASILICA || sd->sc.data[SC_BASILICA]->val4 != sd->bl.id) ) diff --git a/src/map/pc.c b/src/map/pc.c index 7427348fe..2ac5d6919 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -457,8 +457,8 @@ void pc_inventory_rentals(struct map_session_data *sd) if( sd->status.inventory[i].expire_time <= time(NULL) ) { if( sd->status.inventory[i].nameid == ITEMID_REINS_OF_MOUNT - && sd->sc.option&OPTION_MOUNTING ) { - pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING); + && sd->sc.data[SC_ALL_RIDING] ) { + status_change_end(&sd->bl,SC_ALL_RIDING,INVALID_TIMER); } clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid); pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER); @@ -518,9 +518,9 @@ int pc_makesavestatus(struct map_session_data *sd) //Only copy the Cart/Peco/Falcon options, the rest are handled via //status change load/saving. [Skotlex] #ifdef NEW_CARTS - sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_MOUNTING); + sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR); #else - sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_CART|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_MOUNTING); + sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_CART|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR); #endif if (sd->sc.data[SC_JAILED]) { //When Jailed, do not move last point. @@ -4293,7 +4293,7 @@ int pc_useitem(struct map_session_data *sd,int n) /* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */ if( sd->inventory_data[n]->flag.delay_consume ) { - if( nameid != ITEMID_REINS_OF_MOUNT && sd->sc.option&OPTION_MOUNTING ) + if( nameid != ITEMID_REINS_OF_MOUNT && sd->sc.data[SC_ALL_RIDING] ) return 0; else if( pc_issit(sd) ) return 0; @@ -6337,8 +6337,6 @@ int pc_resetskill(struct map_session_data* sd, int flag) i &= ~OPTION_WUGRIDER; if( i&OPTION_MADOGEAR && ( sd->class_&MAPID_THIRDMASK ) == MAPID_MECHANIC ) i &= ~OPTION_MADOGEAR; - if( i&OPTION_MOUNTING ) - i &= ~OPTION_MOUNTING; #ifndef NEW_CARTS if( i&OPTION_CART && pc_checkskill(sd, MC_PUSHCART) ) i &= ~OPTION_CART; @@ -7632,15 +7630,6 @@ int pc_setoption(struct map_session_data *sd,int type) } #endif - if (type&OPTION_MOUNTING && !(p_type&OPTION_MOUNTING) ) { - clif->sc_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0); - status_calc_pc(sd,0); - } else if (!(type&OPTION_MOUNTING) && p_type&OPTION_MOUNTING) { - clif->sc_notick(&sd->bl,SI_ALL_RIDING,0,0,0,0); - status_calc_pc(sd,0); - } - - if (type&OPTION_FALCON && !(p_type&OPTION_FALCON)) //Falcon ON clif->status_change(&sd->bl, SI_FALCON, 1, 0, 0, 0, 0); else if (!(type&OPTION_FALCON) && p_type&OPTION_FALCON) //Falcon OFF @@ -7679,22 +7668,7 @@ int pc_setoption(struct map_session_data *sd,int type) new_look = JOB_STAR_GLADIATOR2; else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING) new_look = -1; - - if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING)) - new_look = JOB_WEDDING; - else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING) - new_look = -1; - - if (type&OPTION_XMAS && !(p_type&OPTION_XMAS)) - new_look = JOB_XMAS; - else if (!(type&OPTION_XMAS) && p_type&OPTION_XMAS) - new_look = -1; - - if (type&OPTION_SUMMER && !(p_type&OPTION_SUMMER)) - new_look = JOB_SUMMER; - else if (!(type&OPTION_SUMMER) && p_type&OPTION_SUMMER) - new_look = -1; - + if (sd->disguise || !new_look) return 0; //Disguises break sprite changes diff --git a/src/map/script.c b/src/map/script.c index a061fcdd1..c847179df 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16697,7 +16697,7 @@ BUILDIN(ismounting) { TBL_PC* sd; if( (sd = script_rid2sd(st)) == NULL ) return true; - if( sd->sc.option&OPTION_MOUNTING ) + if( sd->sc.data[SC_ALL_RIDING] ) script_pushint(st,1); else script_pushint(st,0); @@ -16717,10 +16717,10 @@ BUILDIN(setmounting) { if( sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR) ) script_pushint(st,0);//can't mount with one of these else { - if( sd->sc.option&OPTION_MOUNTING ) - pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING);//release mount + if( sd->sc.data[SC_ALL_RIDING] ) + status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER); else - pc_setoption(sd, sd->sc.option|OPTION_MOUNTING);//mount + sc_start(&sd->bl, SC_ALL_RIDING, 100, 0, -1); script_pushint(st,1);//in both cases, return 1. } return true; diff --git a/src/map/skill.c b/src/map/skill.c index 874ad1a26..399212c96 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -512,7 +512,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) if( sd->skillitem == skill_id ) return 0; - if( sd->sc.option&OPTION_MOUNTING ) + if( sd->sc.data[SC_ALL_RIDING] ) return 1;//You can't use skills while in the new mounts (The client doesn't let you, this is to make cheat-safe) switch (skill_id) { diff --git a/src/map/status.c b/src/map/status.c index 3892d94cc..8777c7d2f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -904,6 +904,7 @@ void initChangeTables(void) { StatusIconChangeTable[SC_CURSED_SOIL] = SI_CURSED_SOIL; StatusIconChangeTable[SC_UPHEAVAL] = SI_UPHEAVAL; StatusIconChangeTable[SC_PUSH_CART] = SI_ON_PUSH_CART; + StatusIconChangeTable[SC_ALL_RIDING] = SI_ALL_RIDING; //Other SC which are not necessarily associated to skills. StatusChangeFlagTable[SC_ASPDPOTION0] = SCB_ASPD; @@ -1664,7 +1665,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin } if (sc->option&OPTION_CHASEWALK && skill_id != ST_CHASEWALK) return 0; - if(sc->option&OPTION_MOUNTING) + if( sc->data[SC_ALL_RIDING] ) return 0;//New mounts can't attack nor use skills in the client; this check makes it cheat-safe [Ind] } @@ -5014,7 +5015,7 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha if( sc->data[SC_FUSION] ) val = 25; else if( sd ) { - if( pc_isriding(sd) || sd->sc.option&(OPTION_DRAGON|OPTION_MOUNTING) ) + if( pc_isriding(sd) || sd->sc.option&(OPTION_DRAGON) || sd->sc.data[SC_ALL_RIDING] ) val = 25;//Same bonus else if( pc_isridingwug(sd) ) val = 15 + 5 * pc_checkskill(sd, RA_WUGRIDER); @@ -5940,124 +5941,122 @@ void status_set_viewdata(struct block_list *bl, int class_) vd = NULL; switch (bl->type) { - case BL_PC: - { - TBL_PC* sd = (TBL_PC*)bl; - if (pcdb_checkid(class_)) { - if (sd->sc.option&OPTION_WEDDING) - class_ = JOB_WEDDING; - else if (sd->sc.option&OPTION_SUMMER) - class_ = JOB_SUMMER; - else if (sd->sc.option&OPTION_XMAS) - class_ = JOB_XMAS; - else if (sd->sc.option&OPTION_RIDING) { - switch (class_) { //Adapt class to a Mounted one. - case JOB_KNIGHT: - class_ = JOB_KNIGHT2; - break; - case JOB_CRUSADER: - class_ = JOB_CRUSADER2; - break; - case JOB_LORD_KNIGHT: - class_ = JOB_LORD_KNIGHT2; - break; - case JOB_PALADIN: - class_ = JOB_PALADIN2; - break; - case JOB_BABY_KNIGHT: - class_ = JOB_BABY_KNIGHT2; - break; - case JOB_BABY_CRUSADER: - class_ = JOB_BABY_CRUSADER2; - break; + case BL_PC: + { + TBL_PC* sd = (TBL_PC*)bl; + if (pcdb_checkid(class_)) { + if (sd->sc.option&OPTION_RIDING) { + switch (class_) { //Adapt class to a Mounted one. + case JOB_KNIGHT: + class_ = JOB_KNIGHT2; + break; + case JOB_CRUSADER: + class_ = JOB_CRUSADER2; + break; + case JOB_LORD_KNIGHT: + class_ = JOB_LORD_KNIGHT2; + break; + case JOB_PALADIN: + class_ = JOB_PALADIN2; + break; + case JOB_BABY_KNIGHT: + class_ = JOB_BABY_KNIGHT2; + break; + case JOB_BABY_CRUSADER: + class_ = JOB_BABY_CRUSADER2; + break; + } } - } - sd->vd.class_ = class_; - clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield); - sd->vd.head_top = sd->status.head_top; - sd->vd.head_mid = sd->status.head_mid; - sd->vd.head_bottom = sd->status.head_bottom; - sd->vd.hair_style = cap_value(sd->status.hair,0,battle_config.max_hair_style); - sd->vd.hair_color = cap_value(sd->status.hair_color,0,battle_config.max_hair_color); - sd->vd.cloth_color = cap_value(sd->status.clothes_color,0,battle_config.max_cloth_color); - sd->vd.robe = sd->status.robe; - sd->vd.sex = sd->status.sex; - } else if (vd) - memcpy(&sd->vd, vd, sizeof(struct view_data)); - else - ShowError("status_set_viewdata (PC): No view data for class %d\n", class_); - } - break; - case BL_MOB: - { - TBL_MOB* md = (TBL_MOB*)bl; - if (vd) - md->vd = vd; - else - ShowError("status_set_viewdata (MOB): No view data for class %d\n", class_); - } - break; - case BL_PET: - { - TBL_PET* pd = (TBL_PET*)bl; - if (vd) { - memcpy(&pd->vd, vd, sizeof(struct view_data)); - if (!pcdb_checkid(vd->class_)) { - pd->vd.hair_style = battle_config.pet_hair_style; - if(pd->pet.equip) { - pd->vd.head_bottom = itemdb_viewid(pd->pet.equip); - if (!pd->vd.head_bottom) - pd->vd.head_bottom = pd->pet.equip; + sd->vd.class_ = class_; + clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield); + sd->vd.head_top = sd->status.head_top; + sd->vd.head_mid = sd->status.head_mid; + sd->vd.head_bottom = sd->status.head_bottom; + sd->vd.hair_style = cap_value(sd->status.hair,0,battle_config.max_hair_style); + sd->vd.hair_color = cap_value(sd->status.hair_color,0,battle_config.max_hair_color); + sd->vd.cloth_color = cap_value(sd->status.clothes_color,0,battle_config.max_cloth_color); + sd->vd.robe = sd->status.robe; + sd->vd.sex = sd->status.sex; + + if ( sd->vd.cloth_color ) { + if( sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette ) + sd->vd.cloth_color = 0; + if( sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette ) + sd->vd.cloth_color = 0; + if( sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette ) + sd->vd.cloth_color = 0; + if( sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette ) + sd->vd.cloth_color = 0; } - } - } else - ShowError("status_set_viewdata (PET): No view data for class %d\n", class_); - } - break; - case BL_NPC: - { - TBL_NPC* nd = (TBL_NPC*)bl; - if (vd) - nd->vd = vd; - else - ShowError("status_set_viewdata (NPC): No view data for class %d\n", class_); - } - break; - case BL_HOM: //[blackhole89] - { - struct homun_data *hd = (struct homun_data*)bl; - if (vd) - hd->vd = vd; - else - ShowError("status_set_viewdata (HOMUNCULUS): No view data for class %d\n", class_); - } + } else if (vd) + memcpy(&sd->vd, vd, sizeof(struct view_data)); + else + ShowError("status_set_viewdata (PC): No view data for class %d\n", class_); + } break; - case BL_MER: - { - struct mercenary_data *md = (struct mercenary_data*)bl; - if (vd) - md->vd = vd; - else - ShowError("status_set_viewdata (MERCENARY): No view data for class %d\n", class_); - } + case BL_MOB: + { + TBL_MOB* md = (TBL_MOB*)bl; + if (vd) + md->vd = vd; + else + ShowError("status_set_viewdata (MOB): No view data for class %d\n", class_); + } break; - case BL_ELEM: - { - struct elemental_data *ed = (struct elemental_data*)bl; - if (vd) - ed->vd = vd; - else - ShowError("status_set_viewdata (ELEMENTAL): No view data for class %d\n", class_); - } + case BL_PET: + { + TBL_PET* pd = (TBL_PET*)bl; + if (vd) { + memcpy(&pd->vd, vd, sizeof(struct view_data)); + if (!pcdb_checkid(vd->class_)) { + pd->vd.hair_style = battle_config.pet_hair_style; + if(pd->pet.equip) { + pd->vd.head_bottom = itemdb_viewid(pd->pet.equip); + if (!pd->vd.head_bottom) + pd->vd.head_bottom = pd->pet.equip; + } + } + } else + ShowError("status_set_viewdata (PET): No view data for class %d\n", class_); + } + break; + case BL_NPC: + { + TBL_NPC* nd = (TBL_NPC*)bl; + if (vd) + nd->vd = vd; + else + ShowError("status_set_viewdata (NPC): No view data for class %d\n", class_); + } break; + case BL_HOM: //[blackhole89] + { + struct homun_data *hd = (struct homun_data*)bl; + if (vd) + hd->vd = vd; + else + ShowError("status_set_viewdata (HOMUNCULUS): No view data for class %d\n", class_); + } + break; + case BL_MER: + { + struct mercenary_data *md = (struct mercenary_data*)bl; + if (vd) + md->vd = vd; + else + ShowError("status_set_viewdata (MERCENARY): No view data for class %d\n", class_); + } + break; + case BL_ELEM: + { + struct elemental_data *ed = (struct elemental_data*)bl; + if (vd) + ed->vd = vd; + else + ShowError("status_set_viewdata (ELEMENTAL): No view data for class %d\n", class_); + } + break; } - vd = status_get_viewdata(bl); - if (vd && vd->cloth_color && ( - (vd->class_==JOB_WEDDING && battle_config.wedding_ignorepalette) - || (vd->class_==JOB_XMAS && battle_config.xmas_ignorepalette) - || (vd->class_==JOB_SUMMER && battle_config.summer_ignorepalette) - )) - vd->cloth_color = 0; } /// Returns the status_change data of bl or NULL if it doesn't exist. @@ -7327,17 +7326,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val case SC_WEDDING: case SC_XMAS: case SC_SUMMER: + case SC_HANBOK: if (!vd) return 0; //Store previous values as they could be removed. - val1 = vd->class_; - val2 = vd->weapon; - val3 = vd->shield; - val4 = vd->cloth_color; unit_stop_attack(bl); - clif->changelook(bl,LOOK_WEAPON,0); - clif->changelook(bl,LOOK_SHIELD,0); - clif->changelook(bl,LOOK_BASE,type==SC_WEDDING?JOB_WEDDING:type==SC_XMAS?JOB_XMAS:JOB_SUMMER); - clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); break; case SC_NOCHAT: // [GodLesZ] FIXME: is this correct? a hardcoded interval of 60sec? what about configuration ?_? @@ -7466,6 +7458,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val case SC_READYTURN: case SC_DODGE: case SC_PUSH_CART: + case SC_ALL_RIDING: tick = -1; break; @@ -8546,22 +8539,22 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val ShowError("UnknownStatusChange [%d]\n", type); return 0; } - } - else //Special considerations when loading SC data. - switch( type ) - { - case SC_WEDDING: - case SC_XMAS: - case SC_SUMMER: - clif->changelook(bl,LOOK_WEAPON,0); - clif->changelook(bl,LOOK_SHIELD,0); - clif->changelook(bl,LOOK_BASE,type==SC_WEDDING?JOB_WEDDING:type==SC_XMAS?JOB_XMAS:JOB_SUMMER); - clif->changelook(bl,LOOK_CLOTHES_COLOR,val4); - break; - case SC_KAAHI: - val4 = INVALID_TIMER; - break; - } + } else //Special considerations when loading SC data. + switch( type ) { + case SC_WEDDING: + case SC_XMAS: + case SC_SUMMER: + case SC_HANBOK: + if( !vd ) break; + clif->changelook(bl,LOOK_BASE,vd->class_); + clif->changelook(bl,LOOK_WEAPON,0); + clif->changelook(bl,LOOK_SHIELD,0); + clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); + break; + case SC_KAAHI: + val4 = INVALID_TIMER; + break; + } //Those that make you stop attacking/walking.... switch (type) { @@ -8619,8 +8612,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val // Set option as needed. opt_flag = 1; - switch(type) - { + switch(type) { //OPT1 case SC_STONE: sc->opt1 = OPT1_STONEWAIT; break; case SC_FREEZE: sc->opt1 = OPT1_FREEZE; break; @@ -8756,12 +8748,19 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val break; case SC_WEDDING: sc->option |= OPTION_WEDDING; + opt_flag |= 0x4; break; case SC_XMAS: sc->option |= OPTION_XMAS; + opt_flag |= 0x4; break; case SC_SUMMER: sc->option |= OPTION_SUMMER; + opt_flag |= 0x4; + break; + case SC_HANBOK: + sc->option |= OPTION_HANBOK; + opt_flag |= 0x4; break; case SC_ORCISH: sc->option |= OPTION_ORCISH; @@ -8774,13 +8773,17 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val } //On Aegis, when turning on a status change, first goes the option packet, then the sc packet. - if(opt_flag) + if(opt_flag) { clif->changeoption(bl); - - if (calc_flag&SCB_DYE) - { //Reset DYE color - if (vd && vd->cloth_color) - { + if( sd && opt_flag&0x4 ) { + clif->changelook(bl,LOOK_BASE,vd->class_); + clif->changelook(bl,LOOK_WEAPON,0); + clif->changelook(bl,LOOK_SHIELD,0); + clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); + } + } + if (calc_flag&SCB_DYE) { //Reset DYE color + if (vd && vd->cloth_color) { val4 = vd->cloth_color; clif->changelook(bl,LOOK_CLOTHES_COLOR,0); } @@ -8936,6 +8939,7 @@ int status_change_clear(struct block_list* bl, int type) { case SC_MELTDOWN: case SC_XMAS: case SC_SUMMER: + case SC_HANBOK: case SC_NOCHAT: case SC_FUSION: case SC_EARTHSCROLL: @@ -8974,6 +8978,7 @@ int status_change_clear(struct block_list* bl, int type) { case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: case SC_PUSH_CART: + case SC_ALL_RIDING: continue; } @@ -8983,6 +8988,7 @@ int status_change_clear(struct block_list* bl, int type) { case SC_WEIGHT90: case SC_NOCHAT: case SC_PUSH_CART: + case SC_ALL_RIDING: continue; } } @@ -9079,28 +9085,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const if(bl->type == BL_PC) skill->break_equip(bl,EQP_WEAPON,10000,BCT_SELF); break; - case SC_WEDDING: - case SC_XMAS: - case SC_SUMMER: - if (!vd) break; - if (sd) - { //Load data from sd->status.* as the stored values could have changed. - //Must remove OPTION to prevent class being rechanged. - sc->option &= type==SC_WEDDING?~OPTION_WEDDING:type==SC_XMAS?~OPTION_XMAS:~OPTION_SUMMER; - clif->changeoption(&sd->bl); - status_set_viewdata(bl, sd->status.class_); - } else { - vd->class_ = sce->val1; - vd->weapon = sce->val2; - vd->shield = sce->val3; - vd->cloth_color = sce->val4; - } - clif->changelook(bl,LOOK_BASE,vd->class_); - clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); - clif->changelook(bl,LOOK_WEAPON,vd->weapon); - clif->changelook(bl,LOOK_SHIELD,vd->shield); - if(sd) clif->skillinfoblock(sd); - break; case SC_RUN: { struct unit_data *ud = unit_bl2ud(bl); @@ -9496,169 +9480,175 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const case SC_INTRAVISION: calc_flag = SCB_ALL;/* required for overlapping */ break; - } + } opt_flag = 1; switch(type){ - case SC_STONE: - case SC_FREEZE: - case SC_STUN: - case SC_SLEEP: - case SC_DEEPSLEEP: - case SC_BURNING: - case SC_WHITEIMPRISON: - case SC_CRYSTALIZE: - sc->opt1 = 0; - break; + case SC_STONE: + case SC_FREEZE: + case SC_STUN: + case SC_SLEEP: + case SC_DEEPSLEEP: + case SC_BURNING: + case SC_WHITEIMPRISON: + case SC_CRYSTALIZE: + sc->opt1 = 0; + break; - case SC_POISON: - case SC_CURSE: - case SC_SILENCE: - case SC_BLIND: - sc->opt2 &= ~(1<<(type-SC_POISON)); - break; - case SC_DPOISON: - sc->opt2 &= ~OPT2_DPOISON; - break; - case SC_SIGNUMCRUCIS: - sc->opt2 &= ~OPT2_SIGNUMCRUCIS; - break; + case SC_POISON: + case SC_CURSE: + case SC_SILENCE: + case SC_BLIND: + sc->opt2 &= ~(1<<(type-SC_POISON)); + break; + case SC_DPOISON: + sc->opt2 &= ~OPT2_DPOISON; + break; + case SC_SIGNUMCRUCIS: + sc->opt2 &= ~OPT2_SIGNUMCRUCIS; + break; - case SC_HIDING: - sc->option &= ~OPTION_HIDE; - opt_flag|= 2|4; //Check for warp trigger + AoE trigger - break; - case SC_CLOAKING: - case SC_CLOAKINGEXCEED: - case SC__INVISIBILITY: - sc->option &= ~OPTION_CLOAK; - case SC_CAMOUFLAGE: - opt_flag|= 2; - break; - case SC_CHASEWALK: - sc->option &= ~(OPTION_CHASEWALK|OPTION_CLOAK); - opt_flag|= 2; - break; - case SC_SIGHT: - sc->option &= ~OPTION_SIGHT; - break; - case SC_WEDDING: - sc->option &= ~OPTION_WEDDING; - break; - case SC_XMAS: - sc->option &= ~OPTION_XMAS; - break; - case SC_SUMMER: - sc->option &= ~OPTION_SUMMER; - break; - case SC_ORCISH: - sc->option &= ~OPTION_ORCISH; - break; - case SC_RUWACH: - sc->option &= ~OPTION_RUWACH; - break; - case SC_FUSION: - sc->option &= ~OPTION_FLYING; - break; - //opt3 - case SC_TWOHANDQUICKEN: - case SC_ONEHAND: - case SC_SPEARQUICKEN: - case SC_CONCENTRATION: - case SC_MERC_QUICKEN: - sc->opt3 &= ~OPT3_QUICKEN; - opt_flag = 0; - break; - case SC_OVERTHRUST: - case SC_MAXOVERTHRUST: - case SC_SWOO: - sc->opt3 &= ~OPT3_OVERTHRUST; - if( type == SC_SWOO ) - opt_flag = 8; - else + case SC_HIDING: + sc->option &= ~OPTION_HIDE; + opt_flag|= 2|4; //Check for warp trigger + AoE trigger + break; + case SC_CLOAKING: + case SC_CLOAKINGEXCEED: + case SC__INVISIBILITY: + sc->option &= ~OPTION_CLOAK; + case SC_CAMOUFLAGE: + opt_flag|= 2; + break; + case SC_CHASEWALK: + sc->option &= ~(OPTION_CHASEWALK|OPTION_CLOAK); + opt_flag|= 2; + break; + case SC_SIGHT: + sc->option &= ~OPTION_SIGHT; + break; + case SC_WEDDING: + sc->option &= ~OPTION_WEDDING; + opt_flag |= 0x4; + break; + case SC_XMAS: + sc->option &= ~OPTION_XMAS; + opt_flag |= 0x4; + break; + case SC_SUMMER: + sc->option &= ~OPTION_SUMMER; + opt_flag |= 0x4; + break; + case SC_HANBOK: + sc->option &= ~OPTION_HANBOK; + opt_flag |= 0x4; + break; + case SC_ORCISH: + sc->option &= ~OPTION_ORCISH; + break; + case SC_RUWACH: + sc->option &= ~OPTION_RUWACH; + break; + case SC_FUSION: + sc->option &= ~OPTION_FLYING; + break; + //opt3 + case SC_TWOHANDQUICKEN: + case SC_ONEHAND: + case SC_SPEARQUICKEN: + case SC_CONCENTRATION: + case SC_MERC_QUICKEN: + sc->opt3 &= ~OPT3_QUICKEN; opt_flag = 0; - break; - case SC_ENERGYCOAT: - case SC_SKE: - sc->opt3 &= ~OPT3_ENERGYCOAT; - opt_flag = 0; - break; - case SC_INCATKRATE: //Simulated Explosion spirits effect. - if (bl->type != BL_MOB) - { + break; + case SC_OVERTHRUST: + case SC_MAXOVERTHRUST: + case SC_SWOO: + sc->opt3 &= ~OPT3_OVERTHRUST; + if( type == SC_SWOO ) + opt_flag = 8; + else + opt_flag = 0; + break; + case SC_ENERGYCOAT: + case SC_SKE: + sc->opt3 &= ~OPT3_ENERGYCOAT; opt_flag = 0; break; - } - case SC_EXPLOSIONSPIRITS: - sc->opt3 &= ~OPT3_EXPLOSIONSPIRITS; - opt_flag = 0; - break; - case SC_STEELBODY: - case SC_SKA: - sc->opt3 &= ~OPT3_STEELBODY; - opt_flag = 0; - break; - case SC_BLADESTOP: - sc->opt3 &= ~OPT3_BLADESTOP; - opt_flag = 0; - break; - case SC_AURABLADE: - sc->opt3 &= ~OPT3_AURABLADE; - opt_flag = 0; - break; - case SC_BERSERK: - opt_flag = 0; -// case SC__BLOODYLUST: - sc->opt3 &= ~OPT3_BERSERK; - break; -// case ???: // doesn't seem to do anything -// sc->opt3 &= ~OPT3_LIGHTBLADE; -// opt_flag = 0; -// break; - case SC_DANCING: - if ((sce->val1&0xFFFF) == CG_MOONLIT) - sc->opt3 &= ~OPT3_MOONLIT; - opt_flag = 0; - break; - case SC_MARIONETTE: - case SC_MARIONETTE2: - sc->opt3 &= ~OPT3_MARIONETTE; - opt_flag = 0; - break; - case SC_ASSUMPTIO: - sc->opt3 &= ~OPT3_ASSUMPTIO; - opt_flag = 0; - break; - case SC_WARM: //SG skills [Komurka] - sc->opt3 &= ~OPT3_WARM; - opt_flag = 0; - break; - case SC_KAITE: - sc->opt3 &= ~OPT3_KAITE; - opt_flag = 0; - break; - case SC_BUNSINJYUTSU: - sc->opt3 &= ~OPT3_BUNSIN; - opt_flag = 0; - break; - case SC_SPIRIT: - sc->opt3 &= ~OPT3_SOULLINK; - opt_flag = 0; - break; - case SC_CHANGEUNDEAD: - sc->opt3 &= ~OPT3_UNDEAD; - opt_flag = 0; - break; -// case ???: // from DA_CONTRACT (looks like biolab mobs aura) -// sc->opt3 &= ~OPT3_CONTRACT; -// opt_flag = 0; -// break; - default: - opt_flag = 0; + case SC_INCATKRATE: //Simulated Explosion spirits effect. + if (bl->type != BL_MOB) + { + opt_flag = 0; + break; + } + case SC_EXPLOSIONSPIRITS: + sc->opt3 &= ~OPT3_EXPLOSIONSPIRITS; + opt_flag = 0; + break; + case SC_STEELBODY: + case SC_SKA: + sc->opt3 &= ~OPT3_STEELBODY; + opt_flag = 0; + break; + case SC_BLADESTOP: + sc->opt3 &= ~OPT3_BLADESTOP; + opt_flag = 0; + break; + case SC_AURABLADE: + sc->opt3 &= ~OPT3_AURABLADE; + opt_flag = 0; + break; + case SC_BERSERK: + opt_flag = 0; + // case SC__BLOODYLUST: + sc->opt3 &= ~OPT3_BERSERK; + break; + // case ???: // doesn't seem to do anything + // sc->opt3 &= ~OPT3_LIGHTBLADE; + // opt_flag = 0; + // break; + case SC_DANCING: + if ((sce->val1&0xFFFF) == CG_MOONLIT) + sc->opt3 &= ~OPT3_MOONLIT; + opt_flag = 0; + break; + case SC_MARIONETTE: + case SC_MARIONETTE2: + sc->opt3 &= ~OPT3_MARIONETTE; + opt_flag = 0; + break; + case SC_ASSUMPTIO: + sc->opt3 &= ~OPT3_ASSUMPTIO; + opt_flag = 0; + break; + case SC_WARM: //SG skills [Komurka] + sc->opt3 &= ~OPT3_WARM; + opt_flag = 0; + break; + case SC_KAITE: + sc->opt3 &= ~OPT3_KAITE; + opt_flag = 0; + break; + case SC_BUNSINJYUTSU: + sc->opt3 &= ~OPT3_BUNSIN; + opt_flag = 0; + break; + case SC_SPIRIT: + sc->opt3 &= ~OPT3_SOULLINK; + opt_flag = 0; + break; + case SC_CHANGEUNDEAD: + sc->opt3 &= ~OPT3_UNDEAD; + opt_flag = 0; + break; + // case ???: // from DA_CONTRACT (looks like biolab mobs aura) + // sc->opt3 &= ~OPT3_CONTRACT; + // opt_flag = 0; + // break; + default: + opt_flag = 0; } - if (calc_flag&SCB_DYE) - { //Restore DYE color + if (calc_flag&SCB_DYE) { //Restore DYE color if (vd && !vd->cloth_color && sce->val4) clif->changelook(bl,LOOK_CLOTHES_COLOR,sce->val4); calc_flag&=~SCB_DYE; @@ -9669,8 +9659,16 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const if( opt_flag&8 ) //bugreport:681 clif->changeoption2(bl); - else if(opt_flag) + else if(opt_flag) { clif->changeoption(bl); + if( sd && opt_flag&0x4 ) { + clif->changelook(bl,LOOK_BASE,vd->class_); + clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield); + clif->changelook(bl,LOOK_WEAPON,sd->vd.weapon); + clif->changelook(bl,LOOK_SHIELD,sd->vd.shield); + clif->changelook(bl,LOOK_CLOTHES_COLOR,cap_value(sd->status.clothes_color,0,battle_config.max_cloth_color)); + } + } if (calc_flag) status_calc_bl(bl,calc_flag); diff --git a/src/map/status.h b/src/map/status.h index 3c02b9d6c..eeac01e70 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -650,6 +650,9 @@ typedef enum sc_type { #ifdef RENEWAL SC_EXTREMITYFIST2, #endif + + SC_ALL_RIDING, + SC_HANBOK, SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; @@ -1450,30 +1453,30 @@ enum { }; enum { - OPTION_NOTHING = 0x00000000, - OPTION_SIGHT = 0x00000001, - OPTION_HIDE = 0x00000002, - OPTION_CLOAK = 0x00000004, - OPTION_FALCON = 0x00000010, - OPTION_RIDING = 0x00000020, - OPTION_INVISIBLE = 0x00000040, - OPTION_ORCISH = 0x00000800, - OPTION_WEDDING = 0x00001000, - OPTION_RUWACH = 0x00002000, - OPTION_CHASEWALK = 0x00004000, - OPTION_FLYING = 0x00008000, //Note that clientside Flying and Xmas are 0x8000 for clients prior to 2007. - OPTION_XMAS = 0x00010000, - OPTION_TRANSFORM = 0x00020000, - OPTION_SUMMER = 0x00040000, - OPTION_DRAGON1 = 0x00080000, - OPTION_WUG = 0x00100000, - OPTION_WUGRIDER = 0x00200000, - OPTION_MADOGEAR = 0x00400000, - OPTION_DRAGON2 = 0x00800000, - OPTION_DRAGON3 = 0x01000000, - OPTION_DRAGON4 = 0x02000000, - OPTION_DRAGON5 = 0x04000000, - OPTION_MOUNTING = 0x08000000, + OPTION_NOTHING = 0x00000000, + OPTION_SIGHT = 0x00000001, + OPTION_HIDE = 0x00000002, + OPTION_CLOAK = 0x00000004, + OPTION_FALCON = 0x00000010, + OPTION_RIDING = 0x00000020, + OPTION_INVISIBLE = 0x00000040, + OPTION_ORCISH = 0x00000800, + OPTION_WEDDING = 0x00001000, + OPTION_RUWACH = 0x00002000, + OPTION_CHASEWALK = 0x00004000, + OPTION_FLYING = 0x00008000, //Note that clientside Flying and Xmas are 0x8000 for clients prior to 2007. + OPTION_XMAS = 0x00010000, + OPTION_TRANSFORM = 0x00020000, + OPTION_SUMMER = 0x00040000, + OPTION_DRAGON1 = 0x00080000, + OPTION_WUG = 0x00100000, + OPTION_WUGRIDER = 0x00200000, + OPTION_MADOGEAR = 0x00400000, + OPTION_DRAGON2 = 0x00800000, + OPTION_DRAGON3 = 0x01000000, + OPTION_DRAGON4 = 0x02000000, + OPTION_DRAGON5 = 0x04000000, + OPTION_HANBOK = 0x08000000, #ifndef NEW_CARTS OPTION_CART1 = 0x00000008, |