summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorcannelle <cannelle@users.noreply.github.com>2013-10-08 23:55:30 -0500
committercannelle <cannelle@users.noreply.github.com>2013-10-08 23:55:30 -0500
commita879388b0af8354bf8dec199de215b206cacb9ac (patch)
tree006e14417471f017b853d0a653d542d844e3358e /src/map/skill.c
parent5fdbee45f634d5d5b29ffa3144c8ac4881c10578 (diff)
downloadhercules-a879388b0af8354bf8dec199de215b206cacb9ac.tar.gz
hercules-a879388b0af8354bf8dec199de215b206cacb9ac.tar.bz2
hercules-a879388b0af8354bf8dec199de215b206cacb9ac.tar.xz
hercules-a879388b0af8354bf8dec199de215b206cacb9ac.zip
Added WE_BABY distance check.
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 248e19e77..2b531c3ec 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6971,21 +6971,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if(sd) {
struct map_session_data *f_sd = pc->get_father(sd);
struct map_session_data *m_sd = pc->get_mother(sd);
- // if neither was found
- if(!f_sd && !m_sd) {
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- map->freeblock_unlock();
- return 0;
+ bool we_baby_parents;
+ if(m_sd && check_distance_bl(bl,&m_sd->bl,AREA_SIZE)) {
+ sc_start(&m_sd->bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
+ clif->specialeffect(&m_sd->bl,408,AREA);
+ we_baby_parents = 1;
}
- status->change_start(bl,SC_STUN,10000,skill_lv,0,0,0,skill->get_time2(skill_id,skill_lv),8);
- if (f_sd) {
+ if(f_sd && check_distance_bl(bl,&f_sd->bl,AREA_SIZE)) {
sc_start(&f_sd->bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
clif->specialeffect(&f_sd->bl,408,AREA);
+ we_baby_parents = 1;
}
- if (m_sd) {
- sc_start(&m_sd->bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
- clif->specialeffect(&m_sd->bl,408,AREA);
+ if (!we_baby_parents) {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ map->freeblock_unlock();
+ return 0;
}
+ else status->change_start(bl,SC_STUN,10000,skill_lv,0,0,0,skill->get_time2(skill_id,skill_lv),8);
}
break;