summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c522
1 files changed, 305 insertions, 217 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 8c98b4315..d7a216c97 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -822,6 +822,8 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_PLUSMAGICPOWER] = SI_PLUSMAGICPOWER;
status->dbs->IconChangeTable[SC_FOOD_CRITICALSUCCESSVALUE] = SI_FOOD_CRITICALSUCCESSVALUE;
status->dbs->IconChangeTable[SC_MORA_BUFF] = SI_MORA_BUFF;
+ status->dbs->IconChangeTable[SC_BUCHEDENOEL] = SI_BUCHEDENOEL;
+ status->dbs->IconChangeTable[SC_PHI_DEMON] = SI_PHI_DEMON;
// Cash Items
status->dbs->IconChangeTable[SC_FOOD_STR_CASH] = SI_FOOD_STR_CASH;
@@ -856,6 +858,10 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_STR_SCROLL] = SI_STR_SCROLL;
status->dbs->IconChangeTable[SC_INT_SCROLL] = SI_INT_SCROLL;
status->dbs->IconChangeTable[SC_STEAMPACK] = SI_STEAMPACK;
+ status->dbs->IconChangeTable[SC_MAGIC_CANDY] = SI_MAGIC_CANDY;
+ status->dbs->IconChangeTable[SC_M_LIFEPOTION] = SI_M_LIFEPOTION;
+ status->dbs->IconChangeTable[SC_G_LIFEPOTION] = SI_G_LIFEPOTION;
+ status->dbs->IconChangeTable[SC_MYSTICPOWDER] = SI_MYSTICPOWDER;
// Eden Crystal Synthesis
status->dbs->IconChangeTable[SC_QUEST_BUFF1] = SI_QUEST_BUFF1;
@@ -897,11 +903,13 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_SPELLBOOK6] = SI_SPELLBOOK6;
status->dbs->IconChangeTable[SC_SPELLBOOK7] = SI_SPELLBOOK7;
+ // Mechanic status icon
status->dbs->IconChangeTable[SC_NEUTRALBARRIER_MASTER] = SI_NEUTRALBARRIER_MASTER;
status->dbs->IconChangeTable[SC_STEALTHFIELD_MASTER] = SI_STEALTHFIELD_MASTER;
status->dbs->IconChangeTable[SC_OVERHEAT] = SI_OVERHEAT;
status->dbs->IconChangeTable[SC_OVERHEAT_LIMITPOINT] = SI_OVERHEAT_LIMITPOINT;
+ // Guillotine Cross status icons
status->dbs->IconChangeTable[SC_HALLUCINATIONWALK_POSTDELAY] = SI_HALLUCINATIONWALK_POSTDELAY;
status->dbs->IconChangeTable[SC_TOXIN] = SI_TOXIN;
status->dbs->IconChangeTable[SC_PARALYSE] = SI_PARALYSE;
@@ -912,27 +920,22 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_OBLIVIONCURSE] = SI_OBLIVIONCURSE;
status->dbs->IconChangeTable[SC_LEECHESEND] = SI_LEECHESEND;
+ // Royal Guard status icons
status->dbs->IconChangeTable[SC_SHIELDSPELL_DEF] = SI_SHIELDSPELL_DEF;
status->dbs->IconChangeTable[SC_SHIELDSPELL_MDEF] = SI_SHIELDSPELL_MDEF;
status->dbs->IconChangeTable[SC_SHIELDSPELL_REF] = SI_SHIELDSPELL_REF;
status->dbs->IconChangeTable[SC_BANDING_DEFENCE] = SI_BANDING_DEFENCE;
+ // Sura status icon
status->dbs->IconChangeTable[SC_CURSEDCIRCLE_ATKER] = SI_CURSEDCIRCLE_ATKER;
- status->dbs->IconChangeTable[SC_STOMACHACHE] = SI_STOMACHACHE;
- status->dbs->IconChangeTable[SC_MYSTERIOUS_POWDER] = SI_MYSTERIOUS_POWDER;
- status->dbs->IconChangeTable[SC_MELON_BOMB] = SI_MELON_BOMB;
- status->dbs->IconChangeTable[SC_BANANA_BOMB] = SI_BANANA_BOMB;
- status->dbs->IconChangeTable[SC_BANANA_BOMB_SITDOWN_POSTDELAY] = SI_BANANA_BOMB_SITDOWN_POSTDELAY;
-
- // Genetics New Food Items Status Icons
+ // Genetics Food items / Throwable items status icons
status->dbs->IconChangeTable[SC_SAVAGE_STEAK] = SI_SAVAGE_STEAK;
status->dbs->IconChangeTable[SC_COCKTAIL_WARG_BLOOD] = SI_COCKTAIL_WARG_BLOOD;
status->dbs->IconChangeTable[SC_MINOR_BBQ] = SI_MINOR_BBQ;
status->dbs->IconChangeTable[SC_SIROMA_ICE_TEA] = SI_SIROMA_ICE_TEA;
status->dbs->IconChangeTable[SC_DROCERA_HERB_STEAMED] = SI_DROCERA_HERB_STEAMED;
status->dbs->IconChangeTable[SC_PUTTI_TAILS_NOODLES] = SI_PUTTI_TAILS_NOODLES;
-
status->dbs->IconChangeTable[SC_BOOST500] |= SI_BOOST500;
status->dbs->IconChangeTable[SC_FULL_SWING_K] |= SI_FULL_SWING_K;
status->dbs->IconChangeTable[SC_MANA_PLUS] |= SI_MANA_PLUS;
@@ -941,6 +944,13 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_EXTRACT_WHITE_POTION_Z] |= SI_EXTRACT_WHITE_POTION_Z;
status->dbs->IconChangeTable[SC_VITATA_500] |= SI_VITATA_500;
status->dbs->IconChangeTable[SC_EXTRACT_SALAMINE_JUICE] |= SI_EXTRACT_SALAMINE_JUICE;
+ status->dbs->IconChangeTable[SC_STOMACHACHE] = SI_STOMACHACHE;
+ status->dbs->IconChangeTable[SC_MYSTERIOUS_POWDER] = SI_MYSTERIOUS_POWDER;
+ status->dbs->IconChangeTable[SC_MELON_BOMB] = SI_MELON_BOMB;
+ status->dbs->IconChangeTable[SC_BANANA_BOMB] = SI_BANANA_BOMB;
+ status->dbs->IconChangeTable[SC_BANANA_BOMB_SITDOWN_POSTDELAY] = SI_BANANA_BOMB_SITDOWN_POSTDELAY;
+ status->dbs->IconChangeTable[SC_PROMOTE_HEALTH_RESERCH] = SI_PROMOTE_HEALTH_RESERCH;
+ status->dbs->IconChangeTable[SC_ENERGY_DRINK_RESERCH] = SI_ENERGY_DRINK_RESERCH;
// Elemental Spirit's 'side' status change icons.
status->dbs->IconChangeTable[SC_CIRCLE_OF_FIRE] = SI_CIRCLE_OF_FIRE;
@@ -1007,16 +1017,13 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_INCHITRATE] |= SCB_HIT;
status->dbs->ChangeFlagTable[SC_INCFLEE] |= SCB_FLEE;
status->dbs->ChangeFlagTable[SC_INCFLEERATE] |= SCB_FLEE;
- status->dbs->ChangeFlagTable[SC_MTF_HITFLEE] |= SCB_HIT | SCB_FLEE;
status->dbs->ChangeFlagTable[SC_CRITICALPERCENT] |= SCB_CRI;
status->dbs->ChangeFlagTable[SC_INCASPDRATE] |= SCB_ASPD;
status->dbs->ChangeFlagTable[SC_PLUSAVOIDVALUE] |= SCB_FLEE2;
status->dbs->ChangeFlagTable[SC_INCMHPRATE] |= SCB_MAXHP;
status->dbs->ChangeFlagTable[SC_INCMSPRATE] |= SCB_MAXSP;
status->dbs->ChangeFlagTable[SC_INCMHP] |= SCB_MAXHP;
- status->dbs->ChangeFlagTable[SC_MTF_MHP] |= SCB_MAXHP;
status->dbs->ChangeFlagTable[SC_INCMSP] |= SCB_MAXSP;
- status->dbs->ChangeFlagTable[SC_MTF_MSP] |= SCB_MAXSP;
status->dbs->ChangeFlagTable[SC_INCATKRATE] |= SCB_BATK | SCB_WATK;
status->dbs->ChangeFlagTable[SC_INCMATKRATE] |= SCB_MATK;
status->dbs->ChangeFlagTable[SC_INCDEFRATE] |= SCB_DEF;
@@ -1031,6 +1038,8 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_BATKFOOD] |= SCB_BATK;
status->dbs->ChangeFlagTable[SC_WATKFOOD] |= SCB_WATK;
status->dbs->ChangeFlagTable[SC_MATKFOOD] |= SCB_MATK;
+ status->dbs->ChangeFlagTable[SC_ALL_RIDING] |= SCB_SPEED;
+ status->dbs->ChangeFlagTable[SC_WEDDING] |= SCB_SPEED;
status->dbs->ChangeFlagTable[SC_ARMORPROPERTY] |= SCB_ALL;
status->dbs->ChangeFlagTable[SC_ARMOR_RESIST] |= SCB_ALL;
status->dbs->ChangeFlagTable[SC_ATKER_BLOOD] |= SCB_ALL;
@@ -1039,6 +1048,7 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_TARGET_ASPD] |= SCB_MAXSP;
status->dbs->ChangeFlagTable[SC_ATKER_ASPD] |= SCB_MAXHP | SCB_ALL;
status->dbs->ChangeFlagTable[SC_ATKER_MOVESPEED] |= SCB_MAXSP | SCB_ALL;
+ status->dbs->ChangeFlagTable[SC_ACARAJE] |= SCB_HIT | SCB_ASPD;
status->dbs->ChangeFlagTable[SC_FOOD_CRITICALSUCCESSVALUE] |= SCB_CRI;
status->dbs->ChangeFlagTable[SC_CUP_OF_BOZA] |= SCB_VIT | SCB_ALL;
status->dbs->ChangeFlagTable[SC_GM_BATTLE] |= SCB_BATK | SCB_MATK | SCB_MAXHP | SCB_MAXSP;
@@ -1047,6 +1057,10 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_STR_SCROLL] |= SCB_STR;
status->dbs->ChangeFlagTable[SC_INT_SCROLL] |= SCB_INT;
status->dbs->ChangeFlagTable[SC_STEAMPACK] |= SCB_BATK | SCB_ASPD | SCB_ALL;
+ status->dbs->ChangeFlagTable[SC_BUCHEDENOEL] |= SCB_REGEN | SCB_HIT | SCB_CRI;
+ status->dbs->ChangeFlagTable[SC_PHI_DEMON] |= SCB_ALL;
+ status->dbs->ChangeFlagTable[SC_MAGIC_CANDY] |= SCB_MATK | SCB_ALL;
+ status->dbs->ChangeFlagTable[SC_MYSTICPOWDER] |= SCB_FLEE | SCB_LUK;
// Cash Items
status->dbs->ChangeFlagTable[SC_FOOD_STR_CASH] |= SCB_STR;
@@ -1071,13 +1085,19 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_PYREXIA] |= SCB_HIT | SCB_FLEE;
status->dbs->ChangeFlagTable[SC_OBLIVIONCURSE] |= SCB_REGEN;
- // RG status
+ // Royal Guard status
status->dbs->ChangeFlagTable[SC_SHIELDSPELL_DEF] |= SCB_WATK;
status->dbs->ChangeFlagTable[SC_SHIELDSPELL_REF] |= SCB_DEF;
- // Meca status
+ // Mechanic status
status->dbs->ChangeFlagTable[SC_STEALTHFIELD_MASTER] |= SCB_SPEED;
+ // Other skills status
+ status->dbs->ChangeFlagTable[SC_REBOUND] |= SCB_SPEED | SCB_REGEN;
+ status->dbs->ChangeFlagTable[SC_DEFSET] |= SCB_DEF | SCB_DEF2;
+ status->dbs->ChangeFlagTable[SC_MDEFSET] |= SCB_MDEF | SCB_MDEF2;
+
+ // Geneticist Foods / Throwable items
status->dbs->ChangeFlagTable[SC_SAVAGE_STEAK] |= SCB_STR;
status->dbs->ChangeFlagTable[SC_COCKTAIL_WARG_BLOOD] |= SCB_INT;
status->dbs->ChangeFlagTable[SC_MINOR_BBQ] |= SCB_VIT;
@@ -1092,12 +1112,10 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_EXTRACT_WHITE_POTION_Z] |= SCB_REGEN;
status->dbs->ChangeFlagTable[SC_VITATA_500] |= SCB_REGEN | SCB_MAXSP;
status->dbs->ChangeFlagTable[SC_EXTRACT_SALAMINE_JUICE] |= SCB_ASPD;
- status->dbs->ChangeFlagTable[SC_REBOUND] |= SCB_SPEED | SCB_REGEN;
- status->dbs->ChangeFlagTable[SC_DEFSET] |= SCB_DEF | SCB_DEF2;
- status->dbs->ChangeFlagTable[SC_MDEFSET] |= SCB_MDEF | SCB_MDEF2;
status->dbs->ChangeFlagTable[SC_MYSTERIOUS_POWDER] |= SCB_MAXHP;
- status->dbs->ChangeFlagTable[SC_ACARAJE] |= SCB_HIT | SCB_ASPD;
status->dbs->ChangeFlagTable[SC_STOMACHACHE] |= SCB_STR | SCB_AGI | SCB_VIT | SCB_INT | SCB_DEX | SCB_LUK | SCB_SPEED;
+ status->dbs->ChangeFlagTable[SC_PROMOTE_HEALTH_RESERCH] |= SCB_MAXHP | SCB_ALL;
+ status->dbs->ChangeFlagTable[SC_ENERGY_DRINK_RESERCH] |= SCB_MAXSP | SCB_ALL;
// Geffen Scrolls
status->dbs->ChangeFlagTable[SC_SKELSCROLL] |= SCB_ALL;
@@ -1110,12 +1128,13 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_FREYJASCROLL] |= SCB_MDEF | SCB_FLEE2;
status->dbs->ChangeFlagTable[SC_SOULSCROLL] |= SCB_MAXHP | SCB_MAXSP;
- status->dbs->ChangeFlagTable[SC_ALL_RIDING] |= SCB_SPEED;
- status->dbs->ChangeFlagTable[SC_WEDDING] |= SCB_SPEED;
-
+ // Monster Transform
status->dbs->ChangeFlagTable[SC_MTF_ASPD] |= SCB_ASPD | SCB_HIT;
status->dbs->ChangeFlagTable[SC_MTF_MATK] |= SCB_MATK;
status->dbs->ChangeFlagTable[SC_MTF_MLEATKED] |= SCB_ALL;
+ status->dbs->ChangeFlagTable[SC_MTF_HITFLEE] |= SCB_HIT | SCB_FLEE;
+ status->dbs->ChangeFlagTable[SC_MTF_MHP] |= SCB_MAXHP;
+ status->dbs->ChangeFlagTable[SC_MTF_MSP] |= SCB_MAXSP;
// Eden Crystal Synthesis
status->dbs->ChangeFlagTable[SC_QUEST_BUFF1] |= SCB_BATK | SCB_MATK;
@@ -3061,7 +3080,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
sd->subele[ELE_FIRE] -= i;
}
if (sc->data[SC_MTF_MLEATKED])
- sd->subele[ELE_NEUTRAL] += 2;
+ sd->subele[ELE_NEUTRAL] += sc->data[SC_MTF_MLEATKED]->val1;
if (sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 3)
sd->magic_addele[ELE_FIRE] += 25;
if (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 3)
@@ -3113,6 +3132,10 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
if (sc->data[SC_CUP_OF_BOZA])
sd->subele[ELE_FIRE] += sc->data[SC_CUP_OF_BOZA]->val2;
+ if (sc->data[SC_PHI_DEMON]) {
+ sd->right_weapon.addrace[RC_DEMON] += sc->data[SC_PHI_DEMON]->val1;
+ sd->left_weapon.addrace[RC_DEMON] += sc->data[SC_PHI_DEMON]->val1;
+ }
}
status_cpy(&sd->battle_status, bstatus);
@@ -3494,6 +3517,8 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
regen->rate.hp *= 2;
if (sc->data[SC_VITALITYACTIVATION])
regen->flag &=~RGN_SP;
+
+ // Recovery Items
if (sc->data[SC_EXTRACT_WHITE_POTION_Z])
regen->rate.hp += regen->rate.hp * sc->data[SC_EXTRACT_WHITE_POTION_Z]->val1 / 100;
if (sc->data[SC_VITATA_500])
@@ -3502,6 +3527,10 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
regen->rate.hp += regen->rate.hp * sc->data[SC_ATKER_ASPD]->val2 / 100;
if (sc->data[SC_ATKER_MOVESPEED])
regen->rate.sp += regen->rate.sp * sc->data[SC_ATKER_MOVESPEED]->val2 / 100;
+ if (sc->data[SC_BUCHEDENOEL]) {
+ regen->rate.hp += regen->rate.hp * sc->data[SC_BUCHEDENOEL]->val1 / 100;
+ regen->rate.sp += regen->rate.sp * sc->data[SC_BUCHEDENOEL]->val2 / 100;
+ }
}
/// Recalculates parts of an object's battle status according to the specified flags.
/// @param flag bitfield of values from enum scb_flag
@@ -4603,55 +4632,57 @@ unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc,
return (unsigned short)cap_value(dex,0,USHRT_MAX);
}
-unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, int luk)
-{
- if(!sc || !sc->count)
- return cap_value(luk,0,USHRT_MAX);
+unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, int luk) {
- if(sc->data[SC_FULL_THROTTLE])
+ if (!sc || !sc->count)
+ return cap_value(luk, 0, USHRT_MAX);
+
+ if (sc->data[SC_FULL_THROTTLE])
luk += luk * 20 / 100;
- if(sc->data[SC_HARMONIZE]) {
+ if (sc->data[SC_HARMONIZE]) {
luk -= sc->data[SC_HARMONIZE]->val2;
- return (unsigned short)cap_value(luk,0,USHRT_MAX);
+ return (unsigned short)cap_value(luk, 0, USHRT_MAX);
}
- if(sc->data[SC_CURSE])
+ if (sc->data[SC_CURSE])
return 0;
- if(sc->data[SC_INCALLSTATUS])
+ if (sc->data[SC_INCALLSTATUS])
luk += sc->data[SC_INCALLSTATUS]->val1;
- if(sc->data[SC_INCLUK])
+ if (sc->data[SC_INCLUK])
luk += sc->data[SC_INCLUK]->val1;
- if(sc->data[SC_FOOD_LUK])
+ if (sc->data[SC_FOOD_LUK])
luk += sc->data[SC_FOOD_LUK]->val1;
- if(sc->data[SC_FOOD_LUK_CASH])
+ if (sc->data[SC_FOOD_LUK_CASH])
luk += sc->data[SC_FOOD_LUK_CASH]->val1;
- if(sc->data[SC_TRUESIGHT])
+ if (sc->data[SC_TRUESIGHT])
luk += 5;
- if(sc->data[SC_GLORIA])
+ if (sc->data[SC_GLORIA])
luk += 30;
- if(sc->data[SC_MARIONETTE_MASTER])
+ if (sc->data[SC_MARIONETTE_MASTER])
luk -= sc->data[SC_MARIONETTE_MASTER]->val4&0xFF;
- if(sc->data[SC_MARIONETTE])
+ if (sc->data[SC_MARIONETTE])
luk += sc->data[SC_MARIONETTE]->val4&0xFF;
- if(sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_HIGH)
+ if (sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_HIGH)
luk += sc->data[SC_SOULLINK]->val4&0xFF;
- if(sc->data[SC_PUTTI_TAILS_NOODLES])
+ if (sc->data[SC_PUTTI_TAILS_NOODLES])
luk += sc->data[SC_PUTTI_TAILS_NOODLES]->val1;
- if(sc->data[SC_INSPIRATION])
+ if (sc->data[SC_INSPIRATION])
luk += sc->data[SC_INSPIRATION]->val3;
- if(sc->data[SC_STOMACHACHE])
+ if (sc->data[SC_STOMACHACHE])
luk -= sc->data[SC_STOMACHACHE]->val1;
- if(sc->data[SC_KYOUGAKU])
+ if (sc->data[SC_KYOUGAKU])
luk -= sc->data[SC_KYOUGAKU]->val3;
- if(sc->data[SC_LAUDARAMUS])
+ if (sc->data[SC_LAUDARAMUS])
luk += 4 + sc->data[SC_LAUDARAMUS]->val1;
- if(sc->data[SC__STRIPACCESSARY] && bl->type != BL_PC)
+ if (sc->data[SC__STRIPACCESSARY] && bl->type != BL_PC)
luk -= luk * sc->data[SC__STRIPACCESSARY]->val2 / 100;
- if(sc->data[SC_BANANA_BOMB])
+ if (sc->data[SC_BANANA_BOMB])
luk -= luk * sc->data[SC_BANANA_BOMB]->val1 / 100;
if (sc->data[SC_2011RWC])
luk += sc->data[SC_2011RWC]->val1;
+ if (sc->data[SC_MYSTICPOWDER])
+ luk += sc->data[SC_MYSTICPOWDER]->val2;
- return (unsigned short)cap_value(luk,0,USHRT_MAX);
+ return (unsigned short)cap_value(luk, 0, USHRT_MAX);
}
unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable)
{
@@ -4867,16 +4898,16 @@ unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc
return 0;
#endif
}
-unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable)
-{
- if(!sc || !sc->count)
+unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) {
+
+ if (!sc || !sc->count)
return cap_value(matk,0,USHRT_MAX);
- if( !viewable ){
+ if (!viewable) {
/* some statuses that are hidden in the status window */
if (sc->data[SC_MINDBREAKER])
- matk += matk * sc->data[SC_MINDBREAKER]->val2/100;
- return (unsigned short)cap_value(matk,0,USHRT_MAX);
+ matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100;
+ return (unsigned short)cap_value(matk, 0, USHRT_MAX);
}
#ifndef RENEWAL
@@ -4891,7 +4922,7 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
matk += sc->data[SC_AQUAPLAY_OPTION]->val2;
if (sc->data[SC_CHILLY_AIR_OPTION])
matk += sc->data[SC_CHILLY_AIR_OPTION]->val2;
- if(sc->data[SC_COOLER_OPTION])
+ if (sc->data[SC_COOLER_OPTION])
matk += sc->data[SC_COOLER_OPTION]->val2;
if (sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 3)
matk += 50;
@@ -4900,16 +4931,16 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
if (sc->data[SC_IZAYOI])
matk += 25 * sc->data[SC_IZAYOI]->val1;
#endif
- if( sc->data[SC_ZANGETSU] )
+ if (sc->data[SC_ZANGETSU])
matk += sc->data[SC_ZANGETSU]->val3;
if (sc->data[SC_MAGICPOWER] && sc->data[SC_MAGICPOWER]->val4)
- matk += matk * sc->data[SC_MAGICPOWER]->val3/100;
+ matk += matk * sc->data[SC_MAGICPOWER]->val3 / 100;
if (sc->data[SC_INCMATKRATE])
- matk += matk * sc->data[SC_INCMATKRATE]->val1/100;
+ matk += matk * sc->data[SC_INCMATKRATE]->val1 / 100;
if (sc->data[SC_MOONLIT_SERENADE])
- matk += matk * sc->data[SC_MOONLIT_SERENADE]->val2/100;
+ matk += matk * sc->data[SC_MOONLIT_SERENADE]->val2 / 100;
if (sc->data[SC_MTF_MATK])
- matk += matk * 25 / 100;
+ matk += matk * sc->data[SC_MTF_MATK]->val1 / 100;
if (sc->data[SC_MYSTICSCROLL])
matk += matk * sc->data[SC_MYSTICSCROLL]->val1 / 100;
@@ -4931,18 +4962,20 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
matk += matk * sc->data[SC_GM_BATTLE2]->val1 / 100;
if (sc->data[SC_2011RWC])
matk += matk * sc->data[SC_2011RWC]->val2 / 100;
+ if (sc->data[SC_MAGIC_CANDY])
+ matk += sc->data[SC_MAGIC_CANDY]->val1;
- return (unsigned short)cap_value(matk,0,USHRT_MAX);
+ return (unsigned short)cap_value(matk, 0, USHRT_MAX);
}
signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) {
- if(!sc || !sc->count)
- return cap_value(critical,10,SHRT_MAX);
+ if (!sc || !sc->count)
+ return cap_value(critical, 10, SHRT_MAX);
- if( !viewable ){
+ if (!viewable) {
/* some statuses that are hidden in the status window */
- return (short)cap_value(critical,10,SHRT_MAX);
+ return (short)cap_value(critical, 10, SHRT_MAX);
}
if (sc->data[SC_CRITICALPERCENT])
@@ -4955,170 +4988,175 @@ signed short status_calc_critical(struct block_list *bl, struct status_change *s
critical += sc->data[SC_FORTUNE]->val2;
if (sc->data[SC_TRUESIGHT])
critical += sc->data[SC_TRUESIGHT]->val2;
- if(sc->data[SC_CLOAKING])
+ if (sc->data[SC_CLOAKING])
critical += critical;
- if(sc->data[SC_STRIKING])
+ if (sc->data[SC_STRIKING])
critical += sc->data[SC_STRIKING]->val1;
#ifdef RENEWAL
if (sc->data[SC_SPEARQUICKEN])
- critical += 3*sc->data[SC_SPEARQUICKEN]->val1*10;
+ critical += 3*sc->data[SC_SPEARQUICKEN]->val1 * 10;
#endif
- if(sc->data[SC__INVISIBILITY])
+ if (sc->data[SC__INVISIBILITY])
critical += sc->data[SC__INVISIBILITY]->val3;
- if(sc->data[SC__UNLUCKY])
+ if (sc->data[SC__UNLUCKY])
critical -= critical * sc->data[SC__UNLUCKY]->val2 / 100;
- if(sc->data[SC_BEYOND_OF_WARCRY])
- critical += 10 * sc->data[SC_BEYOND_OF_WARCRY]->val3;
+ if (sc->data[SC_BEYOND_OF_WARCRY])
+ critical += sc->data[SC_BEYOND_OF_WARCRY]->val3 * 10;
+ if (sc->data[SC_BUCHEDENOEL])
+ critical += sc->data[SC_BUCHEDENOEL]->val4 * 10;
- return (short)cap_value(critical,10,SHRT_MAX);
+ return (short)cap_value(critical, 10, SHRT_MAX);
}
signed short status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable)
{
- if(!sc || !sc->count)
- return cap_value(hit,1,SHRT_MAX);
+ if (!sc || !sc->count)
+ return cap_value(hit, 1, SHRT_MAX);
- if( !viewable ){
+ if (!viewable) {
/* some statuses that are hidden in the status window */
- if(sc->data[SC_MTF_ASPD])
- hit += 5;
- return (short)cap_value(hit,1,SHRT_MAX);
+ if (sc->data[SC_MTF_ASPD])
+ hit += sc->data[SC_MTF_ASPD]->val2;
+ return (short)cap_value(hit, 1, SHRT_MAX);
}
- if(sc->data[SC_INCHIT])
+ if (sc->data[SC_INCHIT])
hit += sc->data[SC_INCHIT]->val1;
- if(sc->data[SC_MTF_HITFLEE])
+ if (sc->data[SC_MTF_HITFLEE])
hit += sc->data[SC_MTF_HITFLEE]->val1;
- if(sc->data[SC_FOOD_BASICHIT])
+ if (sc->data[SC_FOOD_BASICHIT])
hit += sc->data[SC_FOOD_BASICHIT]->val1;
- if(sc->data[SC_TRUESIGHT])
+ if (sc->data[SC_TRUESIGHT])
hit += sc->data[SC_TRUESIGHT]->val3;
- if(sc->data[SC_HUMMING])
+ if (sc->data[SC_HUMMING])
hit += sc->data[SC_HUMMING]->val2;
- if(sc->data[SC_LKCONCENTRATION])
+ if (sc->data[SC_LKCONCENTRATION])
hit += sc->data[SC_LKCONCENTRATION]->val3;
- if(sc->data[SC_INSPIRATION])
+ if (sc->data[SC_INSPIRATION])
hit += 5 * sc->data[SC_INSPIRATION]->val1 + 25;
- if(sc->data[SC_GS_ADJUSTMENT])
+ if (sc->data[SC_GS_ADJUSTMENT])
hit -= 30;
- if(sc->data[SC_GS_ACCURACY])
+ if (sc->data[SC_GS_ACCURACY])
hit += 20; // RockmanEXE; changed based on updated [Reddozen]
- if(sc->data[SC_MER_HIT])
+ if (sc->data[SC_MER_HIT])
hit += sc->data[SC_MER_HIT]->val2;
-
- if(sc->data[SC_INCHITRATE])
+ if (sc->data[SC_INCHITRATE])
hit += hit * sc->data[SC_INCHITRATE]->val1/100;
- if(sc->data[SC_BLIND])
+ if (sc->data[SC_BLIND])
hit -= hit * 25/100;
- if(sc->data[SC_FIRE_EXPANSION_TEAR_GAS])
+ if (sc->data[SC_FIRE_EXPANSION_TEAR_GAS])
hit -= hit * 50 / 100;
- if(sc->data[SC__GROOMY])
+ if (sc->data[SC__GROOMY])
hit -= hit * sc->data[SC__GROOMY]->val3 / 100;
- if(sc->data[SC_FEAR])
+ if (sc->data[SC_FEAR])
hit -= hit * 20 / 100;
if (sc->data[SC_VOLCANIC_ASH])
hit /= 2;
- if(sc->data[SC_ILLUSIONDOPING])
+ if (sc->data[SC_ILLUSIONDOPING])
hit -= hit * (5 + sc->data[SC_ILLUSIONDOPING]->val1) / 100; //custom
if (sc->data[SC_ACARAJE])
hit += sc->data[SC_ACARAJE]->val1;
+ if (sc->data[SC_BUCHEDENOEL])
+ hit += sc->data[SC_BUCHEDENOEL]->val3;
- return (short)cap_value(hit,1,SHRT_MAX);
+ return (short)cap_value(hit, 1, SHRT_MAX);
}
signed short status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) {
- if( bl->type == BL_PC ) {
- if( map_flag_gvg2(bl->m) )
- flee -= flee * battle_config.gvg_flee_penalty/100;
+
+ if (bl->type == BL_PC) {
+ if (map_flag_gvg2(bl->m))
+ flee -= flee * battle_config.gvg_flee_penalty / 100;
else if( map->list[bl->m].flag.battleground )
- flee -= flee * battle_config.bg_flee_penalty/100;
+ flee -= flee * battle_config.bg_flee_penalty / 100;
}
- if(!sc || !sc->count)
- return cap_value(flee,1,SHRT_MAX);
+ if (!sc || !sc->count)
+ return cap_value(flee, 1, SHRT_MAX);
- if( !viewable ){
+ if (!viewable) {
/* some statuses that are hidden in the status window */
- return (short)cap_value(flee,1,SHRT_MAX);
+ return (short)cap_value(flee, 1, SHRT_MAX);
}
- if(sc->data[SC_INCFLEE])
+ if (sc->data[SC_INCFLEE])
flee += sc->data[SC_INCFLEE]->val1;
- if(sc->data[SC_MTF_HITFLEE])
+ if (sc->data[SC_MTF_HITFLEE])
flee += sc->data[SC_MTF_HITFLEE]->val2;
- if(sc->data[SC_FOOD_BASICAVOIDANCE])
+ if (sc->data[SC_FOOD_BASICAVOIDANCE])
flee += sc->data[SC_FOOD_BASICAVOIDANCE]->val1;
- if(sc->data[SC_WHISTLE])
+ if (sc->data[SC_WHISTLE])
flee += sc->data[SC_WHISTLE]->val2;
- if(sc->data[SC_WINDWALK])
+ if (sc->data[SC_WINDWALK])
flee += sc->data[SC_WINDWALK]->val2;
- if(sc->data[SC_VIOLENTGALE])
+ if (sc->data[SC_VIOLENTGALE])
flee += sc->data[SC_VIOLENTGALE]->val2;
- if(sc->data[SC_MOON_COMFORT]) //SG skill [Komurka]
+ if (sc->data[SC_MOON_COMFORT]) // SG skill [Komurka]
flee += sc->data[SC_MOON_COMFORT]->val2;
- if(sc->data[SC_RG_CCONFINE_M])
+ if (sc->data[SC_RG_CCONFINE_M])
flee += 10;
if (sc->data[SC_ANGRIFFS_MODUS])
flee -= sc->data[SC_ANGRIFFS_MODUS]->val3;
- if(sc->data[SC_GS_ADJUSTMENT])
+ if (sc->data[SC_GS_ADJUSTMENT])
flee += 30;
- if(sc->data[SC_HLIF_SPEED])
+ if (sc->data[SC_HLIF_SPEED])
flee += 10 + sc->data[SC_HLIF_SPEED]->val1 * 10;
- if(sc->data[SC_GS_GATLINGFEVER])
+ if (sc->data[SC_GS_GATLINGFEVER])
flee -= sc->data[SC_GS_GATLINGFEVER]->val4;
- if(sc->data[SC_PARTYFLEE])
+ if (sc->data[SC_PARTYFLEE])
flee += sc->data[SC_PARTYFLEE]->val1 * 10;
- if(sc->data[SC_MER_FLEE])
+ if (sc->data[SC_MER_FLEE])
flee += sc->data[SC_MER_FLEE]->val2;
- if( sc->data[SC_HALLUCINATIONWALK] )
+ if (sc->data[SC_HALLUCINATIONWALK])
flee += sc->data[SC_HALLUCINATIONWALK]->val2;
- if( sc->data[SC_WATER_BARRIER] )
+ if (sc->data[SC_WATER_BARRIER])
flee -= sc->data[SC_WATER_BARRIER]->val3;
#ifdef RENEWAL
- if( sc->data[SC_SPEARQUICKEN] )
- flee += 2 * sc->data[SC_SPEARQUICKEN]->val1;
+ if (sc->data[SC_SPEARQUICKEN])
+ flee += sc->data[SC_SPEARQUICKEN]->val1 * 2;
#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_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])
- flee -= flee * 50/100;
- if(sc->data[SC_BLIND])
- flee -= flee * 25/100;
- if(sc->data[SC_FEAR])
+ 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])
+ if (sc->data[SC_PARALYSE])
flee -= flee / 10; // 10% Flee reduction
- if(sc->data[SC_INFRAREDSCAN])
+ if (sc->data[SC_INFRAREDSCAN])
flee -= flee * 30 / 100;
- if( sc->data[SC__LAZINESS] )
+ if (sc->data[SC__LAZINESS])
flee -= flee * sc->data[SC__LAZINESS]->val3 / 100;
- if( sc->data[SC_GLOOMYDAY] )
+ if (sc->data[SC_GLOOMYDAY])
flee -= flee * ( 20 + 5 * sc->data[SC_GLOOMYDAY]->val1 ) / 100;
- if( sc->data[SC_SATURDAY_NIGHT_FEVER] )
+ if (sc->data[SC_SATURDAY_NIGHT_FEVER])
flee -= flee * (40 + 10 * sc->data[SC_SATURDAY_NIGHT_FEVER]->val1) / 100;
- if ( sc->data[SC_FIRE_EXPANSION_SMOKE_POWDER] )
+ if (sc->data[SC_FIRE_EXPANSION_SMOKE_POWDER])
flee += flee * 20 / 100;
- if ( sc->data[SC_FIRE_EXPANSION_TEAR_GAS] )
+ if (sc->data[SC_FIRE_EXPANSION_TEAR_GAS])
flee -= flee * 50 / 100;
- if( sc->data[SC_WIND_STEP_OPTION] )
+ if (sc->data[SC_WIND_STEP_OPTION])
flee += flee * sc->data[SC_WIND_STEP_OPTION]->val2 / 100;
- if( sc->data[SC_ZEPHYR] )
+ if (sc->data[SC_ZEPHYR])
flee += sc->data[SC_ZEPHYR]->val2;
- if(sc->data[SC_VOLCANIC_ASH] && (bl->type==BL_MOB)){ //mob
- if(status_get_element(bl) == ELE_WATER) //water type
+ if (sc->data[SC_VOLCANIC_ASH] && (bl->type == BL_MOB)) { // mob
+ if(status_get_element(bl) == ELE_WATER) // water type
flee /= 2;
}
- if( sc->data[SC_OVERED_BOOST] ) // should be final and unmodifiable by any means
+ if (sc->data[SC_OVERED_BOOST]) // should be final and unmodifiable by any means
flee = sc->data[SC_OVERED_BOOST]->val2;
if (sc->data[SC_ARMORSCROLL])
flee += sc->data[SC_ARMORSCROLL]->val2;
+ if (sc->data[SC_MYSTICPOWDER])
+ flee += sc->data[SC_MYSTICPOWDER]->val2;
- return (short)cap_value(flee,1,SHRT_MAX);
+ return (short)cap_value(flee, 1, SHRT_MAX);
}
signed short status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable)
@@ -5527,6 +5565,11 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
if( sc->data[SC_MARSHOFABYSS] ) // It stacks to other statuses so always put this at the end.
val = max( 50, val + 10 * sc->data[SC_MARSHOFABYSS]->val1 );
+ if (sc->data[SC_MOVHASTE_POTION]) { // Doesn't affect the movement speed by Quagmire, Decrease Agi, Slow Grace [Frost]
+ if (sc->data[SC_DEC_AGI] || sc->data[SC_QUAGMIRE] || sc->data[SC_DONTFORGETME])
+ return 0;
+ }
+
if( sd && sd->bonus.speed_rate + sd->bonus.speed_add_rate > 0 ) // permanent item-based speedup
val = max( val, sd->bonus.speed_rate + sd->bonus.speed_add_rate );
}
@@ -5749,7 +5792,7 @@ short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int
if (sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2)
aspd -= (bl->type==BL_PC?pc->checkskill((TBL_PC *)bl, RK_RUNEMASTERY):10) / 10 * 40;
if (sc->data[SC_MTF_ASPD])
- aspd -= 10;
+ aspd -= sc->data[SC_MTF_ASPD]->val1;
if (sc->data[SC_OVERED_BOOST]) // should be final and unmodifiable by any means
aspd = (200 - sc->data[SC_OVERED_BOOST]->val3) * 10;
@@ -5918,68 +5961,70 @@ unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *
return (unsigned short)cap_value(dmotion,0,USHRT_MAX);
}
-unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, uint64 maxhp)
-{
- if(!sc || !sc->count)
- return (unsigned int)cap_value(maxhp,1,UINT_MAX);
+unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, uint64 maxhp) {
- if(sc->data[SC_INCMHPRATE])
- maxhp += maxhp * sc->data[SC_INCMHPRATE]->val1/100;
- if(sc->data[SC_INCMHP])
+ if (!sc || !sc->count)
+ return (unsigned int)cap_value(maxhp, 1, UINT_MAX);
+
+ if (sc->data[SC_INCMHPRATE])
+ maxhp += maxhp * sc->data[SC_INCMHPRATE]->val1 / 100;
+ if (sc->data[SC_INCMHP])
maxhp += (sc->data[SC_INCMHP]->val1);
- if(sc->data[SC_MTF_MHP])
+ if (sc->data[SC_MTF_MHP])
maxhp += (sc->data[SC_MTF_MHP]->val1);
- if(sc->data[SC_APPLEIDUN])
- maxhp += maxhp * sc->data[SC_APPLEIDUN]->val2/100;
- if(sc->data[SC_DELUGE])
- maxhp += maxhp * sc->data[SC_DELUGE]->val2/100;
- if(sc->data[SC_BERSERK])
+ if (sc->data[SC_APPLEIDUN])
+ maxhp += maxhp * sc->data[SC_APPLEIDUN]->val2 / 100;
+ if (sc->data[SC_DELUGE])
+ maxhp += maxhp * sc->data[SC_DELUGE]->val2 / 100;
+ if (sc->data[SC_BERSERK])
maxhp += maxhp * 2;
- if(sc->data[SC_MARIONETTE_MASTER])
+ if (sc->data[SC_MARIONETTE_MASTER])
maxhp -= 1000;
- if(sc->data[SC_SOLID_SKIN_OPTION])
- maxhp += 2000;// Fix amount.
- if(sc->data[SC_POWER_OF_GAIA])
+ 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)
+ if (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
maxhp += 500;
- if(sc->data[SC_MER_HP])
- maxhp += maxhp * sc->data[SC_MER_HP]->val2/100;
- if(sc->data[SC_EPICLESIS])
+ if (sc->data[SC_MER_HP])
+ maxhp += maxhp * sc->data[SC_MER_HP]->val2 / 100;
+ if (sc->data[SC_EPICLESIS])
maxhp += maxhp * 5 * sc->data[SC_EPICLESIS]->val1 / 100;
- if(sc->data[SC_VENOMBLEED])
+ if (sc->data[SC_VENOMBLEED])
maxhp -= maxhp * 15 / 100;
- if(sc->data[SC__WEAKNESS])
+ if (sc->data[SC__WEAKNESS])
maxhp -= maxhp * sc->data[SC__WEAKNESS]->val2 / 100;
- if(sc->data[SC_LERADS_DEW])
+ if (sc->data[SC_LERADS_DEW])
maxhp += sc->data[SC_LERADS_DEW]->val3;
- if(sc->data[SC_BEYOND_OF_WARCRY])
+ if (sc->data[SC_BEYOND_OF_WARCRY])
maxhp -= maxhp * sc->data[SC_BEYOND_OF_WARCRY]->val4 / 100;
- if(sc->data[SC_FORCEOFVANGUARD])
+ if (sc->data[SC_FORCEOFVANGUARD])
maxhp += maxhp * 3 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100;
- if(sc->data[SC_INSPIRATION])
+ if (sc->data[SC_INSPIRATION])
maxhp += maxhp * 5 * sc->data[SC_INSPIRATION]->val1 / 100 + 600 * sc->data[SC_INSPIRATION]->val1;
- if(sc->data[SC_RAISINGDRAGON])
+ if (sc->data[SC_RAISINGDRAGON])
maxhp += maxhp * (2 + sc->data[SC_RAISINGDRAGON]->val1) / 100;
- if(sc->data[SC_GENTLETOUCH_CHANGE]) // Max HP decrease: [Skill Level x 4] %
+ if (sc->data[SC_GENTLETOUCH_CHANGE]) // Max HP decrease: [Skill Level x 4] %
maxhp -= maxhp * (4 * sc->data[SC_GENTLETOUCH_CHANGE]->val1) / 100;
- if(sc->data[SC_GENTLETOUCH_REVITALIZE])// Max HP increase: [Skill Level x 2] %
+ if (sc->data[SC_GENTLETOUCH_REVITALIZE])// Max HP increase: [Skill Level x 2] %
maxhp += maxhp * (2 * sc->data[SC_GENTLETOUCH_REVITALIZE]->val1) / 100;
- if(sc->data[SC_MUSTLE_M])
- maxhp += maxhp * sc->data[SC_MUSTLE_M]->val1/100;
- if(sc->data[SC_MYSTERIOUS_POWDER])
- maxhp -= sc->data[SC_MYSTERIOUS_POWDER]->val1 / 100;
- if(sc->data[SC_PETROLOGY_OPTION])
+ if (sc->data[SC_MUSTLE_M])
+ maxhp += maxhp * sc->data[SC_MUSTLE_M]->val1 / 100;
+ if (sc->data[SC_PROMOTE_HEALTH_RESERCH])
+ maxhp += sc->data[SC_PROMOTE_HEALTH_RESERCH]->val3;
+ if (sc->data[SC_MYSTERIOUS_POWDER])
+ maxhp -= maxhp * sc->data[SC_MYSTERIOUS_POWDER]->val1 / 100;
+ if (sc->data[SC_PETROLOGY_OPTION])
maxhp += maxhp * sc->data[SC_PETROLOGY_OPTION]->val2 / 100;
- if(sc->data[SC_CURSED_SOIL_OPTION])
+ if (sc->data[SC_CURSED_SOIL_OPTION])
maxhp += maxhp * sc->data[SC_CURSED_SOIL_OPTION]->val2 / 100;
- if(sc->data[SC_UPHEAVAL_OPTION])
+ if (sc->data[SC_UPHEAVAL_OPTION])
maxhp += maxhp * sc->data[SC_UPHEAVAL_OPTION]->val3 / 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;
- if(sc->data[SC_FRIGG_SONG])
+ if (sc->data[SC_FRIGG_SONG])
maxhp += maxhp * sc->data[SC_FRIGG_SONG]->val2 / 100;
if (sc->data[SC_SOULSCROLL])
maxhp += maxhp * sc->data[SC_SOULSCROLL]->val1 / 100;
@@ -5992,32 +6037,34 @@ unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc,
if (sc->data[SC_GM_BATTLE2])
maxhp -= maxhp * sc->data[SC_GM_BATTLE2]->val1 / 100;
- return (unsigned int)cap_value(maxhp,1,UINT_MAX);
+ return (unsigned int)cap_value(maxhp, 1, UINT_MAX);
}
-unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc, unsigned int maxsp)
-{
- if(!sc || !sc->count)
- return cap_value(maxsp,1,UINT_MAX);
+unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc, unsigned int maxsp) {
+
+ if (!sc || !sc->count)
+ return cap_value(maxsp, 1, UINT_MAX);
- if(sc->data[SC_INCMSPRATE])
- maxsp += maxsp * sc->data[SC_INCMSPRATE]->val1/100;
- if(sc->data[SC_INCMSP])
+ if (sc->data[SC_INCMSPRATE])
+ maxsp += maxsp * sc->data[SC_INCMSPRATE]->val1 / 100;
+ if (sc->data[SC_INCMSP])
maxsp += (sc->data[SC_INCMSP]->val1);
- if(sc->data[SC_MTF_MSP])
+ if (sc->data[SC_MTF_MSP])
maxsp += (sc->data[SC_MTF_MSP]->val1);
- if(sc->data[SC_SERVICEFORYOU])
- maxsp += maxsp * sc->data[SC_SERVICEFORYOU]->val2/100;
- if(sc->data[SC_MER_SP])
- maxsp += maxsp * sc->data[SC_MER_SP]->val2/100;
- if(sc->data[SC_RAISINGDRAGON])
+ if (sc->data[SC_SERVICEFORYOU])
+ maxsp += maxsp * sc->data[SC_SERVICEFORYOU]->val2 / 100;
+ if (sc->data[SC_MER_SP])
+ maxsp += maxsp * sc->data[SC_MER_SP]->val2 / 100;
+ if (sc->data[SC_RAISINGDRAGON])
maxsp += maxsp * (2 + sc->data[SC_RAISINGDRAGON]->val1) / 100;
- if(sc->data[SC_LIFE_FORCE_F])
- maxsp += maxsp * sc->data[SC_LIFE_FORCE_F]->val1/100;
- if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
+ if (sc->data[SC_LIFE_FORCE_F])
+ maxsp += maxsp * sc->data[SC_LIFE_FORCE_F]->val1 / 100;
+ if (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
maxsp += 50;
if (sc->data[SC_VITATA_500])
maxsp += maxsp * sc->data[SC_VITATA_500]->val2 / 100;
+ if (sc->data[SC_ENERGY_DRINK_RESERCH])
+ maxsp += maxsp * sc->data[SC_ENERGY_DRINK_RESERCH]->val3 / 100;
if (sc->data[SC_TARGET_ASPD])
maxsp += maxsp * sc->data[SC_TARGET_ASPD]->val1 / 100;
if (sc->data[SC_SOULSCROLL])
@@ -6029,7 +6076,7 @@ unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc,
if (sc->data[SC_GM_BATTLE2])
maxsp -= maxsp * sc->data[SC_GM_BATTLE2]->val1 / 100;
- return cap_value(maxsp,1,UINT_MAX);
+ return cap_value(maxsp, 1, UINT_MAX);
}
unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element)
@@ -7023,23 +7070,23 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
sc = status->get_sc(bl);
st = status->get_status_data(bl);
- if( type <= SC_NONE || type >= SC_MAX ) {
+ if (type <= SC_NONE || type >= SC_MAX) {
ShowError("status_change_start: invalid status change (%d)!\n", type);
return 0;
}
- if( !sc )
+ if (!sc)
return 0; //Unable to receive status changes
- if( status->isdead(bl) && type != SC_NOCHAT ) // SC_NOCHAT should work even on dead characters
+ if (status->isdead(bl) && type != SC_NOCHAT) // SC_NOCHAT should work even on dead characters
return 0;
- if( bl->type == BL_MOB) {
- struct mob_data *md = BL_CAST(BL_MOB,bl);
- if(md && (md->class_ == MOBID_EMPERIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA)
+ if (bl->type == BL_MOB) {
+ struct mob_data *md = BL_CAST(BL_MOB, bl);
+ if (md && (md->class_ == MOBID_EMPERIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA)
return 0; //Emperium/BG Monsters can't be afflicted by status changes
#if 0
- if(md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP)
+ if (md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP)
return 0; //prevent status addinh hp to gvg mob (like bloodylust=hp*3 etc...
#endif // 0
}
@@ -7195,12 +7242,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (sc->data[SC_QUAGMIRE] || sc->data[SC_DEC_AGI])
return 0;
break;
- case SC_QUAGMIRE:
- case SC_DEC_AGI:
- case SC_DONTFORGETME:
- if (sc->data[SC_MOVHASTE_POTION]) // Doesn't affect by Quagmire, Decrease Agi, Slow Grace [Frost]
- return 0;
- break;
case SC_MAGNIFICAT:
if (sc->data[SC_OFFERTORIUM] || sc->option&OPTION_MADOGEAR) // Mado is immune to magnificat
return 0;
@@ -7718,6 +7759,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_S_LIFEPOTION:
case SC_L_LIFEPOTION:
+ case SC_M_LIFEPOTION:
+ case SC_G_LIFEPOTION:
case SC_CASH_BOSS_ALARM:
case SC_STUN:
case SC_SLEEP:
@@ -8102,12 +8145,14 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_S_LIFEPOTION:
case SC_L_LIFEPOTION:
- if( val1 == 0 ) return 0;
+ case SC_M_LIFEPOTION:
+ case SC_G_LIFEPOTION:
+ if (val1 == 0) return 0;
// val1 = heal percent/amout
// val2 = seconds between heals
// val4 = total of heals
- if( val2 < 1 ) val2 = 1;
- if( (val4 = tick/(val2 * 1000)) < 1 )
+ if (val2 < 1) val2 = 1;
+ if ((val4 = tick / (val2 * 1000)) < 1)
val4 = 1;
tick_time = val2 * 1000; // [GodLesZ] tick time
break;
@@ -9226,6 +9271,35 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
tick_time = 10000;
sc_start(src, bl, SC_ENDURE, 100, 10, tick); // Endure effect
break;
+ case SC_MAGIC_CANDY: // [Frost]
+ val3 = 90; // SP Consume.
+ val4 = tick / 10000;
+ tick_time = 10000;
+ break;
+ case SC_PROMOTE_HEALTH_RESERCH:
+ // Val1: 1 = Regular Potion, 2 = Thrown Potion
+ // Val2: 1 = Small Potion, 2 = Medium Potion, 3 = Large Potion
+ // Val3: MaxHP Increase By Fixed Amount
+ // Val4: HP Heal Percentage
+ if (val1 == 1) // If potion was normally used, take the user's BaseLv.
+ val3 = 1000 * val2 - 500 + status->get_lv(bl) * 10 / 3;
+ else if (val1 == 2) // If potion was thrown at someone, take the thrower's BaseLv.
+ val3 = 1000 * val2 - 500 + status->get_lv(src) * 10 / 3;
+ if (val3 <= 0) // Prevents a negeative value from happening.
+ val3 = 0;
+ break;
+ case SC_ENERGY_DRINK_RESERCH:
+ // Val1: 1 = Regular Potion, 2 = Thrown Potion
+ // Val2: 1 = Small Potion, 2 = Medium Potion, 3 = Large Potion
+ // Val3: MaxSP Increase By Fixed Amount
+ // Val4: SP Heal Percentage
+ if (val1 == 1) // If potion was normally used, take the user's BaseLv.
+ val3 = status->get_lv(bl) / 10 + 5 * val2 - 10;
+ else if (val1 == 2) // If potion was thrown at someone, take the thrower's BaseLv.
+ val3 = status->get_lv(src) / 10 + 5 * val2 - 10;
+ if (val3 <= 0) // Prevents a negeative value from happening.
+ val3 = 0;
+ break;
case SC_KYOUGAKU: {
int min = val1*2;
int max = val1*3;
@@ -9850,6 +9924,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_MER_SP:
status_percent_heal(bl, 0, 100); // Recover Full SP
break;
+ case SC_PROMOTE_HEALTH_RESERCH:
+ status_percent_heal(bl, sce->val4, 0);
+ break;
+ case SC_ENERGY_DRINK_RESERCH:
+ status_percent_heal(bl, 0, sce->val4);
+ break;
/**
* Ranger
**/
@@ -10914,10 +10994,12 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
case SC_S_LIFEPOTION:
case SC_L_LIFEPOTION:
- if( sd && --(sce->val4) >= 0 ) {
+ case SC_M_LIFEPOTION:
+ case SC_G_LIFEPOTION:
+ if (sd && --(sce->val4) >= 0) {
// val1 < 0 = per max% | val1 > 0 = exact amount
int hp = 0;
- if( st->hp < st->max_hp )
+ if (st->hp < st->max_hp)
hp = (sce->val1 < 0) ? (int)(sd->status.max_hp * -1 * sce->val1 / 100.) : sce->val1 ;
status->heal(bl, hp, 0, 2);
sc_timer_next((sce->val2 * 1000) + tick, status->change_timer, bl->id, data);
@@ -11530,6 +11612,12 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
sc_timer_next(10000 + tick, status->change_timer, bl->id, data);
}
break;
+ case SC_MAGIC_CANDY:
+ if (--(sce->val4) > 0) {
+ status->charge(bl, 0, sce->val3); // Reduce 90 SP every 10 seconds.
+ sc_timer_next(10000 + tick, status->change_timer, bl->id, data);
+ }
+ break;
case SC_LEADERSHIP:
case SC_GLORYWOUNDS:
case SC_SOULCOLD: