summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-07 16:11:40 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-07 16:11:40 +0000
commitda7c46685d6426706c6f5ded6d7df4e62ee06261 (patch)
treead3cd183c8c77971a0da510d8085dfbfee9315aa /src/map/skill.c
parent4e963a22b54ce6c9f1a9c3db58b55c6690c34716 (diff)
downloadhercules-da7c46685d6426706c6f5ded6d7df4e62ee06261.tar.gz
hercules-da7c46685d6426706c6f5ded6d7df4e62ee06261.tar.bz2
hercules-da7c46685d6426706c6f5ded6d7df4e62ee06261.tar.xz
hercules-da7c46685d6426706c6f5ded6d7df4e62ee06261.zip
- Cleaned some up the add-effect code.
- Corrected ranged add-status only triggering if the attack is arrow based. - Updated counter add-status so they trigger on ranged attacks instead of using "arrow_atk" state. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9972 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 8e792f604..96fe56b94 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1369,10 +1369,10 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
rate += sd->addeff[i].arrow_rate;
if (!rate) continue;
- if (!(sd->addeff[i].flag&ATF_LONG && sd->addeff[i].flag&ATF_SHORT))
+ if ((sd->addeff[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT))
{ //Trigger has range consideration.
- if ((sd->addeff[i].flag&ATF_LONG && !sd->state.arrow_atk) ||
- (sd->addeff[i].flag&ATF_SHORT && sd->state.arrow_atk))
+ if((sd->addeff[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
+ (sd->addeff[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
continue; //Range Failed.
}
type = sd->addeff[i].id;
@@ -1542,18 +1542,17 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
for(i=0; i < MAX_PC_BONUS && dstsd->addeff2[i].flag; i++)
{
rate = dstsd->addeff2[i].rate;
- type = (sd && sd->state.arrow_atk) || (status_get_range(src)>2);
- if (type)
+ if (attack_type&BF_LONG)
rate+=dstsd->addeff2[i].arrow_rate;
if (!rate) continue;
- if (!(dstsd->addeff2[i].flag&ATF_LONG && dstsd->addeff2[i].flag&ATF_SHORT))
+ if ((dstsd->addeff2[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT))
{ //Trigger has range consideration.
- if ((dstsd->addeff2[i].flag&ATF_LONG && !type) ||
- (dstsd->addeff2[i].flag&ATF_SHORT && type))
+ if((dstsd->addeff2[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
+ (dstsd->addeff2[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
continue; //Range Failed.
}
- type = dstsd->addeff2[i].id;
+ type = dstsd->addeff2[i].id;
time = skill_get_time2(StatusSkillChangeTable[type],7);
if (dstsd->addeff2[i].flag&ATF_TARGET)
@@ -7266,9 +7265,10 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case UNT_GOSPEL:
- if (rand()%100 > sg->skill_lv*10)
+ if (rand()%100 > sg->skill_lv*10 || ss == bl)
break;
- if (ss != bl && battle_check_target(ss,bl,BCT_PARTY)>0) { // Support Effect only on party, not guild
+ if (battle_check_target(ss,bl,BCT_PARTY)>0)
+ { // Support Effect only on party, not guild
int i = rand()%13; // Positive buff count
type = skill_get_time2(sg->skill_id, sg->skill_lv); //Duration
switch (i)
@@ -7327,7 +7327,8 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
}
}
- else if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0) { // Offensive Effect
+ else if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0)
+ { // Offensive Effect
int i = rand()%9; // Negative buff count
type = skill_get_time2(sg->skill_id, sg->skill_lv);
switch (i)