summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/mob.c3
-rw-r--r--src/map/pc.c59
-rw-r--r--src/map/skill.c5
4 files changed, 40 insertions, 35 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1adff1ad9..2d6199207 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2829,11 +2829,11 @@ int clif_changelook(struct block_list *bl,int type,int val)
vd->class_ = val;
if (vd->class_ == JOB_WEDDING || vd->class_ == JOB_XMAS)
vd->weapon = vd->shield = 0;
- if (
+ if (vd->cloth_color && (
(vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) ||
(vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette)
- )
- vd->cloth_color = 0;
+ ))
+ clif_changelook(bl,LOOK_CLOTHES_COLOR,0);
break;
case LOOK_HAIR:
vd->hair_style = val;
@@ -8613,7 +8613,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
sc = status_get_sc(bl);
if (sc && (
(sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) && !sd->special_state.intravision) ||
- sc->option&OPTION_INVISIBLE)
+ (sc->option&OPTION_INVISIBLE && !disguised(bl)))
) {
//Asked name of invisible player, this shouldn't be possible!
//Possible bot? Thanks to veider and qspirit
diff --git a/src/map/mob.c b/src/map/mob.c
index 239a38886..f45c6f104 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1968,7 +1968,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
//Drops affected by luk as a % increase [Skotlex]
if (src && battle_config.drops_by_luk2 > 0)
drop_rate += (int)(0.5+drop_rate*status_get_luk(src)*battle_config.drops_by_luk2/10000.0);
- if (sd && battle_config.pk_mode == 1 && (md->db->lv - sd->status.base_level >= 20))
+ if (sd && battle_config.pk_mode &&
+ (int)(md->db->lv - sd->status.base_level) >= 20)
drop_rate = (int)(drop_rate*1.25); // pk_mode increase drops if 20 level difference [Valaris]
// if (10000 < rand()%10000+drop_rate) { //May be better if MAX_RAND is too low?
diff --git a/src/map/pc.c b/src/map/pc.c
index 510e747e6..9475c9566 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5413,50 +5413,51 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
*/
int pc_setoption(struct map_session_data *sd,int type)
{
+ int p_type;
nullpo_retr(0, sd);
- if (type&OPTION_RIDING && !(sd->sc.option&OPTION_RIDING) && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
+ p_type = sd->sc.option;
+
+ //Option has to be changed client-side before the class sprite or it won't always work (eg: Wedding sprite) [Skotlex]
+ sd->sc.option=type;
+ clif_changeoption(&sd->bl);
+
+ if (type&OPTION_RIDING && !(p_type&OPTION_RIDING) && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
{ //We are going to mount. [Skotlex]
- switch (sd->status.class_)
- {
- case JOB_KNIGHT:
- clif_changelook(&sd->bl,LOOK_BASE,JOB_KNIGHT2);
- break;
- case JOB_CRUSADER:
- clif_changelook(&sd->bl,LOOK_BASE,JOB_CRUSADER2);
- break;
- case JOB_LORD_KNIGHT:
- clif_changelook(&sd->bl,LOOK_BASE,JOB_LORD_KNIGHT2);
- break;
- case JOB_PALADIN:
- clif_changelook(&sd->bl,LOOK_BASE,JOB_PALADIN2);
- break;
- case JOB_BABY_KNIGHT:
- clif_changelook(&sd->bl,LOOK_BASE,JOB_BABY_KNIGHT2);
- break;
- case JOB_BABY_CRUSADER:
- clif_changelook(&sd->bl,LOOK_BASE,JOB_BABY_CRUSADER2);
- break;
- }
- clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ status_set_viewdata(&sd->bl, sd->status.class_); //Adjust view class.
+ clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
+ if (sd->vd.cloth_color)
+ clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
clif_status_load(&sd->bl,SI_RIDING,1);
status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds.
}
- else if (!(type&OPTION_RIDING) && sd->sc.option&OPTION_RIDING && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
+ else if (!(type&OPTION_RIDING) && p_type&OPTION_RIDING && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
{ //We are going to dismount.
if (sd->vd.class_ != sd->status.class_) {
- clif_changelook(&sd->bl,LOOK_BASE,sd->status.class_);
+ status_set_viewdata(&sd->bl, sd->status.class_);
+ clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
}
clif_status_load(&sd->bl,SI_RIDING,0);
status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds.
}
- if (type&OPTION_FALCON && !(sd->sc.option&OPTION_FALCON)) //Falcon ON
+
+ if (type&OPTION_FALCON && !(p_type&OPTION_FALCON)) //Falcon ON
clif_status_load(&sd->bl,SI_FALCON,1);
- else if (!(type&OPTION_FALCON) && sd->sc.option&OPTION_FALCON) //Falcon OFF
+ else if (!(type&OPTION_FALCON) && p_type&OPTION_FALCON) //Falcon OFF
clif_status_load(&sd->bl,SI_FALCON,0);
+
+ if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING))
+ clif_changelook(&sd->bl,LOOK_BASE,JOB_WEDDING);
+ else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING)
+ {
+ if (sd->vd.class_ != sd->status.class_) {
+ status_set_viewdata(&sd->bl, sd->status.class_);
+ clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
+ if(sd->status.clothes_color)
+ clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
+ }
+ }
- sd->sc.option=type;
- clif_changeoption(&sd->bl);
status_calc_pc(sd,0);
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index c122b2dd2..e058efcc2 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1455,7 +1455,10 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
}
}
- if(sd && bl->type == BL_MOB && status_isdead(bl) && skill_get_inf(skillid)!=INF_GROUND_SKILL && (rate=pc_checkskill(sd,HW_SOULDRAIN))>0)
+ if(sd && bl->type == BL_MOB && status_isdead(bl) &&
+ skillid && skill_get_type(skillid)==BF_MAGIC &&
+ skill_get_inf(skillid)!=INF_GROUND_SKILL &&
+ (rate=pc_checkskill(sd,HW_SOULDRAIN))>0)
{ //Soul Drain should only work on targetted spells [Skotlex]
int sp;
if (pc_issit(sd)) pc_setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex]