summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-07 20:10:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-07 20:10:13 +0000
commitacc8a7acc9179d8d9a49675448d18c7ad19a6902 (patch)
tree0a948739c5f0f4b3d61dc71ee4572fad86cac5f4 /src/map/skill.c
parent392e49a6097460851f10501cfe34a9ee86010468 (diff)
downloadhercules-acc8a7acc9179d8d9a49675448d18c7ad19a6902.tar.gz
hercules-acc8a7acc9179d8d9a49675448d18c7ad19a6902.tar.bz2
hercules-acc8a7acc9179d8d9a49675448d18c7ad19a6902.tar.xz
hercules-acc8a7acc9179d8d9a49675448d18c7ad19a6902.zip
- Moved the SD_PREAMBLE code to skill_area_sub
- Added SD_SPLASH to let skill_area_sub do the target counter. - Updated splash skills to use these defines. - The NPC_WIDE* skills now use SD_PREAMBLE to correctly display their animation. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12689 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 47b25a0ef..0770f28ab 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1557,10 +1557,6 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
}
}
- // Cart Revolution and Grimtooth need this weirdo dummy packet for the first target to display correctly
- if( flag&SD_PREAMBLE )
- clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, -30000, dmg.div_, skillid, skilllv, 6);
-
//Display damage.
switch( skillid )
{
@@ -1744,8 +1740,14 @@ int skill_area_sub (struct block_list *bl, va_list ap)
func=va_arg(ap,SkillFunc);
if(battle_check_target(src,bl,flag) > 0)
+ {
+ if (flag&(SD_SPLASH|SD_PREAMBLE)) {
+ if (flag&SD_PREAMBLE && !skill_area_temp[2])
+ clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ skill_area_temp[2]++;
+ }
return func(src,bl,skill_id,skill_lv,tick,flag);
-
+ }
return 0;
}
@@ -2477,11 +2479,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
//Splash attack skills.
case AS_GRIMTOOTH:
+ case MC_CARTREVOLUTION:
+ case NPC_SPLASHATTACK:
+ flag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
case AS_SPLASHER:
case SM_MAGNUM:
case HT_BLITZBEAT:
- case MC_CARTREVOLUTION:
- case NPC_SPLASHATTACK:
case AC_SHOWER:
case MG_NAPALMBEAT:
case MG_FIREBALL:
@@ -2505,11 +2508,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
sflag |= SD_LEVEL; // -1 will be used in packets instead of the skill level
if( skill_area_temp[1] != bl->id && !(skill_get_inf2(skillid)&INF2_NPC_SKILL) )
sflag |= SD_ANIMATION; // original target gets no animation (as well as all NPC skills)
- if( skill_area_temp[2] == 0 && (skillid == AS_GRIMTOOTH || skillid == MC_CARTREVOLUTION || skillid == NPC_SPLASHATTACK) )
- sflag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, sflag);
- skill_area_temp[2]++;
}
else
{
@@ -2527,7 +2527,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
skill_area_temp[0] = map_foreachinrange(skill_area_sub, bl, (skillid == AS_SPLASHER)?1:skill_get_splash(skillid, skilllv), BL_CHAR, src, skillid, skilllv, tick, BCT_ENEMY, skill_area_sub_count);
// recursive invocation of skill_castend_damage_id() with flag|1
- map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), splash_target(src), src, skillid, skilllv, tick, flag|BCT_ENEMY|1, skill_castend_damage_id);
+ map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), splash_target(src), src, skillid, skilllv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill_castend_damage_id);
//FIXME: move this to skill_additional_effect or some such? [ultramage]
if (skillid == SM_MAGNUM) {
@@ -5145,16 +5145,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
const enum sc_type sc[] = { SC_STUN, SC_CURSE, SC_SILENCE, SC_BLEEDING };
i = rand()%ARRAYLENGTH(sc);
sc_start(bl,sc[i],100,skilllv,skill_get_time2(skillid,i+1));
- } else {
- // hacked-together packet (not correct) that shows the animation
- clif_skill_damage(src, src, tick, 1, 1, -1, 0, skillid, skilllv, 6);
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv),BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
- skill_castend_nodamage_id);
+ break;
}
- break;
-
case NPC_WIDEBLEEDING:
case NPC_WIDECONFUSE:
case NPC_WIDECURSE:
@@ -5167,10 +5159,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (flag&1)
sc_start(bl,type,100,skilllv,skill_get_time2(skillid,skilllv));
else {
+ skill_area_temp[2] = 0; //For SD_PREAMBLE
clif_skill_nodamage(src,bl,skillid,skilllv,1);
map_foreachinrange(skill_area_sub, bl,
skill_get_splash(skillid, skilllv),BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
+ src,skillid,skilllv,tick, flag|BCT_ENEMY|SD_PREAMBLE|1,
skill_castend_nodamage_id);
}
break;