diff options
author | Haru <haru@dotalux.com> | 2014-11-16 06:35:51 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-11-16 07:16:23 +0100 |
commit | 02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f (patch) | |
tree | 3161fd5786bb563c32059068eb3b4876d2ae11ca /src/map/status.c | |
parent | 31bff051ee3c353fb7ee5e544d68feeaefd4941f (diff) | |
download | hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.gz hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.bz2 hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.xz hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.zip |
Whitespace cleanup (no code changes)
This includes, and is not limited to: mixed or wrong indentation, excess
whitespace (horizontal and vertical), misalignment, trailing spaces.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 406 |
1 files changed, 214 insertions, 192 deletions
diff --git a/src/map/status.c b/src/map/status.c index 4b31b9486..e2eede490 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -245,7 +245,7 @@ void initChangeTables(void) { set_sc( NPC_BARRIER , SC_BARRIER , SI_BLANK , SCB_MDEF|SCB_DEF ); add_sc( NPC_DEFENDER , SC_ARMOR ); add_sc( NPC_LICK , SC_STUN ); - set_sc( NPC_HALLUCINATION , SC_ILLUSION , SI_ILLUSION , SCB_NONE ); + set_sc( NPC_HALLUCINATION , SC_ILLUSION , SI_ILLUSION , SCB_NONE ); add_sc( NPC_REBIRTH , SC_REBIRTH ); add_sc( RG_RAID , SC_STUN ); #ifdef RENEWAL @@ -469,8 +469,8 @@ void initChangeTables(void) { set_sc( HAMI_BLOODLUST , SC_HAMI_BLOODLUST , SI_BLANK , SCB_BATK|SCB_WATK ); // Homunculus S - set_sc( MH_LIGHT_OF_REGENE , SC_LIGHT_OF_REGENE , SI_LIGHT_OF_REGENE , SCB_NONE ); - set_sc( MH_OVERED_BOOST , SC_OVERED_BOOST , SI_OVERED_BOOST , SCB_FLEE|SCB_ASPD|SCB_DEF ); + set_sc( MH_LIGHT_OF_REGENE , SC_LIGHT_OF_REGENE , SI_LIGHT_OF_REGENE , SCB_NONE ); + set_sc( MH_OVERED_BOOST , SC_OVERED_BOOST , SI_OVERED_BOOST , SCB_FLEE|SCB_ASPD|SCB_DEF ); add_sc(MH_STAHL_HORN, SC_STUN); set_sc(MH_ANGRIFFS_MODUS, SC_ANGRIFFS_MODUS, SI_ANGRIFFS_MODUS, SCB_BATK | SCB_DEF | SCB_FLEE | SCB_MAXHP); @@ -529,14 +529,14 @@ void initChangeTables(void) { set_sc( RK_DEATHBOUND , SC_DEATHBOUND , SI_DEATHBOUND , SCB_NONE ); set_sc( RK_WINDCUTTER , SC_FEAR , SI_BLANK , SCB_FLEE|SCB_HIT ); add_sc( RK_DRAGONBREATH , SC_BURNING ); - set_sc( RK_MILLENNIUMSHIELD , SC_MILLENNIUMSHIELD , SI_BLANK , SCB_NONE ); + set_sc( RK_MILLENNIUMSHIELD , SC_MILLENNIUMSHIELD , SI_BLANK , SCB_NONE ); set_sc( RK_REFRESH , SC_REFRESH , SI_REFRESH , SCB_NONE ); set_sc( RK_GIANTGROWTH , SC_GIANTGROWTH , SI_GIANTGROWTH , SCB_STR ); set_sc( RK_STONEHARDSKIN , SC_STONEHARDSKIN , SI_STONEHARDSKIN , SCB_NONE ); set_sc( RK_VITALITYACTIVATION, SC_VITALITYACTIVATION, SI_VITALITYACTIVATION, SCB_REGEN ); set_sc( RK_FIGHTINGSPIRIT , SC_FIGHTINGSPIRIT , SI_FIGHTINGSPIRIT , SCB_WATK|SCB_ASPD ); set_sc( RK_ABUNDANCE , SC_ABUNDANCE , SI_ABUNDANCE , SCB_NONE ); - set_sc( RK_CRUSHSTRIKE , SC_CRUSHSTRIKE , SI_CRUSHSTRIKE , SCB_NONE ); + set_sc( RK_CRUSHSTRIKE , SC_CRUSHSTRIKE , SI_CRUSHSTRIKE , SCB_NONE ); add_sc( RK_DRAGONBREATH_WATER, SC_FROSTMISTY ); /** * GC Guillotine Cross @@ -724,25 +724,25 @@ void initChangeTables(void) { set_sc( EL_ROCK_CRUSHER , SC_ROCK_CRUSHER , SI_ROCK_CRUSHER , SCB_DEF ); set_sc( EL_ROCK_CRUSHER_ATK, SC_ROCK_CRUSHER_ATK , SI_ROCK_CRUSHER_ATK , SCB_SPEED ); - add_sc( KO_YAMIKUMO , SC_HIDING ); - set_sc_with_vfx( KO_JYUMONJIKIRI , SC_KO_JYUMONJIKIRI , SI_KO_JYUMONJIKIRI , SCB_NONE ); - add_sc( KO_MAKIBISHI , SC_STUN ); - set_sc( KO_MEIKYOUSISUI , SC_MEIKYOUSISUI , SI_MEIKYOUSISUI , SCB_NONE ); - set_sc( KO_KYOUGAKU , SC_KYOUGAKU , SI_KYOUGAKU , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK ); - add_sc( KO_JYUSATSU , SC_CURSE ); - set_sc( KO_ZENKAI , SC_ZENKAI , SI_ZENKAI , SCB_NONE ); - set_sc( KO_IZAYOI , SC_IZAYOI , SI_IZAYOI , SCB_MATK ); - set_sc( KG_KYOMU , SC_KYOMU , SI_KYOMU , SCB_NONE ); - set_sc( KG_KAGEMUSYA , SC_KAGEMUSYA , SI_KAGEMUSYA , SCB_NONE ); - set_sc( KG_KAGEHUMI , SC_KG_KAGEHUMI , SI_KG_KAGEHUMI , SCB_NONE ); - set_sc( OB_ZANGETSU , SC_ZANGETSU , SI_ZANGETSU , SCB_MATK|SCB_BATK ); - set_sc_with_vfx( OB_AKAITSUKI , SC_AKAITSUKI , SI_AKAITSUKI , SCB_NONE ); - set_sc( OB_OBOROGENSOU , SC_GENSOU , SI_GENSOU , SCB_NONE ); - - set_sc( ALL_FULL_THROTTLE , SC_FULL_THROTTLE , SI_FULL_THROTTLE , SCB_SPEED|SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK ); - - add_sc( ALL_REVERSEORCISH , SC_ORCISH ); - set_sc( ALL_ANGEL_PROTECT , SC_ANGEL_PROTECT , SI_ANGEL_PROTECT , SCB_REGEN ); + add_sc( KO_YAMIKUMO , SC_HIDING ); + set_sc_with_vfx( KO_JYUMONJIKIRI , SC_KO_JYUMONJIKIRI , SI_KO_JYUMONJIKIRI , SCB_NONE ); + add_sc( KO_MAKIBISHI , SC_STUN ); + set_sc( KO_MEIKYOUSISUI , SC_MEIKYOUSISUI , SI_MEIKYOUSISUI , SCB_NONE ); + set_sc( KO_KYOUGAKU , SC_KYOUGAKU , SI_KYOUGAKU , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK ); + add_sc( KO_JYUSATSU , SC_CURSE ); + set_sc( KO_ZENKAI , SC_ZENKAI , SI_ZENKAI , SCB_NONE ); + set_sc( KO_IZAYOI , SC_IZAYOI , SI_IZAYOI , SCB_MATK ); + set_sc( KG_KYOMU , SC_KYOMU , SI_KYOMU , SCB_NONE ); + set_sc( KG_KAGEMUSYA , SC_KAGEMUSYA , SI_KAGEMUSYA , SCB_NONE ); + set_sc( KG_KAGEHUMI , SC_KG_KAGEHUMI , SI_KG_KAGEHUMI , SCB_NONE ); + set_sc( OB_ZANGETSU , SC_ZANGETSU , SI_ZANGETSU , SCB_MATK|SCB_BATK ); + set_sc_with_vfx( OB_AKAITSUKI, SC_AKAITSUKI , SI_AKAITSUKI , SCB_NONE ); + set_sc( OB_OBOROGENSOU , SC_GENSOU , SI_GENSOU , SCB_NONE ); + + set_sc( ALL_FULL_THROTTLE , SC_FULL_THROTTLE , SI_FULL_THROTTLE , SCB_SPEED|SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK ); + + add_sc( ALL_REVERSEORCISH , SC_ORCISH ); + set_sc( ALL_ANGEL_PROTECT , SC_ANGEL_PROTECT , SI_ANGEL_PROTECT , SCB_REGEN ); add_sc( NPC_WIDEHEALTHFEAR , SC_FEAR ); add_sc( NPC_WIDEBODYBURNNING , SC_BURNING ); @@ -750,7 +750,7 @@ void initChangeTables(void) { add_sc( NPC_WIDECOLD , SC_COLD ); add_sc( NPC_WIDE_DEEP_SLEEP , SC_DEEP_SLEEP ); add_sc( NPC_WIDESIREN , SC_SIREN ); - + set_sc_with_vfx( GN_ILLUSIONDOPING , SC_ILLUSIONDOPING , SI_ILLUSIONDOPING , SCB_HIT ); // Storing the target job rather than simply SC_SOULLINK simplifies code later on. @@ -1022,32 +1022,32 @@ void initChangeTables(void) { status->ChangeFlagTable[SC_DECORATION_OF_MUSIC] |= SCB_NONE; /* status->DisplayType Table [Ind/Hercules] */ - status->DisplayType[SC_ALL_RIDING] = true; - status->DisplayType[SC_PUSH_CART] = true; - status->DisplayType[SC_SUMMON1] = true; - status->DisplayType[SC_SUMMON2] = true; - status->DisplayType[SC_SUMMON3] = true; - status->DisplayType[SC_SUMMON4] = true; - status->DisplayType[SC_SUMMON5] = true; - status->DisplayType[SC_CAMOUFLAGE] = true; - status->DisplayType[SC_DUPLELIGHT] = true; - status->DisplayType[SC_ORATIO] = true; - status->DisplayType[SC_FROSTMISTY] = true; - status->DisplayType[SC_VENOMIMPRESS] = true; - status->DisplayType[SC_HALLUCINATIONWALK] = true; - status->DisplayType[SC_ROLLINGCUTTER] = true; - status->DisplayType[SC_BANDING] = true; - status->DisplayType[SC_COLD] = true; - status->DisplayType[SC_DEEP_SLEEP] = true; - status->DisplayType[SC_CURSEDCIRCLE_ATKER]= true; - status->DisplayType[SC_CURSEDCIRCLE_TARGET]= true; - status->DisplayType[SC_BLOOD_SUCKER] = true; - status->DisplayType[SC__SHADOWFORM] = true; - status->DisplayType[SC_MONSTER_TRANSFORM] = true; - status->DisplayType[SC_MOONSTAR] = true; - status->DisplayType[SC_SUPER_STAR] = true; - status->DisplayType[SC_STRANGELIGHTS] = true; - status->DisplayType[SC_DECORATION_OF_MUSIC] = true; + status->DisplayType[SC_ALL_RIDING] = true; + status->DisplayType[SC_PUSH_CART] = true; + status->DisplayType[SC_SUMMON1] = true; + status->DisplayType[SC_SUMMON2] = true; + status->DisplayType[SC_SUMMON3] = true; + status->DisplayType[SC_SUMMON4] = true; + status->DisplayType[SC_SUMMON5] = true; + status->DisplayType[SC_CAMOUFLAGE] = true; + status->DisplayType[SC_DUPLELIGHT] = true; + status->DisplayType[SC_ORATIO] = true; + status->DisplayType[SC_FROSTMISTY] = true; + status->DisplayType[SC_VENOMIMPRESS] = true; + status->DisplayType[SC_HALLUCINATIONWALK] = true; + status->DisplayType[SC_ROLLINGCUTTER] = true; + status->DisplayType[SC_BANDING] = true; + status->DisplayType[SC_COLD] = true; + status->DisplayType[SC_DEEP_SLEEP] = true; + status->DisplayType[SC_CURSEDCIRCLE_ATKER] = true; + status->DisplayType[SC_CURSEDCIRCLE_TARGET] = true; + status->DisplayType[SC_BLOOD_SUCKER] = true; + status->DisplayType[SC__SHADOWFORM] = true; + status->DisplayType[SC_MONSTER_TRANSFORM] = true; + status->DisplayType[SC_MOONSTAR] = true; + status->DisplayType[SC_SUPER_STAR] = true; + status->DisplayType[SC_STRANGELIGHTS] = true; + status->DisplayType[SC_DECORATION_OF_MUSIC] = true; #ifdef RENEWAL_EDP // renewal EDP increases your weapon atk @@ -1141,7 +1141,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, /* here onwards we consider it a 32-type, the client does not support higher and from here onwards the value doesn't get thru percentage modifiers */ hp = (int)cap_value(in_hp,INT_MIN,INT_MAX); sp = (int)cap_value(in_sp,INT_MIN,INT_MAX); - + if(sp && !(target->type&BL_CONSUME)) sp = 0; //Not a valid SP target. @@ -1178,10 +1178,12 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, if( !st->hp ) flag |= 8; +#if 0 // Let through. battle.c/skill.c have the whole logic of when it's possible or // not to hurt someone (and this check breaks pet catching) [Skotlex] - // if (!target->prev && !(flag&2)) - // return 0; //Cannot damage a bl not on a map, except when "charging" hp/sp + if (!target->prev && !(flag&2)) + return 0; //Cannot damage a bl not on a map, except when "charging" hp/sp +#endif // 0 sc = status->get_sc(target); if( hp && battle_config.invincible_nodamage && src && sc && sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] ) @@ -1190,11 +1192,11 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, if( hp && !(flag&1) ) { if( sc ) { struct status_change_entry *sce; - + #ifdef DEVOTION_REFLECT_DAMAGE if(src && (sce = sc->data[SC_DEVOTION])) { struct block_list *d_bl = map->id2bl(sce->val1); - + if(d_bl &&((d_bl->type == BL_MER && ((TBL_MER *)d_bl)->master && ((TBL_MER *)d_bl)->master->bl.id == target->id) || (d_bl->type == BL_PC && ((TBL_PC *)d_bl)->devotion[sce->val2] == target->id)) && check_distance_bl(target, d_bl, sce->val3)) { clif->damage(d_bl, d_bl, 0, 0, hp, 0, 0, 0); @@ -1204,7 +1206,6 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, status_change_end(target, SC_DEVOTION, INVALID_TIMER); } #endif - if (sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) status_change_end(target, SC_STONE, INVALID_TIMER); status_change_end(target, SC_FREEZE, INVALID_TIMER); @@ -1268,8 +1269,8 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, unit->stop_walking( target, 1 ); } - if( st->hp || (flag&8) ) - { //Still lives or has been dead before this damage. + if (st->hp || (flag&8)) { + //Still lives or has been dead before this damage. if (walkdelay) unit->set_walkdelay(target, timer->gettick(), walkdelay, 0); return (int)(hp+sp); @@ -1287,7 +1288,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, case BL_HOM: flag = homun->dead((TBL_HOM*)target); break; case BL_MER: flag = mercenary->dead((TBL_MER*)target); break; case BL_ELEM: flag = elemental->dead((TBL_ELEM*)target); break; - default: //Unhandled case, do nothing to object. + default: //Unhandled case, do nothing to object. flag = 0; break; } @@ -1373,7 +1374,7 @@ int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) { /* here onwards we consider it a 32-type, the client does not support higher and from here onwards the value doesn't get thru percentage modifiers */ hp = (int)cap_value(in_hp,INT_MIN,INT_MAX); sp = (int)cap_value(in_sp,INT_MIN,INT_MAX); - + sc = status->get_sc(bl); if (sc && !sc->count) sc = NULL; @@ -1517,13 +1518,12 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per if (bl->prev) //Animation only if character is already on a map. clif->resurrection(bl, 1); - + switch (bl->type) { case BL_PC: pc->revive((TBL_PC*)bl, hp, sp); break; case BL_MOB: mob->revive((TBL_MOB*)bl, hp); break; case BL_HOM: homun->revive((TBL_HOM*)bl, hp, sp); break; } - return 1; } @@ -1543,7 +1543,7 @@ int status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned int hp = st->max_hp - st->hp; else if (per_hp && !hp) hp = 1; - + if(sp > st->max_sp - st->sp) sp = st->max_sp - st->sp; else if (per_sp && !sp) @@ -1566,9 +1566,9 @@ int status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned int * Checks whether the src can use the skill on the target, * taking into account status/option of both source/target. [Skotlex] * flag: -* 0 - Trying to use skill on target. -* 1 - Cast bar is done. -* 2 - Skill already pulled off, check is due to ground-based skills or splash-damage ones. +* 0 - Trying to use skill on target. +* 1 - Cast bar is done. +* 2 - Skill already pulled off, check is due to ground-based skills or splash-damage ones. * src MAY be null to indicate we shouldn't check it, this is a ground-based skill attack. * target MAY Be null, in which case the checks are only to see * whether the source can cast or not the skill on the ground. @@ -1701,12 +1701,13 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin } } if ((sc->data[SC_DANCING]->val1&0xFFFF) == CG_HERMODE && skill_id == BD_ADAPTATION) - return 0; //Can't amp out of Wand of Hermode :/ [Skotlex] + return 0; //Can't amp out of Wand of Hermode :/ [Skotlex] } if (skill_id && //Do not block item-casted skills. (src->type != BL_PC || ((TBL_PC*)src)->skillitem != skill_id) - ) { //Skills blocked through status changes... + ) { + //Skills blocked through status changes... if (!flag && ( //Blocked only from using the skill (stuff like autospell may still go through sc->data[SC_SILENCE] || sc->data[SC_STEELBODY] || @@ -1822,7 +1823,8 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin } } break; - case BL_ITEM: //Allow targeting of items to pick'em up (or in the case of mobs, to loot them). + case BL_ITEM: + //Allow targeting of items to pick'em up (or in the case of mobs, to loot them). //TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex] if (st->mode&MD_LOOTER) return 1; @@ -1853,7 +1855,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin int status_check_visibility(struct block_list *src, struct block_list *target) { int view_range; struct status_change *tsc = NULL; - + switch (src->type) { case BL_MOB: view_range = ((TBL_MOB*)src)->min_chase; @@ -1870,7 +1872,7 @@ int status_check_visibility(struct block_list *src, struct block_list *target) { if( src->type == BL_NPC ) /* NPCs don't care for the rest */ return 1; - + if( ( tsc = status->get_sc(target) ) ) { struct status_data *st = status->get_status_data(src); @@ -1899,11 +1901,14 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) short mod = -1; switch( sd->weapontype2 ){ // adjustment for dual wielding - case W_DAGGER: mod = 0; break; // 0, 1, 1 + case W_DAGGER: + mod = 0; + break; // 0, 1, 1 case W_1HSWORD: - case W_1HAXE: mod = 1; + case W_1HAXE: + mod = 1; if( (sd->class_&MAPID_THIRDMASK) == MAPID_GUILLOTINE_CROSS ) // 0, 2, 3 - mod = sd->weapontype2 / W_1HSWORD + W_1HSWORD / sd->weapontype2 ; + mod = sd->weapontype2 / W_1HSWORD + W_1HSWORD / sd->weapontype2; } amotion = ( sd->status.weapon < MAX_WEAPON_TYPE && mod < 0 ) @@ -1926,14 +1931,13 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) // percentual delay reduction from stats amotion -= amotion * (4*st->agi + st->dex)/1000; #endif - // raw delay adjustment from bAspd bonus amotion += sd->bonus.aspd_add; /* angra manyu disregards aspd_base and similar */ if( sd->equip_index[EQI_HAND_R] >= 0 && sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid == ITEMID_ANGRA_MANYU ) return 0; - + return amotion; } @@ -2215,8 +2219,8 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) { status->calc_misc(&md->bl, mstatus, md->level); - if(flag&4) - { // Strengthen Guardians - custom value +10% / lv + if (flag&4) { + // Strengthen Guardians - custom value +10% / lv struct guild_castle *gc; gc=guild->mapname2gc(map->list[md->bl.m].name); if (!gc) @@ -2297,7 +2301,7 @@ int status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt) status->calc_misc(&pd->bl, &pd->status, lv); - if (! (opt&SCO_FIRST) ) //Not done the first time because the pet is not visible yet + if (! (opt&SCO_FIRST) ) //Not done the first time because the pet is not visible yet clif->send_petstatus(sd); } } else if ( opt&SCO_FIRST ) { @@ -2396,7 +2400,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { b_max_weight = sd->max_weight; b_cart_weight_max = sd->cart_weight_max; - pc->calc_skilltree(sd); // SkillTree calculation + pc->calc_skilltree(sd); // SkillTree calculation sd->max_weight = status->max_weight_base[pc->class2idx(sd->status.class_)]+sd->status.str*300; @@ -2472,7 +2476,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { clif->sc_end(&sd->bl,sd->bl.id,SELF,SI_CLAIRVOYANCE); memset(&sd->special_state,0,sizeof(sd->special_state)); - + if (!sd->state.permanent_speed) { memset(&bstatus->max_hp, 0, sizeof(struct status_data)-(sizeof(bstatus->hp)+sizeof(bstatus->sp))); bstatus->speed = DEFAULT_WALK_SPEED; @@ -2481,7 +2485,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { memset(&bstatus->max_hp, 0, sizeof(struct status_data)-(sizeof(bstatus->hp)+sizeof(bstatus->sp))); bstatus->speed = pSpeed; } - + //FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex] //Give them all modes except these (useful for clones) bstatus->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK); @@ -2569,8 +2573,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { bstatus->def += sd->inventory_data[index]->def; - if(opt&SCO_FIRST && sd->inventory_data[index]->equip_script) - { //Execute equip-script on login + if (opt&SCO_FIRST && sd->inventory_data[index]->equip_script) { + //Execute equip-script on login script->run(sd->inventory_data[index]->equip_script,0,sd->bl.id,0); if (!calculating) return 1; @@ -2620,8 +2624,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { return 1; } - if(sd->status.inventory[index].card[0]==CARD0_FORGE) - { // Forged weapon + if (sd->status.inventory[index].card[0]==CARD0_FORGE) { + // Forged weapon wd->star += (sd->status.inventory[index].card[1]>>8); if(wd->star >= 15) wd->star = 40; // 3 Star Crumbs now give +40 dmg if(pc->famerank(MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) ,MAPID_BLACKSMITH)) @@ -2649,7 +2653,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { if(sd->equip_index[EQI_AMMO] >= 0){ index = sd->equip_index[EQI_AMMO]; - if(sd->inventory_data[index]){ // Arrows + if (sd->inventory_data[index]) { + // Arrows sd->bonus.arrow_atk += sd->inventory_data[index]->atk; sd->state.lr_flag = 2; if( !itemdb_is_GNthrowable(sd->inventory_data[index]->nameid) ) //don't run scripts on throwable items @@ -2664,7 +2669,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { for( i = 0; i < sd->combo_count; i++ ) { struct item_combo *combo = itemdb->id2combo(sd->combos[i].id); unsigned char j; - + /** * ensure combo usage is allowed at this location **/ @@ -2677,10 +2682,10 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { if( k != map->list[sd->bl.m].zone->disabled_items_count ) break; } - + if( j != combo->count ) continue; - + script->run(sd->combos[i].bonus,0,sd->bl.id,0); if (!calculating) //Abort, script->run retriggered this. return 1; @@ -3191,7 +3196,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { sd->subele[ELE_HOLY] += sc->data[SC_PROVIDENCE]->val2; sd->subrace[RC_DEMON] += sc->data[SC_PROVIDENCE]->val2; } - 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; @@ -3333,7 +3339,7 @@ int status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt) { homun->calc_skilltree(hd, 0); if((skill_lv=homun->checkskill(hd,HAMI_SKIN)) > 0) - hstatus->def += skill_lv * 4; + hstatus->def += skill_lv * 4; if((skill_lv = homun->checkskill(hd,HVAN_INSTRUCT)) > 0) { hstatus->int_ += 1 +skill_lv/2 +skill_lv/4 +skill_lv/5; @@ -3578,8 +3584,8 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str || sc->data[SC_MAGICMUSHROOM] || sc->data[SC_RAISINGDRAGON] || sc->data[SC_SATURDAY_NIGHT_FEVER] - ) //No regen - regen->flag = 0; + ) + regen->flag = 0; //No regen 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 @@ -3868,9 +3874,9 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) { } // No status changes alter these yet. - // if(flag&SCB_SIZE) - // if(flag&SCB_RACE) - // if(flag&SCB_RANGE) + //if(flag&SCB_SIZE) + //if(flag&SCB_RACE) + //if(flag&SCB_RANGE) if(flag&SCB_MAXHP) { if( bl->type&BL_PC ) { @@ -3944,7 +3950,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) { amotion = (1000 - 2*st->agi - st->dex) * ((TBL_HOM*)bl)->homunculusDB->baseASPD/1000; #else amotion = (1000 - 4*st->agi - st->dex) * ((TBL_HOM*)bl)->homunculusDB->baseASPD/1000; -#endif +#endif st->aspd_rate = status->calc_aspd_rate(bl, sc, bst->aspd_rate); if(st->aspd_rate != 1000) @@ -4013,7 +4019,7 @@ void status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status_ca return; } } - + // remember previous values st = status->get_status_data(bl); memcpy(&bst, st, sizeof(struct status_data)); @@ -4270,7 +4276,7 @@ unsigned short status_calc_agi(struct block_list *bl, struct status_change *sc, if(sc->data[SC_INC_AGI]) agi += sc->data[SC_INC_AGI]->val2; if(sc->data[SC_GS_ACCURACY]) - agi += 4; // added based on skill updates [Reddozen] + agi += 4; // added based on skill updates [Reddozen] if(sc->data[SC_DEC_AGI]) agi -= sc->data[SC_DEC_AGI]->val2; if(sc->data[SC_QUAGMIRE]) @@ -4446,7 +4452,7 @@ unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc, dex >>= 1; } if(sc->data[SC_GS_ACCURACY]) - dex += 4; // added based on skill updates [Reddozen] + dex += 4; // added based on skill updates [Reddozen] if(sc->data[SC_MARIONETTE_MASTER]) dex -= ((sc->data[SC_MARIONETTE_MASTER]->val4)>>8)&0xFF; if(sc->data[SC_MARIONETTE]) @@ -4578,9 +4584,10 @@ unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, batk -= batk * 25/100; if( sc->data[SC_ZANGETSU] ) batk += sc->data[SC_ZANGETSU]->val2; - //Curse shouldn't effect on this? <- Curse OR Bleeding?? - // if(sc->data[SC_BLOODING]) - // batk -= batk * 25/100; +#if 0 //Curse shouldn't effect on this? <- Curse OR Bleeding?? + 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]) @@ -4838,7 +4845,7 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in hit /= 2; if(sc->data[SC_ILLUSIONDOPING]) hit -= hit * (5 + sc->data[SC_ILLUSIONDOPING]->val1) / 100; //custom - + return (short)cap_value(hit,1,SHRT_MAX); } @@ -4923,7 +4930,7 @@ signed short status_calc_flee(struct block_list *bl, struct status_change *sc, i 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 flee = sc->data[SC_OVERED_BOOST]->val2; @@ -4981,7 +4988,7 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def if(sc->data[SC_STEELBODY]) return 90; #endif - + if(sc->data[SC_STONEHARDSKIN]) def += sc->data[SC_STONEHARDSKIN]->val1; if(sc->data[SC_DRUMBATTLE]) @@ -4989,7 +4996,7 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def if(sc->data[SC_STONESKIN]) def += sc->data[SC_STONESKIN]->val2; - if(sc->data[SC_HAMI_DEFENCE]) //[orn] + if(sc->data[SC_HAMI_DEFENCE]) //[orn] def += sc->data[SC_HAMI_DEFENCE]->val2; if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2) @@ -5307,7 +5314,7 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc if( sc->data[SC__GROOMY] ) val = max( val, sc->data[SC__GROOMY]->val2); if( sc->data[SC_GLOOMYDAY] ) - val = max( val, sc->data[SC_GLOOMYDAY]->val3 ); // Should be 50 (-50% speed) + val = max( val, sc->data[SC_GLOOMYDAY]->val3 ); // Should be 50 (-50% speed) if( sc->data[SC_STEALTHFIELD_MASTER] ) val = max( val, 30 ); if( sc->data[SC_BANDING_DEFENCE] ) @@ -5517,7 +5524,7 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl skills2 += sc->data[SC_GS_GATLINGFEVER]->val1; if( sc->data[SC_STAR_COMFORT] ) skills2 += 3 * sc->data[SC_STAR_COMFORT]->val1; - + return ( flag&1? (skills1 + pots) : skills2 ); #else return 0; @@ -5899,8 +5906,8 @@ const char* status_get_name(struct block_list *bl) { /*========================================== * Get the class of the current bl * return -* 0 = fail -* class_id = success +* 0 = fail +* class_id = success *------------------------------------------*/ int status_get_class(struct block_list *bl) { nullpo_ret(bl); @@ -5918,8 +5925,8 @@ int status_get_class(struct block_list *bl) { /*========================================== * Get the base level of the current bl * return -* 1 = fail -* level = success +* 1 = fail +* level = success *------------------------------------------*/ int status_get_lv(struct block_list *bl) { nullpo_ret(bl); @@ -6093,7 +6100,7 @@ int status_get_emblem_id(struct block_list *bl) { case BL_MOB: { struct map_session_data *msd; struct mob_data *md = (struct mob_data *)bl; - if (md->guardian_data) //Guardian's guild [Skotlex] + if (md->guardian_data) //Guardian's guild [Skotlex] return (md->guardian_data->g) ? md->guardian_data->g->emblem_id:0; if (md->special_state.ai && (msd = map->id2sd(md->master_id)) != NULL) return msd->guild_emblem_id; //Alchemist's mobs [Skotlex] @@ -6195,7 +6202,8 @@ void status_set_viewdata(struct block_list *bl, int class_) TBL_PC* sd = (TBL_PC*)bl; if (pcdb_checkid(class_)) { if (pc_isridingpeco(sd)) { - switch (class_) { //Adapt class to a Mounted one. + switch (class_) { + //Adapt class to a Mounted one. case JOB_KNIGHT: class_ = JOB_KNIGHT2; break; @@ -6280,7 +6288,7 @@ void status_set_viewdata(struct block_list *bl, int class_) ShowError("status_set_viewdata (NPC): No view data for class %d\n", class_); } break; - case BL_HOM: //[blackhole89] + case BL_HOM: //[blackhole89] { struct homun_data *hd = (struct homun_data*)bl; if (vd) @@ -6350,7 +6358,7 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ struct map_session_data *sd; nullpo_ret(bl); - + if(!src) return tick ? tick : 1; // If no source, it can't be resisted (NPC given) @@ -6692,19 +6700,19 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ void status_display_add(struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3) { struct sc_display_entry *entry; int i; - + for( i = 0; i < sd->sc_display_count; i++ ) { if( sd->sc_display[i]->type == type ) break; } - + if( i != sd->sc_display_count ) { sd->sc_display[i]->val1 = dval1; sd->sc_display[i]->val2 = dval2; sd->sc_display[i]->val3 = dval3; return; } - + entry = ers_alloc(pc->sc_display_ers, struct sc_display_entry); entry->type = type; @@ -6791,8 +6799,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t struct mob_data *md = BL_CAST(BL_MOB,bl); if(md && (md->class_ == MOBID_EMPERIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA) return 0; //Emperium/BG Monsters can't be afflicted by status changes - //if(md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP) - // return 0; //prevent status addinh hp to gvg mob (like bloodylust=hp*3 etc... +#if 0 + if(md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP) + return 0; //prevent status addinh hp to gvg mob (like bloodylust=hp*3 etc... +#endif // 0 } if( sc->data[SC_REFRESH] ) { @@ -7146,7 +7156,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t { // it doesn't stack or even renewed int i = SC_TOXIN; for(; i<= SC_LEECHESEND; i++) - if(sc->data[i]) return 0; + if(sc->data[i]) return 0; } break; case SC_MAGNETICFIELD: @@ -7296,8 +7306,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t status_change_end(bl, SC_ASSUMPTIO, INVALID_TIMER); break; case SC_CARTBOOST: - if(sc->data[SC_DEC_AGI] || sc->data[SC_ADORAMUS]) - { //Cancel Decrease Agi, but take no further effect [Skotlex] + if (sc->data[SC_DEC_AGI] || sc->data[SC_ADORAMUS]) { + //Cancel Decrease Agi, but take no further effect [Skotlex] status_change_end(bl, SC_DEC_AGI, INVALID_TIMER); status_change_end(bl, SC_ADORAMUS, INVALID_TIMER); return 0; @@ -7599,7 +7609,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t tick_time = val2 = tick>0?tick:60000; tick = -1; // duration sent to the client should be infinite break; - case SC_EDP: // [Celest] + case SC_EDP: // [Celest] val2 = val1 + 2; //Chance to Poison enemies. val3 = 50*(val1+1); //Damage increase (+50 +50*lv%) #ifdef RENEWAL_EDP @@ -7639,7 +7649,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t tick = -1; break; case SC_ENCHANTPOISON: - val2= 250+50*val1; //Poisoning Chance (2.5+0.5%) in 1/10000 rate + val2= 250+50*val1; //Poisoning Chance (2.5+0.5%) in 1/10000 rate case SC_ASPERSIO: case SC_PROPERTYFIRE: case SC_PROPERTYWATER: @@ -7888,12 +7898,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t //val4&1 signals the presence of a wall. //val4&2 makes cloak not end on normal attacks [Skotlex] //val4&4 makes cloak not end on using skills - if (bl->type == BL_PC || (bl->type == BL_MOB && ((TBL_MOB*)bl)->special_state.clone) ) //Standard cloaking. + if (bl->type == BL_PC || (bl->type == BL_MOB && ((TBL_MOB*)bl)->special_state.clone) ) //Standard cloaking. val4 |= battle_config.pc_cloak_check_type&7; else val4 |= battle_config.monster_cloak_check_type&7; break; - case SC_SIGHT: /* splash status */ + case SC_SIGHT: /* splash status */ case SC_RUWACH: case SC_WZ_SIGHTBLASTER: val3 = skill->get_splash(val2, val1); //Val2 should bring the skill-id. @@ -8167,7 +8177,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_KAAHI: val2 = 200*val1; //HP heal val3 = 5*val1; //SP cost - val4 = INVALID_TIMER; //Kaahi Timer. + val4 = INVALID_TIMER; //Kaahi Timer. break; case SC_BLESSING: if ((!undead_flag && st->race!=RC_DEMON) || bl->type == BL_PC) @@ -8303,7 +8313,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t //2. Set restore point (val3 -> return map, val4 return coords val3 = map_index; val4 = pos; - } else if (!val3 + } else if (!val3 || val3 == sd->mapindex || !sd->sc.data[SC_JAILED] // If player is being jailed and is already in jail (issue: 8206) ) { //Use save point. @@ -8357,11 +8367,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t break; case SC_STONESKIN: - if (val2 == NPC_ANTIMAGIC) - { //Boost mdef + if (val2 == NPC_ANTIMAGIC) { + //Boost mdef val2 =-20; val3 = 20; - } else { //Boost def + } else { + //Boost def val2 = 20; val3 =-20; } @@ -8825,7 +8836,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_HEATER_OPTION: val2 = 120; // Watk. TODO: Renewal (Atk2) val3 = (sd ? sd->status.job_level : 0); // % Increase damage. - val4 = 3; // Change into fire element. + val4 = 3; // Change into fire element. break; case SC_TROPIC_OPTION: val2 = 180; // Watk. TODO: Renewal (Atk2) @@ -8835,16 +8846,16 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val2 = 40; break; case SC_COOLER_OPTION: - val2 = 80; // Bonus Matk + val2 = 80; // Bonus Matk val3 = (sd ? sd->status.job_level : 0); // % Freezing chance - val4 = 1; // Change into water elemet + val4 = 1; // Change into water elemet break; case SC_CHILLY_AIR_OPTION: val2 = 120; // Matk. TODO: Renewal (Matk1) val3 = MG_COLDBOLT; break; case SC_WIND_STEP_OPTION: - val2 = 50; // % Increase speed and flee. + val2 = 50; // % Increase speed and flee. break; case SC_BLAST_OPTION: val2 = (sd ? sd->status.job_level : 0); // % Increase damage @@ -8876,7 +8887,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_WATER_DROP_OPTION: case SC_WIND_CURTAIN_OPTION: case SC_STONE_SHIELD_OPTION: - val2 = 100; // Elemental modifier. + val2 = 100; // Elemental modifier. break; case SC_TROPIC: case SC_CHILLY_AIR: @@ -8908,10 +8919,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t tick_time = val3; break; case SC_WATER_BARRIER: - val3 = 20; // Reductions. Atk2, Flee1 + val3 = 20; // Reductions. Atk2, Flee1 break; case SC_ZEPHYR: - val2 = 25; // Flee. + val2 = 25; // Flee. break; case SC_TIDAL_WEAPON: val2 = 20; // Increase Elemental's attack. @@ -8926,7 +8937,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val1 = 15; break; case SC_STOMACHACHE: - val2 = 8; // SP consume. + val2 = 8; // SP consume. val4 = tick / 10000; tick_time = 10000; // [GodLesZ] tick time break; @@ -9061,8 +9072,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val2 = 20+(20*val1); break; default: - if( calc_flag == SCB_NONE && status->SkillChangeTable[type] == 0 && status->IconChangeTable[type] == 0 ) - { //Status change with no calc, no icon, and no skill associated...? + if (calc_flag == SCB_NONE && status->SkillChangeTable[type] == 0 && status->IconChangeTable[type] == 0) { + //Status change with no calc, no icon, and no skill associated...? ShowError("UnknownStatusChange [%d]\n", type); return 0; } @@ -9213,7 +9224,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val_flag |= 1; break; } - + /* [Ind/Hercules] */ if( sd && status->DisplayType[type] ) { int dval1 = 0, dval2 = 0, dval3 = 0; @@ -9317,13 +9328,13 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t opt_flag = 1; switch(type) { //OPT1 - case SC_STONE: sc->opt1 = OPT1_STONEWAIT; break; - case SC_FREEZE: sc->opt1 = OPT1_FREEZE; break; - case SC_STUN: sc->opt1 = OPT1_STUN; break; - case SC_SLEEP: sc->opt1 = OPT1_SLEEP; break; - case SC_BURNING: sc->opt1 = OPT1_BURNING; break; // Burning need this to be showed correctly. [pakpil] - case SC_WHITEIMPRISON: sc->opt1 = OPT1_IMPRISON; break; - case SC_COLD: sc->opt1 = OPT1_CRYSTALIZE; break; + case SC_STONE: sc->opt1 = OPT1_STONEWAIT; break; + case SC_FREEZE: sc->opt1 = OPT1_FREEZE; break; + case SC_STUN: sc->opt1 = OPT1_STUN; break; + case SC_SLEEP: sc->opt1 = OPT1_SLEEP; break; + case SC_BURNING: sc->opt1 = OPT1_BURNING; break; // Burning need this to be showed correctly. [pakpil] + case SC_WHITEIMPRISON: sc->opt1 = OPT1_IMPRISON; break; + case SC_COLD: sc->opt1 = OPT1_CRYSTALIZE; break; //OPT2 case SC_POISON: sc->opt2 |= OPT2_POISON; break; case SC_CURSE: sc->opt2 |= OPT2_CURSE; break; @@ -9349,7 +9360,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t break; case SC_OVERTHRUSTMAX: case SC_OVERTHRUST: - case SC_SWOO: //Why does it shares the same opt as Overthrust? Perhaps we'll never know... + case SC_SWOO: //Why does it shares the same opt as Overthrust? Perhaps we'll never know... sc->opt3 |= OPT3_OVERTHRUST; opt_flag = 0; break; @@ -9385,10 +9396,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t opt_flag = 0; sc->opt3 |= OPT3_BERSERK; break; -// case ???: // doesn't seem to do anything -// sc->opt3 |= OPT3_LIGHTBLADE; -// opt_flag = 0; -// break; +#if 0 + case ???: // doesn't seem to do anything + sc->opt3 |= OPT3_LIGHTBLADE; + opt_flag = 0; + break; +#endif // 0 case SC_DANCING: if ((val1&0xFFFF) == CG_MOONLIT) sc->opt3 |= OPT3_MOONLIT; @@ -9423,10 +9436,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t sc->opt3 |= OPT3_UNDEAD; opt_flag = 0; break; -// case ???: // from DA_CONTRACT (looks like biolab mobs aura) -// sc->opt3 |= OPT3_CONTRACT; -// opt_flag = 0; -// break; +#if 0 + case ???: // from DA_CONTRACT (looks like biolab mobs aura) + sc->opt3 |= OPT3_CONTRACT; + opt_flag = 0; + break; +#endif // 0 //OPTION case SC_HIDING: sc->option |= OPTION_HIDE; @@ -9492,7 +9507,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); } } - if (calc_flag&SCB_DYE) { //Reset DYE color + if (calc_flag&SCB_DYE) { + //Reset DYE color if (vd && vd->cloth_color) { val4 = vd->cloth_color; clif->changelook(bl,LOOK_CLOTHES_COLOR,0); @@ -9694,7 +9710,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const #ifdef ANTI_MAYAP_CHEAT bool invisible = false; #endif - + nullpo_ret(bl); sc = status->get_sc(bl); @@ -9710,7 +9726,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const if( sd && sce->timer == INVALID_TIMER && !sd->state.loggingout ) chrif->del_scdata_single(sd->status.account_id,sd->status.char_id,type); - + if (tid == INVALID_TIMER) { if (type == SC_ENDURE && sce->val4) //Do not end infinite endure. @@ -10333,10 +10349,12 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const opt_flag = 0; sc->opt3 &= ~OPT3_BERSERK; break; - // case ???: // doesn't seem to do anything - // sc->opt3 &= ~OPT3_LIGHTBLADE; - // opt_flag = 0; - // break; +#if 0 + case ???: // doesn't seem to do anything + sc->opt3 &= ~OPT3_LIGHTBLADE; + opt_flag = 0; + break; +#endif // 0 case SC_DANCING: if ((sce->val1&0xFFFF) == CG_MOONLIT) sc->opt3 &= ~OPT3_MOONLIT; @@ -10371,10 +10389,12 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const sc->opt3 &= ~OPT3_UNDEAD; opt_flag = 0; break; - // case ???: // from DA_CONTRACT (looks like biolab mobs aura) - // sc->opt3 &= ~OPT3_CONTRACT; - // opt_flag = 0; - // break; +#if 0 + case ???: // from DA_CONTRACT (looks like biolab mobs aura) + sc->opt3 &= ~OPT3_CONTRACT; + opt_flag = 0; + break; +#endif // 0 default: opt_flag = 0; } @@ -10608,10 +10628,11 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { case SC_KNOWLEDGE: if (!sd) break; - if(bl->m == sd->feel_map[0].m || - bl->m == sd->feel_map[1].m || - bl->m == sd->feel_map[2].m) - { //Timeout will be handled by pc->setpos + if (bl->m == sd->feel_map[0].m + || bl->m == sd->feel_map[1].m + || bl->m == sd->feel_map[2].m + ) { + //Timeout will be handled by pc->setpos sce->timer = INVALID_TIMER; return 0; } @@ -10741,12 +10762,13 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { break; case SC_SPLASHER: - // custom Venom Splasher countdown timer - //if (sce->val4 % 1000 == 0) { - // char counter[10]; - // snprintf (counter, 10, "%d", sce->val4/1000); - // clif->message(bl, counter); - //} +#if 0 // custom Venom Splasher countdown timer + if (sce->val4 % 1000 == 0) { + char counter[10]; + snprintf (counter, 10, "%d", sce->val4/1000); + clif->message(bl, counter); + } +#endif // 0 if((sce->val4 -= 500) > 0) { sc_timer_next(500 + tick, status->change_timer, bl->id, data); return 0; @@ -11163,7 +11185,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { if(--(sce->val4) >= 0) { // 1% SP Upkeep Cost int sp = st->max_sp / 100; - + if( st->sp <= sp ) status_change_end(bl,SC_STEALTHFIELD_MASTER,INVALID_TIMER); @@ -11423,9 +11445,9 @@ unsigned short status_get_rand_matk( unsigned short matk_max, unsigned short mat /** * Get bl's matk_max and matk_min values depending on flag * @param flag - * 0 - Get MATK - * 1 - Get MATK w/o SC bonuses - * 3 - Get MATK w/o EATK & SC bonuses + * 0 - Get MATK + * 1 - Get MATK w/o SC bonuses + * 3 - Get MATK w/o EATK & SC bonuses **/ void status_get_matk_sub( struct block_list *bl, int flag, unsigned short *matk_max, unsigned short *matk_min ) { struct status_data *st; @@ -11496,9 +11518,9 @@ void status_get_matk_sub( struct block_list *bl, int flag, unsigned short *matk_ /** * Get bl's matk value depending on flag * @param flag [malufett] - * 1 - Get MATK w/o SC bonuses - * 2 - Get modified MATK - * 3 - Get MATK w/o eATK & SC bonuses + * 1 - Get MATK w/o SC bonuses + * 2 - Get modified MATK + * 3 - Get MATK w/o eATK & SC bonuses * @retval 1 failure * @retval MATK success * @@ -12231,7 +12253,7 @@ void status_defaults(void) { status->readdb = status_readdb; status->init = do_init_status; status->final = do_final_status; - + status->initChangeTables = initChangeTables; status->initDummyData = initDummyData; status->base_amotion_pc = status_base_amotion_pc; |