summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-06 21:10:45 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-06 21:10:45 +0000
commit18b9549a0a8cfb0614c655d11f87f2acc7c8cc52 (patch)
tree937db1ac7ede04a8b43ce6324508ac75d3d6029c /src/map/skill.c
parent1c0bab41587fced03042d70a91945f5917f3a29e (diff)
downloadhercules-18b9549a0a8cfb0614c655d11f87f2acc7c8cc52.tar.gz
hercules-18b9549a0a8cfb0614c655d11f87f2acc7c8cc52.tar.bz2
hercules-18b9549a0a8cfb0614c655d11f87f2acc7c8cc52.tar.xz
hercules-18b9549a0a8cfb0614c655d11f87f2acc7c8cc52.zip
- Corrected Ground Drift. Splash range of 3x3, stackable and placeable underneath others, cast time is 2 secs. It's considered ranged, and it's damage increase is defense ignoring, always neutral damage.
- Added Bull's Eye 0.5 sec cast time - Corrected Bull's Eye implementation, it should deal normal damage against non brute/demi-human targets. - GS_DUST is now considered a short-range attack - Implemented Desperado's hit rate based on distance to caster as it's believed to behave. - Suiton's Speed/Agi penalty will affect everyone when used in versus maps. - GS_TRACKING's range is no longer affected by Snake Eye. - Cleaned up some skill_trap_splash - GS_FLING's defense reduction is now 5*lv% git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9158 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c139
1 files changed, 77 insertions, 62 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index bf1bc6998..a90e179ce 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -773,7 +773,6 @@ int skill_get_range2 (struct block_list *bl, int id, int lv)
break;
// added to allow GS skills to be effected by the range of Snake Eyes [Reddozen]
case GS_RAPIDSHOWER:
- case GS_TRACKING:
case GS_PIERCINGSHOT:
case GS_FULLBUSTER:
case GS_SPREADATTACK:
@@ -1337,7 +1336,8 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
sc_start(bl,SC_STUN,70,skilllv,skill_get_time2(skillid,skilllv));
break;
case GS_BULLSEYE: //0.1% coma rate.
- status_change_start(bl,SC_COMA,10,skilllv,0,0,0,0,0);
+ if(tstatus->race == RC_BRUTE || tstatus->race == RC_DEMIHUMAN)
+ status_change_start(bl,SC_COMA,10,skilllv,0,0,0,0,0);
break;
case GS_PIERCINGSHOT:
sc_start(bl,SC_BLEEDING,(skilllv*3),skilllv,skill_get_time2(skillid,skilllv));
@@ -3133,10 +3133,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
break;
case GS_BULLSEYE:
- if((tstatus->race == RC_BRUTE || tstatus->race == RC_DEMIHUMAN) && !(tstatus->mode&MD_BOSS))
- skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- else if (sd)
- clif_skill_fail(sd,skillid,0,0);
+ skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
break;
case NJ_KASUMIKIRI:
@@ -6692,9 +6689,10 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
{
int element[5]={ELE_WIND,ELE_DARK,ELE_POISON,ELE_WATER,ELE_FIRE};
- if (src->type == BL_PC)
+ if (sd)
val1=sd->arrow_ele;
- else val1=element[rand()%5];
+ else
+ val1=element[rand()%5];
switch (val1)
{
@@ -6769,6 +6767,18 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
ux+=(i%5-2);
uy+=(i/5-2);
break;
+ case UNT_DESPERADO:
+ val1 = abs(layout->dx[i]);
+ val2 = abs(layout->dy[i]);
+ if (val1 < 2 || val2 < 2) { //Nearby cross, linear decrease with no diagonals
+ if (val2 > val1) val1 = val2;
+ if (val1) val1--;
+ val1 = 36 -12*val1;
+ } else //Diagonal edges
+ val1 = 28 -4*val1 -4*val2;
+ if (val1 < 1) val1 = 1;
+ val2 = 0;
+ break;
default:
if (group->state.song_dance&0x1)
val2 = unit_flag&(UF_DANCE|UF_SONG); //Store whether this is a song/dance
@@ -6892,7 +6902,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
case UNT_SUITON:
if(sc && sc->data[type].timer==-1)
sc_start4(bl,type,100,sg->skill_lv,
- battle_check_target(&src->bl,bl,BCT_ENEMY)>0?1:0, //Send val3 =1 to reduce agi.
+ map_flag_vs(bl->m) || battle_check_target(&src->bl,bl,BCT_ENEMY)>0?1:0, //Send val3 =1 to reduce agi.
0,0,sg->limit);
break;
@@ -7175,6 +7185,21 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
sg->state.into_abyss = 1; //Prevent Remove Trap from giving you the trap back. [Skotlex]
break;
+ case UNT_GROUNDDRIFT_WIND:
+ case UNT_GROUNDDRIFT_DARK:
+ case UNT_GROUNDDRIFT_POISON:
+ case UNT_GROUNDDRIFT_WATER:
+ case UNT_GROUNDDRIFT_FIRE:
+ map_foreachinrange(skill_trap_splash,&src->bl,
+ skill_get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag,
+ &src->bl,tick,0);
+ sg->unit_id = UNT_USED_TRAPS;
+ clif_changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE);
+ sg->limit=DIFF_TICK(tick,sg->tick)+1500;
+ sg->state.into_abyss = 1;
+ break;
+
+
case UNT_TALKIEBOX:
if (sg->src_id == bl->id)
break;
@@ -7312,42 +7337,10 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case UNT_DESPERADO:
- if (!(rand()%5)) //Has a low chance of connecting. [Skotlex]
+ if (rand()%100 < src->val1)
skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
break;
- case UNT_GROUNDDRIFT_WIND:
- case UNT_GROUNDDRIFT_DARK:
- case UNT_GROUNDDRIFT_POISON:
- case UNT_GROUNDDRIFT_WATER:
- case UNT_GROUNDDRIFT_FIRE:
- skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,sg->val1);
-
- switch (sg->val1)
- {
- case ELE_WIND:
- sc_start(bl,SC_STUN,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
- break;
- case ELE_WATER:
- sc_start(bl,SC_FREEZE,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
- break;
- case ELE_POISON:
- sc_start(bl,SC_POISON,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
- break;
- case ELE_DARK:
- sc_start(bl,SC_BLIND,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
- break;
- case ELE_FIRE:
- skill_blown(&src->bl,bl,skill_get_blewcount(sg->skill_id,sg->skill_lv));
- break;
- }
-
- sg->unit_id = UNT_USED_TRAPS;
- clif_changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE);
- sg->limit=DIFF_TICK(tick,sg->tick)+1500;
- sg->state.into_abyss = 1; //Prevent Remove Trap from giving you the trap back. [Skotlex]
- break;
-
case UNT_KAENSIN:
skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
if (--src->val2 <= 0)
@@ -9426,27 +9419,49 @@ int skill_trap_splash (struct block_list *bl, va_list ap)
nullpo_retr(0, sg = unit->group);
nullpo_retr(0, ss = map_id2bl(sg->src_id));
- if(battle_check_target(src,bl,BCT_ENEMY) > 0){
- switch(sg->unit_id){
- case UNT_SHOCKWAVE:
- case UNT_SANDMAN:
- case UNT_FLASHER:
- skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick);
- break;
- case UNT_BLASTMINE:
- case UNT_CLAYMORETRAP:
- //Special property: Each target is hit N times (N = number of targets on splash area)
- if (!count) count = 1;
- for(i=0;i<count;i++)
- skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);
- break;
- case UNT_FREEZINGTRAP:
- skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);
- break;
- }
- }
+ if(battle_check_target(src,bl,BCT_ENEMY) <= 0)
+ return 0;
- return 0;
+ switch(sg->unit_id){
+ case UNT_SHOCKWAVE:
+ case UNT_SANDMAN:
+ case UNT_FLASHER:
+ skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick);
+ break;
+ case UNT_BLASTMINE:
+ case UNT_CLAYMORETRAP:
+ //Special property: Each target is hit N times (N = number of targets on splash area)
+ if (!count) count = 1;
+ for(i=0;i<count;i++)
+ skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);
+ break;
+ case UNT_FREEZINGTRAP:
+ skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);
+ break;
+ case UNT_GROUNDDRIFT_WIND:
+ if(skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
+ sc_start(bl,SC_STUN,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
+ break;
+ case UNT_GROUNDDRIFT_DARK:
+ if(skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
+ sc_start(bl,SC_BLIND,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
+ break;
+ case UNT_GROUNDDRIFT_POISON:
+ if(skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
+ sc_start(bl,SC_POISON,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
+ break;
+ case UNT_GROUNDDRIFT_WATER:
+ if(skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
+ sc_start(bl,SC_FREEZE,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
+ break;
+ case UNT_GROUNDDRIFT_FIRE:
+ if(skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
+ skill_blown(src,bl,skill_get_blewcount(sg->skill_id,sg->skill_lv));
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
/*==========================================