diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-03-02 17:54:13 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-03-02 17:54:13 +0000 |
commit | 5d75265b8cd2295dbd0b815288bd88ec0da69d8d (patch) | |
tree | 2d47f86723eb9ac43cbf60640cddcba2e5d294ae /src/map | |
parent | c18d4eaa0335d8c873a87debb8cbd0a60bfcb436 (diff) | |
download | hercules-5d75265b8cd2295dbd0b815288bd88ec0da69d8d.tar.gz hercules-5d75265b8cd2295dbd0b815288bd88ec0da69d8d.tar.bz2 hercules-5d75265b8cd2295dbd0b815288bd88ec0da69d8d.tar.xz hercules-5d75265b8cd2295dbd0b815288bd88ec0da69d8d.zip |
Just some generic cleanups.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13556 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 53 | ||||
-rw-r--r-- | src/map/clif.c | 8 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 2 |
4 files changed, 31 insertions, 34 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index b0ad2f075..c430cf5e4 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2964,36 +2964,33 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2)) status_change_end(src,SC_CLOAKING,-1); - //Check for counter attacks that block your attack. [Skotlex] - if(tsc) + if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) ) { - if(tsc->data[SC_AUTOCOUNTER] && - status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) - ) { - int dir = map_calc_dir(target,src->x,src->y); - int t_dir = unit_getdir(target); - int dist = distance_bl(src, target); - if(dist <= 0 || (!map_check_dir(dir,t_dir) && dist <= tstatus->rhw.range+1)) - { - int skilllv = tsc->data[SC_AUTOCOUNTER]->val1; - clif_skillcastcancel(target); //Remove the casting bar. [Skotlex] - clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS. - status_change_end(target,SC_AUTOCOUNTER,-1); - skill_attack(BF_WEAPON,target,target,src,KN_AUTOCOUNTER,skilllv,tick,0); - return ATK_NONE; - } + int dir = map_calc_dir(target,src->x,src->y); + int t_dir = unit_getdir(target); + int dist = distance_bl(src, target); + if(dist <= 0 || (!map_check_dir(dir,t_dir) && dist <= tstatus->rhw.range+1)) + { + int skilllv = tsc->data[SC_AUTOCOUNTER]->val1; + clif_skillcastcancel(target); //Remove the casting bar. [Skotlex] + clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS. + status_change_end(target,SC_AUTOCOUNTER,-1); + skill_attack(BF_WEAPON,target,target,src,KN_AUTOCOUNTER,skilllv,tick,0); + return ATK_NONE; } - if (tsc->data[SC_BLADESTOP_WAIT] && !is_boss(src)) { - int skilllv = tsc->data[SC_BLADESTOP_WAIT]->val1; - int duration = skill_get_time2(MO_BLADESTOP,skilllv); - status_change_end(target, SC_BLADESTOP_WAIT, -1); - if(sc_start4(src, SC_BLADESTOP, 100, sd?pc_checkskill(sd, MO_BLADESTOP):5, 0, 0, target->id, duration)) - { //Target locked. - clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS. - clif_bladestop(target, src->id, 1); - sc_start4(target, SC_BLADESTOP, 100, skilllv, 0, 0, src->id, duration); - return ATK_NONE; - } + } + + if( tsc && tsc->data[SC_BLADESTOP_WAIT] && !is_boss(src) ) + { + int skilllv = tsc->data[SC_BLADESTOP_WAIT]->val1; + int duration = skill_get_time2(MO_BLADESTOP,skilllv); + status_change_end(target, SC_BLADESTOP_WAIT, -1); + if(sc_start4(src, SC_BLADESTOP, 100, sd?pc_checkskill(sd, MO_BLADESTOP):5, 0, 0, target->id, duration)) + { //Target locked. + clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS. + clif_bladestop(target, src->id, 1); + sc_start4(target, SC_BLADESTOP, 100, skilllv, 0, 0, src->id, duration); + return ATK_NONE; } } diff --git a/src/map/clif.c b/src/map/clif.c index 739805f04..b17e85aab 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9378,7 +9378,10 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) return; if( sd->bl.id != target_id && !sd->state.skill_flag && tmp&INF_SELF_SKILL ) - target_id = sd->bl.id; //What good is it to mess up the target in self skills? Wished I knew... [Skotlex] + target_id = sd->bl.id; // never trust the client + + if( target_id < 0 && -target_id == sd->bl.id ) // for disguises [Valaris] + target_id = sd->bl.id; if( sd->ud.skilltimer != -1 ) { @@ -9397,9 +9400,6 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) if( sd->sc.data[SC_BASILICA] && (skillnum != HP_BASILICA || sd->sc.data[SC_BASILICA]->val4 != sd->bl.id) ) return; // On basilica only caster can use Basilica again to stop it. - if( target_id < 0 && -target_id == sd->bl.id ) // for disguises [Valaris] - target_id = sd->bl.id; - if( sd->menuskill_id ) { if( sd->menuskill_id == SA_TAMINGMONSTER ) diff --git a/src/map/pc.c b/src/map/pc.c index ee9dc1878..aa3b45157 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5266,7 +5266,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) npc_script_event(sd,NPCE_DIE); - if ( sd && sd->spiritball ) // maybe also monks' spiritballs ? + if ( sd && sd->spiritball ) pc_delspiritball(sd,sd->spiritball,0); if (src) diff --git a/src/map/skill.c b/src/map/skill.c index 159f445ea..cb8fb986d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1306,7 +1306,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in break; case BL_SKILL: su = (struct skill_unit *)target; - if( su->group->unit_id == UNT_ANKLESNARE ) + if( su->group->skill_id == HT_ANKLESNARE ) return 0; // ankle snare cannot be knocked back break; } |