summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-06 22:01:49 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-06 22:01:49 +0000
commit8a000490b0e56b063564468c5b401ad946d0058f (patch)
treeb756edd256e0ead14f0076d7988ae5b83f06c3aa /src/map/status.c
parentc4ea5fb5895ecfe233cb80f5b769ba4c86c8fc8f (diff)
downloadhercules-8a000490b0e56b063564468c5b401ad946d0058f.tar.gz
hercules-8a000490b0e56b063564468c5b401ad946d0058f.tar.bz2
hercules-8a000490b0e56b063564468c5b401ad946d0058f.tar.xz
hercules-8a000490b0e56b063564468c5b401ad946d0058f.zip
Sprint, Fusion, and Increase AGI now stack independently. The other speed buffs still don't take affect if you have any of these three. (bugreport:1155)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12508 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c55
1 files changed, 34 insertions, 21 deletions
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;