summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2014-01-03 13:59:09 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2014-01-03 13:59:09 +0800
commit594f64b62878e70c77de85008f1f96ca1a4fb5be (patch)
tree8cc701d595e2c2fb38cbc3c083501c3ff9425484 /src/map/skill.c
parent3bda07c3983ad715009717695702ff8e799e54d7 (diff)
downloadhercules-594f64b62878e70c77de85008f1f96ca1a4fb5be.tar.gz
hercules-594f64b62878e70c77de85008f1f96ca1a4fb5be.tar.bz2
hercules-594f64b62878e70c77de85008f1f96ca1a4fb5be.tar.xz
hercules-594f64b62878e70c77de85008f1f96ca1a4fb5be.zip
Fixed Bug#7709
-http://hercules.ws/board/tracker/issue-7709-overbrand/?gopid=20445#entry20445 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c68
1 files changed, 32 insertions, 36 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index eeca8a2c4..28937048e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2406,7 +2406,11 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
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:
+ dmg.amotion = status_get_amotion(src) * 2;
case LG_OVERBRAND_PLUSATK:
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick,status_get_amotion(src),dmg.dmotion,damage,dmg.div_,skill_id,-1,5);
+ break;
case EL_FIRE_BOMB:
case EL_FIRE_BOMB_ATK:
case EL_FIRE_WAVE:
@@ -2603,7 +2607,6 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
case MG_FIREWALL:
case PR_SANCTUARY:
case SC_TRIANGLESHOT:
- case LG_OVERBRAND:
case SR_KNUCKLEARROW:
case GN_WALLOFTHORN:
case EL_FIRE_MANTLE:
@@ -2625,15 +2628,9 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
//blown-specific handling
switch( skill_id ) {
- case LG_OVERBRAND:
- if( skill->blown(dsrc,bl,dmg.blewcount,dir,0) ) {
- short dir_x, dir_y;
- dir_x = dirx[(dir+4)%8];
- dir_y = diry[(dir+4)%8];
- if( map->getcell(bl->m, bl->x+dir_x, bl->y+dir_y, CELL_CHKNOPASS) != 0 )
- skill->addtimerskill(src, tick + status_get_amotion(src), bl->id, 0, 0, LG_OVERBRAND_PLUSATK, skill_lv, BF_WEAPON, flag );
- } else
- skill->addtimerskill(src, tick + status_get_amotion(src), bl->id, 0, 0, LG_OVERBRAND_PLUSATK, skill_lv, BF_WEAPON, flag );
+ case LG_OVERBRAND_BRANDISH:
+ if( skill->blown(dsrc,bl,dmg.blewcount,dir,0) < dmg.blewcount )
+ skill->addtimerskill(src, tick + status_get_amotion(src), bl->id, 0, 0, LG_OVERBRAND_PLUSATK, skill_lv, BF_WEAPON, flag|SD_ANIMATION);
break;
case SR_KNUCKLEARROW:
if( skill->blown(dsrc,bl,dmg.blewcount,dir,0) && !(flag&4) ) {
@@ -3187,13 +3184,6 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
}
}
break;
- case LG_OVERBRAND_BRANDISH:
- case LG_OVERBRAND_PLUSATK:
- if( status->check_skilluse(src, target, skl->skill_id, 1) )
- skill->attack(BF_WEAPON, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag|SD_LEVEL);
- else
- clif->skill_damage(src, target, tick, status_get_amotion(src), status_get_dmotion(target), 0, 1, skl->skill_id, skl->skill_lv, skill->get_hit(skl->skill_id));
- break;
case SR_KNUCKLEARROW:
skill->attack(BF_WEAPON, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag|SD_LEVEL);
break;
@@ -3256,10 +3246,22 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
int dummy = 1, i = skill->get_unit_range(skl->skill_id,skl->skill_lv);
map->foreachinarea(skill->cell_overlap, src->m, skl->x-i, skl->y-i, skl->x+i, skl->y+i, BL_SKILL, skl->skill_id, &dummy, src);
}
- // FIXME: there's no 'break' here. If it was intended, please consider adding a comment (issue #160)
+ // fall through ...
case WL_EARTHSTRAIN:
skill->unitsetting(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,(skl->type<<16)|skl->flag);
break;
+ case LG_OVERBRAND_BRANDISH:
+ {
+ short x2 = src->x, y2 = src->y, x = x2, y = y2;
+ switch( skl->type ){
+ case 0: case 1: case 7: x2 += 4; x -= 4; y2 += 4; break;
+ case 3: case 4: case 5: x2 += 4; x -= 4; y -= 4; break;
+ case 2: y2 += 4; y -= 4; x -= 4; break;
+ case 6: y2 += 4; y -= 4; x2 += 4; break;
+ }
+ map->foreachinarea(skill->area_sub, src->m, x, y, x2, y2, BL_CHAR, src, skl->skill_id, skl->skill_lv, tick, skl->flag|BCT_ENEMY|SD_ANIMATION|1,skill->castend_damage_id);
+ }
+ break;
}
}
} while (0);
@@ -3510,6 +3512,8 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case KO_JYUMONJIKIRI:
case KO_SETSUDAN:
case GC_DARKCROW:
+ case LG_OVERBRAND_BRANDISH:
+ case LG_OVERBRAND:
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
@@ -4333,16 +4337,6 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
skill->attack((flag&1)?BF_WEAPON:BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag);
break;
- case LG_OVERBRAND:
- if( status->check_skilluse(src, bl, skill_id, 1) )
- skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag|SD_LEVEL);
- else
- clif->skill_damage(src, bl, tick, status_get_amotion(src), status_get_dmotion(bl), 0, 1, skill_id, skill_lv, skill->get_hit(skill_id));
- break;
-
- case LG_OVERBRAND_BRANDISH:
- skill->addtimerskill(src, tick + status_get_amotion(src)*8/10, bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag|SD_LEVEL);
- break;
case SR_DRAGONCOMBO:
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
@@ -10275,14 +10269,16 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case LG_OVERBRAND:
{
- int width;//according to data from irowiki it actually is a square
- int i;
- for( width = 0; width < 7; width++ )
- for( i = 0; i < 7; i++ )
- map->foreachincell(skill->area_sub, src->m, x-2+i, y-2+width, splash_target(src), src, LG_OVERBRAND_BRANDISH, skill_lv, tick, flag|BCT_ENEMY,skill->castend_damage_id);
- for( width = 0; width < 7; width++ )
- for( i = 0; i < 7; i++ )
- map->foreachincell(skill->area_sub, src->m, x-2+i, y-2+width, splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY,skill->castend_damage_id);
+ uint8 dir = map->calc_dir(src, x, y);
+ uint8 x2 = x = src->x, y2 = y = src->y;
+ switch( dir ){
+ case 0: case 1: case 7: x2++; x--; y2 += 7; break;
+ case 3: case 4: case 5: x2++; x--; y -= 7; break;
+ case 2: y2++; y--; x -= 7;break;
+ case 6: y2++; y--; x2 += 7;break;
+ }
+ map->foreachinarea(skill->area_sub, src->m, x, y, x2, y2, BL_CHAR, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_ANIMATION|1,skill->castend_damage_id);
+ skill->addtimerskill(src,timer->gettick() + status_get_amotion(src), 0, 0, 0, LG_OVERBRAND_BRANDISH, skill_lv, dir, flag);
}
break;