From 0e0dc3fba068827b79bf089eaf2348d518c74a18 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 4 Aug 2016 17:26:51 +0700 Subject: [PATCH] Item bonus: * `bonus bNoEleStone,n;` Removes Flame, Ice, Wind Stone, or Shadow Orb from skill requirement. 'n' is meaningless Signed-off-by: Cydh Ramdh --- doc/item_bonus.txt | 1 + src/map/itemdb.h | 5 +++++ src/map/map.h | 1 + src/map/pc.c | 4 ++++ src/map/pc.h | 1 + src/map/script_constants.h | 2 ++ src/map/skill.c | 2 ++ 7 files changed, 16 insertions(+) diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt index a12719aeadf..119717f0df8 100644 --- a/doc/item_bonus.txt +++ b/doc/item_bonus.txt @@ -446,6 +446,7 @@ bonus2 bAddSkillBlow,sk,n; Knock back the target by n cells when using skill sk bonus bNoKnockback,n; Character is no longer knocked back by enemy skills with such effect (n is meaningless) bonus bNoGemStone,n; Skills requiring Gemstones do not require them (n is meaningless) NOTE: Hocus Pocus still requires 1 Yellow Gemstone, Ganbantein requirements not reduced +bonus bNoEleStone,n; Removes Flame, Ice, Wind Stone, or Shadow Orb from skill requirement. 'n' is meaningless bonus bIntravision,n; Always see Hiding and Cloaking players/mobs (n is meaningless) bonus bPerfectHide,n; Hidden/cloaked character is no longer detected by monsters with 'detector' mode (n is meaningless) bonus bRestartFullRecover,n; When reviving, HP and SP are fully healed (n is meaningless) diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 0ed0feaa9d3..1bcbc725c6b 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -93,6 +93,10 @@ enum item_itemid ITEMID_COATING_BOTTLE = 7139, ITEMID_FRAGMENT_OF_CRYSTAL = 7321, ITEMID_SKULL_ = 7420, + ITEMID_FLAME_STONE = 7521, + ITEMID_ICE_STONE = 7522, + ITEMID_WIND_STONE = 7523, + ITEMID_SHADOW_ORB = 7524, ITEMID_TOKEN_OF_SIEGFRIED = 7621, ITEMID_TRAP_ALLOY = 7940, ITEMID_CATNIP_FRUIT = 11602, @@ -489,6 +493,7 @@ struct item_data* itemdb_exists(unsigned short nameid); #define itemdb_iscashfood(id) ( (id) >= ITEMID_STR_DISH10_ && (id) <= ITEMID_VIT_DISH10_ ) #define itemdb_is_GNbomb(n) (n >= ITEMID_APPLE_BOMB && n <= ITEMID_VERY_HARD_LUMP) #define itemdb_is_GNthrowable(n) (n >= ITEMID_MYSTERIOUS_POWDER && n <= ITEMID_BLACK_THING_TO_THROW) +#define itemid_iselestone(id) ( (id) >= ITEMID_FLAME_STONE && (id) <= ITEMID_SHADOW_ORB ) const char* itemdb_typename(enum item_types type); const char *itemdb_typename_ammo (enum e_item_ammo ammo); bool itemdb_is_spellbook2(unsigned short nameid); diff --git a/src/map/map.h b/src/map/map.h index 8f2ec969fe3..a1344f9b1aa 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -477,6 +477,7 @@ enum _sp { SP_STATE_NORECOVER_RACE, SP_CRITICAL_RANGEATK, SP_MAGIC_ADDRACE2, SP_IGNORE_MDEF_RACE2_RATE, // 2079-2082 SP_WEAPON_ATK_RATE, SP_WEAPON_MATK_RATE, SP_DROP_ADDRACE, SP_DROP_ADDCLASS, SP_NO_MADO_FUEL, // 2083-2087 SP_IGNORE_DEF_CLASS_RATE, SP_REGEN_PERCENT_HP, SP_REGEN_PERCENT_SP, //2088-2091 + SP_NO_ELESTONE, }; enum _look { diff --git a/src/map/pc.c b/src/map/pc.c index 21dc9eea1db..815d8559ac1 100755 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3044,6 +3044,10 @@ void pc_bonus(struct map_session_data *sd,int type,int val) if (sd->state.lr_flag != 2) sd->special_state.no_mado_fuel = 1; break; + case SP_NO_ELESTONE: // bonus bNoEleStone,n; + if(sd->state.lr_flag != 2) + sd->special_state.no_elestone = 1; + break; default: if (running_npc_stat_calc_event) { ShowWarning("pc_bonus: unknown bonus type %d %d in OnPCStatCalcEvent!\n", type, val); diff --git a/src/map/pc.h b/src/map/pc.h index 0f3ebc10931..0c0cb295b16 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -263,6 +263,7 @@ struct map_session_data { unsigned int no_knockback : 1; unsigned int bonus_coma : 1; unsigned int no_mado_fuel : 1; // Disable Magic_Gear_Fuel consumption [Secret] + unsigned int no_elestone : 1; // bNoEleStone [Cydh] } special_state; uint32 login_id1, login_id2; unsigned short class_; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex] diff --git a/src/map/script_constants.h b/src/map/script_constants.h index 524d6daf0bd..3655cd1540c 100644 --- a/src/map/script_constants.h +++ b/src/map/script_constants.h @@ -3174,6 +3174,8 @@ export_constant(STOR_MODE_GET); export_constant(STOR_MODE_PUT); + script_set_constant("bNoEleStone",SP_NO_ELESTONE,false); + #undef export_constant #endif /* _SCRIPT_CONSTANTS_H_ */ diff --git a/src/map/skill.c b/src/map/skill.c index 1a3da02c55e..325a996c88b 100755 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -15964,6 +15964,8 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 } } } + else if (sd->special_state.no_elestone && itemid_iselestone(req.itemid[i])) + req.itemid[i] = req.amount[i] = 0; // Check requirement for Magic Gear Fuel if (req.itemid[i] == ITEMID_MAGIC_GEAR_FUEL) { if (sd->special_state.no_mado_fuel)