viewing paste crescent | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
Index: src/map/battle.c
===================================================================
--- src/map/battle.c    (revision 17307)
+++ src/map/battle.c    (working copy)
@@ -3577,6 +3577,22 @@
            status_change_end(target, SC_REJECTSWORD, INVALID_TIMER);
    }
 
+   if( tsc && tsc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < tsc->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 rdamage = 0;
+       int ratio = (int64)(status_get_hp(src) / 100) * tsc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(target) / 125;
+       if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK
+       rdamage = battle_calc_base_damage(tstatus,&tstatus->rhw,tsc,sstatus->size,tsd,0);
+       rdamage = (int64)rdamage * ratio / 100 + wd.damage * (10 + tsc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10;
+       skill_blown(target, src, skill_get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, tsc->data[SC_CRESCENTELBOW]->val1), unit_getdir(src), 0);
+       clif_skill_damage(target, src, gettick(), status_get_amotion(src), 0, rdamage,
+           1, SR_CRESCENTELBOW_AUTOSPELL, tsc->data[SC_CRESCENTELBOW]->val1, 6); // This is how official does
+       clif_damage(src, target, gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, 0, 0);
+       status_damage(target, src, rdamage, 0, 0, 1);
+       status_damage(src, target, rdamage/10, 0, 0, 1);
+       status_change_end(target, SC_CRESCENTELBOW, INVALID_TIMER);
+   }
+
    if( sc ) {
        //SG_FUSION hp penalty [Komurka]
        if (sc->data[SC_FUSION]) {
@@ -4620,22 +4636,7 @@
            if( --(sc->data[SC_REFLECTDAMAGE]->val3) < 1)
                status_change_end(bl,SC_REFLECTDAMAGE,INVALID_TIMER);
        }
-   }else if( sc && sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){ //TODO: This is a counter-attack skill, put it by Reject Sword
-       //ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}]
-       struct status_data *status = status_get_status_data(bl);
-       struct status_data *tstatus = status_get_status_data(src);
-       int ratio = (int64)(status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(bl) / 125;
-       if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK
-       rdamage = battle_calc_base_damage(status,&status->rhw,sc,tstatus->size,sd,0);
-       rdamage = (int64)rdamage * ratio / 100 + (*dmg) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10;
-       skill_blown(bl, src, skill_get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1), unit_getdir(src), 0);
-       clif_skill_damage(bl, src, gettick(), status_get_amotion(src), 0, rdamage,
-           1, SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1, 6); // This is how official does
-       clif_damage(src, bl, gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, 0, 0);
-       status_damage(src, bl, status_damage(bl, src, rdamage, 0, 0, 1)/10, 0, 0, 1);
-       status_change_end(bl, SC_CRESCENTELBOW, INVALID_TIMER);
-       return 0; // Just put here to minimize redundancy
-   }else if (flag & BF_SHORT) {//Bounces back part of the damage.
+   } else if (flag & BF_SHORT) {//Bounces back part of the damage.
        if ( sd && sd->bonus.short_weapon_damage_return ) {
            rdamage += (int64)damage * sd->bonus.short_weapon_damage_return / 100;
            if(rdamage < 1) rdamage = 1;
Index: src/map/status.c
===================================================================
--- src/map/status.c    (revision 17307)
+++ src/map/status.c    (working copy)
@@ -8560,7 +8560,8 @@
            val_flag |= 1|2|4;
            break;
        case SC_CRESCENTELBOW:
-           val2 = 94 + val1;
+           if( sd )
+               val2 = (sd->status.job_level / 2) + (50 + 5 * val1);
            val_flag |= 1|2;
            break;
        case SC_LIGHTNINGWALK: //  [(Job Level / 2) + (40 + 5 * Skill Level)] %
Viewed 687 times, submitted by Guest.