Skip to content

Commit

Permalink
Hanbok & Costumes Update
Browse files Browse the repository at this point in the history
http://hercules.ws/board/topic/485-hanbok-costumes-update/
Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed Apr 24, 2013
1 parent 018680a commit 2df7ce4
Show file tree
Hide file tree
Showing 13 changed files with 462 additions and 412 deletions.
10 changes: 7 additions & 3 deletions conf/battle/client.conf
Expand Up @@ -69,20 +69,24 @@ wedding_modifydisplay: no
// Save Clothes color. (This will degrade performance) (Note 1)
save_clothcolor: yes

// Do not display cloth colors for the wedding class?
// Do not display cloth colors for the wedding costume?
// Note: Both save_clothcolor and wedding_modifydisplay have to be enabled
// for this option to take effect. Set this to yes if your cloth palettes
// pack doesn't has wedding palettes (or has less than the other jobs)
wedding_ignorepalette: no

// Do not display cloth colors for the Xmas class?
// Do not display cloth colors for the Xmas costume?
// Set this to yes if your cloth palettes pack doesn't has Xmas palettes (or has less than the other jobs)
xmas_ignorepalette: no

// Do not display cloth colors for the Summer class?
// Do not display cloth colors for the Summer costume?
// Set this to yes if your cloth palettes pack doesn't has Summer palettes (or has less than the other jobs)
summer_ignorepalette: no

// Do not display cloth colors for the Hanbok costume?
// Set this to yes if your cloth palettes pack doesn't has Hanbok palettes (or has less than the other jobs)
hanbok_ignorepalette: no

// Set this to 1 if your clients have langtype problems and can't display motd properly
motd_type: 0

Expand Down
6 changes: 6 additions & 0 deletions conf/messages.conf
Expand Up @@ -1489,6 +1489,12 @@
1467: -- %s unbanall <channel name>
1468: - unbans everyone from <channel name>

// @costume
1469: '%s' is not a known costume
1470: You're already with a '%s' costume, type '@costume' to remove it.
1471: -- %s
1472: - Available Costumes
1473: Costume '%s' removed.

//Custom translations
import: conf/import/msg_conf.txt
2 changes: 1 addition & 1 deletion db/pre-re/item_db.txt
Expand Up @@ -1594,7 +1594,7 @@
2773,Krieger_Ring2,Glorious Mass-Production Ring,5,20,,0,,0,,0,0xFFFFFFFE,7,2,136,,61,0,0,{ bonus bAllStats,2; },{},{}
2774,Krieger_Ring3,Glorious Popularized Ring,5,20,,0,,0,,0,0xFFFFFFFE,7,2,136,,0,0,0,{ bonus bAllStats,1; },{},{}
2775,Lure,Lure,5,20,,100,,0,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{},{}
2776,Cool_Towel,Adventurer's Trusty Towel,5,20,,100,,,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{ setoption Option_Summer,1; },{ setoption Option_Summer,0; }
2776,Cool_Towel,Adventurer's Trusty Towel,5,20,,100,,,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{ sc_start SC_SUMMER,-1,0; },{ sc_end SC_SUMMER; }
2777,Shaman_Ring,Shaman Ring,5,20,,100,,0,,1,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bUseSPrate,-5; },{},{}
2778,Shaman_Earing,Shaman Earrings,5,20,,100,,0,,0,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bInt,2; },{},{}
2779,Dark_Knight_Belt,Dark Knight Belt,5,20,,500,,1,,0,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bStr,2; bonus bAgi,1; },{},{}
Expand Down
2 changes: 1 addition & 1 deletion db/re/item_db.txt
Expand Up @@ -1807,7 +1807,7 @@
2773,Krieger_Ring2,Glorious Mass-Production Ring,5,20,,0,,0,,0,0xFFFFFFFE,7,2,136,,61,0,0,{ bonus bAllStats,2; },{},{}
2774,Krieger_Ring3,Glorious Popularized Ring,5,20,,0,,0,,0,0xFFFFFFFE,7,2,136,,0,0,0,{ bonus bAllStats,1; },{},{}
2775,Lure,Lure,5,20,,100,,0,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{},{}
2776,Cool_Towel,Adventurer's Trusty Towel,5,20,,100,,,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{ setoption Option_Summer,1; },{ setoption Option_Summer,0; }
2776,Cool_Towel,Adventurer's Trusty Towel,5,20,,100,,,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{ sc_start SC_SUMMER,-1,0; },{ sc_end SC_SUMMER; }
2777,Shaman_Ring,Shaman Ring,5,20,,100,,0,,1,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bUseSPrate,-5; },{},{}
2778,Shaman_Earing,Shaman Earrings,5,20,,100,,0,,0,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bInt,2; },{},{}
2779,Dark_Knight_Belt,Dark Knight Belt,5,20,,500,,1,,0,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bStr,2; bonus bAgi,1; },{},{}
Expand Down
57 changes: 54 additions & 3 deletions src/map/atcommand.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
**/
Expand Down Expand Up @@ -9644,6 +9694,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(channel),
ACMD_DEF(fontcolor),
ACMD_DEF(searchstore),
ACMD_DEF(costume),
};
AtCommandInfo* cmd;
int i;
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.c
Expand Up @@ -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, },
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.h
Expand Up @@ -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;
Expand Down
54 changes: 33 additions & 21 deletions src/map/clif.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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:
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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] )
Expand Down Expand Up @@ -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) )
Expand Down Expand Up @@ -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) )
Expand Down
38 changes: 6 additions & 32 deletions src/map/pc.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/map/script.c
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/map/skill.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 2df7ce4

Please sign in to comment.