summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/pc.c3
-rw-r--r--src/map/skill.c33
-rw-r--r--src/map/status.c25
-rw-r--r--src/map/unit.c21
-rw-r--r--src/map/unit.h3
7 files changed, 64 insertions, 26 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 75d48532e..a8aa4e988 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3753,7 +3753,8 @@ static const struct battle_data_short {
{ "mob_luk_status_def", &battle_config.mob_luk_sc_def },
{ "pc_max_status_def", &battle_config.pc_max_sc_def },
{ "mob_max_status_def", &battle_config.mob_max_sc_def },
- { "sg_miracle_skill_ratio", &battle_config.sg_miracle_skill_ratio },
+ { "sg_miracle_skill_ratio", &battle_config.sg_miracle_skill_ratio },
+ { "sg_angel_skill_ratio", &battle_config.sg_angel_skill_ratio },
{ "autospell_stacking", &battle_config.autospell_stacking },
{ "override_mob_names", &battle_config.override_mob_names },
{ "min_chat_delay", &battle_config.min_chat_delay },
@@ -4189,6 +4190,7 @@ void battle_set_defaults() {
battle_config.pc_max_sc_def = 10000;
battle_config.mob_max_sc_def = 5000;
battle_config.sg_miracle_skill_ratio=1;
+ battle_config.sg_angel_skill_ratio=1;
battle_config.sg_miracle_skill_duration=600000;
battle_config.autospell_stacking = 0;
battle_config.override_mob_names = 0;
diff --git a/src/map/battle.h b/src/map/battle.h
index f5eb6e666..56ee63cce 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -432,6 +432,7 @@ extern struct Battle_Config {
unsigned short pc_max_sc_def;
unsigned short mob_max_sc_def;
+ unsigned short sg_angel_skill_ratio;
unsigned short sg_miracle_skill_ratio;
int sg_miracle_skill_duration;
unsigned short autospell_stacking; //Enables autospell cards to stack. [Skotlex]
diff --git a/src/map/pc.c b/src/map/pc.c
index 26afaf835..4af78ffe3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -796,8 +796,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->feel_map[i].index = 0;
sd->feel_map[i].m = -1;
}
- sd->hate_mob[i] = pc_readglobalreg(sd,hate_var[i]) - 1;
-
+ sd->hate_mob[i] = pc_readglobalreg(sd,hate_var[i])-1;
}
if ((i = pc_checkskill(sd,RG_PLAGIARISM)) > 0) {
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: /* ケドăƒȘブ */
{
diff --git a/src/map/status.c b/src/map/status.c
index 352d0da62..e561b7d91 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4701,13 +4701,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
if (sc->data[type].val2 > val2)
return 0;
break;
- case SC_WARM:
- { //Fetch the Group, half the attack interval. [Skotlex]
- struct skill_unit_group *group = (struct skill_unit_group *)sc->data[type].val4;
- if (group)
- group->interval/=2;
- return 1;
- }
case SC_STUN:
case SC_SLEEP:
case SC_POISON:
@@ -7012,8 +7005,24 @@ static int status_natural_heal(DBKey key,void * data,va_list app)
sregen->tick.sp += natural_heal_diff_tick * sregen->rate.sp;
while(sregen->tick.sp >= (unsigned int)battle_config.natural_heal_skill_interval)
{
+ val = sregen->sp;
+ if (sd && sd->doridori_counter) {
+ val*=2;
+ sd->doridori_counter--;
+ if (
+ (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR &&
+ rand()%10000 < battle_config.sg_angel_skill_ratio
+ ) { //Angel of the Sun/Moon/Star
+ malloc_set(sd->hate_mob, 0, sizeof(sd->hate_mob));
+ pc_setglobalreg(sd,"PC_HATE_MOB_STAR", 0);
+ pc_setglobalreg(sd,"PC_HATE_MOB_SUN", 0);
+ pc_setglobalreg(sd,"PC_HATE_MOB_MOON", 0);
+ pc_resetfeel(sd);
+ //TODO: Figure out how to make the client-side msg show up.
+ }
+ }
sregen->tick.sp -= battle_config.natural_heal_skill_interval;
- if(status_heal(bl, 0, sregen->sp, 3) < sregen->sp)
+ if(status_heal(bl, 0, val, 3) < val)
break; //Full
}
}
diff --git a/src/map/unit.c b/src/map/unit.c
index c36c14971..2db6108aa 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1139,6 +1139,27 @@ int unit_attack(struct block_list *src,int target_id,int type)
return 0;
}
+//Cancels an ongoing combo, resets attackable time and restarts the
+//attack timer to resume attacking after amotion time. [Skotlex]
+int unit_cancel_combo(struct block_list *bl)
+{
+ struct unit_data *ud;
+
+ if (!status_change_end(bl, SC_COMBO, -1))
+ return 0; //Combo wasn't active.
+
+ ud = unit_bl2ud(bl);
+ nullpo_retr(0, ud);
+
+ ud->attackabletime = gettick() + status_get_amotion(bl);
+
+ if (ud->attacktimer == -1)
+ return 1; //Nothing more to do.
+
+ delete_timer(ud->attacktimer, unit_attack_timer);
+ ud->attacktimer=add_timer(ud->attackabletime,unit_attack_timer,bl->id,0);
+ return 1;
+}
/*==========================================
*
*------------------------------------------
diff --git a/src/map/unit.h b/src/map/unit.h
index 1e4ff3956..7331f4ca5 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -37,8 +37,7 @@ int unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, i
// UŒ‚ŠÖ˜A
int unit_stop_attack(struct block_list *bl);
int unit_attack(struct block_list *src,int target_id,int type);
-
-// int unit_setpos( struct block_list *bl, const char* map, int x, int y);
+int unit_cancel_combo(struct block_list *bl);
// ƒXƒLƒ‹Žg—p
int unit_skilluse_id(struct block_list *src, int target_id, int skill_num, int skill_lv);