From 912578159c8ccca9545e3c7dce9f7ce2b92bee2e Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Tue, 17 Nov 2015 22:09:25 +0800 Subject: Item DB Updates: - Update Geffen Scrolls to its official behavior and effect. - Added Official item effect of Mental Potion. - Fixed Chinese Pestel item effect. - Fixed Vitata500 not giving 5% sp. - Added 'Costume: Time Accessory'. --- src/map/skill.c | 38 +-- src/map/status.c | 862 ++++++++++++++++++++++++++++++------------------------- src/map/status.h | 617 ++++++++++++++++++++------------------- 3 files changed, 802 insertions(+), 715 deletions(-) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index cdf1c031f..827f8db8a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -14316,15 +14316,17 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 req.sp = cap_value(req.sp * sp_skill_rate_bonus / 100, 0, SHRT_MAX); - if( sc ) { - if( sc->data[SC__LAZINESS] ) + if (sc) { + if (sc->data[SC__LAZINESS]) req.sp += req.sp + sc->data[SC__LAZINESS]->val1 * 10; - if( sc->data[SC_UNLIMITED_HUMMING_VOICE] ) + if (sc->data[SC_UNLIMITED_HUMMING_VOICE]) req.sp += req.sp * sc->data[SC_UNLIMITED_HUMMING_VOICE]->val3 / 100; - if( sc->data[SC_RECOGNIZEDSPELL] ) + if (sc->data[SC_RECOGNIZEDSPELL]) req.sp += req.sp / 4; - if( sc->data[SC_TELEKINESIS_INTENSE] && skill->get_ele(skill_id, skill_lv) == ELE_GHOST) + if (sc->data[SC_TELEKINESIS_INTENSE] && skill->get_ele(skill_id, skill_lv) == ELE_GHOST) req.sp -= req.sp * sc->data[SC_TELEKINESIS_INTENSE]->val2 / 100; + if (sc->data[SC_TARGET_ASPD]) + req.sp -= req.sp * sc->data[SC_TARGET_ASPD]->val1 / 100; } req.zeny = skill->dbs->db[idx].zeny[skill_lv-1]; @@ -14740,29 +14742,31 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 } } // Fixed cast reduction bonuses - if( sc->data[SC__LAZINESS] ) + if (sc->data[SC__LAZINESS]) fixcast_r = max(fixcast_r, sc->data[SC__LAZINESS]->val2); - if( sc->data[SC_DANCE_WITH_WUG]) + if (sc->data[SC_DANCE_WITH_WUG]) fixcast_r = max(fixcast_r, sc->data[SC_DANCE_WITH_WUG]->val4); - if( sc->data[SC_SECRAMENT] ) + if (sc->data[SC_SECRAMENT]) fixcast_r = max(fixcast_r, sc->data[SC_SECRAMENT]->val2); if (sd && skill_id >= WL_WHITEIMPRISON && skill_id < WL_FREEZE_SP) { int radius_lv = pc->checkskill(sd, WL_RADIUS); if (radius_lv) fixcast_r = max(fixcast_r, (status_get_int(bl) + status->get_lv(bl)) / 15 + radius_lv * 5); // [{(Caster?s INT / 15) + (Caster?s Base Level / 15) + (Radius Skill Level x 5)}] % } + if (sc->data[SC_MYSTICSCROLL]) + VARCAST_REDUCTION(sc->data[SC_MYSTICSCROLL]->val1); // Fixed cast non percentage bonuses - if( sc->data[SC_MANDRAGORA] ) + if (sc->data[SC_MANDRAGORA]) fixed += sc->data[SC_MANDRAGORA]->val1 * 500; - if( sc->data[SC_IZAYOI] ) + if (sc->data[SC_IZAYOI]) fixed = 0; - if( sc->data[SC_GUST_OPTION] || sc->data[SC_BLAST_OPTION] || sc->data[SC_WILD_STORM_OPTION] ) + if (sc->data[SC_GUST_OPTION] || sc->data[SC_BLAST_OPTION] || sc->data[SC_WILD_STORM_OPTION]) fixed -= 1000; } - if( sd && !(skill->get_castnodex(skill_id, skill_lv)&4) ){ + if (sd && !(skill->get_castnodex(skill_id, skill_lv)&4)) { VARCAST_REDUCTION( max(sd->bonus.varcastrate, 0) + max(i, 0) ); - fixcast_r = max(fixcast_r, sd->bonus.fixcastrate) + min(sd->bonus.fixcastrate,0); + fixcast_r = max(fixcast_r, sd->bonus.fixcastrate) + min(sd->bonus.fixcastrate, 0); for( i = 0; i < ARRAYLENGTH(sd->skillcast) && sd->skillcast[i].id; i++ ) if( sd->skillcast[i].id == skill_id ){ // bonus2 bVariableCastrate if( (i=sd->skillcast[i].val) > 0) @@ -14771,12 +14775,12 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 } } - if( varcast_r < 0 ) // now compute overall factors + if (varcast_r < 0 ) // now compute overall factors time = time * (1 - (float)varcast_r / 100); - if( !(skill->get_castnodex(skill_id, skill_lv)&1) )// reduction from status point - time = (1 - sqrt( ((float)(status_get_dex(bl)*2 + status_get_int(bl)) / battle_config.vcast_stat_scale) )) * time; + if (!(skill->get_castnodex(skill_id, skill_lv)&1)) // reduction from status point + time = (1 - sqrt( ((float)(status_get_dex(bl) * 2 + status_get_int(bl)) / battle_config.vcast_stat_scale) )) * time; // underflow checking/capping - time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed,0); + time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed, 0); #endif return (int)time; } diff --git a/src/map/status.c b/src/map/status.c index 1a07f74dc..0eb75aed7 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -759,22 +759,22 @@ void initChangeTables(void) { // Storing the target job rather than simply SC_SOULLINK simplifies code later on. status->dbs->Skill2SCTable[SL_ALCHEMIST] = (sc_type)MAPID_ALCHEMIST, - status->dbs->Skill2SCTable[SL_MONK] = (sc_type)MAPID_MONK, - status->dbs->Skill2SCTable[SL_STAR] = (sc_type)MAPID_STAR_GLADIATOR, - status->dbs->Skill2SCTable[SL_SAGE] = (sc_type)MAPID_SAGE, - status->dbs->Skill2SCTable[SL_CRUSADER] = (sc_type)MAPID_CRUSADER, - status->dbs->Skill2SCTable[SL_SUPERNOVICE] = (sc_type)MAPID_SUPER_NOVICE, - status->dbs->Skill2SCTable[SL_KNIGHT] = (sc_type)MAPID_KNIGHT, - status->dbs->Skill2SCTable[SL_WIZARD] = (sc_type)MAPID_WIZARD, - status->dbs->Skill2SCTable[SL_PRIEST] = (sc_type)MAPID_PRIEST, - status->dbs->Skill2SCTable[SL_BARDDANCER] = (sc_type)MAPID_BARDDANCER, - status->dbs->Skill2SCTable[SL_ROGUE] = (sc_type)MAPID_ROGUE, - status->dbs->Skill2SCTable[SL_ASSASIN] = (sc_type)MAPID_ASSASSIN, - status->dbs->Skill2SCTable[SL_BLACKSMITH] = (sc_type)MAPID_BLACKSMITH, - status->dbs->Skill2SCTable[SL_HUNTER] = (sc_type)MAPID_HUNTER, - status->dbs->Skill2SCTable[SL_SOULLINKER] = (sc_type)MAPID_SOUL_LINKER, - - //Status that don't have a skill associated. + status->dbs->Skill2SCTable[SL_MONK] = (sc_type)MAPID_MONK, + status->dbs->Skill2SCTable[SL_STAR] = (sc_type)MAPID_STAR_GLADIATOR, + status->dbs->Skill2SCTable[SL_SAGE] = (sc_type)MAPID_SAGE, + status->dbs->Skill2SCTable[SL_CRUSADER] = (sc_type)MAPID_CRUSADER, + status->dbs->Skill2SCTable[SL_SUPERNOVICE] = (sc_type)MAPID_SUPER_NOVICE, + status->dbs->Skill2SCTable[SL_KNIGHT] = (sc_type)MAPID_KNIGHT, + status->dbs->Skill2SCTable[SL_WIZARD] = (sc_type)MAPID_WIZARD, + status->dbs->Skill2SCTable[SL_PRIEST] = (sc_type)MAPID_PRIEST, + status->dbs->Skill2SCTable[SL_BARDDANCER] = (sc_type)MAPID_BARDDANCER, + status->dbs->Skill2SCTable[SL_ROGUE] = (sc_type)MAPID_ROGUE, + status->dbs->Skill2SCTable[SL_ASSASIN] = (sc_type)MAPID_ASSASSIN, + status->dbs->Skill2SCTable[SL_BLACKSMITH] = (sc_type)MAPID_BLACKSMITH, + status->dbs->Skill2SCTable[SL_HUNTER] = (sc_type)MAPID_HUNTER, + status->dbs->Skill2SCTable[SL_SOULLINKER] = (sc_type)MAPID_SOUL_LINKER, + + // Status that don't have a skill associated. status->dbs->IconChangeTable[SC_WEIGHTOVER50] = SI_WEIGHTOVER50; status->dbs->IconChangeTable[SC_WEIGHTOVER90] = SI_WEIGHTOVER90; status->dbs->IconChangeTable[SC_ATTHASTE_POTION1] = SI_ATTHASTE_POTION1; @@ -802,7 +802,8 @@ void initChangeTables(void) { status->dbs->IconChangeTable[SC_SPL_MATK] = SI_SPL_MATK; status->dbs->IconChangeTable[SC_PLUSATTACKPOWER] = SI_PLUSATTACKPOWER; status->dbs->IconChangeTable[SC_PLUSMAGICPOWER] = SI_PLUSMAGICPOWER; - //Cash Items + + // Cash Items status->dbs->IconChangeTable[SC_FOOD_STR_CASH] = SI_FOOD_STR_CASH; status->dbs->IconChangeTable[SC_FOOD_AGI_CASH] = SI_FOOD_AGI_CASH; status->dbs->IconChangeTable[SC_FOOD_VIT_CASH] = SI_FOOD_VIT_CASH; @@ -823,18 +824,22 @@ void initChangeTables(void) { status->dbs->IconChangeTable[SC_L_LIFEPOTION] = SI_L_LIFEPOTION; status->dbs->IconChangeTable[SC_ATKER_BLOOD] = SI_ATKER_BLOOD; status->dbs->IconChangeTable[SC_TARGET_BLOOD] = SI_TARGET_BLOOD; + status->dbs->IconChangeTable[SC_TARGET_ASPD] = SI_TARGET_ASPD; + // Mercenary Bonus Effects status->dbs->IconChangeTable[SC_MER_FLEE] = SI_MER_FLEE; status->dbs->IconChangeTable[SC_MER_ATK] = SI_MER_ATK; status->dbs->IconChangeTable[SC_MER_HP] = SI_MER_HP; status->dbs->IconChangeTable[SC_MER_SP] = SI_MER_SP; status->dbs->IconChangeTable[SC_MER_HIT] = SI_MER_HIT; + // Warlock Spheres status->dbs->IconChangeTable[SC_SUMMON1] = SI_SPHERE_1; status->dbs->IconChangeTable[SC_SUMMON2] = SI_SPHERE_2; status->dbs->IconChangeTable[SC_SUMMON3] = SI_SPHERE_3; status->dbs->IconChangeTable[SC_SUMMON4] = SI_SPHERE_4; status->dbs->IconChangeTable[SC_SUMMON5] = SI_SPHERE_5; + // Warlock Preserved spells status->dbs->IconChangeTable[SC_SPELLBOOK1] = SI_SPELLBOOK1; status->dbs->IconChangeTable[SC_SPELLBOOK2] = SI_SPELLBOOK2; @@ -872,7 +877,7 @@ void initChangeTables(void) { 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 New Food 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; @@ -920,8 +925,9 @@ void initChangeTables(void) { status->dbs->IconChangeTable[SC_DECORATION_OF_MUSIC] = SI_DECORATION_OF_MUSIC; status->dbs->IconChangeTable[SC_LJOSALFAR] = SI_LJOSALFAR; status->dbs->IconChangeTable[SC_MERMAID_LONGING] = SI_MERMAID_LONGING; + status->dbs->IconChangeTable[SC_TIME_ACCESSORY] = SI_TIME_ACCESSORY; - //Other SC which are not necessarily associated to skills. + // Other SC which are not necessarily associated to skills. status->dbs->ChangeFlagTable[SC_ATTHASTE_POTION1] = SCB_ASPD; status->dbs->ChangeFlagTable[SC_ATTHASTE_POTION2] = SCB_ASPD; status->dbs->ChangeFlagTable[SC_ATTHASTE_POTION3] = SCB_ASPD; @@ -930,7 +936,7 @@ void initChangeTables(void) { status->dbs->ChangeFlagTable[SC_MOVHASTE_INFINITY] = SCB_SPEED; status->dbs->ChangeFlagTable[SC_PLUSATTACKPOWER] = SCB_BATK; status->dbs->ChangeFlagTable[SC_PLUSMAGICPOWER] = SCB_MATK; - status->dbs->ChangeFlagTable[SC_INCALLSTATUS] |= SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK; + status->dbs->ChangeFlagTable[SC_INCALLSTATUS] |= SCB_STR | SCB_AGI | SCB_VIT | SCB_INT | SCB_DEX | SCB_LUK; status->dbs->ChangeFlagTable[SC_CHASEWALK2] |= SCB_STR; status->dbs->ChangeFlagTable[SC_INCAGI] |= SCB_AGI; status->dbs->ChangeFlagTable[SC_INCVIT] |= SCB_VIT; @@ -941,7 +947,7 @@ 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_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; @@ -951,7 +957,7 @@ void initChangeTables(void) { 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_INCATKRATE] |= SCB_BATK | SCB_WATK; status->dbs->ChangeFlagTable[SC_INCMATKRATE] |= SCB_MATK; status->dbs->ChangeFlagTable[SC_INCDEFRATE] |= SCB_DEF; status->dbs->ChangeFlagTable[SC_FOOD_STR] |= SCB_STR; @@ -970,6 +976,20 @@ void initChangeTables(void) { status->dbs->ChangeFlagTable[SC_ATKER_BLOOD] |= SCB_ALL; status->dbs->ChangeFlagTable[SC_WALKSPEED] |= SCB_SPEED; status->dbs->ChangeFlagTable[SC_ITEMSCRIPT] |= SCB_ALL; + + // Geffen Scrolls + status->dbs->ChangeFlagTable[SC_SKELSCROLL] |= SCB_ALL; + status->dbs->ChangeFlagTable[SC_DISTRUCTIONSCROLL] |= SCB_ALL; + status->dbs->ChangeFlagTable[SC_ROYALSCROLL] |= SCB_ALL; + status->dbs->ChangeFlagTable[SC_IMMUNITYSCROLL] |= SCB_ALL; + status->dbs->ChangeFlagTable[SC_MYSTICSCROLL] |= SCB_MATK; + status->dbs->ChangeFlagTable[SC_BATTLESCROLL] |= SCB_BATK | SCB_ASPD; + status->dbs->ChangeFlagTable[SC_ARMORSCROLL] |= SCB_DEF | SCB_FLEE; + status->dbs->ChangeFlagTable[SC_FREYJASCROLL] |= SCB_MDEF | SCB_FLEE2; + status->dbs->ChangeFlagTable[SC_SOULSCROLL] |= SCB_MAXHP | SCB_MAXSP; + + status->dbs->ChangeFlagTable[SC_TARGET_ASPD] |= SCB_MAXSP; + // Cash Items status->dbs->ChangeFlagTable[SC_FOOD_STR_CASH] = SCB_STR; status->dbs->ChangeFlagTable[SC_FOOD_AGI_CASH] = SCB_AGI; @@ -977,23 +997,27 @@ void initChangeTables(void) { status->dbs->ChangeFlagTable[SC_FOOD_DEX_CASH] = SCB_DEX; status->dbs->ChangeFlagTable[SC_FOOD_INT_CASH] = SCB_INT; status->dbs->ChangeFlagTable[SC_FOOD_LUK_CASH] = SCB_LUK; + // Mercenary Bonus Effects status->dbs->ChangeFlagTable[SC_MER_FLEE] |= SCB_FLEE; status->dbs->ChangeFlagTable[SC_MER_ATK] |= SCB_WATK; status->dbs->ChangeFlagTable[SC_MER_HP] |= SCB_MAXHP; status->dbs->ChangeFlagTable[SC_MER_SP] |= SCB_MAXSP; status->dbs->ChangeFlagTable[SC_MER_HIT] |= SCB_HIT; + // Guillotine Cross Poison Effects - status->dbs->ChangeFlagTable[SC_PARALYSE] |= SCB_FLEE|SCB_SPEED|SCB_ASPD; + status->dbs->ChangeFlagTable[SC_PARALYSE] |= SCB_FLEE | SCB_SPEED | SCB_ASPD; status->dbs->ChangeFlagTable[SC_VENOMBLEED] |= SCB_MAXHP; status->dbs->ChangeFlagTable[SC_MAGICMUSHROOM] |= SCB_REGEN; status->dbs->ChangeFlagTable[SC_DEATHHURT] |= SCB_REGEN; - status->dbs->ChangeFlagTable[SC_PYREXIA] |= SCB_HIT|SCB_FLEE; + 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; status->dbs->ChangeFlagTable[SC_SAVAGE_STEAK] |= SCB_STR; @@ -1008,17 +1032,17 @@ void initChangeTables(void) { status->dbs->ChangeFlagTable[SC_MUSTLE_M] |= SCB_MAXHP; status->dbs->ChangeFlagTable[SC_LIFE_FORCE_F] |= SCB_MAXSP; status->dbs->ChangeFlagTable[SC_EXTRACT_WHITE_POTION_Z] |= SCB_REGEN; - status->dbs->ChangeFlagTable[SC_VITATA_500] |= 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_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_ALL_RIDING] = SCB_SPEED; status->dbs->ChangeFlagTable[SC_WEDDING] = SCB_SPEED; - status->dbs->ChangeFlagTable[SC_MTF_ASPD] = SCB_ASPD|SCB_HIT; + 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; @@ -1028,6 +1052,7 @@ void initChangeTables(void) { status->dbs->ChangeFlagTable[SC_DECORATION_OF_MUSIC] |= SCB_NONE; status->dbs->ChangeFlagTable[SC_LJOSALFAR] |= SCB_NONE; status->dbs->ChangeFlagTable[SC_MERMAID_LONGING] |= SCB_NONE; + status->dbs->ChangeFlagTable[SC_TIME_ACCESSORY] |= SCB_NONE; /* status->dbs->DisplayType Table [Ind/Hercules] */ status->dbs->DisplayType[SC_ALL_RIDING] = true; @@ -1058,8 +1083,9 @@ void initChangeTables(void) { status->dbs->DisplayType[SC_DECORATION_OF_MUSIC] = true; status->dbs->DisplayType[SC_LJOSALFAR] = true; status->dbs->DisplayType[SC_MERMAID_LONGING] = true; + status->dbs->DisplayType[SC_TIME_ACCESSORY] = true; - if( !battle_config.display_hallucination ) //Disable Hallucination. + if (!battle_config.display_hallucination) // Disable Hallucination. status->dbs->IconChangeTable[SC_ILLUSION] = SI_BLANK; #undef add_sc #undef set_sc_with_vfx @@ -2741,16 +2767,16 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { // ----- EQUIPMENT-MDEF CALCULATION ----- // Apply relative modifiers from equipment - if(sd->mdef_rate < 0) + if (sd->mdef_rate < 0) sd->mdef_rate = 0; - if(sd->mdef_rate != 100) { - i = bstatus->mdef * sd->mdef_rate/100; + if (sd->mdef_rate != 100) { + i = bstatus->mdef * sd->mdef_rate / 100; bstatus->mdef = cap_value(i, DEFTYPE_MIN, DEFTYPE_MAX); } #ifndef RENEWAL if (!battle_config.magic_defense_type && bstatus->mdef > battle_config.max_def) { - bstatus->mdef2 += battle_config.over_def_bonus*(bstatus->mdef -battle_config.max_def); + bstatus->mdef2 += battle_config.over_def_bonus * (bstatus->mdef -battle_config.max_def); bstatus->mdef = (signed char)battle_config.max_def; } #endif @@ -2760,62 +2786,62 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { // Basic ASPD value i = status->base_amotion_pc(sd,bstatus); - bstatus->amotion = cap_value(i,((sd->class_&JOBL_THIRD) ? battle_config.max_third_aspd : battle_config.max_aspd),2000); + bstatus->amotion = cap_value(i, ((sd->class_&JOBL_THIRD) ? battle_config.max_third_aspd : battle_config.max_aspd), 2000); // Relative modifiers from passive skills #ifndef RENEWAL_ASPD - if((skill_lv=pc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK) - bstatus->aspd_rate -= 5*skill_lv; - if((skill_lv = pc->checkskill(sd,SG_DEVIL)) > 0 && !pc->nextjobexp(sd)) - bstatus->aspd_rate -= 30*skill_lv; - if((skill_lv=pc->checkskill(sd,GS_SINGLEACTION))>0 && + if ((skill_lv=pc->checkskill(sd, SA_ADVANCEDBOOK)) > 0 && sd->status.weapon == W_BOOK) + bstatus->aspd_rate -= 5 * skill_lv; + if ((skill_lv = pc->checkskill(sd, SG_DEVIL)) > 0 && !pc->nextjobexp(sd)) + bstatus->aspd_rate -= 30 * skill_lv; + if ((skill_lv=pc->checkskill(sd,GS_SINGLEACTION)) > 0 && (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) - bstatus->aspd_rate -= ((skill_lv+1)/2) * 10; + bstatus->aspd_rate -= ((skill_lv + 1) / 2) * 10; if (pc_isridingpeco(sd)) - bstatus->aspd_rate += 500-100*pc->checkskill(sd,KN_CAVALIERMASTERY); + bstatus->aspd_rate += 500 - 100 * pc->checkskill(sd, KN_CAVALIERMASTERY); else if (pc_isridingdragon(sd)) - bstatus->aspd_rate += 250-50*pc->checkskill(sd,RK_DRAGONTRAINING); + bstatus->aspd_rate += 250 - 50 * pc->checkskill(sd, RK_DRAGONTRAINING); #else // needs more info - if ( (skill_lv = pc->checkskill(sd, SG_DEVIL)) > 0 && !pc->nextjobexp(sd) ) + if ((skill_lv = pc->checkskill(sd, SG_DEVIL)) > 0 && !pc->nextjobexp(sd)) bstatus->aspd_rate += 30 * skill_lv; - if ( pc_isridingpeco(sd) ) + if (pc_isridingpeco(sd)) bstatus->aspd_rate -= 500 - 100 * pc->checkskill(sd, KN_CAVALIERMASTERY); - else if ( pc_isridingdragon(sd) ) + else if (pc_isridingdragon(sd)) bstatus->aspd_rate -= 250 - 50 * pc->checkskill(sd, RK_DRAGONTRAINING); #endif - bstatus->adelay = 2*bstatus->amotion; + bstatus->adelay = 2 * bstatus->amotion; // ----- DMOTION ----- // - i = 800-bstatus->agi*4; + i = 800-bstatus->agi * 4; bstatus->dmotion = cap_value(i, 400, 800); - if(battle_config.pc_damage_delay_rate != 100) - bstatus->dmotion = bstatus->dmotion*battle_config.pc_damage_delay_rate/100; + if (battle_config.pc_damage_delay_rate != 100) + bstatus->dmotion = bstatus->dmotion * battle_config.pc_damage_delay_rate / 100; // ----- MISC CALCULATIONS ----- // Weight - if((skill_lv=pc->checkskill(sd,MC_INCCARRY))>0) + if ((skill_lv = pc->checkskill(sd,MC_INCCARRY)) > 0) sd->max_weight += 2000*skill_lv; if (pc_isridingpeco(sd) && pc->checkskill(sd,KN_RIDING) > 0) sd->max_weight += 10000; else if(pc_isridingdragon(sd)) - sd->max_weight += 5000+2000*pc->checkskill(sd,RK_DRAGONTRAINING); - if(sc->data[SC_KNOWLEDGE]) - sd->max_weight += sd->max_weight*sc->data[SC_KNOWLEDGE]->val1/10; - if((skill_lv=pc->checkskill(sd,ALL_INCCARRY))>0) - sd->max_weight += 2000*skill_lv; + sd->max_weight += 5000 + 2000 * pc->checkskill(sd, RK_DRAGONTRAINING); + if (sc->data[SC_KNOWLEDGE]) + sd->max_weight += sd->max_weight * sc->data[SC_KNOWLEDGE]->val1 / 10; + if ((skill_lv = pc->checkskill(sd, ALL_INCCARRY)) > 0) + sd->max_weight += 2000 * skill_lv; - sd->cart_weight_max = battle_config.max_cart_weight + (pc->checkskill(sd, GN_REMODELING_CART)*5000); + sd->cart_weight_max = battle_config.max_cart_weight + (pc->checkskill(sd, GN_REMODELING_CART) * 5000); - if (pc->checkskill(sd,SM_MOVINGRECOVERY)>0) + if (pc->checkskill(sd,SM_MOVINGRECOVERY) > 0) sd->regen.state.walk = 1; else sd->regen.state.walk = 0; // Skill SP cost - if((skill_lv=pc->checkskill(sd,HP_MANARECHARGE))>0 ) - sd->dsprate -= 4*skill_lv; + if ((skill_lv = pc->checkskill(sd,HP_MANARECHARGE)) > 0) + sd->dsprate -= 4 * skill_lv; if(sc->data[SC_SERVICEFORYOU]) sd->dsprate -= sc->data[SC_SERVICEFORYOU]->val3; @@ -2836,33 +2862,33 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { sd->sprecov_rate = 0; // Anti-element and anti-race - if((skill_lv=pc->checkskill(sd,CR_TRUST))>0) - sd->subele[ELE_HOLY] += skill_lv*5; - if((skill_lv=pc->checkskill(sd,BS_SKINTEMPER))>0) { + if ((skill_lv = pc->checkskill(sd, CR_TRUST)) > 0) + sd->subele[ELE_HOLY] += skill_lv * 5; + if ((skill_lv = pc->checkskill(sd, BS_SKINTEMPER)) > 0) { sd->subele[ELE_NEUTRAL] += skill_lv; - sd->subele[ELE_FIRE] += skill_lv*4; + sd->subele[ELE_FIRE] += skill_lv * 4; } - if((skill_lv=pc->checkskill(sd,NC_RESEARCHFE))>0) { - sd->subele[ELE_EARTH] += skill_lv*10; - sd->subele[ELE_FIRE] += skill_lv*10; + if ((skill_lv = pc->checkskill(sd, NC_RESEARCHFE)) > 0) { + sd->subele[ELE_EARTH] += skill_lv * 10; + sd->subele[ELE_FIRE] += skill_lv * 10; } - if((skill_lv=pc->checkskill(sd,SA_DRAGONOLOGY))>0 ) { + if ((skill_lv = pc->checkskill(sd, SA_DRAGONOLOGY)) > 0) { #ifdef RENEWAL - skill_lv = skill_lv*2; + skill_lv = skill_lv * 2; #else - skill_lv = skill_lv*4; + skill_lv = skill_lv * 4; #endif - sd->right_weapon.addrace[RC_DRAGON]+=skill_lv; - sd->left_weapon.addrace[RC_DRAGON]+=skill_lv; - sd->magic_addrace[RC_DRAGON]+=skill_lv; + sd->right_weapon.addrace[RC_DRAGON] += skill_lv; + sd->left_weapon.addrace[RC_DRAGON] += skill_lv; + sd->magic_addrace[RC_DRAGON] += skill_lv; #ifdef RENEWAL sd->race_tolerance[RC_DRAGON] += skill_lv; #else - sd->subrace[RC_DRAGON]+=skill_lv; + sd->subrace[RC_DRAGON] += skill_lv; #endif } - if( (skill_lv = pc->checkskill(sd, AB_EUCHARISTICA)) > 0 ) { + if ((skill_lv = pc->checkskill(sd, AB_EUCHARISTICA)) > 0) { sd->right_weapon.addrace[RC_DEMON] += skill_lv; sd->right_weapon.addele[ELE_DARK] += skill_lv; sd->left_weapon.addrace[RC_DEMON] += skill_lv; @@ -2877,12 +2903,12 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { sd->subele[ELE_DARK] += skill_lv; } - if(sc->count) { - if(sc->data[SC_CONCENTRATION]) { //Update the card-bonus data - sc->data[SC_CONCENTRATION]->val3 = sd->param_bonus[1]; //Agi - sc->data[SC_CONCENTRATION]->val4 = sd->param_bonus[4]; //Dex + if (sc->count) { + if (sc->data[SC_CONCENTRATION]) { // Update the card-bonus data + sc->data[SC_CONCENTRATION]->val3 = sd->param_bonus[1]; // Agi + sc->data[SC_CONCENTRATION]->val4 = sd->param_bonus[4]; // Dex } - if(sc->data[SC_SIEGFRIED]){ + if (sc->data[SC_SIEGFRIED]){ i = sc->data[SC_SIEGFRIED]->val2; sd->subele[ELE_WATER] += i; sd->subele[ELE_EARTH] += i; @@ -2894,7 +2920,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { sd->subele[ELE_GHOST] += i; sd->subele[ELE_UNDEAD] += i; } - if(sc->data[SC_PROVIDENCE]){ + if (sc->data[SC_PROVIDENCE]){ sd->subele[ELE_HOLY] += sc->data[SC_PROVIDENCE]->val2; #ifdef RENEWAL sd->race_tolerance[RC_DEMON] += sc->data[SC_PROVIDENCE]->val2; @@ -2902,50 +2928,77 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { sd->subrace[RC_DEMON] += sc->data[SC_PROVIDENCE]->val2; #endif } - if(sc->data[SC_ARMORPROPERTY]) { - //This status change should grant card-type elemental resist. + if (sc->data[SC_ARMORPROPERTY]) { + // This status change should grant card-type elemental resist. sd->subele[ELE_WATER] += sc->data[SC_ARMORPROPERTY]->val1; sd->subele[ELE_EARTH] += sc->data[SC_ARMORPROPERTY]->val2; sd->subele[ELE_FIRE] += sc->data[SC_ARMORPROPERTY]->val3; sd->subele[ELE_WIND] += sc->data[SC_ARMORPROPERTY]->val4; } - if(sc->data[SC_ARMOR_RESIST]) { // Undead Scroll + if (sc->data[SC_ARMOR_RESIST]) { // Undead Scroll sd->subele[ELE_WATER] += sc->data[SC_ARMOR_RESIST]->val1; sd->subele[ELE_EARTH] += sc->data[SC_ARMOR_RESIST]->val2; sd->subele[ELE_FIRE] += sc->data[SC_ARMOR_RESIST]->val3; sd->subele[ELE_WIND] += sc->data[SC_ARMOR_RESIST]->val4; } - if( sc->data[SC_FIRE_CLOAK_OPTION] ) { + if (sc->data[SC_FIRE_CLOAK_OPTION]) { i = sc->data[SC_FIRE_CLOAK_OPTION]->val2; sd->subele[ELE_FIRE] += i; sd->subele[ELE_WATER] -= i; } - if( sc->data[SC_WATER_DROP_OPTION] ) { + if (sc->data[SC_WATER_DROP_OPTION]) { i = sc->data[SC_WATER_DROP_OPTION]->val2; sd->subele[ELE_WATER] += i; sd->subele[ELE_WIND] -= i; } - if( sc->data[SC_WIND_CURTAIN_OPTION] ) { + if (sc->data[SC_WIND_CURTAIN_OPTION]) { i = sc->data[SC_WIND_CURTAIN_OPTION]->val2; sd->subele[ELE_WIND] += i; sd->subele[ELE_EARTH] -= i; } - if( sc->data[SC_STONE_SHIELD_OPTION] ) { + if (sc->data[SC_STONE_SHIELD_OPTION]) { i = sc->data[SC_STONE_SHIELD_OPTION]->val2; sd->subele[ELE_EARTH] += i; sd->subele[ELE_FIRE] -= i; } - if( sc->data[SC_MTF_MLEATKED] ) + if (sc->data[SC_MTF_MLEATKED]) sd->subele[ELE_NEUTRAL] += 2; - if( sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 3 ) + 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 ) + if (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 3) sd->magic_addele[ELE_WATER] += 25; - if( sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 3 ) + if (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 3) sd->magic_addele[ELE_WIND] += 25; - if( sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3 ) + if (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3) sd->magic_addele[ELE_EARTH] += 25; + + // Geffen Scrolls [Frost] + if (sc->data[SC_SKELSCROLL]) { +#ifdef RENEWAL + sd->race_tolerance[RC_DEMIHUMAN] += sc->data[SC_SKELSCROLL]->val1; +#else + sd->subrace[RC_DEMIHUMAN] += sc->data[SC_SKELSCROLL]->val1; +#endif + } + if (sc->data[SC_DISTRUCTIONSCROLL]) { + sd->right_weapon.addrace[RC_ANGEL] += sc->data[SC_DISTRUCTIONSCROLL]->val1; + sd->left_weapon.addrace[RC_ANGEL] += sc->data[SC_DISTRUCTIONSCROLL]->val1; + sd->right_weapon.addele[ELE_HOLY] += sc->data[SC_DISTRUCTIONSCROLL]->val1; + sd->left_weapon.addele[ELE_HOLY] += sc->data[SC_DISTRUCTIONSCROLL]->val1; + sd->right_weapon.addrace[RC_BOSS] += sc->data[SC_DISTRUCTIONSCROLL]->val1; + sd->left_weapon.addrace[RC_BOSS] += sc->data[SC_DISTRUCTIONSCROLL]->val1; + } + if (sc->data[SC_ROYALSCROLL]) { +#ifdef RENEWAL + sd->race_tolerance[RC_BOSS] += sc->data[SC_ROYALSCROLL]->val1; +#else + sd->subrace[RC_BOSS] += sc->data[SC_ROYALSCROLL]->val1; +#endif + } + if (sc->data[SC_IMMUNITYSCROLL]) + sd->subele[ELE_NEUTRAL] += sd->subele[ELE_NEUTRAL] * sc->data[SC_IMMUNITYSCROLL]->val1 / 100; } + status_cpy(&sd->battle_status, bstatus); // ----- CLIENT-SIDE REFRESH ----- @@ -3257,22 +3310,22 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str return; regen->flag = RGN_HP|RGN_SP; - if(regen->sregen) + if (regen->sregen) { if (regen->sregen->hp) - regen->flag|=RGN_SHP; + regen->flag |= RGN_SHP; if (regen->sregen->sp) - regen->flag|=RGN_SSP; + regen->flag |= RGN_SSP; regen->sregen->rate.hp = regen->sregen->rate.sp = 1; } if (regen->ssregen) { if (regen->ssregen->hp) - regen->flag|=RGN_SHP; + regen->flag |= RGN_SHP; if (regen->ssregen->sp) - regen->flag|=RGN_SSP; + regen->flag |= RGN_SSP; regen->ssregen->rate.hp = regen->ssregen->rate.sp = 1; } regen->rate.hp = regen->rate.sp = 1; @@ -3291,7 +3344,7 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str ) regen->flag = 0; //No regen - if ( sc->data[SC_DANCING] || sc->data[SC_OBLIVIONCURSE] || sc->data[SC_MAXIMIZEPOWER] || sc->data[SC_REBOUND] + if (sc->data[SC_DANCING] || sc->data[SC_OBLIVIONCURSE] || sc->data[SC_MAXIMIZEPOWER] || sc->data[SC_REBOUND] || ( bl->type == BL_PC && (((TBL_PC*)bl)->class_&MAPID_UPPERMASK) == MAPID_MONK && (sc->data[SC_EXTREMITYFIST] || (sc->data[SC_EXPLOSIONSPIRITS] && (!sc->data[SC_SOULLINK] || sc->data[SC_SOULLINK]->val2 != SL_MONK))) ) @@ -3316,20 +3369,20 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str } else regen->flag&=~sce->val4; //Remove regen as specified by val4 } - if(sc->data[SC_GENTLETOUCH_REVITALIZE]) { - regen->hp += regen->hp * ( 30 * sc->data[SC_GENTLETOUCH_REVITALIZE]->val1 + 50 ) / 100; + if (sc->data[SC_GENTLETOUCH_REVITALIZE]) { + regen->hp += regen->hp * (30 * sc->data[SC_GENTLETOUCH_REVITALIZE]->val1 + 50) / 100; } if ((sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 1) //if insignia lvl 1 || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 1) || (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 1) || (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 1)) regen->rate.hp *= 2; - if( sc->data[SC_VITALITYACTIVATION] ) + if (sc->data[SC_VITALITYACTIVATION]) regen->flag &=~RGN_SP; - 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]) - regen->rate.sp += regen->rate.sp * sc->data[SC_VITATA_500]->val1/100; + 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]) + regen->rate.sp += regen->rate.sp * 20 / 100; } /// Recalculates parts of an object's battle status according to the specified flags. /// @param flag bitfield of values from enum scb_flag @@ -4467,78 +4520,80 @@ unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, } unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable) { - if(!sc || !sc->count) - return cap_value(batk,0,USHRT_MAX); + if (!sc || !sc->count) + return cap_value(batk, 0, USHRT_MAX); - if( !viewable ){ + if (!viewable) { /* some statuses that are hidden in the status window */ if(sc->data[SC_PLUSATTACKPOWER]) batk += sc->data[SC_PLUSATTACKPOWER]->val1; - return (unsigned short)cap_value(batk,0,USHRT_MAX); + return (unsigned short)cap_value(batk, 0, USHRT_MAX); } #ifndef RENEWAL - if(sc->data[SC_PLUSATTACKPOWER]) + if (sc->data[SC_PLUSATTACKPOWER]) batk += sc->data[SC_PLUSATTACKPOWER]->val1; - if(sc->data[SC_GS_MADNESSCANCEL]) + if (sc->data[SC_GS_MADNESSCANCEL]) batk += 100; - if(sc->data[SC_GS_GATLINGFEVER]) + if (sc->data[SC_GS_GATLINGFEVER]) batk += sc->data[SC_GS_GATLINGFEVER]->val3; #endif - if(sc->data[SC_BATKFOOD]) + if (sc->data[SC_BATKFOOD]) batk += sc->data[SC_BATKFOOD]->val1; - if(sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2) + if (sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2) batk += 50; - if(bl->type == BL_ELEM + 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]) + if (sc->data[SC_FULL_SWING_K]) batk += sc->data[SC_FULL_SWING_K]->val1; - if(sc->data[SC_VOLCANIC_ASH] && (bl->type==BL_MOB)){ + if (sc->data[SC_VOLCANIC_ASH] && (bl->type == BL_MOB)){ if(status_get_element(bl) == ELE_WATER) //water type batk /= 2; } - if(sc->data[SC_PYROCLASTIC]) + 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]) - batk += batk * sc->data[SC_PROVOKE]->val3/100; + if (sc->data[SC_INCATKRATE]) + batk += batk * sc->data[SC_INCATKRATE]->val1 / 100; + if (sc->data[SC_PROVOKE]) + batk += batk * sc->data[SC_PROVOKE]->val3 / 100; #ifndef RENEWAL - if(sc->data[SC_LKCONCENTRATION]) - batk += batk * sc->data[SC_LKCONCENTRATION]->val2/100; + if (sc->data[SC_LKCONCENTRATION]) + batk += batk * sc->data[SC_LKCONCENTRATION]->val2 / 100; #else if ( sc->data[SC_NOEQUIPWEAPON] && bl->type != BL_PC ) batk -= batk * sc->data[SC_NOEQUIPWEAPON]->val2 / 100; #endif - if(sc->data[SC_SKE]) + if (sc->data[SC_SKE]) batk += batk * 3; - if(sc->data[SC_HAMI_BLOODLUST]) - batk += batk * sc->data[SC_HAMI_BLOODLUST]->val2/100; - if(sc->data[SC_JOINTBEAT] && sc->data[SC_JOINTBEAT]->val2&BREAK_WAIST) - batk -= batk * 25/100; - if(sc->data[SC_CURSE]) - batk -= batk * 25/100; - if( sc->data[SC_ZANGETSU] ) + if (sc->data[SC_HAMI_BLOODLUST]) + batk += batk * sc->data[SC_HAMI_BLOODLUST]->val2 / 100; + if (sc->data[SC_JOINTBEAT] && sc->data[SC_JOINTBEAT]->val2&BREAK_WAIST) + batk -= batk * 25 / 100; + if (sc->data[SC_CURSE]) + batk -= batk * 25 / 100; + if (sc->data[SC_ZANGETSU]) batk += sc->data[SC_ZANGETSU]->val2; #if 0 //Curse shouldn't effect on this? <- Curse OR Bleeding?? - if(sc->data[SC_BLOODING]) - batk -= batk * 25/100; + if (sc->data[SC_BLOODING]) + batk -= batk * 25 / 100; #endif // 0 - if(sc->data[SC_HLIF_FLEET]) - batk += batk * sc->data[SC_HLIF_FLEET]->val3/100; - if(sc->data[SC__ENERVATION]) + if (sc->data[SC_HLIF_FLEET]) + batk += batk * sc->data[SC_HLIF_FLEET]->val3 / 100; + if (sc->data[SC__ENERVATION]) batk -= batk * sc->data[SC__ENERVATION]->val2 / 100; - if(sc->data[SC_SATURDAY_NIGHT_FEVER]) + if (sc->data[SC_SATURDAY_NIGHT_FEVER]) batk += 100 * sc->data[SC_SATURDAY_NIGHT_FEVER]->val1; + if (sc->data[SC_BATTLESCROLL]) + batk += batk * sc->data[SC_BATTLESCROLL]->val1 / 100; - return (unsigned short)cap_value(batk,0,USHRT_MAX); + return (unsigned short)cap_value(batk, 0, USHRT_MAX); } unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) @@ -4662,14 +4717,14 @@ unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc } 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 (!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 @@ -4684,7 +4739,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; @@ -4696,15 +4751,17 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, 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; + if (sc->data[SC_MYSTICSCROLL]) + matk += matk * sc->data[SC_MYSTICSCROLL]->val1 / 100; - 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) { @@ -4797,115 +4854,118 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in } 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; - else if( map->list[bl->m].flag.battleground ) - flee -= flee * battle_config.bg_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; } - 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] ) + 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_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] ) - flee -= flee * ( 20 + 5 * sc->data[SC_GLOOMYDAY]->val1 ) / 100; - if( sc->data[SC_SATURDAY_NIGHT_FEVER] ) + if (sc->data[SC_GLOOMYDAY]) + flee -= flee * ( 20 + 5 * sc->data[SC_GLOOMYDAY]->val1) / 100; + 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 += 10; - 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) { - if(!sc || !sc->count) - return cap_value(flee2,10,SHRT_MAX); + if (!sc || !sc->count) + return cap_value(flee2, 10, SHRT_MAX); - if( !viewable ){ + if (!viewable) { /* some statuses that are hidden in the status window */ - return (short)cap_value(flee2,10,SHRT_MAX); + return (short)cap_value(flee2, 10, SHRT_MAX); } - if(sc->data[SC_PLUSAVOIDVALUE]) + if (sc->data[SC_PLUSAVOIDVALUE]) flee2 += sc->data[SC_PLUSAVOIDVALUE]->val2; - if(sc->data[SC_WHISTLE]) - flee2 += sc->data[SC_WHISTLE]->val3*10; - if(sc->data[SC__UNLUCKY]) + if (sc->data[SC_WHISTLE]) + flee2 += sc->data[SC_WHISTLE]->val3 * 10; + if (sc->data[SC__UNLUCKY]) flee2 -= flee2 * sc->data[SC__UNLUCKY]->val2 / 100; + if (sc->data[SC_FREYJASCROLL]) + flee2 += 100; - return (short)cap_value(flee2,10,SHRT_MAX); + return (short)cap_value(flee2, 10, SHRT_MAX); } defType status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool viewable) { @@ -4920,7 +4980,7 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def if (sc->data[SC_OVERED_BOOST] && bl->type == BL_PC) def -= def * 50 / 100; if (sc->data[SC_NEUTRALBARRIER]) - def += def * (10 + 5*sc->data[SC_NEUTRALBARRIER]->val1) / 100; + def += def * (10 + 5 * sc->data[SC_NEUTRALBARRIER]->val1) / 100; if (sc->data[SC_FORCEOFVANGUARD]) def += def * 2 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100; if (sc->data[SC_DEFSET]) @@ -4962,22 +5022,22 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def if (sc->data[SC_FREEZE]) def >>=1; if (sc->data[SC_INCDEFRATE]) - def += def * sc->data[SC_INCDEFRATE]->val1/100; + def += def * sc->data[SC_INCDEFRATE]->val1 / 100; #endif if (sc->data[SC_ANGRIFFS_MODUS]) def -= 30 + 20 * sc->data[SC_ANGRIFFS_MODUS]->val1; if (sc->data[SC_CRUCIS]) - def -= def * sc->data[SC_CRUCIS]->val2/100; + def -= def * sc->data[SC_CRUCIS]->val2 / 100; if (sc->data[SC_LKCONCENTRATION]) - def -= def * sc->data[SC_LKCONCENTRATION]->val4/100; + def -= def * sc->data[SC_LKCONCENTRATION]->val4 / 100; if (sc->data[SC_SKE]) def >>=1; if (sc->data[SC_PROVOKE] && bl->type != BL_PC) // Provoke doesn't alter player defense-> - def -= def * sc->data[SC_PROVOKE]->val4/100; + def -= def * sc->data[SC_PROVOKE]->val4 / 100; if (sc->data[SC_NOEQUIPSHIELD]) - def -= def * sc->data[SC_NOEQUIPSHIELD]->val2/100; + def -= def * sc->data[SC_NOEQUIPSHIELD]->val2 / 100; if (sc->data[SC_FLING]) - def -= def * (sc->data[SC_FLING]->val2)/100; + def -= def * (sc->data[SC_FLING]->val2) / 100; if (sc->data[SC_ANALYZE]) def -= def * ( 14 * sc->data[SC_ANALYZE]->val1 ) / 100; if (sc->data[SC_SATURDAY_NIGHT_FEVER]) @@ -4997,23 +5057,25 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def def += sc->data[SC_SHIELDSPELL_REF]->val2; if (sc->data[SC_PRESTIGE]) def += sc->data[SC_PRESTIGE]->val1; - if (sc->data[SC_VOLCANIC_ASH] && (bl->type==BL_MOB)) { - if (status_get_race(bl)==RC_PLANT) + if (sc->data[SC_VOLCANIC_ASH] && (bl->type == BL_MOB)) { + if (status_get_race(bl) == RC_PLANT) def /= 2; } if (sc->data[SC_UNLIMIT]) return 1; + if (sc->data[SC_ARMORSCROLL]) + def += 5; return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX); } signed short status_calc_def2(struct block_list *bl, struct status_change *sc, int def2, bool viewable) { - if(!sc || !sc->count) + if (!sc || !sc->count) #ifdef RENEWAL - return (short)cap_value(def2,SHRT_MIN,SHRT_MAX); + return (short)cap_value(def2, SHRT_MIN, SHRT_MAX); #else - return (short)cap_value(def2,1,SHRT_MAX); + return (short)cap_value(def2, 1, SHRT_MAX); #endif if (!viewable) { @@ -5085,54 +5147,56 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef, bool viewable) { - if(!sc || !sc->count) - return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX); + if (!sc || !sc->count) + return (defType)cap_value(mdef, DEFTYPE_MIN, DEFTYPE_MAX); - if( !viewable ){ + if (!viewable) { /* some statuses that are hidden in the status window */ if(sc->data[SC_NEUTRALBARRIER] ) mdef += mdef * (5 * sc->data[SC_NEUTRALBARRIER]->val1 + 10) / 100; if(sc->data[SC_MDEFSET]) return sc->data[SC_MDEFSET]->val1; - return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX); + return (defType)cap_value(mdef, DEFTYPE_MIN, DEFTYPE_MAX); } if (sc->data[SC_BERSERK]) return 0; - if(sc->data[SC_BARRIER]) + if (sc->data[SC_BARRIER]) return 100; #ifndef RENEWAL // no longer provides 90 MDEF in renewal mode - if(sc->data[SC_STEELBODY]) + if (sc->data[SC_STEELBODY]) return 90; #endif - if(sc->data[SC_STONESKIN]) + if (sc->data[SC_STONESKIN]) mdef += sc->data[SC_STONESKIN]->val3; - if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3) + 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. + 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_STONEHARDSKIN])// Final MDEF increase divided by 10 since were using classic (pre-renewal) mechanics. [Rytech] + 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_ANALYZE]) + 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_ANALYZE]) mdef -= mdef * ( 14 * sc->data[SC_ANALYZE]->val1 ) / 100; - if(sc->data[SC_SYMPHONY_LOVE]) + if (sc->data[SC_SYMPHONY_LOVE]) mdef += mdef * sc->data[SC_SYMPHONY_LOVE]->val2 / 100; - if(sc->data[SC_GENTLETOUCH_CHANGE] && sc->data[SC_GENTLETOUCH_CHANGE]->val4) + if (sc->data[SC_GENTLETOUCH_CHANGE] && sc->data[SC_GENTLETOUCH_CHANGE]->val4) mdef -= mdef * sc->data[SC_GENTLETOUCH_CHANGE]->val4 / 100; if (sc->data[SC_ODINS_POWER]) mdef -= 20; if(sc->data[SC_BURNING]) - mdef -= mdef *25 / 100; + mdef -= mdef * 25 / 100; if (sc->data[SC_UNLIMIT]) return 1; + if (sc->data[SC_FREYJASCROLL]) + mdef += 5; - return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX); + return (defType)cap_value(mdef, DEFTYPE_MIN, DEFTYPE_MAX); } signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc, int mdef2, bool viewable) @@ -5370,27 +5434,27 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl if (flag&1) { int i; // ASPD fixed values - if (sc->data[i=SC_ATTHASTE_INFINITY] - || sc->data[i=SC_ATTHASTE_POTION3] - || sc->data[i=SC_ATTHASTE_POTION2] - || sc->data[i=SC_ATTHASTE_POTION1] + if (sc->data[i = SC_ATTHASTE_INFINITY] + || sc->data[i = SC_ATTHASTE_POTION3] + || sc->data[i = SC_ATTHASTE_POTION2] + || sc->data[i = SC_ATTHASTE_POTION1] ) pots += sc->data[i]->val1; if (!sc->data[SC_QUAGMIRE]) { - if(sc->data[SC_TWOHANDQUICKEN] && bonus < 7) + if (sc->data[SC_TWOHANDQUICKEN] && bonus < 7) bonus = 7; - if(sc->data[SC_ONEHANDQUICKEN] && bonus < 7) + if (sc->data[SC_ONEHANDQUICKEN] && bonus < 7) bonus = 7; - if(sc->data[SC_MER_QUICKEN] && bonus < 7) // needs more info + if (sc->data[SC_MER_QUICKEN] && bonus < 7) // needs more info bonus = 7; - if(sc->data[SC_ADRENALINE2] && bonus < 6) + if (sc->data[SC_ADRENALINE2] && bonus < 6) bonus = 6; - if(sc->data[SC_ADRENALINE] && bonus < 7) + if (sc->data[SC_ADRENALINE] && bonus < 7) bonus = 7; - if(sc->data[SC_SPEARQUICKEN] && bonus < 7) + if (sc->data[SC_SPEARQUICKEN] && bonus < 7) bonus = 7; - if(sc->data[SC_HLIF_FLEET] && bonus < 5) + if (sc->data[SC_HLIF_FLEET] && bonus < 5) bonus = 5; } @@ -5460,7 +5524,6 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl bonus -= sc->data[SC_MELON_BOMB]->val1; if (sc->data[SC_PAIN_KILLER]) bonus -= sc->data[SC_PAIN_KILLER]->val2; - if (sc->data[SC_SWING]) // TODO: SC_SWING shouldn't stack with skill1 modifiers bonus += sc->data[SC_SWING]->val3; if (sc->data[SC_DANCE_WITH_WUG]) @@ -5477,6 +5540,8 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl bonus += sc->data[SC_GS_GATLINGFEVER]->val1; if (sc->data[SC_STAR_COMFORT]) bonus += 3 * sc->data[SC_STAR_COMFORT]->val1; + if (sc->data[SC_BATTLESCROLL]) + bonus += sc->data[SC_BATTLESCROLL]->val1; } return (bonus + pots); @@ -5489,16 +5554,15 @@ short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int if (!sc || !sc->count) return cap_value(aspd, 0, 2000); - if ((sc->data[SC_GUST_OPTION] || sc->data[SC_BLAST_OPTION] - || sc->data[SC_WILD_STORM_OPTION])) + if ((sc->data[SC_GUST_OPTION] || sc->data[SC_BLAST_OPTION] || sc->data[SC_WILD_STORM_OPTION])) aspd -= 50; // +5 ASPD 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; + aspd -= (bl->type == BL_PC ? pc->checkskill((TBL_PC *)bl, RK_RUNEMASTERY) : 10) / 10 * 40; if (sc->data[SC_MTF_ASPD]) aspd -= 10; - if (sc->data[SC_OVERED_BOOST]) // should be final and unmodifiable by any means aspd = (200 - sc->data[SC_OVERED_BOOST]->val3) * 10; + return cap_value(aspd, 0, 2000); // will be recap for proper bl anyway } @@ -5508,47 +5572,47 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int { int i; - if(!sc || !sc->count) - return cap_value(aspd_rate,0,SHRT_MAX); + if (!sc || !sc->count) + return cap_value(aspd_rate, 0, SHRT_MAX); - if( !sc->data[SC_QUAGMIRE] ){ + if (!sc->data[SC_QUAGMIRE]) { int max = 0; - if(sc->data[SC_STAR_COMFORT]) + if (sc->data[SC_STAR_COMFORT]) max = sc->data[SC_STAR_COMFORT]->val2; - if(sc->data[SC_TWOHANDQUICKEN] && + if (sc->data[SC_TWOHANDQUICKEN] && max < sc->data[SC_TWOHANDQUICKEN]->val2) max = sc->data[SC_TWOHANDQUICKEN]->val2; - if(sc->data[SC_ONEHANDQUICKEN] && + if (sc->data[SC_ONEHANDQUICKEN] && max < sc->data[SC_ONEHANDQUICKEN]->val2) max = sc->data[SC_ONEHANDQUICKEN]->val2; - if(sc->data[SC_MER_QUICKEN] && + if (sc->data[SC_MER_QUICKEN] && max < sc->data[SC_MER_QUICKEN]->val2) max = sc->data[SC_MER_QUICKEN]->val2; - if(sc->data[SC_ADRENALINE2] && + if (sc->data[SC_ADRENALINE2] && max < sc->data[SC_ADRENALINE2]->val3) max = sc->data[SC_ADRENALINE2]->val3; - if(sc->data[SC_ADRENALINE] && + if (sc->data[SC_ADRENALINE] && max < sc->data[SC_ADRENALINE]->val3) max = sc->data[SC_ADRENALINE]->val3; - if(sc->data[SC_SPEARQUICKEN] && + if (sc->data[SC_SPEARQUICKEN] && max < sc->data[SC_SPEARQUICKEN]->val2) max = sc->data[SC_SPEARQUICKEN]->val2; - if(sc->data[SC_GS_GATLINGFEVER] && + if (sc->data[SC_GS_GATLINGFEVER] && max < sc->data[SC_GS_GATLINGFEVER]->val2) max = sc->data[SC_GS_GATLINGFEVER]->val2; - if(sc->data[SC_HLIF_FLEET] && + if (sc->data[SC_HLIF_FLEET] && max < sc->data[SC_HLIF_FLEET]->val2) max = sc->data[SC_HLIF_FLEET]->val2; - if(sc->data[SC_ASSNCROS] && + if (sc->data[SC_ASSNCROS] && max < sc->data[SC_ASSNCROS]->val2) { if (bl->type!=BL_PC) @@ -5570,152 +5634,154 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int aspd_rate -= max; - if(sc->data[SC_BERSERK]) + if (sc->data[SC_BERSERK]) aspd_rate -= 300; - else if(sc->data[SC_GS_MADNESSCANCEL]) + else if (sc->data[SC_GS_MADNESSCANCEL]) aspd_rate -= 200; } - if( sc->data[i=SC_ATTHASTE_INFINITY] || - sc->data[i=SC_ATTHASTE_POTION3] || - sc->data[i=SC_ATTHASTE_POTION2] || - sc->data[i=SC_ATTHASTE_POTION1] ) + if (sc->data[i = SC_ATTHASTE_INFINITY] || + sc->data[i = SC_ATTHASTE_POTION3] || + sc->data[i = SC_ATTHASTE_POTION2] || + sc->data[i = SC_ATTHASTE_POTION1]) aspd_rate -= sc->data[i]->val2; - if(sc->data[SC_DONTFORGETME]) + if (sc->data[SC_DONTFORGETME]) aspd_rate += 10 * sc->data[SC_DONTFORGETME]->val2; - if(sc->data[SC_LONGING]) + if (sc->data[SC_LONGING]) aspd_rate += sc->data[SC_LONGING]->val2; - if(sc->data[SC_STEELBODY]) + if (sc->data[SC_STEELBODY]) aspd_rate += 250; - if(sc->data[SC_SKA]) + if (sc->data[SC_SKA]) aspd_rate += 250; - if(sc->data[SC_DEFENDER]) + if (sc->data[SC_DEFENDER]) aspd_rate += sc->data[SC_DEFENDER]->val4; - if(sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_ENEMY) + if (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_ENEMY) aspd_rate += 250; - if(sc->data[SC_GRAVITATION] && sc->data[SC_GRAVITATION]->val3 != BCT_SELF) + if (sc->data[SC_GRAVITATION] && sc->data[SC_GRAVITATION]->val3 != BCT_SELF) aspd_rate += sc->data[SC_GRAVITATION]->val2; - if(sc->data[SC_JOINTBEAT]) { - if( sc->data[SC_JOINTBEAT]->val2&BREAK_WRIST ) + if (sc->data[SC_JOINTBEAT]) { + if (sc->data[SC_JOINTBEAT]->val2&BREAK_WRIST) aspd_rate += 250; - if( sc->data[SC_JOINTBEAT]->val2&BREAK_KNEE ) + if (sc->data[SC_JOINTBEAT]->val2&BREAK_KNEE) aspd_rate += 100; } - if( sc->data[SC_FROSTMISTY] ) + if (sc->data[SC_FROSTMISTY]) aspd_rate += 150; - if( sc->data[SC_HALLUCINATIONWALK_POSTDELAY] ) + if (sc->data[SC_HALLUCINATIONWALK_POSTDELAY]) aspd_rate += 500; - if( sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2 ) + if (sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2) aspd_rate -= sc->data[SC_FIGHTINGSPIRIT]->val2; - if( sc->data[SC_PARALYSE] ) + if (sc->data[SC_PARALYSE]) aspd_rate += 100; - if( sc->data[SC__BODYPAINT] ) + if (sc->data[SC__BODYPAINT]) aspd_rate += 10 * 5 * sc->data[SC__BODYPAINT]->val1; - if( sc->data[SC__INVISIBILITY] ) + if (sc->data[SC__INVISIBILITY]) aspd_rate += sc->data[SC__INVISIBILITY]->val2 * 10 ; - if( sc->data[SC__GROOMY] ) + if (sc->data[SC__GROOMY]) aspd_rate += sc->data[SC__GROOMY]->val2 * 10; - if( sc->data[SC_SWING] ) + if (sc->data[SC_SWING]) aspd_rate -= sc->data[SC_SWING]->val3 * 10; - if( sc->data[SC_DANCE_WITH_WUG] ) + if (sc->data[SC_DANCE_WITH_WUG]) aspd_rate -= sc->data[SC_DANCE_WITH_WUG]->val3 * 10; - if( sc->data[SC_GLOOMYDAY] ) + if (sc->data[SC_GLOOMYDAY]) aspd_rate += ( 15 + 5 * sc->data[SC_GLOOMYDAY]->val1 ); - if( sc->data[SC_EARTHDRIVE] ) + if (sc->data[SC_EARTHDRIVE]) aspd_rate += 250; - if( sc->data[SC_GENTLETOUCH_CHANGE] ) + if (sc->data[SC_GENTLETOUCH_CHANGE]) aspd_rate -= sc->data[SC_GENTLETOUCH_CHANGE]->val3 * 10; - if( sc->data[SC_MELON_BOMB] ) + if (sc->data[SC_MELON_BOMB]) aspd_rate += sc->data[SC_MELON_BOMB]->val1 * 10; - if( sc->data[SC_BOOST500] ) - aspd_rate -= sc->data[SC_BOOST500]->val1 *10; - if( sc->data[SC_EXTRACT_SALAMINE_JUICE] ) + if (sc->data[SC_BOOST500]) + aspd_rate -= sc->data[SC_BOOST500]->val1 * 10; + if (sc->data[SC_EXTRACT_SALAMINE_JUICE]) aspd_rate -= sc->data[SC_EXTRACT_SALAMINE_JUICE]->val1 * 10; - if( sc->data[SC_INCASPDRATE] ) + if (sc->data[SC_INCASPDRATE]) aspd_rate -= sc->data[SC_INCASPDRATE]->val1 * 10; - if( sc->data[SC_PAIN_KILLER]) + if (sc->data[SC_PAIN_KILLER]) aspd_rate += sc->data[SC_PAIN_KILLER]->val2 * 10; - if( sc->data[SC_GOLDENE_FERSE]) + if (sc->data[SC_GOLDENE_FERSE]) aspd_rate -= sc->data[SC_GOLDENE_FERSE]->val3 * 10; + if (sc->data[SC_BATTLESCROLL]) + aspd_rate += sc->data[SC_BATTLESCROLL]->val1 * 10; - return (short)cap_value(aspd_rate,0,SHRT_MAX); + return (short)cap_value(aspd_rate, 0, SHRT_MAX); } unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion) { // It has been confirmed on official servers that MvP mobs have no dmotion even without endure - if( bl->type == BL_MOB && (((TBL_MOB*)bl)->status.mode&MD_BOSS) ) + if (bl->type == BL_MOB && (((TBL_MOB*)bl)->status.mode&MD_BOSS)) return 0; - if( !sc || !sc->count || map_flag_gvg2(bl->m) || map->list[bl->m].flag.battleground ) - return cap_value(dmotion,0,USHRT_MAX); + if (!sc || !sc->count || map_flag_gvg2(bl->m) || map->list[bl->m].flag.battleground) + return cap_value(dmotion, 0, USHRT_MAX); - if( sc->data[SC_ENDURE] ) + if (sc->data[SC_ENDURE]) return 0; - if( sc->data[SC_RUN] || sc->data[SC_WUGDASH] ) + if (sc->data[SC_RUN] || sc->data[SC_WUGDASH]) return 0; - return (unsigned short)cap_value(dmotion,0,USHRT_MAX); + 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); + 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]) + 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]) + if (sc->data[SC_SOLID_SKIN_OPTION]) maxhp += 2000;// Fix amount. - if(sc->data[SC_POWER_OF_GAIA]) + 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_MER_HP]) + maxhp += maxhp * sc->data[SC_MER_HP]->val2 / 100; - if(sc->data[SC_EPICLESIS]) + 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]) + if (sc->data[SC_MUSTLE_M]) maxhp += maxhp * sc->data[SC_MUSTLE_M]->val1/100; - if(sc->data[SC_MYSTERIOUS_POWDER]) + if (sc->data[SC_MYSTERIOUS_POWDER]) maxhp -= sc->data[SC_MYSTERIOUS_POWDER]->val1 / 100; - if(sc->data[SC_PETROLOGY_OPTION]) + 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; @@ -5723,51 +5789,59 @@ unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, maxhp += maxhp * sc->data[SC_GOLDENE_FERSE]->val2 / 100; 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; - 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); + 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; - - return cap_value(maxsp,1,UINT_MAX); + if (sc->data[SC_VITATA_500]) + maxsp += maxsp * 5 / 100; + if (sc->data[SC_SOULSCROLL]) + maxsp += maxsp * sc->data[SC_SOULSCROLL]->val1 / 100; + if (sc->data[SC_TARGET_ASPD]) + maxsp += maxsp * sc->data[SC_TARGET_ASPD]->val1 / 100; + + return cap_value(maxsp, 1, UINT_MAX); } unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element) { - if(!sc || !sc->count) + if (!sc || !sc->count) return element; - if(sc->data[SC_FREEZE]) + if (sc->data[SC_FREEZE]) return ELE_WATER; - if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) + if (sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) return ELE_EARTH; - if(sc->data[SC_BENEDICTIO]) + if (sc->data[SC_BENEDICTIO]) return ELE_HOLY; - if(sc->data[SC_PROPERTYUNDEAD]) + if (sc->data[SC_PROPERTYUNDEAD]) return ELE_UNDEAD; - if(sc->data[SC_ARMOR_PROPERTY]) + if (sc->data[SC_ARMOR_PROPERTY]) return sc->data[SC_ARMOR_PROPERTY]->val2; - if(sc->data[SC_SHAPESHIFT]) + if (sc->data[SC_SHAPESHIFT]) return sc->data[SC_SHAPESHIFT]->val2; return (unsigned char)cap_value(element,0,UCHAR_MAX); @@ -5775,65 +5849,63 @@ unsigned char status_calc_element(struct block_list *bl, struct status_change *s unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv) { - if(!sc || !sc->count) + if (!sc || !sc->count) return lv; - if(sc->data[SC_FREEZE]) + if (sc->data[SC_FREEZE]) return 1; - if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) + if (sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) return 1; - if(sc->data[SC_BENEDICTIO]) + if (sc->data[SC_BENEDICTIO]) return 1; - if(sc->data[SC_PROPERTYUNDEAD]) + if (sc->data[SC_PROPERTYUNDEAD]) return 1; - if(sc->data[SC_ARMOR_PROPERTY]) + if (sc->data[SC_ARMOR_PROPERTY]) return sc->data[SC_ARMOR_PROPERTY]->val1; - if(sc->data[SC_SHAPESHIFT]) + if (sc->data[SC_SHAPESHIFT]) return 1; - if(sc->data[SC__INVISIBILITY]) + if (sc->data[SC__INVISIBILITY]) return 1; - return (unsigned char)cap_value(lv,1,4); + return (unsigned char)cap_value(lv, 1, 4); } unsigned char status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element) { - if(!sc || !sc->count) + if (!sc || !sc->count) return element; - if(sc->data[SC_ENCHANTARMS]) + + if (sc->data[SC_ENCHANTARMS]) return sc->data[SC_ENCHANTARMS]->val2; - if(sc->data[SC_PROPERTYWATER] - || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 2) ) + if (sc->data[SC_PROPERTYWATER] || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 2)) return ELE_WATER; - if(sc->data[SC_PROPERTYGROUND] - || (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2) ) + if (sc->data[SC_PROPERTYGROUND] || (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)) return ELE_EARTH; - if(sc->data[SC_PROPERTYFIRE] - || (sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2) ) + if (sc->data[SC_PROPERTYFIRE] || (sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2)) return ELE_FIRE; - if(sc->data[SC_PROPERTYWIND] - || (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 2) ) + if (sc->data[SC_PROPERTYWIND] || (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 2)) return ELE_WIND; - if(sc->data[SC_ENCHANTPOISON]) + if (sc->data[SC_ENCHANTPOISON]) return ELE_POISON; - if(sc->data[SC_ASPERSIO]) + if (sc->data[SC_ASPERSIO]) return ELE_HOLY; - if(sc->data[SC_PROPERTYDARK]) + if (sc->data[SC_PROPERTYDARK]) return ELE_DARK; - if(sc->data[SC_PROPERTYTELEKINESIS] || sc->data[SC__INVISIBILITY]) + if (sc->data[SC_PROPERTYTELEKINESIS] || sc->data[SC__INVISIBILITY]) return ELE_GHOST; - if(sc->data[SC_TIDAL_WEAPON_OPTION] || sc->data[SC_TIDAL_WEAPON] ) + if (sc->data[SC_TIDAL_WEAPON_OPTION] || sc->data[SC_TIDAL_WEAPON]) return ELE_WATER; - if(sc->data[SC_PYROCLASTIC]) + if (sc->data[SC_PYROCLASTIC]) return ELE_FIRE; - return (unsigned char)cap_value(element,0,UCHAR_MAX); + + return (unsigned char)cap_value(element, 0, UCHAR_MAX); } unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, int mode) { - if(!sc || !sc->count) + if (!sc || !sc->count) return mode; - if(sc->data[SC_MODECHANGE]) { + if (sc->data[SC_MODECHANGE]) { if (sc->data[SC_MODECHANGE]->val2) mode = sc->data[SC_MODECHANGE]->val2; //Set mode if (sc->data[SC_MODECHANGE]->val3) @@ -5841,7 +5913,7 @@ unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, if (sc->data[SC_MODECHANGE]->val4) mode&=~sc->data[SC_MODECHANGE]->val4; //Del mode } - return cap_value(mode,0,USHRT_MAX); + return cap_value(mode, 0, USHRT_MAX); } const char* status_get_name(struct block_list *bl) { diff --git a/src/map/status.h b/src/map/status.h index 800e3de9f..7dbef0923 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -17,10 +17,10 @@ struct mob_data; struct npc_data; struct pet_data; -//Change the equation when the values are high enough to discard the -//imprecision in exchange of overflow protection [Skotlex] -//Also add 100% checks since those are the most used cases where we don't -//want approximation errors. +// Change the equation when the values are high enough to discard the +// imprecision in exchange of overflow protection [Skotlex] +// Also add 100% checks since those are the most used cases where we don't +// want approximation errors. #define APPLY_RATE(value, rate) ( \ (rate) == 100 ? \ (value) \ @@ -83,7 +83,7 @@ enum scstart_flag { // Status changes listing. These code are for use by the server. typedef enum sc_type { SC_NONE = -1, - //First we enumerate common status ailments which are often used around. + // First we enumerate common status ailments which are often used around. SC_STONE = 0, SC_COMMON_MIN = 0, // begin SC_FREEZE, @@ -95,14 +95,14 @@ typedef enum sc_type { SC_CONFUSION, SC_BLIND, SC_BLOODING, - SC_DPOISON, //10 + SC_DPOISON, // 10 SC_FEAR, SC_COLD, SC_BURNING, SC_DEEP_SLEEP, SC_COMMON_MAX = 14, // end - //Next up, we continue on 20, to leave enough room for additional "common" ailments in the future. + // Next up, we continue on 20, to leave enough room for additional "common" ailments in the future. SC_PROVOKE = 20, SC_ENDURE, SC_TWOHANDQUICKEN, @@ -113,7 +113,7 @@ typedef enum sc_type { SC_POISONREACT, SC_QUAGMIRE, SC_ANGELUS, - SC_BLESSING, //30 + SC_BLESSING, // 30 SC_CRUCIS, SC_INC_AGI, SC_DEC_AGI, @@ -123,7 +123,7 @@ typedef enum sc_type { SC_ASPERSIO, SC_BENEDICTIO, SC_KYRIE, - SC_MAGNIFICAT, //40 + SC_MAGNIFICAT, // 40 SC_GLORIA, SC_LEXAETERNA, SC_ADRENALINE, @@ -133,7 +133,7 @@ typedef enum sc_type { SC_TRICKDEAD, SC_SHOUT, SC_ENERGYCOAT, - SC_BROKENARMOR, //50 - NOTE: These two aren't used anywhere, and they have an icon... + SC_BROKENARMOR, // 50 - NOTE: These two aren't used anywhere, and they have an icon... SC_BROKENWEAPON, SC_ILLUSION, SC_WEIGHTOVER50, @@ -143,7 +143,7 @@ typedef enum sc_type { SC_ATTHASTE_POTION3, SC_ATTHASTE_INFINITY, SC_MOVHASTE_HORSE, - SC_MOVHASTE_INFINITY, //60 + SC_MOVHASTE_INFINITY, // 60 SC_PLUSATTACKPOWER, SC_PLUSMAGICPOWER, SC_WEDDING, @@ -153,7 +153,7 @@ typedef enum sc_type { SC_BARRIER, SC_NOEQUIPWEAPON, SC_NOEQUIPSHIELD, - SC_NOEQUIPARMOR, //70 + SC_NOEQUIPARMOR, // 70 SC_NOEQUIPHELM, SC_PROTECTWEAPON, SC_PROTECTSHIELD, @@ -163,7 +163,7 @@ typedef enum sc_type { SC_REFLECTSHIELD, SC_SPLASHER, SC_PROVIDENCE, - SC_DEFENDER, //80 + SC_DEFENDER, // 80 SC_MAGICROD, SC_SPELLBREAKER, SC_AUTOSPELL, @@ -173,7 +173,7 @@ typedef enum sc_type { SC_AUTOCOUNTER, SC_SIGHT, SC_SAFETYWALL, - SC_RUWACH, //90 + SC_RUWACH, // 90 SC_EXTREMITYFIST, SC_EXPLOSIONSPIRITS, SC_COMBOATTACK, @@ -183,7 +183,7 @@ typedef enum sc_type { SC_PROPERTYWATER, SC_PROPERTYWIND, SC_PROPERTYGROUND, - SC_VOLCANO, //100, + SC_VOLCANO, // 100, SC_DELUGE, SC_VIOLENTGALE, SC_SUB_WEAPONPROPERTY, @@ -193,7 +193,7 @@ typedef enum sc_type { SC_BABY, SC_AURABLADE, SC_PARRYING, - SC_LKCONCENTRATION, //110 + SC_LKCONCENTRATION, // 110 SC_TENSIONRELAX, SC_BERSERK, SC_FURY, @@ -203,7 +203,7 @@ typedef enum sc_type { SC_GUILDAURA, SC_MAGICPOWER, SC_EDP, - SC_TRUESIGHT, //120 + SC_TRUESIGHT, // 120 SC_WINDWALK, SC_MELTDOWN, SC_CARTBOOST, @@ -213,7 +213,7 @@ typedef enum sc_type { SC_MARIONETTE, SC_PROPERTYUNDEAD, SC_JOINTBEAT, - SC_MINDBREAKER, //130 + SC_MINDBREAKER, // 130 SC_MEMORIZE, SC_FOGWALL, SC_SPIDERWEB, @@ -223,7 +223,7 @@ typedef enum sc_type { SC_ORCISH, SC_STORMKICK_READY, SC_DOWNKICK_READY, - SC_TURNKICK_READY, //140 + SC_TURNKICK_READY, // 140 SC_COUNTERKICK_READY, SC_DODGE_READY, SC_RUN, @@ -233,7 +233,7 @@ typedef enum sc_type { SC_KAIZEL, SC_KAAHI, SC_KAUPE, - SC_ONEHANDQUICKEN, //150 + SC_ONEHANDQUICKEN, // 150 SC_PRESERVE, SC_GDSKILL_BATTLEORDER, SC_GDSKILL_REGENERATION, @@ -243,7 +243,7 @@ typedef enum sc_type { SC_LONGING, SC_HERMODE, SC_TAROTCARD, - SC_CR_SHRINK, //160 + SC_CR_SHRINK, // 160 SC_WZ_SIGHTBLASTER, SC_DC_WINKCHARM, SC_RG_CCONFINE_M, @@ -253,7 +253,7 @@ typedef enum sc_type { SC_RICHMANKIM, SC_ETERNALCHAOS, SC_DRUMBATTLE, - SC_NIBELUNGEN, //170 + SC_NIBELUNGEN, // 170 SC_ROKISWEIL, SC_INTOABYSS, SC_SIEGFRIED, @@ -263,17 +263,17 @@ typedef enum sc_type { SC_APPLEIDUN, SC_MODECHANGE, SC_HUMMING, - SC_DONTFORGETME, //180 + SC_DONTFORGETME, // 180 SC_FORTUNE, SC_SERVICEFORYOU, - SC_STOP, //Prevents inflicted chars from walking. [Skotlex] + SC_STOP, // Prevents inflicted chars from walking. [Skotlex] SC_STRUP, SC_SOULLINK, - SC_COMA, //Not a real SC_, it makes a char's HP/SP hit 1. + SC_COMA, // Not a real SC_, it makes a char's HP/SP hit 1. SC_CLAIRVOYANCE, SC_INCALLSTATUS, SC_CHASEWALK2, - SC_INCAGI, //190 + SC_INCAGI, // 190 SC_INCVIT, SC_INCINT, SC_INCDEX, @@ -283,7 +283,7 @@ typedef enum sc_type { SC_INCFLEE, SC_INCFLEERATE, SC_INCMHPRATE, - SC_INCMSPRATE, //200 + SC_INCMSPRATE, // 200 SC_INCATKRATE, SC_INCMATKRATE, SC_INCDEFRATE, @@ -293,17 +293,17 @@ typedef enum sc_type { SC_FOOD_INT, SC_FOOD_DEX, SC_FOOD_LUK, - SC_FOOD_BASICHIT, //210 + SC_FOOD_BASICHIT, // 210 SC_FOOD_BASICAVOIDANCE, SC_BATKFOOD, SC_WATKFOOD, SC_MATKFOOD, - SC_SCRESIST, //Increases resistance to status changes. + SC_SCRESIST, // Increases resistance to status changes. SC_XMAS, // Xmas Suit [Valaris] - SC_WARM, //SG skills [Komurka] + SC_WARM, // SG skills [Komurka] SC_SUN_COMFORT, SC_MOON_COMFORT, - SC_STAR_COMFORT, //220 + SC_STAR_COMFORT, // 220 SC_FUSION, SC_SKILLRATE_UP, SC_SKE, @@ -311,9 +311,9 @@ typedef enum sc_type { SC_SWOO, // [marquis007] SC_SKA, // [marquis007] SC_EARTHSCROLL, - SC_MIRACLE, //SG 'hidden' skill [Komurka] + SC_MIRACLE, // SG 'hidden' skill [Komurka] SC_GS_MADNESSCANCEL, - SC_GS_ADJUSTMENT, //230 + SC_GS_ADJUSTMENT, // 230 SC_GS_ACCURACY, SC_GS_GATLINGFEVER, SC_NJ_TATAMIGAESHI, @@ -323,7 +323,7 @@ typedef enum sc_type { SC_NJ_SUITON, SC_NJ_NEN, SC_KNOWLEDGE, - SC_SMA_READY, //240 + SC_SMA_READY, // 240 SC_FLING, SC_HLIF_AVOID, SC_HLIF_CHANGE, @@ -333,7 +333,7 @@ typedef enum sc_type { SC_HAMI_DEFENCE, SC_INCASPDRATE, SC_PLUSAVOIDVALUE, - SC_JAILED, //250 + SC_JAILED, // 250 SC_ENCHANTARMS, SC_MAGICALATTACK, SC_STONESKIN, @@ -343,7 +343,7 @@ typedef enum sc_type { SC_SUMMER, SC_CASH_PLUSEXP, SC_CASH_RECEIVEITEM, - SC_CASH_BOSS_ALARM, //260 + SC_CASH_BOSS_ALARM, // 260 SC_CASH_DEATHPENALTY, SC_CRITICALPERCENT, //SC_INCDEF, @@ -353,7 +353,7 @@ typedef enum sc_type { //SC_HPREGEN, SC_HEALPLUS = 268, SC_PNEUMA, - SC_AUTOTRADE, //270 + SC_AUTOTRADE, // 270 SC_KSPROTECTED, SC_ARMOR_RESIST, SC_ATKER_BLOOD, @@ -364,13 +364,13 @@ typedef enum sc_type { SC_WALKSPEED = 278, // Mercenary Only Bonus Effects SC_MER_FLEE, - SC_MER_ATK, //280 + SC_MER_ATK, // 280 SC_MER_HP, SC_MER_SP, SC_MER_HIT, SC_MER_QUICKEN, SC_REBIRTH, - //SC_SKILLCASTRATE, //286 + //SC_SKILLCASTRATE, // 286 //SC_DEFRATIOATK, //SC_HPDRAIN, //SC_SKILLATKBONUS, @@ -384,7 +384,7 @@ typedef enum sc_type { SC_INVINCIBLEOFF, SC_MANU_ATK, SC_MANU_DEF, - SC_SPL_ATK, //300 + SC_SPL_ATK, // 300 SC_SPL_DEF, SC_MANU_MATK, SC_SPL_MATK, @@ -394,14 +394,12 @@ typedef enum sc_type { SC_FOOD_DEX_CASH, SC_FOOD_INT_CASH, SC_FOOD_LUK_CASH, - /** - * 3rd - **/ + + /* 3rd Jobs */ //SC_FEAR, SC_FROSTMISTY = 311, - /** - * Rune Knight - **/ + + /* Rune Knight */ SC_ENCHANTBLADE, SC_DEATHBOUND, SC_MILLENNIUMSHIELD, @@ -414,9 +412,8 @@ typedef enum sc_type { SC_STORMBLAST, SC_FIGHTINGSPIRIT, SC_ABUNDANCE, - /** - * Arch Bishop - **/ + + /* Arch Bishop */ SC_ADORAMUS, SC_EPICLESIS, SC_ORATIO, @@ -426,9 +423,8 @@ typedef enum sc_type { SC_EXPIATIO, // 330 SC_DUPLELIGHT, SC_SECRAMENT, - /** - * Warlock - **/ + + /* Warlock */ SC_WHITEIMPRISON, SC_MARSHOFABYSS, SC_RECOGNIZEDSPELL, @@ -440,17 +436,15 @@ typedef enum sc_type { SC_SUMMON5, SC_READING_SB, SC_FREEZINGSP, - /** - * Ranger - **/ + + /* Ranger */ SC_FEARBREEZE, SC_ELECTRICSHOCKER, SC_WUGDASH, SC_WUGBITE, SC_CAMOUFLAGE, - /** - * Mechanic - **/ + + /* Mechanic */ SC_ACCELERATION, SC_HOVERING, // 350 SC_SHAPESHIFT, @@ -463,9 +457,8 @@ typedef enum sc_type { SC_STEALTHFIELD_MASTER, SC_OVERHEAT, SC_OVERHEAT_LIMITPOINT, // 360 - /** - * Guillotine Cross - **/ + + /* Guillotine Cross */ SC_VENOMIMPRESS, SC_POISONINGWEAPON, SC_WEAPONBLOCKING, @@ -481,9 +474,8 @@ typedef enum sc_type { SC_PYREXIA, SC_OBLIVIONCURSE, SC_LEECHESEND, - /** - * Royal Guard - **/ + + /* Royal Guard */ SC_LG_REFLECTDAMAGE, SC_FORCEOFVANGUARD, SC_SHIELDSPELL_DEF, @@ -495,18 +487,16 @@ typedef enum sc_type { SC_BANDING_DEFENCE, SC_EARTHDRIVE, SC_INSPIRATION, - /** - * Sorcerer - **/ + + /* Sorcerer */ SC_SPELLFIST, //SC_COLD, SC_STRIKING = 389, SC_WARMER, // 390 SC_VACUUM_EXTREME, SC_PROPERTYWALK, - /** - * Minstrel / Wanderer - **/ + + /* Minstrel / Wanderer */ SC_SWING, SC_SYMPHONY_LOVE, SC_MOONLIT_SERENADE, @@ -527,9 +517,8 @@ typedef enum sc_type { SC_UNLIMITED_HUMMING_VOICE, // 410 SC_SITDOWN_FORCE, SC_NETHERWORLD, - /** - * Sura - **/ + + /* Sura */ SC_CRESCENTELBOW = 413, SC_CURSEDCIRCLE_ATKER, SC_CURSEDCIRCLE_TARGET, @@ -538,9 +527,8 @@ typedef enum sc_type { SC_GENTLETOUCH_ENERGYGAIN, SC_GENTLETOUCH_CHANGE, SC_GENTLETOUCH_REVITALIZE, // 420 - /** - * Genetic - **/ + + /* Genetic */ SC_GN_CARTBOOST, SC_THORNS_TRAP, SC_BLOOD_SUCKER, @@ -566,9 +554,8 @@ typedef enum sc_type { SC_EXTRACT_WHITE_POTION_Z, SC_VITATA_500, SC_EXTRACT_SALAMINE_JUICE, - /** - * Shadow Chaser - **/ + + /* Shadow Chaser */ SC__REPRODUCE, SC__AUTOSHADOWSPELL, SC__SHADOWFORM, @@ -584,9 +571,8 @@ typedef enum sc_type { SC__STRIPACCESSARY, SC__MANHOLE, SC__BLOODYLUST, // 460 - /** - * Elemental Spirits - **/ + + /* Elemental Spirits */ SC_CIRCLE_OF_FIRE, SC_CIRCLE_OF_FIRE_OPTION, SC_FIRE_CLOAK, @@ -634,20 +620,25 @@ typedef enum sc_type { SC_TIDAL_WEAPON_OPTION, SC_ROCK_CRUSHER, SC_ROCK_CRUSHER_ATK, + /* Guild Aura */ SC_LEADERSHIP, SC_GLORYWOUNDS, SC_SOULCOLD, // 510 SC_HAWKEYES, + /* ... */ SC_ODINS_POWER, + /* Sorcerer .extra */ SC_FIRE_INSIGNIA, SC_WATER_INSIGNIA, SC_WIND_INSIGNIA, SC_EARTH_INSIGNIA, + /* new pushcart */ SC_PUSH_CART, + /* Warlock Spell books */ SC_SPELLBOOK1, SC_SPELLBOOK2, @@ -660,13 +651,13 @@ typedef enum sc_type { * To increase the maximum value just add another status type before SC_SPELLBOOK7 (ex. SC_SPELLBOOK8, SC_SPELLBOOK9 and so on) **/ SC_SPELLBOOK7, + /* Max HP & SP */ SC_INCMHP, SC_INCMSP, SC_PARTYFLEE, - /** - * Kagerou & Oboro [malufett] - **/ + + /* Kagerou & Oboro [malufett] */ SC_MEIKYOUSISUI, SC_KO_JYUMONJIKIRI, SC_KYOUGAKU, // 530 @@ -679,7 +670,7 @@ typedef enum sc_type { SC_GENSOU, SC_AKAITSUKI, - //homon S + /* Homunculus S */ SC_STYLE_CHANGE, SC_GOLDENE_FERSE, // 540 SC_ANGRIFFS_MODUS, @@ -731,13 +722,13 @@ typedef enum sc_type { SC_FALLENEMPIRE, SC_FLASHCOMBO, // 580 - //Vellum Weapon reductions + /* Vellum Weapon reductions */ SC_DEFSET, SC_MDEFSET, SC_NO_SWITCH_EQUIP, - // 2014 Halloween Event + /* 2014 Halloween Event */ SC_MTF_MHP, SC_MTF_MSP, SC_MTF_PUMPKIN, @@ -745,8 +736,22 @@ typedef enum sc_type { SC_LJOSALFAR, SC_MERMAID_LONGING, + SC_TIME_ACCESSORY, // 590 + + /* Geffen Scrolls */ + SC_SKELSCROLL, + SC_DISTRUCTIONSCROLL, + SC_ROYALSCROLL, + SC_IMMUNITYSCROLL, + SC_MYSTICSCROLL, + SC_BATTLESCROLL, + SC_ARMORSCROLL, + SC_FREYJASCROLL, + SC_SOULSCROLL, + + SC_TARGET_ASPD, // 600 - SC_MAX, //Automatically updated max, used in for's to check we are within bounds. + SC_MAX, // Automatically updated max, used in for's to check we are within bounds. } sc_type; /// Official status change ids, used to display status icons in the client. @@ -1056,7 +1061,7 @@ enum si_type { SI_CRITICALPERCENT = 295, SI_PLUSAVOIDVALUE = 296, //SI_ATKER_ASPD = 297, - //SI_TARGET_ASPD = 298, + SI_TARGET_ASPD = 298, //SI_ATKER_MOVESPEED = 299, SI_ATKER_BLOOD = 300, @@ -1350,7 +1355,7 @@ enum si_type { SI_ODINS_POWER = 583, SI_STYLE_CHANGE = 584, SI_SONIC_CLAW_POSTDELAY = 585, - // ID's 586 - 595 Currently Unused + /** ID's 586 - 595 Currently Unused **/ SI_SILVERVEIN_RUSH_POSTDELAY = 596, SI_MIDNIGHT_FRENZY_POSTDELAY = 597, SI_GOLDENE_FERSE = 598, @@ -1493,24 +1498,24 @@ enum si_type { SI_2013_VALENTINE2 = 732, SI_2013_VALENTINE3 = 733, SI_ILLUSIONDOPING = 734, - //SI_WIDEWEB = 735, + //SI_WIDEWEB = 735, SI_CHILL = 736, SI_BURNT = 737, - //SI_PCCAFE_PLAY_TIME = 738, - //SI_TWISTED_TIME = 739, + //SI_PCCAFE_PLAY_TIME = 738, + //SI_TWISTED_TIME = 739, SI_FLASHCOMBO = 740, - - //SI_JITTER_BUFF1 = 741, - //SI_JITTER_BUFF2 = 742, - //SI_JITTER_BUFF3 = 743, - //SI_JITTER_BUFF4 = 744, - //SI_JITTER_BUFF5 = 745, - //SI_JITTER_BUFF6 = 746, - //SI_JITTER_BUFF7 = 747, - //SI_JITTER_BUFF8 = 748, - //SI_JITTER_BUFF9 = 749, - //SI_JITTER_BUFF10 = 750, - //SI_CUP_OF_BOZA = 751, + //SI_JITTER_BUFF1 = 741, + //SI_JITTER_BUFF2 = 742, + //SI_JITTER_BUFF3 = 743, + //SI_JITTER_BUFF4 = 744, + //SI_JITTER_BUFF5 = 745, + //SI_JITTER_BUFF6 = 746, + //SI_JITTER_BUFF7 = 747, + //SI_JITTER_BUFF8 = 748, + //SI_JITTER_BUFF9 = 749, + + //SI_JITTER_BUFF10 = 750, + //SI_CUP_OF_BOZA = 751, SI_B_TRAP = 752, SI_E_CHAIN = 753, SI_E_QD_SHOT_READY = 754, @@ -1536,142 +1541,148 @@ enum si_type { SI_PACKING_ENVELOPE9 = 774, SI_PACKING_ENVELOPE10 = 775, SI_GLASTHEIM_TRANS = 776, - //SI_ZONGZI_POUCH_TRANS = 777, + //SI_ZONGZI_POUCH_TRANS = 777, SI_HEAT_BARREL_AFTER = 778, SI_DECORATION_OF_MUSIC = 779, - //SI_OVERSEAEXPUP = 780, - //SI_CLOWN_N_GYPSY_CARD = 781, - //SI_OPEN_NPC_MARKET = 782, - //SI_BEEF_RIB_STEW = 783, - //SI_PORK_RIB_STEW = 784, - //SI_CHUSEOK_MONDAY = 785, - //SI_CHUSEOK_TUESDAY = 786, - //SI_CHUSEOK_WEDNESDAY = 787, - //SI_CHUSEOK_THURSDAY = 788, - //SI_CHUSEOK_FRIDAY = 789, - //SI_CHUSEOK_WEEKEND = 790, - //SI_ALL_LIGHTGUARD = 791, - //SI_ALL_LIGHTGUARD_COOL_TIME = 792, - //SI_MTF_MHP = 793, - //SI_MTF_MSP = 794, - //SI_MTF_PUMPKIN = 795, - //SI_MTF_HITFLEE = 796, - //SI_MTF_CRIDAMAGE2 = 797, - //SI_MTF_SPDRAIN = 798, - //SI_ACUO_MINT_GUM = 799, + //SI_OVERSEAEXPUP = 780, + //SI_CLOWN_N_GYPSY_CARD = 781, + //SI_OPEN_NPC_MARKET = 782, + //SI_BEEF_RIB_STEW = 783, + //SI_PORK_RIB_STEW = 784, + //SI_CHUSEOK_MONDAY = 785, + //SI_CHUSEOK_TUESDAY = 786, + //SI_CHUSEOK_WEDNESDAY = 787, + //SI_CHUSEOK_THURSDAY = 788, + //SI_CHUSEOK_FRIDAY = 789, + //SI_CHUSEOK_WEEKEND = 790, + //SI_ALL_LIGHTGUARD = 791, + //SI_ALL_LIGHTGUARD_COOL_TIME = 792, + //SI_MTF_MHP = 793, + //SI_MTF_MSP = 794, + //SI_MTF_PUMPKIN = 795, + //SI_MTF_HITFLEE = 796, + //SI_MTF_CRIDAMAGE2 = 797, + //SI_MTF_SPDRAIN = 798, + //SI_ACUO_MINT_GUM = 799, - //SI_S_HEALPOTION = 800, - //SI_REUSE_LIMIT_S_HEAL_POTION = 801, - //SI_PLAYTIME_STATISTICS = 802, - //SI_GN_CHANGEMATERIAL_OPERATOR = 803, - //SI_GN_MIX_COOKING_OPERATOR = 804, - //SI_GN_MAKEBOMB_OPERATOR = 805, - //SI_GN_S_PHARMACY_OPERATOR = 806, - //SI_SO_EL_ANALYSIS_DISASSEMBLY_OPERATOR = 807, - //SI_SO_EL_ANALYSIS_COMBINATION_OPERATOR = 808, - //SI_NC_MAGICDECOY_OPERATOR = 809, - //SI_GUILD_STORAGE = 810, - //SI_GC_POISONINGWEAPON_OPERATOR = 811, - //SI_WS_WEAPONREFINE_OPERATOR = 812, - //SI_BS_REPAIRWEAPON_OPERATOR = 813, - //SI_GET_MAILBOX = 814, - //SI_JUMPINGCLAN = 815, - //SI_JP_OTP = 816, - //SI_HANDICAPTOLERANCE_LEVELGAP = 817, - //SI_MTF_RANGEATK2 = 818, - //SI_MTF_ASPD2 = 819, - //SI_MTF_MATK2 = 820, - //SI_QSCARABA = 825, + //SI_S_HEALPOTION = 800, + //SI_REUSE_LIMIT_S_HEAL_POTION = 801, + //SI_PLAYTIME_STATISTICS = 802, + //SI_GN_CHANGEMATERIAL_OPERATOR = 803, + //SI_GN_MIX_COOKING_OPERATOR = 804, + //SI_GN_MAKEBOMB_OPERATOR = 805, + //SI_GN_S_PHARMACY_OPERATOR = 806, + //SI_SO_EL_ANALYSIS_DISASSEMBLY_OPERATOR = 807, + //SI_SO_EL_ANALYSIS_COMBINATION_OPERATOR = 808, + //SI_NC_MAGICDECOY_OPERATOR = 809, + //SI_GUILD_STORAGE = 810, + //SI_GC_POISONINGWEAPON_OPERATOR = 811, + //SI_WS_WEAPONREFINE_OPERATOR = 812, + //SI_BS_REPAIRWEAPON_OPERATOR = 813, + //SI_GET_MAILBOX = 814, + //SI_JUMPINGCLAN = 815, + //SI_JP_OTP = 816, + //SI_HANDICAPTOLERANCE_LEVELGAP = 817, + //SI_MTF_RANGEATK2 = 818, + //SI_MTF_ASPD2 = 819, + //SI_MTF_MATK2 = 820, + /** ID's 821 - 824 Currently Unused **/ + //SI_QSCARABA = 825, SI_LJOSALFAR = 826, - //SI_PAD_READER_KNIGHT = 827, - //SI_PAD_READER_CRUSADER = 828, - //SI_PAD_READER_BLACKSMITH = 829, - //SI_PAD_READER_ALCHEMIST = 830, - //SI_PAD_READER_ASSASSIN = 831, - //SI_PAD_READER_ROGUE = 832, - //SI_PAD_READER_WIZARD = 833, - //SI_PAD_READER_SAGE = 834, - //SI_PAD_READER_PRIEST = 835, - //SI_PAD_READER_MONK = 836, - //SI_PAD_READER_HUNTER = 837, - //SI_PAD_READER_BARD = 838, - //SI_PAD_READER_DANCER = 839, - //SI_PAD_READER_TAEKWON = 840, - //SI_PAD_READER_NINJA = 841, - //SI_PAD_READER_GUNSLINGER = 842, - //SI_PAD_READER_SUPERNOVICE = 843, - //SI_ESSENCE_OF_TIME = 844, - //SI_MTF_MARIONETTE = 860, - //SI_MTF_LUDE = 861, - //SI_MTF_CRUISER = 862, + //SI_PAD_READER_KNIGHT = 827, + //SI_PAD_READER_CRUSADER = 828, + //SI_PAD_READER_BLACKSMITH = 829, + //SI_PAD_READER_ALCHEMIST = 830, + //SI_PAD_READER_ASSASSIN = 831, + //SI_PAD_READER_ROGUE = 832, + //SI_PAD_READER_WIZARD = 833, + //SI_PAD_READER_SAGE = 834, + //SI_PAD_READER_PRIEST = 835, + //SI_PAD_READER_MONK = 836, + //SI_PAD_READER_HUNTER = 837, + //SI_PAD_READER_BARD = 838, + //SI_PAD_READER_DANCER = 839, + //SI_PAD_READER_TAEKWON = 840, + //SI_PAD_READER_NINJA = 841, + //SI_PAD_READER_GUNSLINGER = 842, + //SI_PAD_READER_SUPERNOVICE = 843, + //SI_ESSENCE_OF_TIME = 844, + + /** ID's 845 - 859 Currently Unused **/ + //SI_MTF_MARIONETTE = 860, + //SI_MTF_LUDE = 861, + //SI_MTF_CRUISER = 862, SI_MERMAID_LONGING = 863, - //SI_DRACULA_CARD = 865, - //SI_LIMIT_POWER_BOOSTER = 867, - //SI_TIME_ACCESSORY = 872, - //SI_EP16_DEF = 873, - //SI_NORMAL_ATKED_SP = 874, - //SI_BODYSTATE_STONECURSE = 875, - //SI_BODYSTATE_FREEZING = 876, - //SI_BODYSTATE_STUN = 877, - //SI_BODYSTATE_SLEEP = 878, - //SI_BODYSTATE_UNDEAD = 879, - //SI_BODYSTATE_STONECURSE_ING = 880, - //SI_BODYSTATE_BURNNING = 881, - //SI_BODYSTATE_IMPRISON = 882, - //SI_HEALTHSTATE_POISON = 883, - //SI_HEALTHSTATE_CURSE = 884, - //SI_HEALTHSTATE_SILENCE = 885, - //SI_HEALTHSTATE_CONFUSION = 886, - //SI_HEALTHSTATE_BLIND = 887, - //SI_HEALTHSTATE_ANGELUS = 888, - //SI_HEALTHSTATE_BLOODING = 889, - //SI_HEALTHSTATE_HEAVYPOISON = 890, - //SI_HEALTHSTATE_FEAR = 891, - //SI_CHERRY_BLOSSOM_CAKE = 892, - //SI_SU_STOOP = 893, - //SI_CATNIPPOWDER = 894, - //SI_ATTACK_PROPERTY_NOTHING = 897, - //SI_ATTACK_PROPERTY_WATER = 898, - //SI_ATTACK_PROPERTY_GROUND = 899, + //SI_DRACULA_CARD = 865, + //SI_LIMIT_POWER_BOOSTER = 867, + /** ID's 868 - 871 Currently Unused **/ + SI_TIME_ACCESSORY = 872, + //SI_EP16_DEF = 873, + //SI_NORMAL_ATKED_SP = 874, + //SI_BODYSTATE_STONECURSE = 875, + //SI_BODYSTATE_FREEZING = 876, + //SI_BODYSTATE_STUN = 877, + //SI_BODYSTATE_SLEEP = 878, + //SI_BODYSTATE_UNDEAD = 879, + //SI_BODYSTATE_STONECURSE_ING = 880, + //SI_BODYSTATE_BURNNING = 881, + //SI_BODYSTATE_IMPRISON = 882, + //SI_HEALTHSTATE_POISON = 883, + //SI_HEALTHSTATE_CURSE = 884, + //SI_HEALTHSTATE_SILENCE = 885, + //SI_HEALTHSTATE_CONFUSION = 886, + //SI_HEALTHSTATE_BLIND = 887, + //SI_HEALTHSTATE_ANGELUS = 888, + //SI_HEALTHSTATE_BLOODING = 889, + //SI_HEALTHSTATE_HEAVYPOISON = 890, + //SI_HEALTHSTATE_FEAR = 891, + //SI_CHERRY_BLOSSOM_CAKE = 892, + //SI_SU_STOOP = 893, + //SI_CATNIPPOWDER = 894, + /** ID 895 Currently Unused **/ + //SI_SV_ROOTTWIST = 896, + //SI_ATTACK_PROPERTY_NOTHING = 897, + //SI_ATTACK_PROPERTY_WATER = 898, + //SI_ATTACK_PROPERTY_GROUND = 899, - //SI_ATTACK_PROPERTY_FIRE = 900, - //SI_ATTACK_PROPERTY_WIND = 901, - //SI_ATTACK_PROPERTY_POISON = 902, - //SI_ATTACK_PROPERTY_SAINT = 903, - //SI_ATTACK_PROPERTY_DARKNESS = 904, - //SI_ATTACK_PROPERTY_TELEKINESIS = 905, - //SI_ATTACK_PROPERTY_UNDEAD = 906, - //SI_RESIST_PROPERTY_NOTHING = 907, - //SI_RESIST_PROPERTY_WATER = 908, - //SI_RESIST_PROPERTY_GROUND = 909, - //SI_RESIST_PROPERTY_FIRE = 910, - //SI_RESIST_PROPERTY_WIND = 911, - //SI_RESIST_PROPERTY_POISON = 912, - //SI_RESIST_PROPERTY_SAINT = 913, - //SI_RESIST_PROPERTY_DARKNESS = 914, - //SI_RESIST_PROPERTY_TELEKINESIS = 915, - //SI_RESIST_PROPERTY_UNDEAD = 916, - //SI_PERIOD_RECEIVEITEM = 922, - //SI_PERIOD_PLUSEXP = 923, - //SI_PERIOD_PLUSJOBEXP = 924, - //SI_RUNEHELM = 925, - //SI_HELM_VERKANA = 926, - //SI_HELM_RHYDO = 927, - //SI_HELM_TURISUS = 928, - //SI_HELM_HAGALAS = 929, - //SI_HELM_ISIA = 930, - //SI_HELM_ASIR = 931, - //SI_HELM_URJ = 932, - //SI_SV_ROOTTWIST = 896, - //SI_BITESCAR = 917, - //SI_ARCLOUSEDASH = 918, - //SI_TUNAPARTY = 919, - //SI_SHRIMP = 920, - //SI_FRESHSHRIMP = 921, - //SI_SUHIDE = 933, - //SI_SPRITEMABLE = 937, - //SI_DORAM_BUF_01 = 935, - //SI_DORAM_BUF_02 = 936, + //SI_ATTACK_PROPERTY_FIRE = 900, + //SI_ATTACK_PROPERTY_WIND = 901, + //SI_ATTACK_PROPERTY_POISON = 902, + //SI_ATTACK_PROPERTY_SAINT = 903, + //SI_ATTACK_PROPERTY_DARKNESS = 904, + //SI_ATTACK_PROPERTY_TELEKINESIS = 905, + //SI_ATTACK_PROPERTY_UNDEAD = 906, + //SI_RESIST_PROPERTY_NOTHING = 907, + //SI_RESIST_PROPERTY_WATER = 908, + //SI_RESIST_PROPERTY_GROUND = 909, + //SI_RESIST_PROPERTY_FIRE = 910, + //SI_RESIST_PROPERTY_WIND = 911, + //SI_RESIST_PROPERTY_POISON = 912, + //SI_RESIST_PROPERTY_SAINT = 913, + //SI_RESIST_PROPERTY_DARKNESS = 914, + //SI_RESIST_PROPERTY_TELEKINESIS = 915, + //SI_RESIST_PROPERTY_UNDEAD = 916, + //SI_BITESCAR = 917, + //SI_ARCLOUSEDASH = 918, + //SI_TUNAPARTY = 919, + //SI_SHRIMP = 920, + //SI_FRESHSHRIMP = 921, + //SI_PERIOD_RECEIVEITEM = 922, + //SI_PERIOD_PLUSEXP = 923, + //SI_PERIOD_PLUSJOBEXP = 924, + //SI_RUNEHELM = 925, + //SI_HELM_VERKANA = 926, + //SI_HELM_RHYDO = 927, + //SI_HELM_TURISUS = 928, + //SI_HELM_HAGALAS = 929, + //SI_HELM_ISIA = 930, + //SI_HELM_ASIR = 931, + //SI_HELM_URJ = 932, + //SI_SUHIDE = 933, + /** ID 934 Currently Unused **/ + //SI_DORAM_BUF_01 = 935, + //SI_DORAM_BUF_02 = 936, + //SI_SPRITEMABLE = 937, SI_MAX, }; @@ -1709,23 +1720,23 @@ enum e_mode MD_MASK = 0xFFFF, }; -//Status change option definitions (options are what makes status changes visible to chars -//who were not on your field of sight when it happened) +// Status change option definitions (options are what makes status changes visible to chars +// who were not on your field of sight when it happened) -//opt1: Non stackable status changes. +// opt1: Non stackable status changes. enum { - OPT1_STONE = 1, //Petrified + OPT1_STONE = 1, // Petrified OPT1_FREEZE, OPT1_STUN, OPT1_SLEEP, - //Aegis uses OPT1 = 5 to identify undead enemies (which also grants them immunity to the other opt1 changes) - OPT1_STONEWAIT=6, //Petrifying + // Aegis uses OPT1 = 5 to identify undead enemies (which also grants them immunity to the other opt1 changes) + OPT1_STONEWAIT = 6, // Petrifying OPT1_BURNING, OPT1_IMPRISON, OPT1_CRYSTALIZE, }; -//opt2: Stackable status changes. +// opt2: Stackable status changes. enum { OPT2_POISON = 0x0001, OPT2_CURSE = 0x0002, @@ -1761,7 +1772,7 @@ enum { OPT3_CONTRACT = 0x00020000, }; -//Defines for the manner system [Skotlex] +// Defines for the manner system [Skotlex] enum manner_flags { MANNER_NOCHAT = 0x01, @@ -1771,7 +1782,7 @@ enum manner_flags MANNER_NOROOM = 0x10, }; -//Define flags for the status_calc_bl function. [Skotlex] +// Define flags for the status_calc_bl function. [Skotlex] enum scb_flag { SCB_NONE = 0x00000000, @@ -1811,7 +1822,7 @@ enum scb_flag SCB_ALL = 0x3FFFFFFF }; -//Regen related flags. +// Regen related flags. enum e_regen { RGN_HP = 0x01, RGN_SP = 0x02, @@ -1825,16 +1836,16 @@ enum e_status_calc_opt { SCO_FORCE = 0x2, /* only relevant to BL_PC types, ensures call bypasses the queue caused by delayed damage */ }; -//Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex] +// Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex] #define BL_CONSUME (BL_PC|BL_HOM|BL_MER|BL_ELEM) -//Define to determine who has regen +// Define to determine who has regen #define BL_REGEN (BL_PC|BL_HOM|BL_MER|BL_ELEM) -//Define to determine who will receive a clif_status_change packet for effects that require one to display correctly +// Define to determine who will receive a clif_status_change packet for effects that require one to display correctly #define BL_SCEFFECT (BL_PC|BL_HOM|BL_MER|BL_MOB|BL_ELEM) -//Basic damage info of a weapon -//Required because players have two of these, one in status_data -//and another for their left hand weapon. +// Basic damage info of a weapon +// Required because players have two of these, one in status_data +// and another for their left hand weapon. typedef struct weapon_atk { unsigned short atk, atk2; unsigned short range; @@ -1845,7 +1856,7 @@ typedef struct weapon_atk { #endif } weapon_atk; -//For holding basic status (which can be modified by status changes) +// For holding basic status (which can be modified by status changes) struct status_data { unsigned int hp, sp, // see status_cpy before adding members before hp and sp @@ -1867,103 +1878,103 @@ struct status_data { /** * defType is RENEWAL dependent and defined in src/map/config/data/const.h **/ - defType def,mdef; + defType def, mdef; unsigned char def_ele, ele_lv, size, race; - struct weapon_atk rhw, lhw; //Right Hand/Left Hand Weapon. + struct weapon_atk rhw, lhw; // Right Hand/Left Hand Weapon. #ifdef RENEWAL int equip_atk; #endif }; -//Additional regen data that only players have. +// Additional regen data that only players have. struct regen_data_sub { unsigned short - hp,sp; + hp, sp; - //tick accumulation before healing. + // tick accumulation before healing. struct { - unsigned int hp,sp; + unsigned int hp, sp; } tick; - //Regen rates (where every 1 means +100% regen) + // Regen rates (where every 1 means +100% regen) struct { - unsigned char hp,sp; + unsigned char hp, sp; } rate; }; struct regen_data { - unsigned short flag; //Marks what stuff you may heal or not. + unsigned short flag; // Marks what stuff you may heal or not. unsigned short - hp,sp,shp,ssp; + hp, sp, shp, ssp; - //tick accumulation before healing. + // tick accumulation before healing. struct { - unsigned int hp,sp,shp,ssp; + unsigned int hp, sp, shp, ssp; } tick; - //Regen rates (where every 1 means +100% regen) + // Regen rates (where every 1 means +100% regen) struct { unsigned char - hp,sp,shp,ssp; + hp, sp, shp, ssp; } rate; struct { - unsigned walk:1; //Can you regen even when walking? - unsigned gc:1; //Tags when you should have double regen due to GVG castle - unsigned overweight :2; //overweight state (1: 50%, 2: 90%) - unsigned block :2; //Block regen flag (1: Hp, 2: Sp) + unsigned walk : 1; // Can you regen even when walking? + unsigned gc : 1; // Tags when you should have double regen due to GVG castle + unsigned overweight : 2; // overweight state (1: 50%, 2: 90%) + unsigned block : 2; // Block regen flag (1: Hp, 2: Sp) } state; - //skill-regen, sitting-skill-regen (since not all chars with regen need it) + // skill-regen, sitting-skill-regen (since not all chars with regen need it) struct regen_data_sub *sregen, *ssregen; }; struct sc_display_entry { enum sc_type type; - int val1,val2,val3; + int val1, val2, val3; }; struct status_change_entry { int timer; - int val1,val2,val3,val4; + int val1, val2, val3, val4; bool infinite_duration; }; struct status_change { - unsigned int option;// effect state (bitfield) - unsigned int opt3;// skill state (bitfield) - unsigned short opt1;// body state - unsigned short opt2;// health state (bitfield) + unsigned int option; // effect state (bitfield) + unsigned int opt3; // skill state (bitfield) + unsigned short opt1; // body state + unsigned short opt2; // health state (bitfield) unsigned char count; - //TODO: See if it is possible to implement the following SC's without requiring extra parameters while the SC is inactive. - unsigned char jb_flag; //Joint Beat type flag - //int sg_id; //ID of the previous Storm gust that hit you - short comet_x, comet_y; // Point where src casted Comet - required to calculate damage from this point + // TODO: See if it is possible to implement the following SC's without requiring extra parameters while the SC is inactive. + unsigned char jb_flag; // Joint Beat type flag + // int sg_id; // ID of the previous Storm gust that hit you + short comet_x, comet_y; // Point where src casted Comet - required to calculate damage from this point /** * The Storm Gust counter was dropped in renewal **/ #ifndef RENEWAL - unsigned char sg_counter; //Storm gust counter (previous hits from storm gust) + unsigned char sg_counter; // Storm gust counter (previous hits from storm gust) #endif - unsigned char bs_counter; // Blood Sucker counter - unsigned char fv_counter; // Force of vanguard counter + unsigned char bs_counter; // Blood Sucker counter + unsigned char fv_counter; // Force of vanguard counter struct status_change_entry *data[SC_MAX]; }; -//Define for standard HP damage attacks. +// Define for standard HP damage attacks. #define status_fix_damage(src, target, hp, walkdelay) (status->damage((src), (target), (hp), 0, (walkdelay), 0)) -//Define for standard HP/SP damage triggers. +// Define for standard HP/SP damage triggers. #define status_zap(bl, hp, sp) (status->damage(NULL, (bl), (hp), (sp), 0, 1)) -//Easier handling of status->percent_change +// Easier handling of status->percent_change #define status_percent_heal(bl, hp_rate, sp_rate) (status->percent_change(NULL, (bl), -(hp_rate), -(sp_rate), 0)) -#define status_percent_damage(src, target, hp_rate, sp_rate, kill) (status->percent_change((src), (target), (hp_rate), (sp_rate), (kill)?1:2)) -//Instant kill with no drops/exp/etc +#define status_percent_damage(src, target, hp_rate, sp_rate, kill) (status->percent_change((src), (target), (hp_rate), (sp_rate), (kill) ? 1 : 2)) +// Instant kill with no drops/exp/etc #define status_kill(bl) status_percent_damage(NULL, (bl), 100, 0, true) #define status_get_range(bl) (status->get_status_data(bl)->rhw.range) @@ -2010,10 +2021,10 @@ struct status_change { #define status_get_homdex(bl) (st->dex + ((TBL_HOM*)bl)->homunculus.dex_value) #define status_get_homluk(bl) (st->luk + ((TBL_HOM*)bl)->homunculus.luk_value) -//Short version, receives rate in 1->100 range, and does not uses a flag setting. -#define sc_start(src, bl, type, rate, val1, tick) (status->change_start((src),(bl),(type),100*(rate),(val1),0,0,0,(tick),SCFLAG_NONE)) -#define sc_start2(src, bl, type, rate, val1, val2, tick) (status->change_start((src),(bl),(type),100*(rate),(val1),(val2),0,0,(tick),SCFLAG_NONE)) -#define sc_start4(src, bl, type, rate, val1, val2, val3, val4, tick) (status->change_start((src),(bl),(type),100*(rate),(val1),(val2),(val3),(val4),(tick),SCFLAG_NONE)) +// Short version, receives rate in 1->100 range, and does not uses a flag setting. +#define sc_start(src, bl, type, rate, val1, tick) (status->change_start((src), (bl), (type), 100 * (rate), (val1), 0, 0, 0, (tick), SCFLAG_NONE)) +#define sc_start2(src, bl, type, rate, val1, val2, tick) (status->change_start((src), (bl), (type), 100 * (rate), (val1), (val2), 0, 0, (tick), SCFLAG_NONE)) +#define sc_start4(src, bl, type, rate, val1, val2, val3, val4, tick) (status->change_start((src), (bl), (type), 100 * (rate), (val1), (val2), (val3), (val4), (tick), SCFLAG_NONE)) #define status_change_end(bl,type,tid) (status->change_end_((bl),(type),(tid),__FILE__,__LINE__)) @@ -2028,9 +2039,9 @@ struct status_change { // bonus values and upgrade chances for refining equipment struct s_refine_info { - int chance[MAX_REFINE]; // success chance - int bonus[MAX_REFINE]; // cumulative fixed bonus damage - int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage + int chance[MAX_REFINE]; // success chance + int bonus[MAX_REFINE]; // cumulative fixed bonus damage + int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage }; struct s_status_dbs { @@ -2038,8 +2049,8 @@ BEGIN_ZEROED_BLOCK; /* Everything within this block will be memset to 0 when sta int max_weight_base[CLASS_COUNT]; int HP_table[CLASS_COUNT][MAX_LEVEL + 1]; int SP_table[CLASS_COUNT][MAX_LEVEL + 1]; - int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD - sc_type Skill2SCTable[MAX_SKILL]; // skill -> status + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE + 1]; // +1 for RENEWAL_ASPD + sc_type Skill2SCTable[MAX_SKILL]; // skill -> status int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) unsigned int ChangeFlagTable[SC_MAX]; // status -> flags int SkillChangeTable[SC_MAX]; // status -> skill @@ -2048,7 +2059,7 @@ BEGIN_ZEROED_BLOCK; /* Everything within this block will be memset to 0 when sta /* */ struct s_refine_info refine_info[REFINE_TYPE_MAX]; /* */ - int atkmods[3][MAX_WEAPON_TYPE];//ATK weapon modification for size (size_fix.txt) + int atkmods[3][MAX_WEAPON_TYPE]; // ATK weapon modification for size (size_fix.txt) char job_bonus[CLASS_COUNT][MAX_LEVEL]; sc_conf_type sc_conf[SC_MAX]; END_ZEROED_BLOCK; /* End */ @@ -2067,7 +2078,7 @@ struct status_interface { struct s_status_dbs *dbs; - struct eri *data_ers; //For sc_data entries + struct eri *data_ers; // For sc_data entries struct status_data dummy; int64 natural_heal_prev_tick; unsigned int natural_heal_diff_tick; @@ -2083,10 +2094,10 @@ struct status_interface { int (*type2relevant_bl_types) (int type); int (*get_sc_type) (sc_type idx); int (*damage) (struct block_list *src,struct block_list *target,int64 hp,int64 sp, int walkdelay, int flag); - //Define for standard HP/SP skill-related cost triggers (mobs require no HP/SP to use skills) + // Define for standard HP/SP skill-related cost triggers (mobs require no HP/SP to use skills) int (*charge) (struct block_list* bl, int64 hp, int64 sp); int (*percent_change) (struct block_list *src,struct block_list *target,signed char hp_rate, signed char sp_rate, int flag); - //Used to set the hp/sp of an object to an absolute value (can't kill) + // Used to set the hp/sp of an object to an absolute value (can't kill) int (*set_hp) (struct block_list *bl, unsigned int hp, int flag); int (*set_sp) (struct block_list *bl, unsigned int sp, int flag); int (*heal) (struct block_list *bl,int64 hp,int64 sp, int flag); -- cgit v1.2.3-70-g09d2