summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-11 17:20:44 +0000
committerrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-11 17:20:44 +0000
commit97166dfb92d7cbdef8731771c38923cc219a4fc3 (patch)
treeb757962d8b2ef15de65fd62872f5dcc3a740e4a9 /src/map/status.c
parente6376945eb87a94974bfad2a5ca649c9b8d1288f (diff)
downloadhercules-97166dfb92d7cbdef8731771c38923cc219a4fc3.tar.gz
hercules-97166dfb92d7cbdef8731771c38923cc219a4fc3.tar.bz2
hercules-97166dfb92d7cbdef8731771c38923cc219a4fc3.tar.xz
hercules-97166dfb92d7cbdef8731771c38923cc219a4fc3.zip
Happy Holidays and Happy 12/12/12 :)
Update Elemental summon to its official behavior - Fixed missing skill features of Ventus(bugreport:6792,bugreport:6723,bugreport:6511) - Note: upgrade_svn17014.sql - And other elemental skills are to follow :) Fixed bugreport:6889 updated const.txt where it cause error to some items. Fixed bugreport:6999 where matk damage deals miss atk to plant type targets. Fixed status calculation where it doesn't give accurate result or how official calculation does. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17014 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c358
1 files changed, 180 insertions, 178 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 7cf76c56e..d9081ede8 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -723,10 +723,10 @@ void initChangeTables(void) {
set_sc( EL_AQUAPLAY , SC_AQUAPLAY_OPTION , SI_AQUAPLAY_OPTION , SCB_MATK );
set_sc( EL_COOLER , SC_COOLER_OPTION , SI_COOLER_OPTION , SCB_MATK );
set_sc( EL_CHILLY_AIR , SC_CHILLY_AIR_OPTION , SI_CHILLY_AIR_OPTION , SCB_MATK );
- set_sc( EL_GUST , SC_GUST_OPTION , SI_GUST_OPTION , SCB_NONE );
- set_sc( EL_BLAST , SC_BLAST_OPTION , SI_BLAST_OPTION , SCB_NONE );
- set_sc( EL_WILD_STORM , SC_WILD_STORM_OPTION , SI_WILD_STORM_OPTION , SCB_NONE );
- set_sc( EL_PETROLOGY , SC_PETROLOGY_OPTION , SI_PETROLOGY_OPTION , SCB_NONE );
+ set_sc( EL_GUST , SC_GUST_OPTION , SI_GUST_OPTION , SCB_ASPD );
+ set_sc( EL_BLAST , SC_BLAST_OPTION , SI_BLAST_OPTION , SCB_ASPD );
+ set_sc( EL_WILD_STORM , SC_WILD_STORM_OPTION , SI_WILD_STORM_OPTION , SCB_ASPD );
+ set_sc( EL_PETROLOGY , SC_PETROLOGY_OPTION , SI_PETROLOGY_OPTION , SCB_MAXHP );
set_sc( EL_CURSED_SOIL , SC_CURSED_SOIL_OPTION , SI_CURSED_SOIL_OPTION , SCB_NONE );
set_sc( EL_UPHEAVAL , SC_UPHEAVAL_OPTION , SI_UPHEAVAL_OPTION , SCB_NONE );
set_sc( EL_TIDAL_WEAPON , SC_TIDAL_WEAPON_OPTION , SI_TIDAL_WEAPON_OPTION , SCB_ALL );
@@ -3196,31 +3196,31 @@ int status_calc_elemental_(struct elemental_data *ed, bool first) {
if( !sd )
return 0;
- status->str = ele->str;
- status->agi = ele->agi;
- status->vit = ele->vit;
- status->dex = ele->dex;
- status->int_ = ele->int_;
- status->luk = ele->luk;
-
if( first ) {
memcpy(status, &ed->db->status, sizeof(struct status_data));
- status->mode = MD_CANMOVE|MD_CANATTACK;
- status->max_hp += 4000 + 500 * pc_checkskill(sd,SO_EL_SYMPATHY);
- status->max_sp += 300 + 50 * pc_checkskill(sd,SO_EL_SYMPATHY);
- status->hp = status->max_hp;
- status->sp = status->max_sp;
- status->str += sd->base_status.str * 25 / 100;
- status->agi += sd->base_status.agi * 25 / 100;
- status->vit += sd->base_status.vit * 25 / 100;
- status->int_ += sd->base_status.int_ * 25 / 100;
- status->def += sd->base_status.dex * 25 / 100;
- status->luk += sd->base_status.luk * 25 / 100;
-
- status_calc_misc(&ed->bl, status, ed->db->lv);
+ if( !ele->mode )
+ status->mode = EL_MODE_PASSIVE;
+ else
+ status->mode = ele->mode;
+
+ status_calc_misc(&ed->bl, status, 0);
+
+ status->max_hp = ele->max_hp;
+ status->max_sp = ele->max_sp;
+ status->hp = ele->hp;
+ status->sp = ele->sp;
+ status->rhw.atk = ele->atk;
+ status->rhw.atk2 = ele->atk2;
+
+ status->matk_min += ele->matk;
+ status->def += ele->def;
+ status->mdef += ele->mdef;
+ status->flee = ele->flee;
+ status->hit = ele->hit;
+
memcpy(&ed->battle_status,status,sizeof(struct status_data));
} else {
- status_calc_misc(&ed->bl, status, ed->db->lv);
+ status_calc_misc(&ed->bl, status, 0);
status_cpy(&ed->battle_status, status);
}
@@ -3827,9 +3827,6 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
if(status->aspd_rate != 1000) // absolute percentage modifier
amotion = ( 200 - (200-amotion/10) * status->aspd_rate / 1000 ) * 10;
#endif
- //@TODO move FIGHTINGSPIRIT in fix_aspd
- if( sc && sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2 )
- amotion -= (sd?pc_checkskill(sd, RK_RUNEMASTERY):10) / 10 * 40;
amotion = status_calc_fix_aspd(bl, sc, amotion);
status->amotion = cap_value(amotion,((sd->class_&JOBL_THIRD) ? battle_config.max_third_aspd : battle_config.max_aspd),2000);
@@ -4202,8 +4199,6 @@ static unsigned short status_calc_vit(struct block_list *bl, struct status_chang
vit += sc->data[SC_GLORYWOUNDS]->val1;
if(sc->data[SC_TRUESIGHT])
vit += 5;
- if(sc->data[SC_STRIPARMOR])
- vit -= vit * sc->data[SC_STRIPARMOR]->val2/100;
if(sc->data[SC_MARIONETTE])
vit -= sc->data[SC_MARIONETTE]->val3&0xFF;
if(sc->data[SC_MARIONETTE2])
@@ -4219,6 +4214,9 @@ static unsigned short status_calc_vit(struct block_list *bl, struct status_chang
if(sc->data[SC_KYOUGAKU])
vit -= sc->data[SC_KYOUGAKU]->val2;
+ if(sc->data[SC_STRIPARMOR])
+ vit -= vit * sc->data[SC_STRIPARMOR]->val2/100;
+
return (unsigned short)cap_value(vit,0,USHRT_MAX);
}
@@ -4253,8 +4251,6 @@ static unsigned short status_calc_int(struct block_list *bl, struct status_chang
else
int_ >>= 1;
}
- if(sc->data[SC_STRIPHELM])
- int_ -= int_ * sc->data[SC_STRIPHELM]->val2/100;
if(sc->data[SC_NEN])
int_ += sc->data[SC_NEN]->val1;
if(sc->data[SC_MARIONETTE])
@@ -4263,8 +4259,6 @@ static unsigned short status_calc_int(struct block_list *bl, struct status_chang
int_ += ((sc->data[SC_MARIONETTE2]->val4)>>16)&0xFF;
if(sc->data[SC_MANDRAGORA])
int_ -= 5 + 5 * sc->data[SC_MANDRAGORA]->val1;
- if(sc->data[SC__STRIPACCESSORY])
- int_ -= int_ * sc->data[SC__STRIPACCESSORY]->val2 / 100;
if(sc->data[SC_COCKTAIL_WARG_BLOOD])
int_ += sc->data[SC_COCKTAIL_WARG_BLOOD]->val1;
if(sc->data[SC_INSPIRATION])
@@ -4273,6 +4267,11 @@ static unsigned short status_calc_int(struct block_list *bl, struct status_chang
int_ -= sc->data[SC_STOMACHACHE]->val1;
if(sc->data[SC_KYOUGAKU])
int_ -= sc->data[SC_KYOUGAKU]->val2;
+
+ if(sc->data[SC_STRIPHELM])
+ int_ -= int_ * sc->data[SC_STRIPHELM]->val2/100;
+ if(sc->data[SC__STRIPACCESSORY])
+ int_ -= int_ * sc->data[SC__STRIPACCESSORY]->val2 / 100;
return (unsigned short)cap_value(int_,0,USHRT_MAX);
}
@@ -4318,8 +4317,6 @@ static unsigned short status_calc_dex(struct block_list *bl, struct status_chang
dex -= ((sc->data[SC_MARIONETTE]->val4)>>8)&0xFF;
if(sc->data[SC_MARIONETTE2])
dex += ((sc->data[SC_MARIONETTE2]->val4)>>8)&0xFF;
- if(sc->data[SC__STRIPACCESSORY])
- dex -= dex * sc->data[SC__STRIPACCESSORY]->val2 / 100;
if(sc->data[SC_SIROMA_ICE_TEA])
dex += sc->data[SC_SIROMA_ICE_TEA]->val1;
if(sc->data[SC_INSPIRATION])
@@ -4329,6 +4326,9 @@ static unsigned short status_calc_dex(struct block_list *bl, struct status_chang
if(sc->data[SC_KYOUGAKU])
dex -= sc->data[SC_KYOUGAKU]->val2;
+ if(sc->data[SC__STRIPACCESSORY])
+ dex -= dex * sc->data[SC__STRIPACCESSORY]->val2 / 100;
+
return (unsigned short)cap_value(dex,0,USHRT_MAX);
}
@@ -4361,20 +4361,21 @@ static unsigned short status_calc_luk(struct block_list *bl, struct status_chang
luk -= sc->data[SC_MARIONETTE]->val4&0xFF;
if(sc->data[SC_MARIONETTE2])
luk += sc->data[SC_MARIONETTE2]->val4&0xFF;
- if(sc->data[SC_LAUDARAMUS])
- luk += 4 + sc->data[SC_LAUDARAMUS]->val1;
- if(sc->data[SC__STRIPACCESSORY])
- luk -= luk * sc->data[SC__STRIPACCESSORY]->val2 / 100;
if(sc->data[SC_PUTTI_TAILS_NOODLES])
luk += sc->data[SC_PUTTI_TAILS_NOODLES]->val1;
if(sc->data[SC_INSPIRATION])
luk += sc->data[SC_INSPIRATION]->val3;
if(sc->data[SC_STOMACHACHE])
luk -= sc->data[SC_STOMACHACHE]->val1;
- if(sc->data[SC_BANANA_BOMB])
- luk -= luk * sc->data[SC_BANANA_BOMB]->val1 / 100;
if(sc->data[SC_KYOUGAKU])
luk -= sc->data[SC_KYOUGAKU]->val2;
+ if(sc->data[SC_LAUDARAMUS])
+ luk += 4 + sc->data[SC_LAUDARAMUS]->val1;
+
+ if(sc->data[SC__STRIPACCESSORY])
+ luk -= luk * sc->data[SC__STRIPACCESSORY]->val2 / 100;
+ if(sc->data[SC_BANANA_BOMB])
+ luk -= luk * sc->data[SC_BANANA_BOMB]->val1 / 100;
return (unsigned short)cap_value(luk,0,USHRT_MAX);
}
@@ -4388,6 +4389,32 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
batk += sc->data[SC_ATKPOTION]->val1;
if(sc->data[SC_BATKFOOD])
batk += sc->data[SC_BATKFOOD]->val1;
+ if(sc->data[SC_GATLINGFEVER])
+ batk += sc->data[SC_GATLINGFEVER]->val3;
+ if(sc->data[SC_MADNESSCANCEL])
+ batk += 100;
+ if(sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2)
+ batk += 50;
+ if(bl->type == BL_ELEM
+ && ((sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 1)
+ || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 1)
+ || (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 1)
+ || (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 1))
+ )
+ batk += batk / 5;
+ if(sc->data[SC_FULL_SWING_K])
+ batk += sc->data[SC_FULL_SWING_K]->val1;
+ if(sc->data[SC_ODINS_POWER])
+ batk += 70;
+ if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
+ if(status_get_element(bl) == ELE_WATER) //water type
+ batk /= 2;
+ }
+ if(sc->data[SC_PYROCLASTIC])
+ batk += sc->data[SC_PYROCLASTIC]->val2;
+ if (sc->data[SC_ANGRIFFS_MODUS])
+ batk += sc->data[SC_ANGRIFFS_MODUS]->val2;
+
if(sc->data[SC_INCATKRATE])
batk += batk * sc->data[SC_INCATKRATE]->val1/100;
if(sc->data[SC_PROVOKE])
@@ -4407,10 +4434,6 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
// batk -= batk * 25/100;
if(sc->data[SC_FLEET])
batk += batk * sc->data[SC_FLEET]->val3/100;
- if(sc->data[SC_GATLINGFEVER])
- batk += sc->data[SC_GATLINGFEVER]->val3;
- if(sc->data[SC_MADNESSCANCEL])
- batk += 100;
if(sc->data[SC__ENERVATION])
batk -= batk * sc->data[SC__ENERVATION]->val2 / 100;
if(sc->data[SC_RUSHWINDMILL])
@@ -4421,29 +4444,8 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
batk -= batk * sc->data[SC_MELODYOFSINK]->val3/100;
if(sc->data[SC_BEYONDOFWARCRY])
batk += batk * sc->data[SC_BEYONDOFWARCRY]->val3/100;
- if(sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2)
- batk += 50;
- if(bl->type == BL_ELEM
- && ((sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 1)
- || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 1)
- || (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 1)
- || (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 1))
- )
- batk += batk / 5;
- if(sc->data[SC_FULL_SWING_K])
- batk += sc->data[SC_FULL_SWING_K]->val1;
- if(sc->data[SC_ODINS_POWER])
- batk += 70;
if( sc->data[SC_ZANGETSU] )
batk += batk * sc->data[SC_ZANGETSU]->val2 / 100;
- if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
- if(status_get_element(bl) == ELE_WATER) //water type
- batk /= 2;
- }
- if(sc->data[SC_PYROCLASTIC])
- batk += sc->data[SC_PYROCLASTIC]->val2;
- if (sc->data[SC_ANGRIFFS_MODUS])
- batk += sc->data[SC_ANGRIFFS_MODUS]->val2;
return (unsigned short)cap_value(batk,0,USHRT_MAX);
}
@@ -4461,14 +4463,26 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan
watk += sc->data[SC_DRUMBATTLE]->val2;
if(sc->data[SC_VOLCANO])
watk += sc->data[SC_VOLCANO]->val2;
- if(sc->data[SC_INCATKRATE])
- watk += watk * sc->data[SC_INCATKRATE]->val1/100;
- if(sc->data[SC_PROVOKE])
- watk += watk * sc->data[SC_PROVOKE]->val3/100;
- if(sc->data[SC_CONCENTRATION])
- watk += watk * sc->data[SC_CONCENTRATION]->val2/100;
- if(sc->data[SC_SKE])
- watk += watk * 3;
+ if(sc->data[SC_MERC_ATKUP])
+ watk += sc->data[SC_MERC_ATKUP]->val2;
+ if(sc->data[SC_FIGHTINGSPIRIT])
+ watk += sc->data[SC_FIGHTINGSPIRIT]->val1;
+ if(sc->data[SC_STRIKING])
+ watk += sc->data[SC_STRIKING]->val2;
+ if(sc->data[SC_SHIELDSPELL_DEF] && sc->data[SC_SHIELDSPELL_DEF]->val1 == 3)
+ watk += sc->data[SC_SHIELDSPELL_DEF]->val2;
+ if(sc->data[SC_INSPIRATION])
+ watk += sc->data[SC_INSPIRATION]->val2;
+ if( sc->data[SC_BANDING] && sc->data[SC_BANDING]->val2 > 0 )
+ watk += (10 + 10 * sc->data[SC_BANDING]->val1) * (sc->data[SC_BANDING]->val2);
+ if( sc->data[SC_TROPIC_OPTION] )
+ watk += sc->data[SC_TROPIC_OPTION]->val2;
+ if( sc->data[SC_HEATER_OPTION] )
+ watk += sc->data[SC_HEATER_OPTION]->val2;
+ if( sc->data[SC_WATER_BARRIER] )
+ watk -= sc->data[SC_WATER_BARRIER]->val3;
+ if( sc->data[SC_PYROTECHNIC_OPTION] )
+ watk += sc->data[SC_PYROTECHNIC_OPTION]->val2;
if(sc->data[SC_NIBELUNGEN]) {
if (bl->type != BL_PC)
watk += sc->data[SC_NIBELUNGEN]->val2;
@@ -4481,6 +4495,15 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan
watk += sc->data[SC_NIBELUNGEN]->val2;
}
}
+
+ if(sc->data[SC_INCATKRATE])
+ watk += watk * sc->data[SC_INCATKRATE]->val1/100;
+ if(sc->data[SC_PROVOKE])
+ watk += watk * sc->data[SC_PROVOKE]->val3/100;
+ if(sc->data[SC_CONCENTRATION])
+ watk += watk * sc->data[SC_CONCENTRATION]->val2/100;
+ if(sc->data[SC_SKE])
+ watk += watk * 3;
if(sc->data[SC__ENERVATION])
watk -= watk * sc->data[SC__ENERVATION]->val2 / 100;
if(sc->data[SC_FLEET])
@@ -4489,28 +4512,8 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan
watk -= watk * 25/100;
if(sc->data[SC_STRIPWEAPON])
watk -= watk * sc->data[SC_STRIPWEAPON]->val2/100;
- if(sc->data[SC_MERC_ATKUP])
- watk += sc->data[SC_MERC_ATKUP]->val2;
- if(sc->data[SC_FIGHTINGSPIRIT])
- watk += sc->data[SC_FIGHTINGSPIRIT]->val1;
if(sc->data[SC__ENERVATION])
watk -= watk * sc->data[SC__ENERVATION]->val2 / 100;
- if(sc->data[SC_STRIKING])
- watk += sc->data[SC_STRIKING]->val2;
- if(sc->data[SC_SHIELDSPELL_DEF] && sc->data[SC_SHIELDSPELL_DEF]->val1 == 3)
- watk += sc->data[SC_SHIELDSPELL_DEF]->val2;
- if(sc->data[SC_INSPIRATION])
- watk += sc->data[SC_INSPIRATION]->val2;
- if( sc->data[SC_BANDING] && sc->data[SC_BANDING]->val2 > 0 )
- watk += (10 + 10 * sc->data[SC_BANDING]->val1) * (sc->data[SC_BANDING]->val2);
- if( sc->data[SC_TROPIC_OPTION] )
- watk += sc->data[SC_TROPIC_OPTION]->val2;
- if( sc->data[SC_HEATER_OPTION] )
- watk += sc->data[SC_HEATER_OPTION]->val2;
- if( sc->data[SC_WATER_BARRIER] )
- watk -= sc->data[SC_WATER_BARRIER]->val3;
- if( sc->data[SC_PYROTECHNIC_OPTION] )
- watk += sc->data[SC_PYROTECHNIC_OPTION]->val2;
if((sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2)
|| (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 2)
|| (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 2)
@@ -4615,15 +4618,16 @@ static signed short status_calc_critical(struct block_list *bl, struct status_ch
critical += critical;
if(sc->data[SC_STRIKING])
critical += sc->data[SC_STRIKING]->val1;
- if(sc->data[SC__INVISIBILITY])
- critical += critical * sc->data[SC__INVISIBILITY]->val3 / 100;
- if(sc->data[SC__UNLUCKY])
- critical -= critical * sc->data[SC__UNLUCKY]->val2 / 100;
#ifdef RENEWAL
if (sc->data[SC_SPEARQUICKEN])
critical += 3*sc->data[SC_SPEARQUICKEN]->val1*10;
#endif
+ if(sc->data[SC__INVISIBILITY])
+ critical += critical * sc->data[SC__INVISIBILITY]->val3 / 100;
+ if(sc->data[SC__UNLUCKY])
+ critical -= critical * sc->data[SC__UNLUCKY]->val2 / 100;
+
return (short)cap_value(critical,10,SHRT_MAX);
}
@@ -4643,22 +4647,23 @@ static signed short status_calc_hit(struct block_list *bl, struct status_change
hit += sc->data[SC_HUMMING]->val2;
if(sc->data[SC_CONCENTRATION])
hit += sc->data[SC_CONCENTRATION]->val3;
- if(sc->data[SC_INCHITRATE])
- hit += hit * sc->data[SC_INCHITRATE]->val1/100;
- if(sc->data[SC_BLIND])
- hit -= hit * 25/100;
+ if(sc->data[SC_INSPIRATION])
+ hit += 5 * sc->data[SC_INSPIRATION]->val1;
if(sc->data[SC_ADJUSTMENT])
hit -= 30;
if(sc->data[SC_INCREASING])
hit += 20; // RockmanEXE; changed based on updated [Reddozen]
if(sc->data[SC_MERC_HITUP])
hit += sc->data[SC_MERC_HITUP]->val2;
+
+ if(sc->data[SC_INCHITRATE])
+ hit += hit * sc->data[SC_INCHITRATE]->val1/100;
+ if(sc->data[SC_BLIND])
+ hit -= hit * 25/100;
if(sc->data[SC__GROOMY])
hit -= hit * sc->data[SC__GROOMY]->val3 / 100;
if(sc->data[SC_FEAR])
hit -= hit * 20 / 100;
- if(sc->data[SC_INSPIRATION])
- hit += 5 * sc->data[SC_INSPIRATION]->val1;
if (sc->data[SC_ASH])
hit /= 2;
@@ -4686,30 +4691,45 @@ static signed short status_calc_flee(struct block_list *bl, struct status_change
flee += sc->data[SC_WHISTLE]->val2;
if(sc->data[SC_WINDWALK])
flee += sc->data[SC_WINDWALK]->val2;
- if(sc->data[SC_INCFLEERATE])
- flee += flee * sc->data[SC_INCFLEERATE]->val1/100;
if(sc->data[SC_VIOLENTGALE])
flee += sc->data[SC_VIOLENTGALE]->val2;
if(sc->data[SC_MOON_COMFORT]) //SG skill [Komurka]
flee += sc->data[SC_MOON_COMFORT]->val2;
if(sc->data[SC_CLOSECONFINE])
flee += 10;
- if(sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1)
- flee -= flee * 50/100;
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
- flee -= flee * 50/100;
- if(sc->data[SC_BLIND])
- flee -= flee * 25/100;
+ if (sc->data[SC_ANGRIFFS_MODUS])
+ flee -= sc->data[SC_ANGRIFFS_MODUS]->val3;
+ if (sc->data[SC_OVERED_BOOST])
+ flee = max(flee,sc->data[SC_OVERED_BOOST]->val2);
if(sc->data[SC_ADJUSTMENT])
flee += 30;
- if(sc->data[SC_GATLINGFEVER])
- flee -= sc->data[SC_GATLINGFEVER]->val4;
if(sc->data[SC_SPEED])
flee += 10 + sc->data[SC_SPEED]->val1 * 10;
+ if(sc->data[SC_GATLINGFEVER])
+ flee -= sc->data[SC_GATLINGFEVER]->val4;
if(sc->data[SC_PARTYFLEE])
flee += sc->data[SC_PARTYFLEE]->val1 * 10;
if(sc->data[SC_MERC_FLEEUP])
flee += sc->data[SC_MERC_FLEEUP]->val2;
+ if( sc->data[SC_HALLUCINATIONWALK] )
+ flee += sc->data[SC_HALLUCINATIONWALK]->val2;
+ if( sc->data[SC_WATER_BARRIER] )
+ flee -= sc->data[SC_WATER_BARRIER]->val3;
+ if( sc->data[SC_MARSHOFABYSS] )
+ flee -= (9 * sc->data[SC_MARSHOFABYSS]->val3 / 10 + sc->data[SC_MARSHOFABYSS]->val2 / 10) * (bl->type == BL_MOB ? 2 : 1);
+#ifdef RENEWAL
+ if( sc->data[SC_SPEARQUICKEN] )
+ flee += 2 * sc->data[SC_SPEARQUICKEN]->val1;
+#endif
+
+ if(sc->data[SC_INCFLEERATE])
+ flee += flee * sc->data[SC_INCFLEERATE]->val1/100;
+ if(sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1)
+ flee -= flee * 50/100;
+ if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ flee -= flee * 50/100;
+ if(sc->data[SC_BLIND])
+ flee -= flee * 25/100;
if(sc->data[SC_FEAR])
flee -= flee * 20 / 100;
if(sc->data[SC_PARALYSE])
@@ -4720,26 +4740,12 @@ static signed short status_calc_flee(struct block_list *bl, struct status_change
flee -= flee * sc->data[SC__LAZINESS]->val3 / 100;
if( sc->data[SC_GLOOMYDAY] )
flee -= flee * sc->data[SC_GLOOMYDAY]->val2 / 100;
- if( sc->data[SC_HALLUCINATIONWALK] )
- flee += sc->data[SC_HALLUCINATIONWALK]->val2;
if( sc->data[SC_SATURDAYNIGHTFEVER] )
flee -= flee * (40 + 10 * sc->data[SC_SATURDAYNIGHTFEVER]->val1) / 100;
- if( sc->data[SC_WATER_BARRIER] )
- flee -= sc->data[SC_WATER_BARRIER]->val3;
if( sc->data[SC_WIND_STEP_OPTION] )
flee += flee * sc->data[SC_WIND_STEP_OPTION]->val2 / 100;
if( sc->data[SC_ZEPHYR] )
flee += flee * sc->data[SC_ZEPHYR]->val2 / 100;
- if( sc->data[SC_MARSHOFABYSS] )
- flee -= (9 * sc->data[SC_MARSHOFABYSS]->val3 / 10 + sc->data[SC_MARSHOFABYSS]->val2 / 10) * (bl->type == BL_MOB ? 2 : 1);
-#ifdef RENEWAL
- if( sc->data[SC_SPEARQUICKEN] )
- flee += 2 * sc->data[SC_SPEARQUICKEN]->val1;
-#endif
- if (sc->data[SC_ANGRIFFS_MODUS])
- flee -= sc->data[SC_ANGRIFFS_MODUS]->val3;
- if (sc->data[SC_OVERED_BOOST])
- flee = max(flee,sc->data[SC_OVERED_BOOST]->val2);
if(sc->data[SC_ASH] && (bl->type==BL_MOB)){ //mob
if(status_get_element(bl) == ELE_WATER) //water type
flee /= 2;
@@ -4788,6 +4794,14 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc,
def += sc->data[SC_DEFENCE]->val2 ;
if(sc->data[SC_INCDEFRATE])
def += def * sc->data[SC_INCDEFRATE]->val1/100;
+ if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
+ def += 50;
+ if(sc->data[SC_ODINS_POWER])
+ def -= 20;
+ if( sc->data[SC_ANGRIFFS_MODUS] )
+ def -= 30 + 20 * sc->data[SC_ANGRIFFS_MODUS]->val1;
+ if(sc->data[SC_STONEHARDSKIN])// Final DEF increase divided by 10 since were using classic (pre-renewal) mechanics. [Rytech]
+ def += sc->data[SC_STONEHARDSKIN]->val1;
if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE)
def >>=1;
if(sc->data[SC_FREEZE])
@@ -4808,8 +4822,6 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc,
def -= def * sc->data[SC_STRIPSHIELD]->val2/100;
if (sc->data[SC_FLING])
def -= def * (sc->data[SC_FLING]->val2)/100;
- if(sc->data[SC_STONEHARDSKIN])// Final DEF increase divided by 10 since were using classic (pre-renewal) mechanics. [Rytech]
- def += sc->data[SC_STONEHARDSKIN]->val1;
if( sc->data[SC_FREEZING] )
def -= def * 10 / 100;
if( sc->data[SC_MARSHOFABYSS] )
@@ -4828,12 +4840,6 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc,
def += def * sc->data[SC_POWER_OF_GAIA]->val2 / 100;
if( sc->data[SC_PRESTIGE] )
def += def * sc->data[SC_PRESTIGE]->val1 / 100;
- if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
- def += 50;
- if(sc->data[SC_ODINS_POWER])
- def -= 20;
- if( sc->data[SC_ANGRIFFS_MODUS] )
- def -= 30 + 20 * sc->data[SC_ANGRIFFS_MODUS]->val1;
if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
if(status_get_race(bl)==RC_PLANT)
def /= 2;
@@ -4857,6 +4863,10 @@ static signed short status_calc_def2(struct block_list *bl, struct status_change
return 0;
if(sc->data[SC_SUN_COMFORT])
def2 += sc->data[SC_SUN_COMFORT]->val2;
+ if( sc->data[SC_SHIELDSPELL_REF] && sc->data[SC_SHIELDSPELL_REF]->val1 == 1 )
+ def2 += sc->data[SC_SHIELDSPELL_REF]->val2;
+ if( sc->data[SC_BANDING] && sc->data[SC_BANDING]->val2 > 0 )
+ def2 += (5 + sc->data[SC_BANDING]->val1) * (sc->data[SC_BANDING]->val2);
if(sc->data[SC_ANGELUS])
#ifdef RENEWAL //in renewal only the VIT stat bonus is boosted by angelus
@@ -4889,10 +4899,6 @@ static signed short status_calc_def2(struct block_list *bl, struct status_change
def2 -= def2 * ( 14 * sc->data[SC_ANALYZE]->val1 ) / 100;
if( sc->data[SC_ECHOSONG] )
def2 += def2 * sc->data[SC_ECHOSONG]->val2/100;
- if( sc->data[SC_SHIELDSPELL_REF] && sc->data[SC_SHIELDSPELL_REF]->val1 == 1 )
- def2 += sc->data[SC_SHIELDSPELL_REF]->val2;
- if( sc->data[SC_BANDING] && sc->data[SC_BANDING]->val2 > 0 )
- def2 += (5 + sc->data[SC_BANDING]->val1) * (sc->data[SC_BANDING]->val2);
if( sc->data[SC_GT_REVITALIZE] && sc->data[SC_GT_REVITALIZE]->val4)
def2 += def2 * sc->data[SC_GT_REVITALIZE]->val4 / 100;
if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
@@ -4927,20 +4933,26 @@ static defType status_calc_mdef(struct block_list *bl, struct status_change *sc,
if(sc->data[SC_ARMORCHANGE])
mdef += sc->data[SC_ARMORCHANGE]->val3;
- if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE)
- mdef += 25*mdef/100;
- if(sc->data[SC_FREEZE])
- mdef += 25*mdef/100;
+ if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
+ mdef += 50;
if(sc->data[SC_ENDURE])// It has been confirmed that eddga card grants 1 MDEF, not 0, not 10, but 1.
mdef += (sc->data[SC_ENDURE]->val4 == 0) ? sc->data[SC_ENDURE]->val1 : 1;
if(sc->data[SC_CONCENTRATION])
mdef += 1; //Skill info says it adds a fixed 1 Mdef point.
+ if(sc->data[SC_STONEHARDSKIN])// Final MDEF increase divided by 10 since were using classic (pre-renewal) mechanics. [Rytech]
+ mdef += sc->data[SC_STONEHARDSKIN]->val1;
+ if(sc->data[SC_WATER_BARRIER])
+ mdef += sc->data[SC_WATER_BARRIER]->val2;
+
#ifdef RENEWAL
if(sc->data[SC_ASSUMPTIO])
mdef *= 2;
#endif
- if(sc->data[SC_STONEHARDSKIN])// Final MDEF increase divided by 10 since were using classic (pre-renewal) mechanics. [Rytech]
- mdef += sc->data[SC_STONEHARDSKIN]->val1;
+
+ if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE)
+ mdef += 25*mdef/100;
+ if(sc->data[SC_FREEZE])
+ mdef += 25*mdef/100;
if( sc->data[SC_MARSHOFABYSS] )
mdef -= mdef * ( 6 + 6 * sc->data[SC_MARSHOFABYSS]->val3/10 + (bl->type == BL_MOB ? 5 : 3) * sc->data[SC_MARSHOFABYSS]->val2/36 ) / 100;
if(sc->data[SC_ANALYZE])
@@ -4949,12 +4961,8 @@ static defType status_calc_mdef(struct block_list *bl, struct status_change *sc,
mdef += mdef * sc->data[SC_SYMPHONYOFLOVER]->val2 / 100;
if(sc->data[SC_GT_CHANGE] && sc->data[SC_GT_CHANGE]->val4)
mdef -= mdef * sc->data[SC_GT_CHANGE]->val4 / 100;
- if(sc->data[SC_WATER_BARRIER])
- mdef += sc->data[SC_WATER_BARRIER]->val2;
if (sc->data[SC_ODINS_POWER])
mdef -= 20 * sc->data[SC_ODINS_POWER]->val1;
- if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
- mdef += 50;
return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
}
@@ -5295,20 +5303,16 @@ static short status_calc_fix_aspd(struct block_list *bl, struct status_change *s
return cap_value(aspd, 0, 2000);
if (!sc->data[SC_QUAGMIRE]) {
- if (sc->data[SC_FIGHTINGSPIRIT])
- aspd += sc->data[SC_FIGHTINGSPIRIT]->val3;
- if ((sc->data[SC_GUST_OPTION]
- || sc->data[SC_BLAST_OPTION]
- || sc->data[SC_WILD_STORM_OPTION])
- )
- aspd -= 50; // ventus passive = +5 ASPD
- if (sc->data[SC_OVERED_BOOST]){
- aspd = 2000 - sc->data[SC_OVERED_BOOST]->val3*10;
- }
-// if(sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2 )
-// aspd -= (sd?pc_checkskill(sd, RK_RUNEMASTERY):10) * 4;
+ if (sc->data[SC_OVERED_BOOST])
+ aspd = 2000 - sc->data[SC_OVERED_BOOST]->val3*10;
}
+ if ((sc->data[SC_GUST_OPTION] || sc->data[SC_BLAST_OPTION]
+ || sc->data[SC_WILD_STORM_OPTION]))
+ aspd -= 50; // +5 ASPD
+ if( sc && sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2 )
+ aspd -= (bl->type==BL_PC?pc_checkskill((TBL_PC *)bl, RK_RUNEMASTERY):10) / 10 * 40;
+
return cap_value(aspd, 0, 2000); // will be recap for proper bl anyway
}
@@ -5485,6 +5489,12 @@ static unsigned int status_calc_maxhp(struct block_list *bl, struct status_chang
maxhp += maxhp * 2;
if(sc->data[SC_MARIONETTE])
maxhp -= 1000;
+ if(sc->data[SC_SOLID_SKIN_OPTION])
+ maxhp += 2000;// Fix amount.
+ if(sc->data[SC_POWER_OF_GAIA])
+ maxhp += 3000;
+ if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
+ maxhp += 500;
if(sc->data[SC_MERC_HPUP])
maxhp += maxhp * sc->data[SC_MERC_HPUP]->val2/100;
@@ -5509,18 +5519,14 @@ static unsigned int status_calc_maxhp(struct block_list *bl, struct status_chang
maxhp += maxhp * (2 * sc->data[SC_GT_REVITALIZE]->val1) / 100;
if(sc->data[SC_MUSTLE_M])
maxhp += maxhp * sc->data[SC_MUSTLE_M]->val1/100;
- if(sc->data[SC_SOLID_SKIN_OPTION])
- maxhp += 2000;// Fix amount.
- if(sc->data[SC_POWER_OF_GAIA])
- maxhp += 3000;
if(sc->data[SC_MYSTERIOUS_POWDER])
maxhp -= sc->data[SC_MYSTERIOUS_POWDER]->val1 / 100;
- if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
- maxhp += 500;
+ if(sc->data[SC_PETROLOGY_OPTION])
+ maxhp += maxhp * sc->data[SC_PETROLOGY_OPTION]->val2 / 100;
if (sc->data[SC_ANGRIFFS_MODUS])
maxhp += maxhp * 5 * sc->data[SC_ANGRIFFS_MODUS]->val1 /100;
if (sc->data[SC_GOLDENE_FERSE])
- maxhp += (maxhp * sc->data[SC_GOLDENE_FERSE]->val2) / 100;
+ maxhp += maxhp * sc->data[SC_GOLDENE_FERSE]->val2 / 100;
return cap_value(maxhp,1,UINT_MAX);
}
@@ -8328,8 +8334,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
}
break;
case SC_PYROTECHNIC_OPTION:
- val2 = 60; // Watk TODO: Renewal (Atk2)
- val3 = 11; // % Increase damage.
val_flag |= 1|2|4;
break;
case SC_HEATER_OPTION:
@@ -8343,8 +8347,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val3 = MG_FIREBOLT;
break;
case SC_AQUAPLAY_OPTION:
- val2 = 40; // Matk. TODO: Renewal (Matk1)
- val3 = 33; // % Increase effects.
+ val2 = 40;
val_flag |= 1|2|4;
break;
case SC_COOLER_OPTION:
@@ -8359,15 +8362,14 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val_flag |= 1|2;
break;
case SC_GUST_OPTION:
- val2 = 33;
val_flag |= 1|2;
break;
case SC_WIND_STEP_OPTION:
val2 = 50; // % Increase speed and flee.
break;
case SC_BLAST_OPTION:
- val2 = 33;
- val3 = 4;
+ val2 = 20;
+ val3 = ELE_WIND;
val_flag |= 1|2|4;
break;
case SC_WILD_STORM_OPTION:
@@ -8376,7 +8378,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_PETROLOGY_OPTION:
val2 = 5;
- val3 = 33;
+ val3 = 50;
val_flag |= 1|2|4;
break;
case SC_CURSED_SOIL_OPTION: