diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/status.c | 55 |
2 files changed, 36 insertions, 21 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index b4f23dd7f..604398272 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2008/04/06 + * Sprint, Fusion, and Increase AGI now stack independently. + - The others still don't take affect if you have any of these three. (r12508) [Kevin] * Mind Sensing no longer gives an xp bonus on bosses. (r12507) [Kevin] * Changed Union/Increase AGI stack fix (it should work now). (r12506) [Kevin] * Fixed seven wind not allowing ghost/shadow. (r12505) [Kevin] diff --git a/src/map/status.c b/src/map/status.c index bd2884569..77189bedb 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3701,41 +3701,54 @@ static signed short status_calc_mdef2(struct block_list *bl, struct status_chang static unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed) { + int new_speed = speed; + if(!sc || !sc->count) return cap_value(speed,10,USHRT_MAX); // Fixed reductions if(sc->data[SC_CURSE]) - speed += 450; + new_speed += 450; if(sc->data[SC_SWOO]) - speed += 450; //Let's use Curse's slow down momentarily (exact value unknown) + new_speed += 450; //Let's use Curse's slow down momentarily (exact value unknown) if(sc->data[SC_WEDDING]) - speed += 300; + new_speed += 300; if(!sc->data[SC_GATLINGFEVER]) - { //% increases (they don't stack, with a few exceptions) + { //These two stack with everything (but only one of them) if(sc->data[SC_SPEEDUP1]) - speed -= speed * 50/100; + new_speed -= new_speed * 50/100; else if(sc->data[SC_AVOID]) - speed -= speed * sc->data[SC_AVOID]->val2/100; + new_speed -= new_speed * sc->data[SC_AVOID]->val2/100; + + speed = new_speed; + //These stack independently if(sc->data[SC_RUN]) - speed -= speed * 50/100; - else if(sc->data[SC_INCREASEAGI] && sc->data[SC_FUSION]) - speed -= speed * 50/100; - else if(sc->data[SC_SPEEDUP0]) - speed -= speed * 25/100; - else if(sc->data[SC_INCREASEAGI]) - speed -= speed * 25/100; - else if(sc->data[SC_FUSION]) - speed -= speed * 25/100; - else if(sc->data[SC_CARTBOOST]) - speed -= speed * 20/100; - else if(sc->data[SC_BERSERK]) - speed -= speed * 20/100; - else if(sc->data[SC_WINDWALK]) - speed -= speed * sc->data[SC_WINDWALK]->val3/100; + new_speed -= new_speed * 50/100; + if(sc->data[SC_INCREASEAGI]) + new_speed -= new_speed * 25/100; + if(sc->data[SC_FUSION]) + new_speed -= new_speed * 25/100; + + + //These only apply if you don't have increase agi and/or fusion and/or sprint + if(speed == new_speed) + { + if(sc->data[SC_SPEEDUP0]) + new_speed -= new_speed * 25/100; + else if(sc->data[SC_CARTBOOST]) + new_speed -= new_speed * 20/100; + else if(sc->data[SC_BERSERK]) + new_speed -= new_speed * 20/100; + else if(sc->data[SC_WINDWALK]) + new_speed -= new_speed * sc->data[SC_WINDWALK]->val3/100; + } + } + + speed = new_speed; + //% reductions (they stack) if(sc->data[SC_DANCING] && sc->data[SC_DANCING]->val3&0xFFFF) speed += speed*(sc->data[SC_DANCING]->val3&0xFFFF)/100; |