summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 6d84b7514..531cb9857 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5408,28 +5408,36 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case SG_HATE:
- if (sd) {
+ if (sd && skilllv <= 3) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ if (sd->hate_mob[skilllv-1] != -1)
+ { //Can't change hate targets.
+ clif_skill_fail(sd,skillid,0,0);
+ break;
+ }
if(dstsd) //PC
{
sd->hate_mob[skilllv-1] = dstsd->status.class_;
pc_setglobalreg(sd,"PC_HATE_MOB_STAR",sd->hate_mob[skilllv-1]+1);
clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
+ break;
}
- else if(dstmd) // mob
+ if(dstmd) // mob
{
+ if (sd->hate_mob[skilllv-1] || tstatus->size != skilllv-1)
+ { //Can't change hate targets / wrong target size
+ clif_skill_fail(sd,skillid,0,0);
+ break;
+ }
switch(skilllv)
{
case 1:
- if (tstatus->size==0)
- {
- sd->hate_mob[0] = dstmd->class_;
- pc_setglobalreg(sd,"PC_HATE_MOB_SUN",sd->hate_mob[0]+1);
- clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
- } else clif_skill_fail(sd,skillid,0,0);
+ sd->hate_mob[0] = dstmd->class_;
+ pc_setglobalreg(sd,"PC_HATE_MOB_SUN",sd->hate_mob[0]+1);
+ clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
break;
case 2:
- if (tstatus->size==1 && tstatus->max_hp>=6000)
+ if (tstatus->max_hp>=6000)
{
sd->hate_mob[1] = dstmd->class_;
pc_setglobalreg(sd,"PC_HATE_MOB_MOON",sd->hate_mob[1]+1);
@@ -5437,16 +5445,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
} else clif_skill_fail(sd,skillid,0,0);
break;
case 3:
- if (tstatus->size==2 && tstatus->max_hp>=20000)
+ if (tstatus->max_hp>=20000)
{
sd->hate_mob[2] = dstmd->class_;
pc_setglobalreg(sd,"PC_HATE_MOB_STAR",sd->hate_mob[2]+1);
clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
} else clif_skill_fail(sd,skillid,0,0);
break;
- default:
- clif_skill_fail(sd,skillid,0,0);
- break;
}
}
}
@@ -8088,6 +8093,8 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
} else
if(sc->data[SC_COMBO].val1 == skill)
break; //Combo ready.
+ //Cancel combo wait.
+ unit_cancel_combo(&sd->bl);
return 0;
case BD_ADAPTATION: /* アドリブ */
{