summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2015-12-23 14:41:23 +0800
committerJedzkie <jedzkie13@rocketmail.com>2015-12-23 14:41:23 +0800
commitc0afd048169aa9d66c739ac548df05ed498a0a34 (patch)
tree309e6f105e32f23be4f46652b6a98c95064ff338
parent5954bf53cac41cac2fd1eb3bb3d91783f0f9644e (diff)
downloadhercules-c0afd048169aa9d66c739ac548df05ed498a0a34.tar.gz
hercules-c0afd048169aa9d66c739ac548df05ed498a0a34.tar.bz2
hercules-c0afd048169aa9d66c739ac548df05ed498a0a34.tar.xz
hercules-c0afd048169aa9d66c739ac548df05ed498a0a34.zip
Item Update:
- Fix typo MOBID_GUARIDAN to MOBID_GUARDIAN - Added official item effect for Magic Candy.
-rw-r--r--db/const.txt1
-rw-r--r--db/re/item_db.conf15
-rw-r--r--db/sc_config.txt2
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/skill.c6
-rw-r--r--src/map/status.c43
-rw-r--r--src/map/status.h1
7 files changed, 49 insertions, 23 deletions
diff --git a/db/const.txt b/db/const.txt
index 4837b3898..a77a612bf 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -1345,6 +1345,7 @@ SC_BUCHEDENOEL 634
SC_PHI_DEMON 635
SC_PROMOTE_HEALTH_RESERCH 636
SC_ENERGY_DRINK_RESERCH 637
+SC_MAGIC_CANDY 638
e_gasp 0
e_what 1
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index c63e71bc5..b85203710 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -84462,18 +84462,23 @@ item_db: (
Id: 12596
AegisName: "Magic_Candy"
Name: "Magic Candy"
- Type: 11
+ Type: 2
Buy: 0
Weight: 10
+ Delay: 180000
Trade: {
nodrop: true
notrade: true
noselltonpc: true
nocart: true
- nogstorage: true
nomail: true
noauction: true
+ nogstorage: true
}
+ Script: <"
+ specialeffect2 EF_HASTEUP;
+ sc_start2 SC_MAGIC_CANDY, 60000, 30, 70;
+ ">
},
{
Id: 12597
@@ -116556,17 +116561,19 @@ item_db: (
Id: 16666
AegisName: "Magic_Candy_Box10"
Name: "Magic Candy Box(10)"
- Type: 2
+ Type: 18
Buy: 20
+ Weight: 10
Trade: {
nodrop: true
notrade: true
noselltonpc: true
nocart: true
- nogstorage: true
nomail: true
noauction: true
+ nogstorage: true
}
+ Script: <" getitem Magic_Candy, 10; ">
},
{
Id: 16673
diff --git a/db/sc_config.txt b/db/sc_config.txt
index a521dd8ed..afc75b8e5 100644
--- a/db/sc_config.txt
+++ b/db/sc_config.txt
@@ -399,7 +399,7 @@ SC_LIGHT_OF_REGENE, 1
//SC_CBC, 2
//SC_CBC_POSTDELAY, 2
//SC_EQC, 2
-//SC_MAGIC_CANDY, 92
+SC_MAGIC_CANDY, 92
//SC_ALL_RIDING_REUSE_LIMIT, 1
//SC_HANDICAPSTATE_DEEP_SLEEP, 80
SC_MONSTER_TRANSFORM, 12
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;