diff options
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 122 |
1 files changed, 110 insertions, 12 deletions
diff --git a/src/map/status.c b/src/map/status.c index d8c5bf495..2565d8856 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -523,6 +523,18 @@ void initChangeTables(void) set_sc( NC_MAGNETICFIELD , SC_MAGNETICFIELD , SI_MAGNETICFIELD , SCB_NONE ); set_sc( NC_NEUTRALBARRIER , SC_NEUTRALBARRIER , SI_NEUTRALBARRIER , SCB_NONE ); set_sc( NC_STEALTHFIELD , SC_STEALTHFIELD , SI_STEALTHFIELD , SCB_NONE ); + /** + * Royal Guard + **/ + set_sc( LG_REFLECTDAMAGE , SC_REFLECTDAMAGE , SI_LG_REFLECTDAMAGE, SCB_NONE ); + set_sc( LG_FORCEOFVANGUARD , SC_FORCEOFVANGUARD , SI_FORCEOFVANGUARD , SCB_MAXHP|SCB_DEF ); + set_sc( LG_EXEEDBREAK , SC_EXEEDBREAK , SI_EXEEDBREAK , SCB_NONE ); + set_sc( LG_PRESTIGE , SC_PRESTIGE , SI_PRESTIGE , SCB_DEF2 ); + set_sc( LG_BANDING , SC_BANDING , SI_BANDING , SCB_DEF2|SCB_WATK );// Renewal: atk2 & def2 + set_sc( LG_PIETY , SC_BENEDICTIO , SI_BENEDICTIO , SCB_DEF_ELE ); + set_sc( LG_EARTHDRIVE , SC_EARTHDRIVE , SI_EARTHDRIVE , SCB_DEF|SCB_ASPD ); + set_sc( LG_INSPIRATION , SC_INSPIRATION , SI_INSPIRATION , SCB_MAXHP|SCB_WATK|SCB_HIT|SCB_VIT|SCB_AGI|SCB_STR|SCB_DEX|SCB_INT|SCB_LUK); + ///** // * Shadow Chaser // **/ @@ -543,17 +555,6 @@ void initChangeTables(void) //add_sc( SC_CHAOSPANIC , SC_CHAOS ); //set_sc( SC_BLOODYLUST , SC__BLOODYLUST , SI_BLOODYLUST , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK ); ///** - // * Royal Guard - // **/ - //set_sc( LG_REFLECTDAMAGE , SC_REFLECTDAMAGE , SI_LG_REFLECTDAMAGE, SCB_NONE ); - //set_sc( LG_FORCEOFVANGUARD , SC_FORCEOFVANGUARD , SI_FORCEOFVANGUARD , SCB_MAXHP|SCB_DEF ); - //set_sc( LG_EXEEDBREAK , SC_EXEEDBREAK , SI_EXEEDBREAK , SCB_NONE ); - //set_sc( LG_PRESTIGE , SC_PRESTIGE , SI_PRESTIGE , SCB_DEF2 ); - //set_sc( LG_BANDING , SC_BANDING , SI_BANDING , SCB_DEF2|SCB_WATK );// Renewal: atk2 & def2 - //set_sc( LG_PIETY , SC_BENEDICTIO , SI_BENEDICTIO , SCB_DEF_ELE ); - //set_sc( LG_EARTHDRIVE , SC_EARTHDRIVE , SI_EARTHDRIVE , SCB_DEF|SCB_ASPD ); - //set_sc( LG_INSPIRATION , SC_INSPIRATION , SI_INSPIRATION , SCB_MAXHP|SCB_WATK|SCB_HIT|SCB_VIT|SCB_AGI|SCB_STR|SCB_DEX|SCB_INT|SCB_LUK); - ///** // * Sura // **/ //add_sc( SR_DRAGONCOMBO , SC_STUN ); @@ -2155,6 +2156,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first) + sizeof(sd->setitem_hash) + sizeof(sd->setitem_hash2) + sizeof(sd->itemhealrate2) + + sizeof(sd->shieldmdef) // shorts + sizeof(sd->splash_range) + sizeof(sd->splash_add_range) @@ -2265,7 +2267,11 @@ int status_calc_pc_(struct map_session_data* sd, bool first) else if(sd->inventory_data[index]->type == IT_ARMOR) { refinedef += sd->status.inventory[index].refine*refinebonus[0][0]; if(sd->inventory_data[index]->script) { + if( i == EQI_HAND_L ) //Shield + sd->state.lr_flag = 3; run_script(sd->inventory_data[index]->script,0,sd->bl.id,0); + if( i == EQI_HAND_L ) //Shield + sd->state.lr_flag = 0; if (!calculating) //Abort, run_script retriggered this. [Skotlex] return 1; } @@ -3632,6 +3638,8 @@ static unsigned short status_calc_str(struct block_list *bl, struct status_chang **/ if(sc->data[SC_GIANTGROWTH]) str += 30; + if(sc->data[SC_INSPIRATION]) + str += sc->data[SC_INSPIRATION]->val3; return (unsigned short)cap_value(str,0,USHRT_MAX); } @@ -3676,6 +3684,8 @@ static unsigned short status_calc_agi(struct block_list *bl, struct status_chang **/ if(sc->data[SC_ADORAMUS]) agi -= sc->data[SC_ADORAMUS]->val2; + if(sc->data[SC_INSPIRATION]) + agi += sc->data[SC_INSPIRATION]->val3; return (unsigned short)cap_value(agi,0,USHRT_MAX); } @@ -3705,6 +3715,8 @@ static unsigned short status_calc_vit(struct block_list *bl, struct status_chang vit -= sc->data[SC_MARIONETTE]->val3&0xFF; if(sc->data[SC_MARIONETTE2]) vit += sc->data[SC_MARIONETTE2]->val3&0xFF; + if(sc->data[SC_INSPIRATION]) + vit += sc->data[SC_INSPIRATION]->val3; if(sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_HIGH && vit < 50) vit = 50; @@ -3744,6 +3756,8 @@ static unsigned short status_calc_int(struct block_list *bl, struct status_chang int_ -= ((sc->data[SC_MARIONETTE]->val4)>>16)&0xFF; if(sc->data[SC_MARIONETTE2]) int_ += ((sc->data[SC_MARIONETTE2]->val4)>>16)&0xFF; + if(sc->data[SC_INSPIRATION]) + int_ += sc->data[SC_INSPIRATION]->val3; if(sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_HIGH && int_ < 50) int_ = 50; @@ -3786,6 +3800,8 @@ static unsigned short status_calc_dex(struct block_list *bl, struct status_chang dex -= ((sc->data[SC_MARIONETTE]->val4)>>8)&0xFF; if(sc->data[SC_MARIONETTE2]) dex += ((sc->data[SC_MARIONETTE2]->val4)>>8)&0xFF; + if(sc->data[SC_INSPIRATION]) + dex += sc->data[SC_INSPIRATION]->val3; if(sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_HIGH && dex < 50) dex = 50; @@ -3815,6 +3831,8 @@ static unsigned short status_calc_luk(struct block_list *bl, struct status_chang luk -= sc->data[SC_MARIONETTE]->val4&0xFF; if(sc->data[SC_MARIONETTE2]) luk += sc->data[SC_MARIONETTE2]->val4&0xFF; + if(sc->data[SC_INSPIRATION]) + luk += sc->data[SC_INSPIRATION]->val3; if(sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_HIGH && luk < 50) luk = 50; @@ -3904,6 +3922,13 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan watk -= watk * sc->data[SC_STRIPWEAPON]->val2/100; if(sc->data[SC_MERC_ATKUP]) watk += sc->data[SC_MERC_ATKUP]->val2; + if(sc->data[SC_SHIELDSPELL_DEF] && sc->data[SC_SHIELDSPELL_DEF]->val1 == 3) + watk += sc->data[SC_SHIELDSPELL_DEF]->val2; + if(sc->data[SC_INSPIRATION]) + watk += sc->data[SC_INSPIRATION]->val2; + if( sc->data[SC_BANDING] && sc->data[SC_BANDING]->val2 > 0 ) + watk += (10 + 10 * sc->data[SC_BANDING]->val1) * (sc->data[SC_BANDING]->val2); + #if RE_EDP /** * in RE EDP increases your weapon atk by watk x Skill Level - 1 @@ -3984,6 +4009,8 @@ static signed short status_calc_hit(struct block_list *bl, struct status_change hit += sc->data[SC_MERC_HITUP]->val2; if(sc->data[SC_FEAR]) hit -= hit * 20 / 100; + if(sc->data[SC_INSPIRATION]) + hit += 5 * sc->data[SC_INSPIRATION]->val1; return (short)cap_value(hit,1,SHRT_MAX); } @@ -4602,6 +4629,10 @@ static unsigned int status_calc_maxhp(struct block_list *bl, struct status_chang maxhp += maxhp * 5 * sc->data[SC_EPICLESIS]->val1 / 100; if(sc->data[SC_VENOMBLEED]) maxhp -= maxhp * 15 / 100; + if(sc->data[SC_FORCEOFVANGUARD]) + maxhp += maxhp * 3 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100; + if(sc->data[SC_INSPIRATION]) //Custom value. + maxhp += maxhp * 3 * sc->data[SC_INSPIRATION]->val1 / 100; return cap_value(maxhp,1,UINT_MAX); @@ -5380,6 +5411,54 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val return 0; //Emperium/BG Monsters can't be afflicted by status changes } + if( sc->data[SC_REFRESH] ) { + if( type >= SC_COMMON_MIN && type <= SC_COMMON_MAX) // Confirmed. + return 0; // Immune to status ailements + switch( type ) { + case SC_QUAGMIRE://Tester said it protects against this and decrease agi. + case SC_DECREASEAGI: + case SC_BURNING: + case SC_FREEZING: + //case SC_WHITEIMPRISON://Need confirm. Protected against this in the past. [Rytech] + case SC_MARSHOFABYSS: + case SC_TOXIN: + case SC_PARALYSE: + case SC_VENOMBLEED: + case SC_MAGICMUSHROOM: + case SC_DEATHHURT: + case SC_PYREXIA: + case SC_OBLIVIONCURSE: + //case SC_LEECHESEND://Need confirm. If it protects against nearly every Guillotine poison, it should work on this too right? [Rytech] + case SC_CRYSTALIZE: + case SC_DEEPSLEEP: + case SC_MANDRAGORA: + return 0; + } + } + else if( sc->data[SC_INSPIRATION] ) { + if( type >= SC_COMMON_MIN && type <= SC_COMMON_MAX ) + return 0; // Immune to status ailements + switch( type ) { + case SC_DEEPSLEEP: + case SC_SATURDAYNIGHTFEVER: + case SC_PYREXIA: + case SC_DEATHHURT: + case SC_MAGICMUSHROOM: + case SC_VENOMBLEED: + case SC_TOXIN: + case SC_OBLIVIONCURSE: + case SC_LEECHESEND: + case SC__ENERVATION: + case SC__GROOMY: + case SC__LAZINESS: + case SC__UNLUCKY: + case SC__WEAKNESS: + case SC__BODYPAINT: + case SC__IGNORANCE: + return 0; + } + } + sd = BL_CAST(BL_PC, bl); //Adjust tick according to status resistances @@ -5800,6 +5879,23 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val case SC_FOOD_LUK_CASH: status_change_end(bl, SC_LUKFOOD, INVALID_TIMER); break; + case SC_REFLECTSHIELD: + status_change_end(bl, SC_REFLECTDAMAGE, INVALID_TIMER); + break; + case SC_REFLECTDAMAGE: + status_change_end(bl, SC_REFLECTSHIELD, INVALID_TIMER); + break; + case SC_SHIELDSPELL_DEF: + case SC_SHIELDSPELL_MDEF: + case SC_SHIELDSPELL_REF: + status_change_end(bl, SC_MAGNIFICAT, INVALID_TIMER); + if( type != SC_SHIELDSPELL_DEF ) + status_change_end(bl, SC_SHIELDSPELL_DEF, INVALID_TIMER); + if( type != SC_SHIELDSPELL_MDEF ) + status_change_end(bl, SC_SHIELDSPELL_MDEF, INVALID_TIMER); + if( type != SC_SHIELDSPELL_REF ) + status_change_end(bl, SC_SHIELDSPELL_REF, INVALID_TIMER); + break; } //Check for overlapping fails @@ -8019,6 +8115,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const clif_standing(bl,true); } break; + */ case SC_NEUTRALBARRIER_MASTER: case SC_STEALTHFIELD_MASTER: if( sce->val2 ) @@ -8039,6 +8136,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const } } break; + /* case SC_CURSEDCIRCLE_ATKER: if( sce->val3 ) map_foreachinrange(status_change_timer_sub, bl, skill_get_splash(SR_CURSEDCIRCLE, sce->val1),BL_CHAR, bl, sce, SC_CURSEDCIRCLE_TARGET, gettick()); @@ -8941,7 +9039,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data) case SC_BANDING: if( status_charge(bl, 0, 7 - sce->val1) ) { - //if( sd ) pc_banding(sd, sce->val1); + if( sd ) pc_banding(sd, sce->val1); sc_timer_next(5000 + tick, status_change_timer, bl->id, data); return 0; } |