diff options
author | shennetsind <ind@henn.et> | 2014-03-16 12:58:19 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-03-16 12:58:19 -0300 |
commit | 8c6547a5c3ec4d6b1845b60d14b0aae5c827892c (patch) | |
tree | 082922b693692e061c3f0455d41e7323bd9c0828 /src | |
parent | 4fe6f657e682b9c722b15346f31ec3fe0298b9d9 (diff) | |
parent | 48d29089a06bb207276ef53754e6a0d217cfcc77 (diff) | |
download | hercules-8c6547a5c3ec4d6b1845b60d14b0aae5c827892c.tar.gz hercules-8c6547a5c3ec4d6b1845b60d14b0aae5c827892c.tar.bz2 hercules-8c6547a5c3ec4d6b1845b60d14b0aae5c827892c.tar.xz hercules-8c6547a5c3ec4d6b1845b60d14b0aae5c827892c.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 29 | ||||
-rw-r--r-- | src/map/skill.c | 29 | ||||
-rw-r--r-- | src/map/status.c | 3 |
3 files changed, 25 insertions, 36 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 24f39a35d..91db3202c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5317,20 +5317,21 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st sc = NULL; if( sc ) { - - if( sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){ - //ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}] - int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status->get_lv(target) / 125; - if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK - rdamage = rdamage * ratio / 100 + (damage) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10; - skill->blown(target, src, skill->get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1), unit->getdir(src), 0); - clif->skill_damage(target, src, tick, status_get_amotion(src), 0, rdamage, - 1, SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1, 6); // This is how official does - clif->delay_damage(tick + delay, src, target,status_get_amotion(src)+1000,0, rdamage/10, 1, 0); - status->damage(src, target, status->damage(target, src, rdamage, 0, 0, 1)/10, 0, 0, 1); - status_change_end(target, SC_CRESCENTELBOW, INVALID_TIMER); - /* shouldn't this trigger skill->additional_effect? */ - return; // Just put here to minimize redundancy + if (wd->flag & BF_SHORT && !(skill->get_inf(skill_id) & (INF_GROUND_SKILL | INF_SELF_SKILL))) { + if( sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){ + //ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}] + int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status->get_lv(target) / 125; + if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK + rdamage = rdamage * ratio / 100 + (damage) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10; + skill->blown(target, src, skill->get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1), unit->getdir(src), 0); + clif->skill_damage(target, src, tick, status_get_amotion(src), 0, rdamage, + 1, SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1, 6); // This is how official does + clif->delay_damage(tick + delay, src, target,status_get_amotion(src)+1000,0, rdamage/10, 1, 0); + status->damage(src, target, status->damage(target, src, rdamage, 0, 0, 1)/10, 0, 0, 1); + status_change_end(target, SC_CRESCENTELBOW, INVALID_TIMER); + /* shouldn't this trigger skill->additional_effect? */ + return; // Just put here to minimize redundancy + } } if( wd->flag & BF_SHORT ) { diff --git a/src/map/skill.c b/src/map/skill.c index 554528af2..78f5fe3f1 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3264,16 +3264,9 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { 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); - } + skill->area_temp[1] = 0; + map->foreachinpath(skill->attack_area,src->m,src->x,src->y,skl->x,skl->y,4,2,BL_CHAR, + skill->get_type(skl->skill_id),src,src,skl->skill_id,skl->skill_lv,tick,skl->flag,BCT_ENEMY); break; case GN_CRAZYWEED: if( skl->type >= 0 ) { @@ -10423,18 +10416,10 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui break; case LG_OVERBRAND: - { - 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); - } + skill->area_temp[1] = 0; + map->foreachinpath(skill->attack_area,src->m,src->x,src->y,x,y,1,5,BL_CHAR, + skill->get_type(skill_id),src,src,skill_id,skill_lv,tick,flag,BCT_ENEMY); + skill->addtimerskill(src,timer->gettick() + status_get_amotion(src), 0, x, y, LG_OVERBRAND_BRANDISH, skill_lv, 0, flag); break; case LG_BANDING: diff --git a/src/map/status.c b/src/map/status.c index d3af72e57..09f7f4303 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8734,6 +8734,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t tick_time = 5000; // [GodLesZ] tick time status->change_clear_buffs(bl,3); //Remove buffs/debuffs break; + case SC_CRESCENTELBOW: + val2 = (sd ? sd->status.job_level : 2) / 2 + 50 + 5 * val1; + break; case SC_LIGHTNINGWALK: // [(Job Level / 2) + (40 + 5 * Skill Level)] % val1 = (sd?sd->status.job_level:2)/2 + 40 + 5 * val1; break; |