From c0afd048169aa9d66c739ac548df05ed498a0a34 Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 23 Dec 2015 14:41:23 +0800 Subject: Item Update: - Fix typo MOBID_GUARIDAN to MOBID_GUARDIAN - Added official item effect for Magic Candy. --- src/map/map.h | 4 ++-- src/map/skill.c | 6 ++++-- src/map/status.c | 43 +++++++++++++++++++++++++++++-------------- src/map/status.h | 1 + 4 files changed, 36 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/map/map.h b/src/map/map.h index 84af04f77..db03727f5 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -70,8 +70,8 @@ enum MOBID { MOBID_TREAS40 = 1363, MOBID_BARRICADE1 = 1905, MOBID_BARRICADE2, - MOBID_GUARIDAN_STONE1, - MOBID_GUARIDAN_STONE2, + MOBID_GUARDIAN_STONE1, + MOBID_GUARDIAN_STONE2, MOBID_FOOD_STOR, MOBID_BLUE_CRYST = 1914, MOBID_PINK_CRYST, diff --git a/src/map/skill.c b/src/map/skill.c index 9b06591f4..f82cdee71 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7623,7 +7623,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // Slim Pitcher case CR_SLIMPITCHER: // Updated to block Slim Pitcher from working on barricades and guardian stones. - if( dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARIDAN_STONE2)) ) + if( dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARDIAN_STONE2)) ) break; if (script->potion_hp || script->potion_sp) { int hp = script->potion_hp, sp = script->potion_sp; @@ -13667,7 +13667,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case SR_CURSEDCIRCLE: if (map_flag_gvg2(sd->bl.m)) { if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB, - MOBID_EMPERIUM, MOBID_GUARIDAN_STONE1, MOBID_GUARIDAN_STONE2)) { + MOBID_EMPERIUM, MOBID_GUARDIAN_STONE1, MOBID_GUARDIAN_STONE2)) { char output[128]; sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */ clif->messagecolor_self(sd->fd, COLOR_RED, output); @@ -14778,6 +14778,8 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 } if (sc->data[SC_FENRIR_CARD]) fixcast_r = max(fixcast_r, sc->data[SC_FENRIR_CARD]->val2); + if (sc->data[SC_MAGIC_CANDY]) + fixcast_r = max(fixcast_r, sc->data[SC_MAGIC_CANDY]->val2); // Fixed cast non percentage bonuses if( sc->data[SC_MANDRAGORA] ) diff --git a/src/map/status.c b/src/map/status.c index 9348307b3..108f3d72d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -858,6 +858,7 @@ void initChangeTables(void) { status->dbs->IconChangeTable[SC_STR_SCROLL] = SI_STR_SCROLL; status->dbs->IconChangeTable[SC_INT_SCROLL] = SI_INT_SCROLL; status->dbs->IconChangeTable[SC_STEAMPACK] = SI_STEAMPACK; + status->dbs->IconChangeTable[SC_MAGIC_CANDY] = SI_MAGIC_CANDY; // Eden Crystal Synthesis status->dbs->IconChangeTable[SC_QUEST_BUFF1] = SI_QUEST_BUFF1; @@ -1055,6 +1056,7 @@ void initChangeTables(void) { status->dbs->ChangeFlagTable[SC_STEAMPACK] |= SCB_BATK | SCB_ASPD | SCB_ALL; status->dbs->ChangeFlagTable[SC_BUCHEDENOEL] |= SCB_REGEN | SCB_HIT | SCB_CRI; status->dbs->ChangeFlagTable[SC_PHI_DEMON] |= SCB_ALL; + status->dbs->ChangeFlagTable[SC_MAGIC_CANDY] |= SCB_MATK | SCB_ALL; // Cash Items status->dbs->ChangeFlagTable[SC_FOOD_STR_CASH] |= SCB_STR; @@ -4890,16 +4892,16 @@ unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc return 0; #endif } -unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) -{ - if(!sc || !sc->count) +unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) { + + if (!sc || !sc->count) return cap_value(matk,0,USHRT_MAX); - if( !viewable ){ + if (!viewable) { /* some statuses that are hidden in the status window */ if (sc->data[SC_MINDBREAKER]) - matk += matk * sc->data[SC_MINDBREAKER]->val2/100; - return (unsigned short)cap_value(matk,0,USHRT_MAX); + matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100; + return (unsigned short)cap_value(matk, 0, USHRT_MAX); } #ifndef RENEWAL @@ -4914,7 +4916,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; @@ -4923,14 +4925,14 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, if (sc->data[SC_IZAYOI]) matk += 25 * sc->data[SC_IZAYOI]->val1; #endif - if( sc->data[SC_ZANGETSU] ) + if (sc->data[SC_ZANGETSU]) matk += sc->data[SC_ZANGETSU]->val3; if (sc->data[SC_MAGICPOWER] && sc->data[SC_MAGICPOWER]->val4) - matk += matk * sc->data[SC_MAGICPOWER]->val3/100; + matk += matk * sc->data[SC_MAGICPOWER]->val3 / 100; if (sc->data[SC_INCMATKRATE]) - matk += matk * sc->data[SC_INCMATKRATE]->val1/100; + matk += matk * sc->data[SC_INCMATKRATE]->val1 / 100; if (sc->data[SC_MOONLIT_SERENADE]) - matk += matk * sc->data[SC_MOONLIT_SERENADE]->val2/100; + matk += matk * sc->data[SC_MOONLIT_SERENADE]->val2 / 100; if (sc->data[SC_MTF_MATK]) matk += matk * sc->data[SC_MTF_MATK]->val1 / 100; if (sc->data[SC_MYSTICSCROLL]) @@ -4954,8 +4956,10 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, matk += matk * sc->data[SC_GM_BATTLE2]->val1 / 100; if (sc->data[SC_2011RWC]) matk += matk * sc->data[SC_2011RWC]->val2 / 100; + if (sc->data[SC_MAGIC_CANDY]) + matk += sc->data[SC_MAGIC_CANDY]->val1; - return (unsigned short)cap_value(matk,0,USHRT_MAX); + return (unsigned short)cap_value(matk, 0, USHRT_MAX); } signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) { @@ -9255,11 +9259,16 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t tick_time = 10000; sc_start(src, bl, SC_ENDURE, 100, 10, tick); // Endure effect break; + case SC_MAGIC_CANDY: // [Frost] + val3 = 90; // SP Consume. + val4 = tick / 10000; + tick_time = 10000; + break; case SC_PROMOTE_HEALTH_RESERCH: // Val1: 1 = Regular Potion, 2 = Thrown Potion // Val2: 1 = Small Potion, 2 = Medium Potion, 3 = Large Potion // Val3: MaxHP Increase By Fixed Amount - // Val4: MaxHP Heal Percentage + // Val4: HP Heal Percentage if (val1 == 1) // If potion was normally used, take the user's BaseLv. val3 = 1000 * val2 - 500 + status->get_lv(bl) * 10 / 3; else if (val1 == 2) // If potion was thrown at someone, take the thrower's BaseLv. @@ -9271,7 +9280,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t // Val1: 1 = Regular Potion, 2 = Thrown Potion // Val2: 1 = Small Potion, 2 = Medium Potion, 3 = Large Potion // Val3: MaxSP Increase By Fixed Amount - // Val4: MaxSP Heal Percentage + // Val4: SP Heal Percentage if (val1 == 1) // If potion was normally used, take the user's BaseLv. val3 = status->get_lv(bl) / 10 + 5 * val2 - 10; else if (val1 == 2) // If potion was thrown at someone, take the thrower's BaseLv. @@ -11589,6 +11598,12 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { sc_timer_next(10000 + tick, status->change_timer, bl->id, data); } break; + case SC_MAGIC_CANDY: + if (--(sce->val4) > 0) { + status->charge(bl, 0, sce->val3); // Reduce 100 SP every 10 seconds. + sc_timer_next(10000 + tick, status->change_timer, bl->id, data); + } + break; case SC_LEADERSHIP: case SC_GLORYWOUNDS: case SC_SOULCOLD: diff --git a/src/map/status.h b/src/map/status.h index e1585aabd..dfc914849 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -821,6 +821,7 @@ typedef enum sc_type { SC_PHI_DEMON, SC_PROMOTE_HEALTH_RESERCH, SC_ENERGY_DRINK_RESERCH, + SC_MAGIC_CANDY, SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; -- cgit v1.2.3-60-g2f50