diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-19 18:49:42 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-19 18:49:42 +0000 |
commit | d41f7e18f02012ef61df70ee6cc0f3bf1ce14c23 (patch) | |
tree | ae8114bf00136c94aa530b9c9a18365393bd1ebf /src/map/skill.c | |
parent | f4fb6137949da60fc8f2a5cde80a60a1f4760aa2 (diff) | |
download | hercules-d41f7e18f02012ef61df70ee6cc0f3bf1ce14c23.tar.gz hercules-d41f7e18f02012ef61df70ee6cc0f3bf1ce14c23.tar.bz2 hercules-d41f7e18f02012ef61df70ee6cc0f3bf1ce14c23.tar.xz hercules-d41f7e18f02012ef61df70ee6cc0f3bf1ce14c23.zip |
- Modified the targetted skill logic to enable offensive skills to be targetted at party/guild members if the appropiate inf2 value is set.
- Added the SC_JAIL code for timed jailing, but the related @ commands ain't in yet.
- Added checks to make adding items to inventory/cart fail when a char is in finalsave state.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7751 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 18715653e..837c5e6a3 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5741,7 +5741,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data) struct mob_data* md = NULL; struct unit_data* ud = unit_bl2ud(src); struct status_change *sc; - int inf2; + int inf,inf2; nullpo_retr(0, ud); @@ -5808,11 +5808,23 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data) break; } } else { - inf2 = skill_get_inf(ud->skillid); - if((inf2&INF_ATTACK_SKILL || - (inf2&INF_SELF_SKILL && skill_get_inf2(ud->skillid)&INF2_NO_TARGET_SELF)) //Combo skills - && battle_check_target(src, target, BCT_ENEMY)<=0 + //Check target validity. + inf = skill_get_inf(ud->skillid); + inf2 = skill_get_inf2(ud->skillid); + + if((inf&INF_ATTACK_SKILL || + (inf&INF_SELF_SKILL && inf2&INF2_NO_TARGET_SELF)) //Combo skills ) + inf = INF_ATTACK_SKILL; //Offensive skill. + else + inf = 0; + + if(inf2 & (INF2_PARTY_ONLY|INF2_GUILD_ONLY) && src != target) + inf |= + (inf2&INF2_PARTY_ONLY?BCT_PARTY:0)| + (inf2&INF2_GUILD_ONLY?BCT_GUILD:0)| + (inf2&INF2_ALLOW_ENEMY?BCT_ENEMY:0); + if (inf && battle_check_target(src, target, inf) <= 0) break; } @@ -5831,17 +5843,6 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data) } } - inf2 = skill_get_inf2(ud->skillid); - if(inf2 & (INF2_PARTY_ONLY|INF2_GUILD_ONLY) && src != target) { - inf2 = - (inf2&INF2_PARTY_ONLY?BCT_PARTY:0)| - (inf2&INF2_GUILD_ONLY?BCT_GUILD:0)| - (inf2&INF2_ALLOW_ENEMY?BCT_ENEMY:0); - - if(battle_check_target(src, target, inf2) <= 0) - break; - } - if(src != target && battle_config.skill_add_range && !check_distance_bl(src, target, skill_get_range2(src,ud->skillid,ud->skilllv)+battle_config.skill_add_range)) { |