diff options
author | shennetsind <ind@henn.et> | 2013-03-27 17:06:52 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-03-27 17:06:52 -0300 |
commit | 691b3e61f2e7ead7c3afa51cdc03d4e9f86f4fed (patch) | |
tree | 9ecc4ef2b6ed0bdbc23168157bdbf67fd65275a0 /src/map/skill.c | |
parent | 9aded8a259e39b49698cb50111e8e5306f77dd52 (diff) | |
download | hercules-691b3e61f2e7ead7c3afa51cdc03d4e9f86f4fed.tar.gz hercules-691b3e61f2e7ead7c3afa51cdc03d4e9f86f4fed.tar.bz2 hercules-691b3e61f2e7ead7c3afa51cdc03d4e9f86f4fed.tar.xz hercules-691b3e61f2e7ead7c3afa51cdc03d4e9f86f4fed.zip |
Fixed Bug #7135 Tetra Vortex Client Crash
http://hercules.ws/board/tracker/issue-7135-crash-in-tetra-vortex/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 203 |
1 files changed, 101 insertions, 102 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index e8e63b86c..4342ca567 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2381,108 +2381,107 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds } //Display damage. - switch( skill_id ) - { - case PA_GOSPEL: //Should look like Holy Cross [Skotlex] - dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, 5); - break; - //Skills that need be passed as a normal attack for the client to display correctly. - case HVAN_EXPLOSION: - case NPC_SELFDESTRUCTION: - if(src->type==BL_PC) - dmg.blewcount = 10; - dmg.amotion = 0; //Disable delay or attack will do no damage since source is dead by the time it takes effect. [Skotlex] - // fall through - case KN_AUTOCOUNTER: - case NPC_CRITICALSLASH: - case TF_DOUBLE: - case GS_CHAINACTION: - dmg.dmotion = clif_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,dmg.type,dmg.damage2); - break; + switch( skill_id ) { + case PA_GOSPEL: //Should look like Holy Cross [Skotlex] + dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, 5); + break; + //Skills that need be passed as a normal attack for the client to display correctly. + case HVAN_EXPLOSION: + case NPC_SELFDESTRUCTION: + if(src->type==BL_PC) + dmg.blewcount = 10; + dmg.amotion = 0; //Disable delay or attack will do no damage since source is dead by the time it takes effect. [Skotlex] + // fall through + case KN_AUTOCOUNTER: + case NPC_CRITICALSLASH: + case TF_DOUBLE: + case GS_CHAINACTION: + dmg.dmotion = clif_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,dmg.type,dmg.damage2); + break; - case AS_SPLASHER: - if( flag&SD_ANIMATION ) // the surrounding targets - dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, 5); // needs -1 as skill level - else // the central target doesn't display an animation - dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -2, 5); // needs -2(!) as skill level - break; - case WL_HELLINFERNO: - case SR_EARTHSHAKER: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,skill_id,-2,6); - break; - case WL_SOULEXPANSION: - case WL_COMET: - case KO_MUCHANAGE: - case NJ_HUUMA: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,skill_lv,8); - break; - case WL_CHAINLIGHTNING_ATK: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,WL_CHAINLIGHTNING,-2,6); - break; - case LG_OVERBRAND_BRANDISH: - case LG_OVERBRAND_PLUSATK: - case EL_FIRE_BOMB: - case EL_FIRE_BOMB_ATK: - case EL_FIRE_WAVE: - case EL_FIRE_WAVE_ATK: - case EL_FIRE_MANTLE: - case EL_CIRCLE_OF_FIRE: - case EL_FIRE_ARROW: - case EL_ICE_NEEDLE: - case EL_WATER_SCREW: - case EL_WATER_SCREW_ATK: - case EL_WIND_SLASH: - case EL_TIDAL_WEAPON: - case EL_ROCK_CRUSHER: - case EL_ROCK_CRUSHER_ATK: - case EL_HURRICANE: - case EL_HURRICANE_ATK: - case KO_BAKURETSU: - case GN_CRAZYWEED_ATK: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,5); - break; - case GN_SLINGITEM_RANGEMELEEATK: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,GN_SLINGITEM,-2,6); - break; - case EL_STONE_RAIN: - dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,(flag&1)?8:5); - break; - case WM_SEVERE_RAINSTORM_MELEE: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_SEVERE_RAINSTORM,skill_lv,5); - break; - case WM_REVERBERATION_MELEE: - case WM_REVERBERATION_MAGIC: - dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_REVERBERATION,-2,6); - break; - case HT_CLAYMORETRAP: - case HT_BLASTMINE: - case HT_FLASHER: - case HT_FREEZINGTRAP: - case RA_CLUSTERBOMB: - case RA_FIRINGTRAP: - case RA_ICEBOUNDTRAP: - dmg.dmotion = clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id,flag&SD_LEVEL?-1:skill_lv, 5); - if( dsrc != src ) // avoid damage display redundancy - break; - case HT_LANDMINE: - dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, type); - break; - case WZ_SIGHTBLASTER: - dmg.dmotion = clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5); + case AS_SPLASHER: + if( flag&SD_ANIMATION ) // the surrounding targets + dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, 5); // needs -1 as skill level + else // the central target doesn't display an animation + dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -2, 5); // needs -2(!) as skill level + break; + case WL_HELLINFERNO: + case SR_EARTHSHAKER: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,skill_id,-2,6); + break; + case WL_SOULEXPANSION: + case WL_COMET: + case KO_MUCHANAGE: + case NJ_HUUMA: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,skill_lv,8); + break; + case WL_CHAINLIGHTNING_ATK: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,WL_CHAINLIGHTNING,-2,6); + break; + case LG_OVERBRAND_BRANDISH: + case LG_OVERBRAND_PLUSATK: + case EL_FIRE_BOMB: + case EL_FIRE_BOMB_ATK: + case EL_FIRE_WAVE: + case EL_FIRE_WAVE_ATK: + case EL_FIRE_MANTLE: + case EL_CIRCLE_OF_FIRE: + case EL_FIRE_ARROW: + case EL_ICE_NEEDLE: + case EL_WATER_SCREW: + case EL_WATER_SCREW_ATK: + case EL_WIND_SLASH: + case EL_TIDAL_WEAPON: + case EL_ROCK_CRUSHER: + case EL_ROCK_CRUSHER_ATK: + case EL_HURRICANE: + case EL_HURRICANE_ATK: + case KO_BAKURETSU: + case GN_CRAZYWEED_ATK: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,5); + break; + case GN_SLINGITEM_RANGEMELEEATK: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,GN_SLINGITEM,-2,6); + break; + case EL_STONE_RAIN: + dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,(flag&1)?8:5); + break; + case WM_SEVERE_RAINSTORM_MELEE: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_SEVERE_RAINSTORM,skill_lv,5); + break; + case WM_REVERBERATION_MELEE: + case WM_REVERBERATION_MAGIC: + dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_REVERBERATION,-2,6); + break; + case HT_CLAYMORETRAP: + case HT_BLASTMINE: + case HT_FLASHER: + case HT_FREEZINGTRAP: + case RA_CLUSTERBOMB: + case RA_FIRINGTRAP: + case RA_ICEBOUNDTRAP: + dmg.dmotion = clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id,flag&SD_LEVEL?-1:skill_lv, 5); + if( dsrc != src ) // avoid damage display redundancy + break; + case HT_LANDMINE: + dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, type); + break; + case WZ_SIGHTBLASTER: + dmg.dmotion = clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5); + break; + case AB_DUPLELIGHT_MELEE: + case AB_DUPLELIGHT_MAGIC: + dmg.amotion = 300;/* makes the damage value not overlap with previous damage (when displayed by the client) */ + default: + if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit. + type = 5; + if( bl->type == BL_SKILL ){ + TBL_SKILL *su = (TBL_SKILL*)bl; + if( su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targets + clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5); + } + dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, type); break; - case AB_DUPLELIGHT_MELEE: - case AB_DUPLELIGHT_MAGIC: - dmg.amotion = 300;/* makes the damage value not overlap with previous damage (when displayed by the client) */ - default: - if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit. - type = 5; - if( bl->type == BL_SKILL ){ - TBL_SKILL *su = (TBL_SKILL*)bl; - if( su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targets - clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5); - } - dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, type); - break; } map_freeblock_lock(); @@ -4202,8 +4201,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint sc->data[SC_READING_SB]->val2 -= point; else // Last spell to be released status_change_end(src, SC_READING_SB, INVALID_TIMER); - - clif_skill_nodamage(src, bl, skill_id, skill_lv, 1); + if( bl->type != BL_SKILL ) /* skill types will crash the client */ + clif_skill_nodamage(src, bl, skill_id, skill_lv, 1); if( !skill->check_condition_castbegin(sd, skill_id, skill_lv) ) break; |