summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-05 17:00:51 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-05 17:00:51 +0000
commitd1527fb4557f1b175677bfd171afff2994b84820 (patch)
tree160b41b83f5e59dbbd2d2f045e3b75f46b6a9008 /src
parentec7f5035ca95489c32d7e49f4b0f8f1c76d36d7f (diff)
downloadhercules-d1527fb4557f1b175677bfd171afff2994b84820.tar.gz
hercules-d1527fb4557f1b175677bfd171afff2994b84820.tar.bz2
hercules-d1527fb4557f1b175677bfd171afff2994b84820.tar.xz
hercules-d1527fb4557f1b175677bfd171afff2994b84820.zip
* Fixed skill tree entries for Vulcan Arrow, and Throw Arrow
* Fixed damage reflecting * Fixed Backstab to not have a push back effect * Fixed auto spell to not taking SP * Fixed Sanctuary to have proper healing count git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1412 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c79
-rw-r--r--src/map/skill.c26
2 files changed, 50 insertions, 55 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 3529b9946..b7e0320e8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3574,30 +3574,27 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
}
if(sd) {
if(sd->autospell_id > 0 && rand()%100 < sd->autospell_rate) {
- int skilllv=sd->autospell_lv,i,f=0,sp;
+ int skilllv = sd->autospell_lv, i;
i = rand()%100;
if(i >= 50) skilllv -= 2;
else if(i >= 15) skilllv--;
if(skilllv < 1) skilllv = 1;
- sp = skill_get_sp(sd->autospell_id,skilllv)*2/3;
- if(sd->status.sp >= sp) {
- if((i=skill_get_inf(sd->autospell_id) == 2) || i == 32)
- f = skill_castend_pos2(src,target->x,target->y,sd->autospell_id,skilllv,tick,flag);
- else {
- switch( skill_get_nk(sd->autospell_id) ) {
- case 0: case 2:
- f = skill_castend_damage_id(src,target,sd->autospell_id,skilllv,tick,flag);
- break;
- case 1:/* 支援系 */
- if((sd->autospell_id==AL_HEAL || (sd->autospell_id==ALL_RESURRECTION && target->type != BL_PC)) && battle_check_undead(race,ele))
- f = skill_castend_damage_id(src,target,sd->autospell_id,skilllv,tick,flag);
- else
- f = skill_castend_nodamage_id(src,target,sd->autospell_id,skilllv,tick,flag);
- break;
- }
+
+ if((i=skill_get_inf(sd->autospell_id) == 2) || i == 32)
+ skill_castend_pos2(src,target->x,target->y,sd->autospell_id,skilllv,tick,flag);
+ else {
+ switch( skill_get_nk(sd->autospell_id) ) {
+ case 0: case 2:
+ skill_castend_damage_id(src,target,sd->autospell_id,skilllv,tick,flag);
+ break;
+ case 1:/* 支援系 */
+ if((sd->autospell_id==AL_HEAL || (sd->autospell_id==ALL_RESURRECTION && target->type != BL_PC)) && battle_check_undead(race,ele))
+ skill_castend_damage_id(src,target,sd->autospell_id,skilllv,tick,flag);
+ else
+ skill_castend_nodamage_id(src,target,sd->autospell_id,skilllv,tick,flag);
+ break;
}
- if(!f) pc_heal(sd,0,-sp);
- }
+ }
}
if (wd.flag&BF_WEAPON && src != target && (wd.damage > 0 || wd.damage2 > 0)) {
int hp = 0,sp = 0;
@@ -3626,39 +3623,37 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
struct map_session_data *tsd = (struct map_session_data *)target;
if(tsd && ((sd && !sd->state.arrow_atk) || (status_get_range(src)<=2)) &&
tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) {
- int skilllv = tsd->autospell_lv,i,f=0,sp;
+ struct block_list *tbl;
+ int skilllv = tsd->autospell_lv, i;
i = rand()%100;
if(i >= 50) skilllv -= 2;
else if(i >= 15) skilllv--;
if(skilllv < 1) skilllv = 1;
- sp = skill_get_sp(tsd->autospell2_id,skilllv)*2/3;
- if(tsd->status.sp >= sp) {
- struct block_list *tbl;
- if (tsd->autospell2_type == 0) tbl = target;
- else tbl = src;
- if((i=skill_get_inf(tsd->autospell2_id) == 2) || i == 32)
- f = skill_castend_pos2(target,tbl->x,tbl->y,tsd->autospell2_id,skilllv,tick,flag);
- else {
- switch( skill_get_nk(tsd->autospell2_id) ) {
- case 0: case 2:
- f = skill_castend_damage_id(target,tbl,tsd->autospell2_id,skilllv,tick,flag);
- break;
- case 1:/* 支援系 */
- if((tsd->autospell2_id==AL_HEAL || (tsd->autospell2_id==ALL_RESURRECTION && tbl->type != BL_PC)) &&
- battle_check_undead(status_get_race(tbl),status_get_elem_type(tbl)))
- f = skill_castend_damage_id(target,tbl,tsd->autospell2_id,skilllv,tick,flag);
- else
- f = skill_castend_nodamage_id(target,tbl,tsd->autospell2_id,skilllv,tick,flag);
+
+ if (tsd->autospell2_type == 0) tbl = target;
+ else tbl = src;
+ if((i=skill_get_inf(tsd->autospell2_id) == 2) || i == 32)
+ skill_castend_pos2(target,tbl->x,tbl->y,tsd->autospell2_id,skilllv,tick,flag);
+ else {
+ switch( skill_get_nk(tsd->autospell2_id) ) {
+ case 0: case 2:
+ skill_castend_damage_id(target,tbl,tsd->autospell2_id,skilllv,tick,flag);
+ break;
+ case 1:/* 支援系 */
+ if((tsd->autospell2_id==AL_HEAL || (tsd->autospell2_id==ALL_RESURRECTION && tbl->type != BL_PC)) &&
+ battle_check_undead(status_get_race(tbl),status_get_elem_type(tbl)))
+ skill_castend_damage_id(target,tbl,tsd->autospell2_id,skilllv,tick,flag);
+ else
+ skill_castend_nodamage_id(target,tbl,tsd->autospell2_id,skilllv,tick,flag);
break;
- }
}
- if(!f) pc_heal(tsd,0,-sp);
- }
+ }
}
}
if(rdamage > 0)
- battle_delay_damage(tick+wd.amotion,src,target,rdamage,0);
+ battle_delay_damage(tick+wd.amotion,target,src,rdamage,0);
+
if(t_sc_data && t_sc_data[SC_AUTOCOUNTER].timer != -1 && t_sc_data[SC_AUTOCOUNTER].val4 > 0) {
if(t_sc_data[SC_AUTOCOUNTER].val3 == src->id)
battle_weapon_attack(target,src,tick,0x8000|t_sc_data[SC_AUTOCOUNTER].val1);
diff --git a/src/map/skill.c b/src/map/skill.c
index 887395b40..fe22ce6cd 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5633,26 +5633,26 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
switch (sg->unit_id) {
case 0x83: /* サンクチュアリ */
{
- int race=status_get_race(bl);
+ int race = status_get_race(bl);
- if (battle_check_undead(race,status_get_elem_type(bl)) || race==6) {
- if (skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0)) {
- // reduce healing count if this was meant for damaging [celest]
- // sg->val1 /= 2;
- sg->val1--; // チャットキャンセルに対応
+ if (battle_check_undead(race, status_get_elem_type(bl)) || race==6) {
+ if (skill_attack(BF_MAGIC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0)) {
+ // reduce healing count if this was meant for damaging [hekate]
+ sg->val1 -= 2;
+ //sg->val1--; // チャットキャンセルに対応
}
} else {
int heal = sg->val2;
- if (status_get_hp(bl)>=status_get_max_hp(bl))
+ if (status_get_hp(bl) >= status_get_max_hp(bl))
break;
- if(bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage)
- heal=0; /* 黄金蟲カード(ヒール量0) */
- clif_skill_nodamage(&src->bl,bl,AL_HEAL,heal,1);
- battle_heal(NULL,bl,heal,0,0);
- if (diff>=500)
+ if (bl->type == BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage)
+ heal = 0; /* 黄金蟲カード(ヒール量0) */
+ clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
+ battle_heal(NULL, bl, heal, 0, 0);
+ if (diff >= 500)
sg->val1--; // 新規に入ったユニットだけカウント
}
- if (sg->val1<=0)
+ if (sg->val1 <= 0)
skill_delunitgroup(sg);
break;
}