From 82217a44bd3f65d6824b36bdd92ba3b126fcdadb Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 9 Oct 2017 14:58:27 +0200 Subject: [PATCH 01/27] Initial release of the refine UI --- conf/battle/feature.conf | 7 + conf/msg_conf/map_msg.conf | 7 +- doc/atcommands.txt | 8 + doc/script_commands.txt | 10 +- npc/merchants/refine.txt | 13 +- src/map/atcommand.c | 30 ++++ src/map/battle.c | 8 + src/map/battle.h | 1 + src/map/clif.cpp | 319 ++++++++++++++++++++++++++++++++++++- src/map/clif.h | 3 + src/map/clif_packetdb.h | 9 ++ src/map/pc.h | 3 +- src/map/script.cpp | 30 +++- src/map/script_constants.h | 4 +- src/map/status.c | 29 +++- src/map/status.h | 8 +- 16 files changed, 471 insertions(+), 18 deletions(-) diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf index cd31321d41e..3c5d7cb513d 100644 --- a/conf/battle/feature.conf +++ b/conf/battle/feature.conf @@ -67,3 +67,10 @@ feature.roulette: off // Achievement (Note 1) // Requires: 2015-05-13aRagexe or later feature.achievement: on + +// Refine UI (Note 3) +// Requires: 2016-10-12aRagexeRE or later +// 0 = Disabled +// 1 = Enabled +// 2 = Enabled in existing official scripts (old dialogs were removed and replaced by the UI) +feature.refineui: 0 diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index 0235555b27b..d1c4171449c 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -831,7 +831,12 @@ // Achievements 772: Achievements are disabled. -//773-899 free +// @refineui +773: This command requires packet version 2016-10-12 or newer. +774: This command is disabled via configuration. +775: You have already opened the refine UI. + +//776-899 free //------------------------------------ // More atcommands message diff --git a/doc/atcommands.txt b/doc/atcommands.txt index d310424c48d..10528c8c8b1 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -1176,6 +1176,14 @@ Adopts the specified player with the attached character as one of the parents. --------------------------------------- +@refineui + +Opens the refine user interface. + +Note: This command requires packet version 2016-10-12 or newer. + +--------------------------------------- + @request Sends a message to all connected GMs (via the GM whisper system). diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 7bc78e9a109..1eca8b730b2 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2761,7 +2761,15 @@ REFINE_ZENY_COST - Zeny REFINE_MATERIAL_ID - Material Item ID This function will return -1 on failure. The function fails if the cost type -is invalid or if there is no item in the equipment slot. +is invalid or if there is no item in the equipment slot. + +--------------------------------------- + +*refineui({}) + +Opens the refine UI for the attached player or the given character id. + +This feature requires 2016-10-12aRagexeRE or newer. --------------------------------------- diff --git a/npc/merchants/refine.txt b/npc/merchants/refine.txt index 176b8aced7c..557a7ce3ba7 100644 --- a/npc/merchants/refine.txt +++ b/npc/merchants/refine.txt @@ -560,9 +560,20 @@ lhz_in02,282,20,7 script Fulerr 869,{ //= .@safe to the max safe refine in refine_db.txt as well. //============================================================ function script refinemain { - disable_items; .@npc_name$ = getarg(0); .@features = getarg(1); + + if( getbattleflag( "feature.refineui" ) == 3 ){ + mes "["+ .@npc_name$ +"]"; + mes "I've spent a long time refining powerful weapons."; + mes "You are in the presence of 장춰탕넨 [Zhang Zhuangtan]"; // TODO: find a valid translation + mes "Do you want to strengthen your equipment?"; + close2; + refineui(); + end; + } + + disable_items; mes "["+ .@npc_name$ +"]"; mes "I'm the Armsmith."; mes "I can refine all kinds of weapons, armor and equipment, so let me"; diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 37073550fe5..0063fd52173 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9973,6 +9973,35 @@ ACMD_FUNC(adopt) return -1; } + +/** + * Opens the refineUI + * Usage: @refineui + */ +ACMD_FUNC(refineui) +{ + nullpo_retr(-1, sd); + +#if PACKETVER < 20161012 + clif_displaymessage(fd, msg_txt(sd, 773)); // This command requires packet version 2016-10-12 or newer. + return -1; +#else + if( !battle_config.feature_refineui ){ + clif_displaymessage(fd, msg_txt(sd, 774)); // This command is disabled via configuration. + return -1; + } + + if( sd->state.refineui_open ){ + clif_displaymessage(fd, msg_txt(sd, 775)); // You have already opened the refine UI. + return -1; + } + + clif_refineui_open(sd); + return 0; +#endif +} + + #include "../custom/atcommand.inc" /** @@ -10270,6 +10299,7 @@ void atcommand_basecommands(void) { ACMD_DEF(adopt), ACMD_DEF(agitstart3), ACMD_DEF(agitend3), + ACMD_DEF(refineui), }; AtCommandInfo* atcommand; int i; diff --git a/src/map/battle.c b/src/map/battle.c index 1caef37a800..251689f1bff 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -8432,6 +8432,7 @@ static const struct _battle_data { { "feature.achievement", &battle_config.feature_achievement, 1, 0, 1, }, { "allow_bound_sell", &battle_config.allow_bound_sell, 1, 0, 1, }, { "event_refine_chance", &battle_config.event_refine_chance, 0, 0, 1, }, + { "feature.refineui", &battle_config.feature_refineui, 0, 0, 3, }, #include "../custom/battle_config_init.inc" }; @@ -8562,6 +8563,13 @@ void battle_adjust_conf() } #endif +#if PACKETVER < 20161012 + if (battle_config.feature_refineui) { + ShowWarning("conf/battle/feature.conf refine UI is enabled but it requires PACKETVER 2016-10-12 or newer, disabling...\n"); + battle_config.feature_refineui = 0; + } +#endif + #ifndef CELL_NOSTACK if (battle_config.custom_cell_stack_limit != 1) ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n"); diff --git a/src/map/battle.h b/src/map/battle.h index 0e2b6012772..21e94b876da 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -634,6 +634,7 @@ extern struct Battle_Config int feature_achievement; int allow_bound_sell; int event_refine_chance; + int feature_refineui; #include "../custom/battle_config_struct.inc" } battle_config; diff --git a/src/map/clif.cpp b/src/map/clif.cpp index eb5e129a7ef..00c1fc0b41c 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -19955,7 +19955,7 @@ void clif_parse_sale_remove( int fd, struct map_session_data* sd ){ /** * Sends all achievement data to the client (ZC_ALL_AG_LIST). - * 0a23 .W .W .L .L + * 0a23 .W .L .L */ void clif_achievement_list_all(struct map_session_data *sd) { @@ -20000,7 +20000,7 @@ void clif_achievement_list_all(struct map_session_data *sd) /** * Sends a single achievement's data to the client (ZC_AG_UPDATE). - * 0a24 .W .L + * 0a24 .L */ void clif_achievement_update(struct map_session_data *sd, struct achievement *ach, int count) { @@ -20036,7 +20036,7 @@ void clif_achievement_update(struct map_session_data *sd, struct achievement *ac /** * Checks if an achievement reward can be rewarded (CZ_REQ_AG_REWARD). - * 0a25 .W .L + * 0a25 .L */ void clif_parse_AchievementCheckReward(int fd, struct map_session_data *sd) { @@ -20050,7 +20050,7 @@ void clif_parse_AchievementCheckReward(int fd, struct map_session_data *sd) /** * Returns the result of achievement_check_reward (ZC_REQ_AG_REWARD_ACK). - * 0a26 .W .W .L + * 0a26 .W .L */ void clif_achievement_reward_ack(int fd, unsigned char result, int achievement_id) { @@ -20061,6 +20061,317 @@ void clif_achievement_reward_ack(int fd, unsigned char result, int achievement_i WFIFOSET(fd, packet_len(0xa26)); } +/** + * Opens the refine UI on the designated client. + * 0aa0 + */ +void clif_refineui_open( struct map_session_data* sd ){ +#if PACKETVER >= 20161012 + int fd = sd->fd; + + WFIFOHEAD(fd,packet_len(0x0AA0)); + WFIFOW(fd,0) = 0x0AA0; + WFIFOSET(fd,packet_len(0x0AA0)); + + sd->state.refineui_open = true; +#endif +} + +/** + * Parses cancel/close of the refine UI on client side. + * 0aa4 + */ +void clif_parse_refineui_close( int fd, struct map_session_data* sd ){ +#if PACKETVER >= 20161012 + sd->state.refineui_open = false; +#endif +} + +#define REFINEUI_MAT_CNT 4 + +/** + * Structure to store all required data about refine requirements + */ +struct refine_materials { + struct refine_cost cost; + uint8 chance; +}; + +/** + * Fills the given index with the requested data for that item and + * returns true on success or false on failure. + */ +static inline bool clif_refineui_materials_sub( struct item *item, struct item_data *id, struct refine_materials materials[REFINEUI_MAT_CNT], int index, enum refine_cost_type type ){ + if( index < 0 || index > REFINEUI_MAT_CNT ){ + return false; + } + + // Get the material that is required to refine this item + materials[index].cost.nameid = status_get_refine_cost( id->wlv, type, REFINE_MATERIAL_ID ); + // Get the amount of zeny that is required to refine the item with this material + materials[index].cost.zeny = status_get_refine_cost( id->wlv, type, REFINE_ZENY_COST ); + // Get the chance for refining the item with this material + materials[index].chance = status_get_refine_chance( (enum refine_type)id->wlv, item->refine, type == REFINE_COST_ENRICHED ); + + // Either of the values was not set + if( materials[index].cost.nameid == 0 || materials[index].cost.zeny == 0 || materials[index].chance == 0 ){ + // Reset all entries properly + materials[index].cost.nameid = materials[index].cost.zeny = materials[index].chance = 0; + return false; + }else{ + // Everything was set properly + return true; + } +} + +/** + * Calculates all possible materials for the given item. + * Returns the count of materials that were filled in the materials array. + */ +static inline uint8 clif_refineui_materials( struct item *item, struct item_data *id, struct refine_materials materials[REFINEUI_MAT_CNT] ){ + // Initialize the counter + uint8 count = 0; + + // Zero the memory + memset( materials, 0, sizeof(struct refine_materials)*REFINEUI_MAT_CNT ); + + // Is the item +10 or above + if( item->refine >= 10 ){ + // Normal refine requirements for +10 and above + if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_OVER10 ) ){ + count++; + } + + // HD refine requirements for +10 and above + if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_OVER10_HD ) ){ + count++; + } + }else{ + // Normal refine requirements + if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_NORMAL ) ){ + count++; + } + + // HD refine requirements + if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_HD ) ){ + count++; + } + } + + // Enriched refine requirements + if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_ENRICHED ) ){ + count++; + } + + // Return the amount of found materials + return count; +} + +/** + * Adds the selected item into the refine UI and sends the possible materials + * to the client. + * 0aa2 .W .W .B { .W .B .L }* + */ +void clif_refineui_info( struct map_session_data* sd, uint16 index ){ + int fd = sd->fd; + struct item *item; + struct item_data *id; + uint16 length; + struct refine_materials materials[REFINEUI_MAT_CNT]; + uint8 i, material_count; + + // Get the item db reference + id = sd->inventory_data[index]; + + // No item data was found + if( id == NULL ){ + return; + } + + // Check if the item can be refined + if( id->flag.no_refine ){ + return; + } + + // Only weapons and armors can be refined in the refine UI + if( id->type != IT_WEAPON && id->type != IT_ARMOR ){ + return; + } + + // Check the inventory + item = &sd->inventory.u.items_inventory[index]; + + // No item was found at the given index + if( item == NULL ){ + return; + } + + // Check if the item is identified + if( !item->identify ){ + return; + } + + // Check if the item is broken + if( item->attribute ){ + return; + } + + // Calculate the possible materials + material_count = clif_refineui_materials( item, id, materials ); + + // No possibilities were found + if( material_count == 0 ){ + return; + } + + length = 7 + material_count * 7; + + WFIFOHEAD(fd,length); + WFIFOW(fd,0) = 0x0AA2; + WFIFOW(fd,2) = length; + WFIFOW(fd,4) = index + 2; + WFIFOB(fd,6) = 0; //TODO: required amount of "Blacksmith Blessing"(id: 6635) + + for( i = 0; i < material_count; i++ ){ + WFIFOW(fd,7 + i * 7) = materials[i].cost.nameid; + WFIFOB(fd,7 + i * 7 + 2) = materials[i].chance; + WFIFOL(fd,7 + i * 7 + 3) = materials[i].cost.zeny; + } + + WFIFOSET(fd,length); +} + +/** + * Client request to add an item to the refine UI. + * 0aa1 .W + */ +void clif_parse_refineui_add( int fd, struct map_session_data* sd ){ +#if PACKETVER >= 20161012 + uint16 index = RFIFOW(fd, 2) - 2; + + // Check if the refine UI is open + if( !sd->state.refineui_open ){ + return; + } + + // Check if the index is valid + if( index < 0 || index >= MAX_INVENTORY ){ + return; + } + + // Send out the requirements for the refine process + clif_refineui_info( sd, index ); +#endif +} + +/** + * Client requests to try to refine an item. + * 0aa3 .W .W .B + */ +void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ +#if PACKETVER >= 20161012 + uint16 index = RFIFOW( fd, 2 ) - 2; + uint16 material = RFIFOW( fd, 4 ); + bool use_blacksmith_blessing = RFIFOB( fd, 6 ) != 0; // TODO: add logic + struct refine_materials materials[REFINEUI_MAT_CNT]; + uint8 i, material_count; + uint16 j; + struct item *item; + struct item_data *id; + + // Check if the refine UI is open + if( !sd->state.refineui_open ){ + return; + } + + // Get the item db reference + id = sd->inventory_data[index]; + + // No item data was found + if( id == NULL ){ + return; + } + + // Check if the item can be refined + if( id->flag.no_refine ){ + return; + } + + // Only weapons and armors can be refined in the refine UI + if( id->type != IT_WEAPON && id->type != IT_ARMOR ){ + return; + } + + // Check the inventory + item = &sd->inventory.u.items_inventory[index]; + + // No item was found at the given index + if( item == NULL ){ + return; + } + + // Check if the item is identified + if( !item->identify ){ + return; + } + + // Check if the item is broken + if( item->attribute ){ + return; + } + + // Check if the player has the selected material + if( ( j = pc_search_inventory( sd, material ) ) < 0 ){ + return; + } + + // Calculate the possible materials + material_count = clif_refineui_materials( item, id, materials ); + + // No possibilities were found + if( material_count == 0 ){ + return; + } + + // Find the selected material + ARR_FIND( 0, REFINEUI_MAT_CNT, i, materials[i].cost.nameid == material ); + + // The material was not in the list of possible materials + if( i >= REFINEUI_MAT_CNT || i < 0 ){ + return; + } + + // Try to pay for the refine + if( pc_payzeny( sd, materials[i].cost.zeny, LOG_TYPE_CONSUME, NULL ) ){ + clif_npc_buy_result( sd, 1 ); // "You do not have enough zeny." + return; + } + + // Delete the required material + if( pc_delitem( sd, j, 1, 0, 0, LOG_TYPE_CONSUME ) ){ + return; + } + + // Try to refine the item + if( materials[i].chance >= rnd() % 100 ){ + // Success + item->refine++; + clif_misceffect( &sd->bl, 3 ); + clif_refine( fd, 0, index, item->refine ); + achievement_update_objective( sd, AG_REFINE_SUCCESS, 2, id->wlv, item->refine ); + clif_refineui_info( sd, index ); + }else{ + // Failure + clif_misceffect( &sd->bl, 2 ); + clif_refine( fd, 1, index, item->refine ); + pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_CONSUME ); + achievement_update_objective( sd, AG_REFINE_FAIL, 1, 1 ); + } +#endif +} + +#undef REFINEUI_MAT_CNT + /*========================================== * Main client packet processing function *------------------------------------------*/ diff --git a/src/map/clif.h b/src/map/clif.h index ab3b516d485..73b83ea304a 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1015,6 +1015,9 @@ void clif_sale_start(struct sale_item_data* sale_item, struct block_list* bl, en void clif_sale_end(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target); void clif_sale_amount(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target); +// Refine UI +void clif_refineui_open( struct map_session_data* sd ); + /** * Color Table **/ diff --git a/src/map/clif_packetdb.h b/src/map/clif_packetdb.h index ad360117af7..7921e77fbda 100644 --- a/src/map/clif_packetdb.h +++ b/src/map/clif_packetdb.h @@ -2328,6 +2328,15 @@ parseable_packet(0x0A9C,2,clif_parse_dull,0); #endif +// 2016-10-12aRagexeRE +#if PACKETVER >= 20161012 + packet(0x0AA0,2); + parseable_packet(0x0AA1,4,clif_parse_refineui_add,2); + packet(0x0AA2,-1); + parseable_packet(0x0AA3,7,clif_parse_refineui_refine,2,4,6); + parseable_packet(0x0AA4,2,clif_parse_refineui_close,0); +#endif + // 2016-10-26bRagexeRE #if PACKETVER >= 20161026 packet(0x0AA5,-1); diff --git a/src/map/pc.h b/src/map/pc.h index c8be9459226..ef9c47104db 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -268,6 +268,7 @@ struct map_session_data { bool keepshop; // Whether shop data should be removed when the player disconnects bool mail_writing; // Whether the player is currently writing a mail in RODEX or not bool cashshop_open; + bool refineui_open; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -877,7 +878,7 @@ extern struct s_job_info { #define pc_issit(sd) ( (sd)->vd.dead_sit == 2 ) #define pc_isidle(sd) ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(last_tick, (sd)->idletime) >= battle_config.idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) -#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) +#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refineui_open ) /* equals pc_cant_act except it doesn't check for chat rooms or npcs */ #define pc_cant_act2(sd) ( (sd)->state.vending || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) diff --git a/src/map/script.cpp b/src/map/script.cpp index 2d03cfe1c59..4c1009d343f 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -23613,11 +23613,35 @@ BUILDIN_FUNC(getequiprefinecost) { weapon_lv = REFINE_TYPE_SHADOW; } - script_pushint(st, status_get_refine_cost(weapon_lv, type, info != 0)); + script_pushint(st, status_get_refine_cost(weapon_lv, type, (enum refine_info_type)info)); return SCRIPT_CMD_SUCCESS; } +BUILDIN_FUNC(refineui){ +#if PACKETVER < 20161012 + ShowError( "buildin_refineui: This command requires packet version 2016-10-12 or newer.\n" ); + return SCRIPT_CMD_FAILURE; +#else + struct map_session_data* sd; + + if( !script_charid2sd(2,sd) ){ + return SCRIPT_CMD_FAILURE; + } + + if( !battle_config.feature_refineui ){ + ShowError( "buildin_refineui: This command is disabled via configuration.\n" ); + return SCRIPT_CMD_FAILURE; + } + + if( !sd->state.refineui_open ){ + clif_refineui_open(sd); + } + + return SCRIPT_CMD_SUCCESS; +#endif +} + #include "../custom/script.inc" // declarations that were supposed to be exported from npc_chat.c @@ -24258,8 +24282,10 @@ struct script_function buildin_func[] = { BUILDIN_DEF(achievementexists,"i?"), BUILDIN_DEF(achievementupdate,"iii?"), - + // Refine UI BUILDIN_DEF(getequiprefinecost,"iii?"), + BUILDIN_DEF(refineui,"?"), + #include "../custom/script_def.inc" {NULL,NULL,NULL}, diff --git a/src/map/script_constants.h b/src/map/script_constants.h index 7347570965a..a023413249f 100644 --- a/src/map/script_constants.h +++ b/src/map/script_constants.h @@ -3873,8 +3873,8 @@ export_constant(REFINE_COST_MAX); /* refine information types */ - script_set_constant("REFINE_MATERIAL_ID", 0, false, false); - script_set_constant("REFINE_ZENY_COST", 1, false, false); + export_constant(REFINE_MATERIAL_ID); + export_constant(REFINE_ZENY_COST); #undef export_constant #undef export_constant2 diff --git a/src/map/status.c b/src/map/status.c index 840dd2d7145..642e4ace38f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -14109,12 +14109,24 @@ static int status_natural_heal_timer(int tid, unsigned int tick, int id, intptr_ */ int status_get_refine_chance(enum refine_type wlv, int refine, bool enriched) { + enum e_refine_chance_type type; + if ( refine < 0 || refine >= MAX_REFINE) return 0; - int type = enriched ? 1 : 0; - if (battle_config.event_refine_chance) - type |= 2; + if( battle_config.event_refine_chance ){ + if( enriched ){ + type = REFINE_CHANCE_EVENT_ENRICHED; + }else{ + type = REFINE_CHANCE_EVENT_NORMAL; + } + }else{ + if( enriched ){ + type = REFINE_CHANCE_ENRICHED; + }else{ + type = REFINE_CHANCE_NORMAL; + } + } return refine_info[wlv].chance[type][refine]; } @@ -14345,8 +14357,15 @@ static void status_yaml_readdb_refine(const char* directory, const char* file) { * @param what true = returns zeny, false = returns item id * @return Refine cost for a weapon level */ -int status_get_refine_cost(int weapon_lv, int type, bool what) { - return what ? refine_info[weapon_lv].cost[type].zeny : refine_info[weapon_lv].cost[type].nameid; +int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what) { + switch( what ){ + case REFINE_MATERIAL_ID: + return refine_info[weapon_lv].cost[type].nameid; + case REFINE_ZENY_COST: + return refine_info[weapon_lv].cost[type].zeny; + } + + return 0; } /** diff --git a/src/map/status.h b/src/map/status.h index 316ce51d118..98420c196d3 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -48,6 +48,12 @@ enum refine_cost_type { REFINE_COST_MAX }; +// Refine information type +enum refine_info_type { + REFINE_MATERIAL_ID = 0, + REFINE_ZENY_COST +}; + struct refine_cost { unsigned short nameid; int zeny; @@ -55,7 +61,7 @@ struct refine_cost { /// Get refine chance int status_get_refine_chance(enum refine_type wlv, int refine, bool enriched); -int status_get_refine_cost(int weapon_lv, int type, bool what); +int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what); /// Status changes listing. These code are for use by the server. typedef enum sc_type { From b9858f706272a3fcd54c2b42732ee608a972bf60 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 9 Oct 2017 15:37:38 +0200 Subject: [PATCH 02/27] Added a missing index check Thanks to @cydh --- src/map/clif.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 00c1fc0b41c..f44d224f46e 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20284,6 +20284,11 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ return; } + // Check if the index is valid + if( index < 0 || index >= MAX_INVENTORY ){ + return; + } + // Get the item db reference id = sd->inventory_data[index]; From ed664a3e47522df4c13f8679cf4222dec0a130e3 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 9 Oct 2017 23:30:23 +0200 Subject: [PATCH 03/27] Added a logic check for the feature configuration Thanks to @anity99 --- src/map/battle.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/map/battle.c b/src/map/battle.c index 251689f1bff..1326682dd98 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -8568,6 +8568,12 @@ void battle_adjust_conf() ShowWarning("conf/battle/feature.conf refine UI is enabled but it requires PACKETVER 2016-10-12 or newer, disabling...\n"); battle_config.feature_refineui = 0; } +#else + // Check if Refine UI is only enabled in scripts + if( battle_config.feature_refineui == 2 ){ + ShowWarning("conf/battle/feature.conf refine UI is enabled in scripts but disabled in general, enabling...\n"); + battle_config.feature_refineui = 3; + } #endif #ifndef CELL_NOSTACK From 0a2d6c1b8b780a6ee3e6ae1fc0ac471ce88fbc37 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 9 Oct 2017 23:47:17 +0200 Subject: [PATCH 04/27] Added a feature check for existing refiners --- npc/re/merchants/hd_refiner.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index 64aa698566a..7e4e3a9da7b 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -137,6 +137,17 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 826 // iRO NPC locations: // payon,174,133,4 duplicate(MightyHammer) Mighty Hammer#im 826 +// Refine UI makes these NPCs useless +- script RefineUIMightyHammerInit -1,{ + end; + +OnInit: + if( getbattleflag( "feature.refineui" ) == 3 ){ + unloadnpc "MightyHammer"; + } + end; +} + // Basta (+10 and up) :: cash_smelting //============================================================ - script ::Basta -1,{ @@ -286,3 +297,15 @@ alberta_in,18,56,3 duplicate(Basta) Basta#alberta 826 yuno_in01,173,18,3 duplicate(Basta) Basta#yuno 826 ein_in01,24,82,3 duplicate(Basta) Basta#einbroch 826 lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 826 + +// Refine UI makes these NPCs useless +- script RefineUIBastaInit -1,{ + end; + +OnInit: + if( getbattleflag( "feature.refineui" ) == 3 ){ + unloadnpc "Basta"; + } + end; +} + From db82c459cd39a101a2705508660378ccd00a7811 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Tue, 10 Oct 2017 00:21:12 +0200 Subject: [PATCH 05/27] Added downgrade logic Added a new configuration values in the YAML configuration to mark if a material will break or downgrade the item in case of failure. --- db/re/refine_db.yml | 11 +++++++++++ doc/script_commands.txt | 2 ++ src/map/clif.cpp | 18 +++++++++++++++--- src/map/script_constants.h | 1 + src/map/status.c | 9 ++++++++- src/map/status.h | 4 +++- 6 files changed, 40 insertions(+), 5 deletions(-) diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index f96e0d2d9a8..06f7675b245 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -32,12 +32,14 @@ Armor: - Type: REFINE_COST_HD Price: 20000 Material: 6241 + Breakable: false - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7619 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6225 + Breakable: false Rates: - Level: 1 Bonus: 100 @@ -157,12 +159,14 @@ WeaponLv1: - Type: REFINE_COST_HD Price: 20000 Material: 6240 + Breakable: false - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 + Breakable: false Rates: - Level: 8 NormalChance: 60 @@ -248,12 +252,14 @@ WeaponLv2: - Type: REFINE_COST_HD Price: 20000 Material: 6240 + Breakable: false - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 + Breakable: false Rates: - Level: 7 NormalChance: 60 @@ -344,12 +350,14 @@ WeaponLv3: - Type: REFINE_COST_HD Price: 20000 Material: 6240 + Breakable: false - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 + Breakable: false Rates: - Level: 6 NormalChance: 60 @@ -445,12 +453,14 @@ WeaponLv4: - Type: REFINE_COST_HD Price: 20000 Material: 6240 + Breakable: false - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 + Breakable: false Rates: - Level: 5 NormalChance: 60 @@ -548,6 +558,7 @@ Shadow: - Type: REFINE_COST_HD Price: 20000 Material: 6241 + Breakable: false - Type: REFINE_COST_ENRICHED Price: 20000 Material: 7619 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 1eca8b730b2..a9d2e2e3791 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2759,6 +2759,8 @@ Valid information types are: REFINE_ZENY_COST - Zeny REFINE_MATERIAL_ID - Material Item ID +REFINE_BREAKABLE - If the equipment will be broken by using this material + on a failed atempt This function will return -1 on failure. The function fails if the cost type is invalid or if there is no item in the equipment slot. diff --git a/src/map/clif.cpp b/src/map/clif.cpp index f44d224f46e..89d544dc5ff 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20110,6 +20110,8 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d materials[index].cost.nameid = status_get_refine_cost( id->wlv, type, REFINE_MATERIAL_ID ); // Get the amount of zeny that is required to refine the item with this material materials[index].cost.zeny = status_get_refine_cost( id->wlv, type, REFINE_ZENY_COST ); + // Get the breaking chance of the item with this material + materials[index].cost.breakable = status_get_refine_cost( id->wlv, type, REFINE_BREAKABLE ); // Get the chance for refining the item with this material materials[index].chance = status_get_refine_chance( (enum refine_type)id->wlv, item->refine, type == REFINE_COST_ENRICHED ); @@ -20117,6 +20119,7 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d if( materials[index].cost.nameid == 0 || materials[index].cost.zeny == 0 || materials[index].chance == 0 ){ // Reset all entries properly materials[index].cost.nameid = materials[index].cost.zeny = materials[index].chance = 0; + materials[index].cost.breakable = true; return false; }else{ // Everything was set properly @@ -20360,16 +20363,25 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ // Try to refine the item if( materials[i].chance >= rnd() % 100 ){ // Success - item->refine++; + item->refine = cap_value( item->refine + 1, 0, MAX_REFINE ); clif_misceffect( &sd->bl, 3 ); clif_refine( fd, 0, index, item->refine ); achievement_update_objective( sd, AG_REFINE_SUCCESS, 2, id->wlv, item->refine ); clif_refineui_info( sd, index ); }else{ // Failure + + // Delete the item if it is breakable + if( materials[i].cost.breakable ){ + clif_refine( fd, 1, index, item->refine ); + pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_CONSUME ); + }else{ + // Otherwise downgrade it + item->refine = cap_value( item->refine - 1, 0, MAX_REFINE ); + clif_refine( fd, 2, index, item->refine ); + } + clif_misceffect( &sd->bl, 2 ); - clif_refine( fd, 1, index, item->refine ); - pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_CONSUME ); achievement_update_objective( sd, AG_REFINE_FAIL, 1, 1 ); } #endif diff --git a/src/map/script_constants.h b/src/map/script_constants.h index a023413249f..f1b97a29b1d 100644 --- a/src/map/script_constants.h +++ b/src/map/script_constants.h @@ -3875,6 +3875,7 @@ /* refine information types */ export_constant(REFINE_MATERIAL_ID); export_constant(REFINE_ZENY_COST); + export_constant(REFINE_BREAKABLE); #undef export_constant #undef export_constant2 diff --git a/src/map/status.c b/src/map/status.c index 642e4ace38f..2210f712af2 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -14253,7 +14253,7 @@ static bool status_yaml_readdb_refine_sub(yamlwrapper* wrapper, int refine_info_ for (yamlwrapper* type = yaml_iterator_first(it); yaml_iterator_has_next(it); type = yaml_iterator_next(it)) { int idx = 0, price; unsigned short material; - static char* keys[] = {"Type", "Price", "Material" }; + static char* keys[] = { "Type", "Price", "Material" }; char* result; if ((result = yaml_verify_nodes(type, ARRAYLENGTH(keys), keys)) != NULL) { @@ -14272,6 +14272,11 @@ static bool status_yaml_readdb_refine_sub(yamlwrapper* wrapper, int refine_info_ refine_info[refine_info_index].cost[idx].nameid = material; refine_info[refine_info_index].cost[idx].zeny = price; + if( yaml_node_is_defined(type, "Breakable" ) ){ + refine_info[refine_info_index].cost[idx].breakable = yaml_get_boolean(type, "Breakable"); + }else{ + refine_info[refine_info_index].cost[idx].breakable = true; + } aFree(refine_cost_const); yaml_destroy_wrapper(type); @@ -14363,6 +14368,8 @@ int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what) return refine_info[weapon_lv].cost[type].nameid; case REFINE_ZENY_COST: return refine_info[weapon_lv].cost[type].zeny; + case REFINE_BREAKABLE: + return refine_info[weapon_lv].cost[type].breakable; } return 0; diff --git a/src/map/status.h b/src/map/status.h index 98420c196d3..ecaa6e090d8 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -51,12 +51,14 @@ enum refine_cost_type { // Refine information type enum refine_info_type { REFINE_MATERIAL_ID = 0, - REFINE_ZENY_COST + REFINE_ZENY_COST, + REFINE_BREAKABLE }; struct refine_cost { unsigned short nameid; int zeny; + bool breakable; }; /// Get refine chance From d50cb66665aab092f6542ca9ad8cd72fff32dfac Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Tue, 10 Oct 2017 10:21:13 +0200 Subject: [PATCH 06/27] Sanity check for current refine level --- src/map/clif.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 89d544dc5ff..833d39f3a1d 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20219,6 +20219,11 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ return; } + // Check the current refine level + if( item->refine < 0 || item->refine >= MAX_REFINE ){ + return; + } + // Calculate the possible materials material_count = clif_refineui_materials( item, id, materials ); @@ -20328,6 +20333,11 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ return; } + // Check the current refine level + if( item->refine < 0 || item->refine >= MAX_REFINE ){ + return; + } + // Check if the player has the selected material if( ( j = pc_search_inventory( sd, material ) ) < 0 ){ return; From fe391b0997eaa715e9b94b1167126678627647af Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Tue, 10 Oct 2017 21:23:29 +0700 Subject: [PATCH 07/27] Fixed Refine UI doesn't update the refine value on downrefine. Thanks to @ecdarreola Signed-off-by: Cydh Ramdh --- src/map/clif.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 833d39f3a1d..1fb0b4cf8ba 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20389,6 +20389,7 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ // Otherwise downgrade it item->refine = cap_value( item->refine - 1, 0, MAX_REFINE ); clif_refine( fd, 2, index, item->refine ); + clif_refineui_info(sd, index); } clif_misceffect( &sd->bl, 2 ); From 9c155acdca8e5b6559cd6ba95b1f0ac891efe2e3 Mon Sep 17 00:00:00 2001 From: Atemo Date: Tue, 10 Oct 2017 20:14:59 +0200 Subject: [PATCH 08/27] Added 'Blacksmith blessing' system in refine npcs (Basta and Mighty hammer) --- npc/re/merchants/hd_refiner.txt | 216 +++++++++++++++++++++----------- 1 file changed, 143 insertions(+), 73 deletions(-) diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index 7e4e3a9da7b..17c0b0b8434 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -1,4 +1,4 @@ -//===== rAthena Script ======================================= +//===== rAthena Script ======================================= //= HD Refiners //===== Description: ========================================= //= [Official Conversion] @@ -28,9 +28,9 @@ mes "So lets kick this into overdrive, what d' ya say? What item do you want to refine?"; next; setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Not equipped]" ) +":"; - set .@part, .@indices[ select(.@menu$) ]; + for ( .@i = 1; .@i <= 10; ++.@i ) + .@menu$ = .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) + "-[Not equipped]" ) + ":"; + .@part = .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Blacksmith Mighty Hammer]"; switch(.@part) { @@ -68,20 +68,30 @@ mes "This item can't be refined."; close; } - if (getequiprefinerycnt(.@part) < 7 || getequiprefinerycnt(.@part) > 9) { + switch( getequiprefinerycnt(.@part) ) { + case 7: + .@blacksmith_blessing_count = 1; + break; + case 8: + .@blacksmith_blessing_count = 2; + break; + case 9: + .@blacksmith_blessing_count = 4; + break; + default: mes "[Blacksmith Mighty Hammer]"; mes "I only handle items with refine levels from +7 to +9."; close; } - + .@price = getequiprefinecost(.@part, REFINE_COST_HD, REFINE_ZENY_COST); .@material = getequiprefinecost(.@part, REFINE_COST_HD, REFINE_MATERIAL_ID); - + mes "[Blacksmith Mighty Hammer]"; - mes "In order to refine the gear you selected you need ^ff9999"+getitemname(.@material)+"^000000 and 20,000 zeny as a fee."; + mes "In order to refine the gear you selected you need ^ff9999" + getitemname(.@material) + "^000000 and 20,000 zeny as a fee."; mes "Do you have them ready?"; next; - if(select("Yes:No") == 2) { + if (select("Yes:No") == 2) { mes "[Blacksmith Mighty Hammer]"; mes "I will wait until you are ready."; close; @@ -92,19 +102,42 @@ mes "Well, even if it fails, it only decreases by 1 refine level."; mes "Would you like to continue refining?"; next; - if(select("Yes:No") == 2) { + if (countitem(6635) < .@blacksmith_blessing_count) + setarray .@menu$[1], "Yes", "Not yet"; + else { + mes "[Blacksmith Mighty Hammer]"; + mes "Ah! is it the ^0000ffBlacksmith Blessing^000000?"; + mes "With the Blacksmith Blessing, the equipment won't vanish if the refine is failed!"; + next; + mes "[Blacksmith Mighty Hammer]"; + if (getequipweaponlv(.@part) < 1 || getequipweaponlv(.@part) > 4) + mes "For +" + getequiprefinerycnt(.@part) + " equipment, refine with^316AC5 " + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; + else + mes "For +" + getequiprefinerycnt(.@part) + " weapon, refine with^316AC5 " + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; + next; + setarray .@menu$[0], "Use it to refine", "Refine directly without it", "Don't refine yet"; + } + switch( select(.@menu$[0], .@menu$[1], .@menu$[2]) ) { + case 1: + .@bless_who = 1; + break; + case 2: + break; + case 3: mes "[Blacksmith Mighty Hammer]"; mes "Only those who overcome fear of failure will obtain a masterpiece."; close; } } - if (countitem(.@material) == 0 || Zeny < .@price) { + if ((.@bless_who && countitem(6635) < .@blacksmith_blessing_count) || countitem(.@material) == 0 || Zeny < .@price) { mes "[Blacksmith Mighty Hammer]"; mes "Didn't you just say you had everything ready?"; close; } + if (.@bless_who) + delitem 6635, .@blacksmith_blessing_count; delitem .@material,1; - set Zeny, Zeny-.@price; + Zeny = Zeny - .@price; mes "[Blacksmith Mighty Hammer]"; mes "Tac! Tac! Tac!"; if (getequippercentrefinery(.@part, true) > rand(100)) { @@ -116,6 +149,17 @@ mes "Here, have it. Refine succeeded flawlessly!"; close; } + if (.@bless_who == 1) { + specialeffect EF_HOLYHIT; + next; + emotion e_omg; + mes "[Blacksmith Mighty Hammer]"; + mes "What?!!"; + next; + mes "[Blacksmith Mighty Hammer]"; + mes "Aiya! I am faceless now. HmHm."; + close; + } downrefitem .@part; next; emotion e_omg; @@ -126,16 +170,16 @@ mes "I am sure a person like you would never blame me for a decrease in refine level by 1. Hmm."; close; } -prt_in,59,54,3 duplicate(MightyHammer) Mighty Hammer#prt 826 -morocc_in,65,30,3 duplicate(MightyHammer) Mighty Hammer#morocc 826 -payon,148,176,3 duplicate(MightyHammer) Mighty Hammer#pay 826 -alberta_in,16,56,3 duplicate(MightyHammer) Mighty Hammer#alb 826 -yuno_in01,171,18,3 duplicate(MightyHammer) Mighty Hammer#yuno 826 -ein_in01,22,82,3 duplicate(MightyHammer) Mighty Hammer#ein 826 -lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 826 +prt_in,59,54,3 duplicate(MightyHammer) Mighty Hammer#prt 4_M_DWARF +morocc_in,65,30,3 duplicate(MightyHammer) Mighty Hammer#morocc 4_M_DWARF +payon,148,176,3 duplicate(MightyHammer) Mighty Hammer#pay 4_M_DWARF +alberta_in,16,56,3 duplicate(MightyHammer) Mighty Hammer#alb 4_M_DWARF +yuno_in01,171,18,3 duplicate(MightyHammer) Mighty Hammer#yuno 4_M_DWARF +ein_in01,22,82,3 duplicate(MightyHammer) Mighty Hammer#ein 4_M_DWARF +lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF // iRO NPC locations: -// payon,174,133,4 duplicate(MightyHammer) Mighty Hammer#im 826 +// payon,174,133,4 duplicate(MightyHammer) Mighty Hammer#im 4_M_DWARF // Refine UI makes these NPCs useless - script RefineUIMightyHammerInit -1,{ @@ -161,9 +205,9 @@ OnInit: mes "Which equipment do you want to refine?"; next; setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Unequipped]" ) +":"; - set .@part, .@indices[ select(.@menu$) ]; + for ( .@i = 1; .@i <= 10; ++.@i ) + .@menu$ = .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) + "-[Unequipped]" ) + ":"; + .@part = .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Basta]"; switch(.@part) { @@ -201,43 +245,41 @@ OnInit: mes "Even I cannot refine this item. There's no way."; close; } - if (getequiprefinerycnt(.@part) < 10) { + .@refine_count = getequiprefinerycnt(.@part); + if (.@refine_count < 10) { mes "[Basta]"; mes "Haven't I told you? I only refine equipments that are +10 and above."; close; } - if (getequiprefinerycnt(.@part) == 20) { + else if (.@refine_count == 10) + .@blacksmith_blessing_count = 7; + else if (.@refine_count == 11) + .@blacksmith_blessing_count = 11; + else if (.@refine_count == 20) { mes "[Basta]"; mes "This weapon is perfect, no need to refine it anymore~"; close; } .@price = getequiprefinecost(.@part, REFINE_COST_OVER10_HD, REFINE_ZENY_COST); .@material = getequiprefinecost(.@part, REFINE_COST_OVER10_HD, REFINE_MATERIAL_ID); - switch(getequipweaponlv(.@part)) { - default: - case 0: - set .@type$,"armor"; - break; - case 1: - case 2: - case 3: - case 4: - set .@type$,"weapon"; - break; - } + + if (getequipweaponlv(.@part) < 1 || getequipweaponlv(.@part) > 4) + .@type$ = "armor"; + else + .@type$ = "weapon"; mes "[Basta]"; mes "Hmm... is this the one you want to refine?"; - mes "To refine this equipment, I need 1 ^ff9999"+getitemname(.@material)+"^000000 and " + callfunc("F_InsertComma",.@price) + " zeny as a fee."; + mes "To refine this equipment, I need 1 ^ff9999" + getitemname(.@material) + "^000000 and " + callfunc("F_InsertComma",.@price) + " zeny as a fee."; mes "Do you really want to refine this?"; next; - if(select("Yes:No") == 2) { + if (select("Yes:No") == 2) { mes "[Basta]"; mes "Okay. If that's what you want..."; close; } if (getequippercentrefinery(.@part, true) < 100) { mes "[Basta]"; - mes "This "+.@type$+" has already been refined pretty high."; + mes "This " + .@type$ + " has already been refined pretty high."; mes "If you try to refine it more, the refine level could decrease."; next; mes "[Basta]"; @@ -245,25 +287,45 @@ OnInit: mes "It is impossible that the refine level will drop by, say, 3 or 4... that sounds scary."; mes "Here it can only decrease by 1 level."; next; - mes "[Basta]"; - mes "Compared to other blacksmiths, the risk is smaller."; - mes "I've given all precautions. Do you want to try it?"; - next; - if(select("Yes:No") == 2) { + if (.@blacksmith_blessing_count == 0 || countitem(6635) < .@blacksmith_blessing_count) { + mes "[Basta]"; + mes "Compared to other blacksmiths, the risk is smaller."; + mes "I've given all precautions. Do you want to try it?"; + next; + setarray .@menu$[1], "Yes", "No"; + } + else { + mes "[Basta]"; + mes "Woh~ is it the ^316AC5Blacksmith Blessing^000000? It is difficult to get it~ But, you has get it!"; + next; + mes "[Basta]"; + mes "For +" + .@refine_count + " " + .@type$ + " need ^316AC5" + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment is vanished. Do you want to refine with Blacksmith Blessing?"; + next; + setarray .@menu$[0], "Refine with Blacksmith Blessing", "Refine without Blacksmith Blessing", "Don't refine yet"; + } + switch( select(.@menu$[0], .@menu$[1], .@menu$[2]) ) { + case 1: + .@bless_who = 1; + break; + case 2: + break; + case 3: mes "[Basta]"; mes "Well~"; mes "Not challenging at all could also be a kind of wisdom in life."; close; } } - if (countitem(.@material) == 0 || Zeny < .@price) { + if ((.@bless_who && countitem(6635) < .@blacksmith_blessing_count) || countitem(.@material) == 0 || Zeny < .@price) { mes "[Basta]"; mes "Hmm... You didn't bring all the materials needed."; mes "Come back when you have them all."; close; } + if (.@bless_who) + delitem 6635, .@blacksmith_blessing_count; delitem .@material,1; - set Zeny, Zeny-.@price; + Zeny = Zeny - .@price; mes "Pow! Pow! Pow! Pow!"; if (getequippercentrefinery(.@part, true) > rand(100)) { successrefitem .@part; @@ -274,38 +336,46 @@ OnInit: mes "I really am the best blacksmith in the whole wide world!"; close; } - downrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "[Basta]"; - mes "Aaaaaaaaaaak!!!"; - next; - mes "[Basta]"; - mes "Damn it!"; - mes "Refining failed and refine level has decreased!"; - mes "Even the best blacksmith in the world doesn't guarantee 100% success!"; + if (.@bless_who == 1) { + specialeffect EF_HOLYHIT; + next; + emotion (rand(5) ? e_omg : e_cash ); + mes "[Basta]"; + mes "Aaaaaaaaaaak!!!"; + next; + mes "[Basta]"; + mes "Refining is failed!"; + mes "The best blacksmith in the world like me..."; + mes "doesn't guarantee 100% success~"; + } + else { + downrefitem .@part; + next; + emotion (rand(5) ? e_omg : e_cash ); + mes "[Basta]"; + mes "Aaaaaaaaaaak!!!"; + next; + mes "[Basta]"; + mes "Damn it!"; + mes "Refining failed and refine level has decreased!"; + mes "Even the best blacksmith in the world doesn't guarantee 100% success!"; + } mes "Too bad."; next; mes "[Basta]"; mes "I'll do better next time! Don't worry!"; close; -} -prt_in,57,54,3 duplicate(Basta) Basta#prt 826 -morocc_in,68,30,3 duplicate(Basta) Basta#morocc 826 -payon,148,174,3 duplicate(Basta) Basta#payon 826 -alberta_in,18,56,3 duplicate(Basta) Basta#alberta 826 -yuno_in01,173,18,3 duplicate(Basta) Basta#yuno 826 -ein_in01,24,82,3 duplicate(Basta) Basta#einbroch 826 -lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 826 - -// Refine UI makes these NPCs useless -- script RefineUIBastaInit -1,{ - end; -OnInit: - if( getbattleflag( "feature.refineui" ) == 3 ){ - unloadnpc "Basta"; - } +OnInit: // Refine UI makes these NPCs useless + if (getbattleflag("feature.refineui") == 3) + unloadnpc strnpcinfo(0); end; } +prt_in,57,54,3 duplicate(Basta) Basta#prt 4_M_DWARF +morocc_in,68,30,3 duplicate(Basta) Basta#morocc 4_M_DWARF +payon,148,174,3 duplicate(Basta) Basta#payon 4_M_DWARF +alberta_in,18,56,3 duplicate(Basta) Basta#alberta 4_M_DWARF +yuno_in01,173,18,3 duplicate(Basta) Basta#yuno 4_M_DWARF +ein_in01,24,82,3 duplicate(Basta) Basta#einbroch 4_M_DWARF +lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 4_M_DWARF From 2f008a5b476c0b0558e7cd30c121bf006ec5a8da Mon Sep 17 00:00:00 2001 From: Atemo Date: Fri, 13 Oct 2017 19:54:46 +0200 Subject: [PATCH 09/27] Updated script accordly @cydh comment --- npc/re/merchants/hd_refiner.txt | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index 17c0b0b8434..0c039246d90 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -110,7 +110,8 @@ mes "With the Blacksmith Blessing, the equipment won't vanish if the refine is failed!"; next; mes "[Blacksmith Mighty Hammer]"; - if (getequipweaponlv(.@part) < 1 || getequipweaponlv(.@part) > 4) + .@weapon_lvl = getequipweaponlv(.@part); + if (.@weapon_lvl < 1 || .@weapon_lvl > 4) mes "For +" + getequiprefinerycnt(.@part) + " equipment, refine with^316AC5 " + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; else mes "For +" + getequiprefinerycnt(.@part) + " weapon, refine with^316AC5 " + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; @@ -181,17 +182,6 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF // iRO NPC locations: // payon,174,133,4 duplicate(MightyHammer) Mighty Hammer#im 4_M_DWARF -// Refine UI makes these NPCs useless -- script RefineUIMightyHammerInit -1,{ - end; - -OnInit: - if( getbattleflag( "feature.refineui" ) == 3 ){ - unloadnpc "MightyHammer"; - } - end; -} - // Basta (+10 and up) :: cash_smelting //============================================================ - script ::Basta -1,{ @@ -263,7 +253,8 @@ OnInit: .@price = getequiprefinecost(.@part, REFINE_COST_OVER10_HD, REFINE_ZENY_COST); .@material = getequiprefinecost(.@part, REFINE_COST_OVER10_HD, REFINE_MATERIAL_ID); - if (getequipweaponlv(.@part) < 1 || getequipweaponlv(.@part) > 4) + .@weapon_lvl = getequipweaponlv(.@part); + if (.@weapon_lvl < 1 || .@weapon_lvl > 4) .@type$ = "armor"; else .@type$ = "weapon"; @@ -365,11 +356,6 @@ OnInit: mes "[Basta]"; mes "I'll do better next time! Don't worry!"; close; - -OnInit: // Refine UI makes these NPCs useless - if (getbattleflag("feature.refineui") == 3) - unloadnpc strnpcinfo(0); - end; } prt_in,57,54,3 duplicate(Basta) Basta#prt 4_M_DWARF @@ -379,3 +365,14 @@ alberta_in,18,56,3 duplicate(Basta) Basta#alberta 4_M_DWARF yuno_in01,173,18,3 duplicate(Basta) Basta#yuno 4_M_DWARF ein_in01,24,82,3 duplicate(Basta) Basta#einbroch 4_M_DWARF lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 4_M_DWARF + +// Refine UI makes these NPCs useless +- script RefineUI_Init -1,{ + end; +OnInit: + if (getbattleflag("feature.refineui") == 3) { + unloadnpc "Basta"; + unloadnpc "MightyHammer"; + } + end; +} From b532dfeebad1308fa2aa7555157cf8fc03a6eb94 Mon Sep 17 00:00:00 2001 From: aleos Date: Tue, 20 Feb 2018 17:03:42 -0500 Subject: [PATCH 10/27] Corrected an emotion constant * Updated it to the proper constant name. --- npc/re/merchants/hd_refiner.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index b337fb89594..f81c9d09724 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -153,7 +153,7 @@ if (.@bless_who == 1) { specialeffect EF_HOLYHIT; next; - emotion e_omg; + emotion ET_HUK; mes "[Blacksmith Mighty Hammer]"; mes "What?!!"; next; From a7b6e4162284896c366fdca184b85bf6530e0507 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 20:10:50 +0700 Subject: [PATCH 11/27] Refine UI Updates * Enabled Blacksmith Blessing check for refining to disable downrefine on fail! (of course without breaking the refined item) * +7 to +8 needs 1 ea * +8 to +9 needs 2 ea * +9 to +10 needs 4 ea * +10 to +11 needs 7 ea * +11 to +12 needs 11 ea * Added Blacksmith Blessing entries to refine_db.yml follow the values above. * Fixed refine_info clearances on loading files. Signed-off-by: Cydh Ramdh --- db/re/refine_db.yml | 88 +++++++++++++++++++++++++++++++++++++++++++++ src/map/clif.cpp | 27 +++++++++++--- src/map/status.cpp | 40 ++++++++++++++++++++- src/map/status.hpp | 5 +++ 4 files changed, 154 insertions(+), 6 deletions(-) diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index 2b5a781add9..e82abad3010 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -79,30 +79,45 @@ Armor: EventNormalChance: 20 EventEnrichedChance: 50 Bonus: 200 + BlacksmithBlessing: + ItemID: 6635 + Count: 1 - Level: 9 NormalChance: 20 EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 50 Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 2 - Level: 10 NormalChance: 9 EnrichedChance: 20 EventNormalChance: 9 EventEnrichedChance: 35 Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 4 - Level: 11 NormalChance: 8 EnrichedChance: 8 EventNormalChance: 20 EventEnrichedChance: 20 Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 7 - Level: 12 NormalChance: 8 EnrichedChance: 8 EventNormalChance: 20 EventEnrichedChance: 20 Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 11 - Level: 13 NormalChance: 8 EnrichedChance: 8 @@ -185,26 +200,41 @@ WeaponLv1: EnrichedChance: 90 EventNormalChance: 60 EventEnrichedChance: 95 + BlacksmithBlessing: + ItemID: 6635 + Count: 1 - Level: 9 NormalChance: 40 EnrichedChance: 70 EventNormalChance: 40 EventEnrichedChance: 85 + BlacksmithBlessing: + ItemID: 6635 + Count: 2 - Level: 10 NormalChance: 19 EnrichedChance: 30 EventNormalChance: 19 EventEnrichedChance: 55 + BlacksmithBlessing: + ItemID: 6635 + Count: 4 - Level: 11 NormalChance: 18 EnrichedChance: 18 EventNormalChance: 40 EventEnrichedChance: 40 + BlacksmithBlessing: + ItemID: 6635 + Count: 7 - Level: 12 NormalChance: 18 EnrichedChance: 18 EventNormalChance: 40 EventEnrichedChance: 40 + BlacksmithBlessing: + ItemID: 6635 + Count: 11 - Level: 13 NormalChance: 18 EnrichedChance: 18 @@ -289,26 +319,41 @@ WeaponLv2: EnrichedChance: 70 EventNormalChance: 40 EventEnrichedChance: 85 + BlacksmithBlessing: + ItemID: 6635 + Count: 1 - Level: 9 NormalChance: 20 EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 60 + BlacksmithBlessing: + ItemID: 6635 + Count: 2 - Level: 10 NormalChance: 19 EnrichedChance: 30 EventNormalChance: 19 EventEnrichedChance: 45 + BlacksmithBlessing: + ItemID: 6635 + Count: 4 - Level: 11 NormalChance: 18 EnrichedChance: 18 EventNormalChance: 40 EventEnrichedChance: 40 + BlacksmithBlessing: + ItemID: 6635 + Count: 7 - Level: 12 NormalChance: 18 EnrichedChance: 18 EventNormalChance: 40 EventEnrichedChance: 40 + BlacksmithBlessing: + ItemID: 6635 + Count: 11 - Level: 13 NormalChance: 18 EnrichedChance: 18 @@ -398,26 +443,41 @@ WeaponLv3: EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 70 + BlacksmithBlessing: + ItemID: 6635 + Count: 1 - Level: 9 NormalChance: 20 EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 60 + BlacksmithBlessing: + ItemID: 6635 + Count: 2 - Level: 10 NormalChance: 19 EnrichedChance: 30 EventNormalChance: 19 EventEnrichedChance: 45 + BlacksmithBlessing: + ItemID: 6635 + Count: 4 - Level: 11 NormalChance: 18 EnrichedChance: 18 EventNormalChance: 40 EventEnrichedChance: 40 + BlacksmithBlessing: + ItemID: 6635 + Count: 7 - Level: 12 NormalChance: 18 EnrichedChance: 18 EventNormalChance: 40 EventEnrichedChance: 40 + BlacksmithBlessing: + ItemID: 6635 + Count: 11 - Level: 13 NormalChance: 18 EnrichedChance: 18 @@ -512,26 +572,41 @@ WeaponLv4: EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 60 + BlacksmithBlessing: + ItemID: 6635 + Count: 1 - Level: 9 NormalChance: 20 EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 50 + BlacksmithBlessing: + ItemID: 6635 + Count: 2 - Level: 10 NormalChance: 9 EnrichedChance: 20 EventNormalChance: 9 EventEnrichedChance: 35 + BlacksmithBlessing: + ItemID: 6635 + Count: 4 - Level: 11 NormalChance: 8 EnrichedChance: 8 EventNormalChance: 20 EventEnrichedChance: 20 + BlacksmithBlessing: + ItemID: 6635 + Count: 7 - Level: 12 NormalChance: 8 EnrichedChance: 8 EventNormalChance: 20 EventEnrichedChance: 20 + BlacksmithBlessing: + ItemID: 6635 + Count: 11 - Level: 13 NormalChance: 8 EnrichedChance: 8 @@ -613,13 +688,26 @@ Shadow: EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 50 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 1 - Level: 9 NormalChance: 20 EnrichedChance: 40 EventNormalChance: 20 EventEnrichedChance: 50 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 2 - Level: 10 NormalChance: 9 EnrichedChance: 20 EventNormalChance: 9 EventEnrichedChance: 35 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 4 + #- Level: 11 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 7 diff --git a/src/map/clif.cpp b/src/map/clif.cpp index bb0a67e56fc..b32dd420350 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20319,7 +20319,8 @@ void clif_parse_refineui_close( int fd, struct map_session_data* sd ){ #endif } -#define REFINEUI_MAT_CNT 4 +#define REFINEUI_MAT_BS_BLESS 4 +#define REFINEUI_MAT_CNT (REFINEUI_MAT_BS_BLESS+1) /** * Structure to store all required data about refine requirements @@ -20327,6 +20328,7 @@ void clif_parse_refineui_close( int fd, struct map_session_data* sd ){ struct refine_materials { struct refine_cost cost; uint8 chance; + struct refine_bs_blessing bs_bless; }; /** @@ -20334,7 +20336,7 @@ struct refine_materials { * returns true on success or false on failure. */ static inline bool clif_refineui_materials_sub( struct item *item, struct item_data *id, struct refine_materials materials[REFINEUI_MAT_CNT], int index, enum refine_cost_type type ){ - if( index < 0 || index > REFINEUI_MAT_CNT ){ + if( index < 0 || index >= REFINEUI_MAT_CNT ){ return false; } @@ -20398,6 +20400,9 @@ static inline uint8 clif_refineui_materials( struct item *item, struct item_data count++; } + // Blacksmith Blessing requirements if any + status_get_refine_blacksmithBlessing(&materials[REFINEUI_MAT_BS_BLESS].bs_bless, (enum refine_type)id->wlv, item->refine); + // Return the amount of found materials return count; } @@ -20470,7 +20475,7 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ WFIFOW(fd,0) = 0x0AA2; WFIFOW(fd,2) = length; WFIFOW(fd,4) = index + 2; - WFIFOB(fd,6) = 0; //TODO: required amount of "Blacksmith Blessing"(id: 6635) + WFIFOB(fd,6) = (uint8)materials[REFINEUI_MAT_BS_BLESS].bs_bless.count; for( i = 0; i < material_count; i++ ){ WFIFOW(fd,7 + i * 7) = materials[i].cost.nameid; @@ -20602,6 +20607,16 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ return; } + if (use_blacksmith_blessing && materials[REFINEUI_MAT_BS_BLESS].bs_bless.count) { + if ((j = pc_search_inventory(sd, materials[REFINEUI_MAT_BS_BLESS].bs_bless.nameid)) < 0) { + return; + } + + if (pc_delitem(sd, j, materials[REFINEUI_MAT_BS_BLESS].bs_bless.count, 0, 0, LOG_TYPE_CONSUME)) { + return; + } + } + // Try to refine the item if( materials[i].chance >= rnd() % 100 ){ // Success @@ -20613,8 +20628,10 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ }else{ // Failure - // Delete the item if it is breakable - if( materials[i].cost.breakable ){ + if (use_blacksmith_blessing) { // Blacksmith Blessing were used, no break & no down refine + clif_refine(fd, 1, index, item->refine); + clif_refineui_info(sd, index); + } else if (materials[i].cost.breakable) { // Delete the item if it is breakable clif_refine( fd, 1, index, item->refine ); pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_CONSUME ); }else{ diff --git a/src/map/status.cpp b/src/map/status.cpp index 85becedb300..6beecf0e4f7 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -51,6 +51,7 @@ static struct { int bonus[MAX_REFINE]; /// Cumulative fixed bonus damage int randombonus_max[MAX_REFINE]; /// Cumulative maximum random bonus damage struct refine_cost cost[REFINE_COST_MAX]; + struct refine_bs_blessing bs_blessing[MAX_REFINE]; } refine_info[REFINE_TYPE_MAX]; static int atkmods[SZ_ALL][MAX_WEAPON_TYPE]; /// ATK weapon modification for size (size_fix.txt) @@ -14322,6 +14323,25 @@ int status_get_refine_chance(enum refine_type wlv, int refine, bool enriched) return refine_info[wlv].chance[type][refine]; } +/** + * Get Blacksmith Blessing requirement for refining + * @param bs Pointer to store the value + * @param type Armor or weapon level (see enum refine_type) + * @param refine Current refine level + * @return True if has valid value, false otherwise. + **/ +bool status_get_refine_blacksmithBlessing(struct refine_bs_blessing* bs, enum refine_type type, int refine) +{ + if (refine < 0 || refine >= MAX_REFINE) + return false; + + if (type < REFINE_TYPE_ARMOR || type > REFINE_TYPE_SHADOW) + return false; + + memcpy(bs, &refine_info[type].bs_blessing[refine], sizeof(struct refine_bs_blessing)); + return true; +} + /** * Check if status is disabled on a map * @param type: Status Change data @@ -14494,6 +14514,23 @@ static bool status_yaml_readdb_refine_sub(const YAML::Node &node, int refine_inf if (refine_level >= random_bonus_start_level - 1) refine_info[refine_info_index].randombonus_max[refine_level] = random_bonus * (refine_level - random_bonus_start_level + 2); + + // Blacksmith Blessing + if (yaml_node_is_defined(level, "BlacksmithBlessing")) { + yamlwrapper* bswrap = yaml_get_subnode(level, "BlacksmithBlessing"); + static char* keys[] = { "ItemID", "Count" }; + char* result; + + if ((result = yaml_verify_nodes(bswrap, ARRAYLENGTH(keys), keys)) != NULL) { + ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", result, file_name); + yaml_destroy_wrapper(bswrap); + } + else { + refine_info[refine_info_index].bs_blessing[refine_level].nameid = yaml_get_int(bswrap, "ItemID"); + refine_info[refine_info_index].bs_blessing[refine_level].count = yaml_get_uint16(bswrap, "Count"); + yaml_destroy_wrapper(bswrap); + } + } } for (int refine_level = 0; refine_level < MAX_REFINE; ++refine_level) refine_info[refine_info_index].bonus[refine_level] += bonus_per_level + (refine_level > 0 ? refine_info[refine_info_index].bonus[refine_level - 1] : 0); @@ -14631,7 +14668,8 @@ int status_readdb(void) // refine_db.yml for(i=0;i Date: Sun, 8 Jul 2018 20:11:58 +0700 Subject: [PATCH 12/27] Added Refine material limitations * HD Oridecon & HD Elunium only can be used to update equip with refine level +7 to +9. It means +7 -> +8, +8 -> +9, +9 -> +10. * Enriched Oridecon & Enriched Elunium are just replacement of normal materials. It means only can be used to refine up to +10. * Corrected `true = enriched` flag for `getequippercentrefinery` commands. HD just simply use normal rates, not enriched. Or create new value for HDs later Signed-off-by: Cydh Ramdh --- db/re/refine_db.yml | 200 +++++++++++++-------------- npc/re/merchants/blessed_refiner.txt | 2 +- npc/re/merchants/hd_refiner.txt | 6 +- npc/re/merchants/shadow_refiner.txt | 2 +- src/map/clif.cpp | 5 +- 5 files changed, 108 insertions(+), 107 deletions(-) diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index e82abad3010..903553d2cb7 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -102,69 +102,69 @@ Armor: Count: 4 - Level: 11 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 16 - EventEnrichedChance: 16 + EventEnrichedChance: 0 Bonus: 400 - Level: 14 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 16 - EventEnrichedChance: 16 + EventEnrichedChance: 0 Bonus: 400 - Level: 15 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 400 - Level: 16 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 400 - Level: 17 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 14 - EventEnrichedChance: 14 + EventEnrichedChance: 0 Bonus: 500 - Level: 18 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 14 - EventEnrichedChance: 14 + EventEnrichedChance: 0 Bonus: 500 - Level: 19 NormalChance: 5 - EnrichedChance: 5 + EnrichedChance: 0 EventNormalChance: 10 - EventEnrichedChance: 10 + EventEnrichedChance: 0 Bonus: 500 - Level: 20 NormalChance: 5 - EnrichedChance: 5 + EnrichedChance: 0 EventNormalChance: 10 - EventEnrichedChance: 10 + EventEnrichedChance: 0 Bonus: 500 WeaponLv1: StatsPerLevel: 200 @@ -221,64 +221,64 @@ WeaponLv1: Count: 4 - Level: 11 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 40 - EventEnrichedChance: 40 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 40 - EventEnrichedChance: 40 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 35 - EventEnrichedChance: 35 + EventEnrichedChance: 0 - Level: 14 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 35 - EventEnrichedChance: 35 + EventEnrichedChance: 0 - Level: 15 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 30 - EventEnrichedChance: 30 + EventEnrichedChance: 0 - Level: 16 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 30 - EventEnrichedChance: 30 + EventEnrichedChance: 0 Bonus: 300 - Level: 17 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 300 - Level: 18 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 300 - Level: 19 NormalChance: 15 - EnrichedChance: 15 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 300 - Level: 20 NormalChance: 15 - EnrichedChance: 15 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 300 WeaponLv2: StatsPerLevel: 300 @@ -340,64 +340,64 @@ WeaponLv2: Count: 4 - Level: 11 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 40 - EventEnrichedChance: 40 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 40 - EventEnrichedChance: 40 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 35 - EventEnrichedChance: 35 + EventEnrichedChance: 0 - Level: 14 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 35 - EventEnrichedChance: 35 + EventEnrichedChance: 0 - Level: 15 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 30 - EventEnrichedChance: 30 + EventEnrichedChance: 0 - Level: 16 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 30 - EventEnrichedChance: 30 + EventEnrichedChance: 0 Bonus: 600 - Level: 17 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 600 - Level: 18 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 600 - Level: 19 NormalChance: 15 - EnrichedChance: 15 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 600 - Level: 20 NormalChance: 15 - EnrichedChance: 15 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 600 WeaponLv3: StatsPerLevel: 500 @@ -464,64 +464,64 @@ WeaponLv3: Count: 4 - Level: 11 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 40 - EventEnrichedChance: 40 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 40 - EventEnrichedChance: 40 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 35 - EventEnrichedChance: 35 + EventEnrichedChance: 0 - Level: 14 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 35 - EventEnrichedChance: 35 + EventEnrichedChance: 0 - Level: 15 NormalChance: 18 - EnrichedChance: 18 + EnrichedChance: 0 EventNormalChance: 30 - EventEnrichedChance: 30 + EventEnrichedChance: 0 - Level: 16 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 30 - EventEnrichedChance: 30 + EventEnrichedChance: 0 Bonus: 900 - Level: 17 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 900 - Level: 18 NormalChance: 17 - EnrichedChance: 17 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 Bonus: 900 - Level: 19 NormalChance: 15 - EnrichedChance: 15 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 900 - Level: 20 NormalChance: 15 - EnrichedChance: 15 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 900 WeaponLv4: StatsPerLevel: 700 @@ -593,64 +593,64 @@ WeaponLv4: Count: 4 - Level: 11 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 20 - EventEnrichedChance: 20 + EventEnrichedChance: 0 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 16 - EventEnrichedChance: 16 + EventEnrichedChance: 0 - Level: 14 NormalChance: 8 - EnrichedChance: 8 + EnrichedChance: 0 EventNormalChance: 16 - EventEnrichedChance: 16 + EventEnrichedChance: 0 - Level: 15 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 - Level: 16 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 15 - EventEnrichedChance: 15 + EventEnrichedChance: 0 Bonus: 1200 - Level: 17 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 14 - EventEnrichedChance: 14 + EventEnrichedChance: 0 Bonus: 1200 - Level: 18 NormalChance: 7 - EnrichedChance: 7 + EnrichedChance: 0 EventNormalChance: 14 - EventEnrichedChance: 14 + EventEnrichedChance: 0 Bonus: 1200 - Level: 19 NormalChance: 5 - EnrichedChance: 5 + EnrichedChance: 0 EventNormalChance: 10 - EventEnrichedChance: 10 + EventEnrichedChance: 0 Bonus: 1200 - Level: 20 NormalChance: 5 - EnrichedChance: 5 + EnrichedChance: 0 EventNormalChance: 10 - EventEnrichedChance: 10 + EventEnrichedChance: 0 Bonus: 1200 Shadow: StatsPerLevel: 0 diff --git a/npc/re/merchants/blessed_refiner.txt b/npc/re/merchants/blessed_refiner.txt index 00b0fdf9a79..5eedd4a6c4a 100644 --- a/npc/re/merchants/blessed_refiner.txt +++ b/npc/re/merchants/blessed_refiner.txt @@ -144,7 +144,7 @@ mes "[Blacksmith Dister]"; mes "Tac! Tac! Tac!"; - if (getequippercentrefinery(.@part, true) > rand(100)) { + if (getequippercentrefinery(.@part) > rand(100)) { specialeffect EF_BLESSING; successrefitem .@part; next; diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index a21e8630a1a..a87f13a79ce 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -156,7 +156,7 @@ mes "[Blacksmith Mighty Hammer]"; mes "Tac! Tac! Tac!"; - if (getequippercentrefinery(.@part, true) > rand(100)) { + if (getequippercentrefinery(.@part) > rand(100)) { successrefitem .@part; next; emotion ET_BEST; @@ -286,7 +286,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF mes "Okay. If that's what you want..."; close; } - if (getequippercentrefinery(.@part, true) < 100) { + if (getequippercentrefinery(.@part) < 100) { mes "[Basta]"; mes "This " + .@type$ + " has already been refined pretty high."; mes "If you try to refine it more, the refine level could decrease."; @@ -348,7 +348,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF } mes "Pow! Pow! Pow! Pow!"; - if (getequippercentrefinery(.@part, true) > rand(100)) { + if (getequippercentrefinery(.@part) > rand(100)) { successrefitem .@part; next; emotion ET_BEST; diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index 4aa22ed28cf..b139d1db2f5 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -137,7 +137,7 @@ if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@equip_refine)) close; - if (getequippercentrefinery(.@part, .@is_enriched) > rand(100)) { + if (getequippercentrefinery(.@part, .@option == 2) > rand(100)) { successrefitem .@part; mes "[Shadow Blacksmith]"; mes "It worked! It worked!"; diff --git a/src/map/clif.cpp b/src/map/clif.cpp index b32dd420350..29214f14b03 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20389,8 +20389,9 @@ static inline uint8 clif_refineui_materials( struct item *item, struct item_data count++; } - // HD refine requirements - if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_HD ) ){ + // HD refine requirements only if the refine is +7 ~ +9 + // TODO: Remove this hardcoded check, add HD values separetd from 'normal' rates + if( item->refine >= 7 && item->refine <= 9 && clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_HD ) ){ count++; } } From 1a3ac7a7f5a25aec6c3dec36eda0b23b4559b38a Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 20:37:02 +0700 Subject: [PATCH 13/27] Refine DB is revamped! * You are now allowed to add your own refine costs/chances! * Say goodbye to `event_refine_chance` config. If you need 'event'-like chance, just add the chance value and use that type for `getequippercentrefinery` command, just like its bro `getequiprefinecost`. * To disable certain refine material (based on refine cost/type) on certain refine level/type, just remove its value from it! * The most important,see your refine_db.yml now, the refine rates are using refine cost types. If you have custom values, just simply adjust it. * There are Blessed Oridecon/Elunium from `blessed_refiner` NPC to refine_db.yml but it won't be displayed in NEW Refine UI, why? Because the `RefineUI` value in refine_db.yml is set as `false`. * technically Over +10 is 'normal' rates, just have different material, so the `REFINE_COST_NORMAL` never be in +11 to +20 so does `REFINE_COST_OVER10` will never be in below +10. There are also HD, Enriched, and Blessed ores with this refine level restriction. Signed-off-by: Cydh Ramdh --- db/pre-re/refine_db.yml | 350 +++++++---- db/re/refine_db.yml | 800 +++++++++++++++----------- doc/script_commands.txt | 26 +- npc/merchants/advanced_refiner.txt | 4 +- npc/merchants/refine.txt | 8 +- npc/quests/seals/mjolnir_seal.txt | 8 +- npc/re/jobs/2e/kagerou_oboro.txt | 2 +- npc/re/jobs/novice/academy.txt | 8 +- npc/re/merchants/advanced_refiner.txt | 4 +- npc/re/merchants/blessed_refiner.txt | 16 +- npc/re/merchants/hd_refiner.txt | 8 +- npc/re/merchants/refine.txt | 12 +- npc/re/merchants/shadow_refiner.txt | 11 +- src/map/battle.cpp | 3 +- src/map/battle.hpp | 3 +- src/map/clif.cpp | 46 +- src/map/script.cpp | 10 +- src/map/skill.cpp | 2 +- src/map/status.cpp | 211 ++++--- src/map/status.hpp | 21 +- 20 files changed, 924 insertions(+), 629 deletions(-) diff --git a/db/pre-re/refine_db.yml b/db/pre-re/refine_db.yml index 3602c72b786..2dda4bd3ed3 100644 --- a/db/pre-re/refine_db.yml +++ b/db/pre-re/refine_db.yml @@ -29,37 +29,51 @@ Armor: - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7619 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7619 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 5 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 6 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 7 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 - Level: 10 - NormalChance: 9 - EnrichedChance: 20 - EventNormalChance: 9 - EventEnrichedChance: 35 + REFINE_COST_NORMAL: 9 + REFINE_COST_ENRICHED: 20 + REFINE_COST_EVT_ENRICHED: 35 WeaponLv1: StatsPerLevel: 200 RandomBonusStartLevel: 8 @@ -71,22 +85,51 @@ WeaponLv1: - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 5 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 6 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 7 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 8 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 9 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 85 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 85 - Level: 10 - NormalChance: 19 - EnrichedChance: 30 - EventNormalChance: 19 - EventEnrichedChance: 55 + REFINE_COST_NORMAL: 19 + REFINE_COST_ENRICHED: 30 + REFINE_COST_EVT_ENRICHED: 55 WeaponLv2: StatsPerLevel: 300 RandomBonusStartLevel: 7 @@ -98,27 +141,51 @@ WeaponLv2: - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 5 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 6 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 7 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 8 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 85 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 85 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 60 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 60 - Level: 10 - NormalChance: 19 - EnrichedChance: 30 - EventNormalChance: 19 - EventEnrichedChance: 45 + REFINE_COST_NORMAL: 19 + REFINE_COST_ENRICHED: 30 + REFINE_COST_EVT_ENRICHED: 45 WeaponLv3: StatsPerLevel: 500 RandomBonusStartLevel: 6 @@ -130,32 +197,51 @@ WeaponLv3: - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 5 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 6 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 7 - NormalChance: 50 - EnrichedChance: 80 - EventNormalChance: 50 - EventEnrichedChance: 90 + REFINE_COST_NORMAL: 50 + REFINE_COST_ENRICHED: 80 + REFINE_COST_EVT_ENRICHED: 90 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 70 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 70 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 60 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 60 - Level: 10 - NormalChance: 19 - EnrichedChance: 30 - EventNormalChance: 19 - EventEnrichedChance: 45 + REFINE_COST_NORMAL: 19 + REFINE_COST_ENRICHED: 30 + REFINE_COST_EVT_ENRICHED: 45 WeaponLv4: StatsPerLevel: 700 RandomBonusStartLevel: 5 @@ -167,69 +253,93 @@ WeaponLv4: - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 5 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 6 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 7 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 60 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 60 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 - Level: 10 - NormalChance: 9 - EnrichedChance: 20 - EventNormalChance: 9 - EventEnrichedChance: 35 + REFINE_COST_NORMAL: 9 + REFINE_COST_ENRICHED: 20 + REFINE_COST_EVT_ENRICHED: 35 Shadow: StatsPerLevel: 0 RandomBonusStartLevel: 0 RandomBonusValue: 0 Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 5 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 6 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 7 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 - Level: 10 - NormalChance: 9 - EnrichedChance: 20 - EventNormalChance: 9 - EventEnrichedChance: 35 + REFINE_COST_NORMAL: 9 + REFINE_COST_ENRICHED: 20 + REFINE_COST_EVT_ENRICHED: 35 diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index 903553d2cb7..f6ad2069f41 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -46,125 +46,142 @@ Armor: - Type: REFINE_COST_WAGJAK Price: 20000 Material: 985 + - Type: REFINE_COST_BLESSED + Price: 20000 + Material: 6439 + Breakable: false + RefineUI: false + # 'Event' rates + - Type: REFINE_COST_EVT_OVER10_HD + Price: 100000 + Material: 6225 + Breakable: false + RefineUI: false + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7619 + RefineUI: false Rates: - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 Bonus: 100 - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 Bonus: 100 - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 Bonus: 100 - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 Bonus: 100 - Level: 5 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 Bonus: 200 - Level: 6 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 Bonus: 200 - Level: 7 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_BLESSED: 40 + REFINE_COST_EVT_ENRICHED: 80 Bonus: 200 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_BLESSED: 20 + REFINE_COST_EVT_ENRICHED: 50 Bonus: 200 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_BLESSED: 20 + REFINE_COST_EVT_ENRICHED: 50 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - NormalChance: 9 - EnrichedChance: 20 - EventNormalChance: 9 - EventEnrichedChance: 35 + REFINE_COST_NORMAL: 9 + REFINE_COST_HD: 9 + REFINE_COST_ENRICHED: 20 + REFINE_COST_BLESSED: 9 + REFINE_COST_EVT_ENRICHED: 35 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_BLESSED: 8 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_BLESSED: 8 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 16 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_BLESSED: 8 + REFINE_COST_EVT_OVER10_HD: 16 Bonus: 400 - Level: 14 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 16 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_EVT_OVER10_HD: 16 Bonus: 400 - Level: 15 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 400 - Level: 16 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 400 - Level: 17 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 14 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 14 Bonus: 500 - Level: 18 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 14 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 14 Bonus: 500 - Level: 19 - NormalChance: 5 - EnrichedChance: 0 - EventNormalChance: 10 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 5 + REFINE_COST_OVER10_HD: 5 + REFINE_COST_EVT_OVER10_HD: 10 Bonus: 500 - Level: 20 - NormalChance: 5 - EnrichedChance: 0 - EventNormalChance: 10 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 5 + REFINE_COST_OVER10_HD: 5 + REFINE_COST_EVT_OVER10_HD: 10 Bonus: 500 WeaponLv1: StatsPerLevel: 200 @@ -194,91 +211,131 @@ WeaponLv1: - Type: REFINE_COST_WAGJAK Price: 1000 Material: 1010 + - Type: REFINE_COST_BLESSED + Price: 1000 + Material: 6438 + Breakable: false + RefineUI: false + # 'Event' rates + - Type: REFINE_COST_EVT_OVER10_HD + Price: 100000 + Material: 6226 + Breakable: false + RefineUI: false + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 5 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 6 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 7 + REFINE_COST_NORMAL: 100 + REFINE_COST_BLESSED: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 8 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_HD: 60 + REFINE_COST_BLESSED: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 85 + REFINE_COST_NORMAL: 40 + REFINE_COST_HD: 40 + REFINE_COST_BLESSED: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 85 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - NormalChance: 19 - EnrichedChance: 30 - EventNormalChance: 19 - EventEnrichedChance: 55 + REFINE_COST_NORMAL: 19 + REFINE_COST_HD: 19 + REFINE_COST_BLESSED: 19 + REFINE_COST_ENRICHED: 30 + REFINE_COST_EVT_ENRICHED: 55 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 40 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 40 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 40 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 40 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 35 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 35 - Level: 14 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 35 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_EVT_OVER10_HD: 35 - Level: 15 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 30 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_EVT_OVER10_HD: 30 - Level: 16 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 30 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 30 Bonus: 300 - Level: 17 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 300 - Level: 18 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 300 - Level: 19 - NormalChance: 15 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 15 + REFINE_COST_OVER10_HD: 15 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 300 - Level: 20 - NormalChance: 15 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 15 + REFINE_COST_OVER10_HD: 15 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 300 WeaponLv2: StatsPerLevel: 300 @@ -308,96 +365,131 @@ WeaponLv2: - Type: REFINE_COST_WAGJAK Price: 2000 Material: 1011 + - Type: REFINE_COST_BLESSED + Price: 2000 + Material: 6438 + Breakable: false + RefineUI: false + # 'Event' rates + - Type: REFINE_COST_EVT_OVER10_HD + Price: 100000 + Material: 6226 + Breakable: false + RefineUI: false + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 5 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 6 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 7 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_BLESSED: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 8 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 85 + REFINE_COST_NORMAL: 40 + REFINE_COST_HD: 40 + REFINE_COST_BLESSED: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 85 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 60 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_BLESSED: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 60 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - NormalChance: 19 - EnrichedChance: 30 - EventNormalChance: 19 - EventEnrichedChance: 45 + REFINE_COST_NORMAL: 19 + REFINE_COST_HD: 19 + REFINE_COST_BLESSED: 19 + REFINE_COST_ENRICHED: 30 + REFINE_COST_EVT_ENRICHED: 45 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 40 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 40 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 40 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 40 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 35 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 35 - Level: 14 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 35 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_EVT_OVER10_HD: 35 - Level: 15 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 30 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_EVT_OVER10_HD: 30 - Level: 16 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 30 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 30 Bonus: 600 - Level: 17 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 600 - Level: 18 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 600 - Level: 19 - NormalChance: 15 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 15 + REFINE_COST_OVER10_HD: 15 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 600 - Level: 20 - NormalChance: 15 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 15 + REFINE_COST_OVER10_HD: 15 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 600 WeaponLv3: StatsPerLevel: 500 @@ -427,101 +519,131 @@ WeaponLv3: - Type: REFINE_COST_WAGJAK Price: 10000 Material: 984 + - Type: REFINE_COST_BLESSED + Price: 20000 + Material: 6438 + Breakable: false + RefineUI: false + # 'Event' rates + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false + - Type: REFINE_COST_EVT_OVER10_HD + Price: 100000 + Material: 6226 + Breakable: false + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 5 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 6 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 7 - NormalChance: 50 - EnrichedChance: 80 - EventNormalChance: 50 - EventEnrichedChance: 90 + REFINE_COST_NORMAL: 50 + REFINE_COST_BLESSED: 50 + REFINE_COST_ENRICHED: 80 + REFINE_COST_EVT_ENRICHED: 90 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 70 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_BLESSED: 20 + REFINE_COST_EVT_ENRICHED: 70 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 60 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_BLESSED: 20 + REFINE_COST_EVT_ENRICHED: 60 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - NormalChance: 19 - EnrichedChance: 30 - EventNormalChance: 19 - EventEnrichedChance: 45 + REFINE_COST_NORMAL: 19 + REFINE_COST_HD: 19 + REFINE_COST_ENRICHED: 30 + REFINE_COST_BLESSED: 19 + REFINE_COST_EVT_ENRICHED: 45 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 40 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 40 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 40 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 40 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 35 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_BLESSED: 18 + REFINE_COST_EVT_OVER10_HD: 35 - Level: 14 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 35 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_EVT_OVER10_HD: 35 - Level: 15 - NormalChance: 18 - EnrichedChance: 0 - EventNormalChance: 30 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 18 + REFINE_COST_OVER10_HD: 18 + REFINE_COST_EVT_OVER10_HD: 30 - Level: 16 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 30 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 30 Bonus: 900 - Level: 17 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 900 - Level: 18 - NormalChance: 17 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 17 + REFINE_COST_OVER10_HD: 17 + REFINE_COST_EVT_OVER10_HD: 20 Bonus: 900 - Level: 19 - NormalChance: 15 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 15 + REFINE_COST_OVER10_HD: 15 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 900 - Level: 20 - NormalChance: 15 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 15 + REFINE_COST_OVER10_HD: 15 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 900 WeaponLv4: StatsPerLevel: 700 @@ -551,106 +673,131 @@ WeaponLv4: - Type: REFINE_COST_WAGJAK Price: 20000 Material: 984 + - Type: REFINE_COST_BLESSED + Price: 40000 + Material: 6438 + Breakable: false + RefineUI: false + # 'Event' rates + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false + - Type: REFINE_COST_EVT_OVER10_HD + Price: 100000 + Material: 6226 + Breakable: false + RefineUI: false Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 5 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 6 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 7 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_BLESSED: 40 + REFINE_COST_EVT_ENRICHED: 80 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 60 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_BLESSED: 20 + REFINE_COST_EVT_ENRICHED: 60 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_BLESSED: 20 + REFINE_COST_EVT_ENRICHED: 50 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - NormalChance: 9 - EnrichedChance: 20 - EventNormalChance: 9 - EventEnrichedChance: 35 + REFINE_COST_NORMAL: 9 + REFINE_COST_HD: 9 + REFINE_COST_ENRICHED: 20 + REFINE_COST_BLESSED: 9 + REFINE_COST_EVT_ENRICHED: 35 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_BLESSED: 8 + REFINE_COST_EVT_OVER10_HD: 20 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 20 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_BLESSED: 8 + REFINE_COST_EVT_OVER10_HD: 20 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 16 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_BLESSED: 8 + REFINE_COST_EVT_OVER10_HD: 16 - Level: 14 - NormalChance: 8 - EnrichedChance: 0 - EventNormalChance: 16 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 8 + REFINE_COST_OVER10_HD: 8 + REFINE_COST_EVT_OVER10_HD: 16 - Level: 15 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 15 - Level: 16 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 15 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 15 Bonus: 1200 - Level: 17 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 14 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 14 Bonus: 1200 - Level: 18 - NormalChance: 7 - EnrichedChance: 0 - EventNormalChance: 14 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 7 + REFINE_COST_OVER10_HD: 7 + REFINE_COST_EVT_OVER10_HD: 14 Bonus: 1200 - Level: 19 - NormalChance: 5 - EnrichedChance: 0 - EventNormalChance: 10 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 5 + REFINE_COST_OVER10_HD: 5 + REFINE_COST_EVT_OVER10_HD: 10 Bonus: 1200 - Level: 20 - NormalChance: 5 - EnrichedChance: 0 - EventNormalChance: 10 - EventEnrichedChance: 0 + REFINE_COST_OVER10: 5 + REFINE_COST_OVER10_HD: 5 + REFINE_COST_EVT_OVER10_HD: 10 Bonus: 1200 Shadow: StatsPerLevel: 0 @@ -668,42 +815,55 @@ Shadow: Price: 20000 Material: 7619 Rates: + - Level: 1 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 2 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 3 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 + - Level: 4 + REFINE_COST_NORMAL: 100 + REFINE_COST_ENRICHED: 100 + REFINE_COST_EVT_ENRICHED: 100 - Level: 5 - NormalChance: 60 - EnrichedChance: 90 - EventNormalChance: 60 - EventEnrichedChance: 95 + REFINE_COST_NORMAL: 60 + REFINE_COST_ENRICHED: 90 + REFINE_COST_EVT_ENRICHED: 95 - Level: 6 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 7 - NormalChance: 40 - EnrichedChance: 70 - EventNormalChance: 40 - EventEnrichedChance: 80 + REFINE_COST_NORMAL: 40 + REFINE_COST_ENRICHED: 70 + REFINE_COST_EVT_ENRICHED: 80 - Level: 8 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 # BlacksmithBlessing: # ItemID: 6635 # Count: 1 - Level: 9 - NormalChance: 20 - EnrichedChance: 40 - EventNormalChance: 20 - EventEnrichedChance: 50 + REFINE_COST_NORMAL: 20 + REFINE_COST_HD: 20 + REFINE_COST_ENRICHED: 40 + REFINE_COST_EVT_ENRICHED: 50 # BlacksmithBlessing: # ItemID: 6635 # Count: 2 - Level: 10 - NormalChance: 9 - EnrichedChance: 20 - EventNormalChance: 9 - EventEnrichedChance: 35 + REFINE_COST_NORMAL: 9 + REFINE_COST_HD: 9 + REFINE_COST_ENRICHED: 20 + REFINE_COST_EVT_ENRICHED: 35 # BlacksmithBlessing: # ItemID: 6635 # Count: 4 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 248d58eb909..3e703a216c4 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2791,7 +2791,7 @@ Examples: --------------------------------------- -*getequippercentrefinery({,,}) +*getequippercentrefinery(,{,}) This function calculates and returns the percent value chance to successfully refine the item found in the specified equipment slot of the invoking character @@ -2799,8 +2799,9 @@ by +1. There is no actual formula, the success rate for a given weapon level of a certain refine level is found in the db/(pre-)re/refine_db.yml file. For a list of equipment slots see 'getequipid'. -If enriched parameter is set to true, chance to successfully refine the item with -enriched material is returned instead. +For 'type' values, see the valid types in 'getequiprefinecost' below. +(As backward compatibility, if this value is unset, below +10 will use +REFINE_COST_NORMAL and above +10 is using REFINE_COST_OVER10). These values can be displayed for the player to see, or used to calculate the random change of a refine succeeding or failing and then going through with it @@ -2819,13 +2820,16 @@ passed arguments and . Valid cost types are: -REFINE_COST_NORMAL - For normal refining -REFINE_COST_OVER10 - For refining over +10 -REFINE_COST_HD - For refining with HD ores -REFINE_COST_ENRICHED - For refining with enriched ores -REFINE_COST_OVER10_HD - For refining over +10 with HD ores -REFINE_COST_HOLINK - For refining at Holink in Malangdo -REFINE_COST_WAGJAK - For refining at Refining Machine Wagjak in the Novice Academy +REFINE_COST_NORMAL - For normal refining +REFINE_COST_OVER10 - For refining over +10 +REFINE_COST_HD - For refining with HD ores +REFINE_COST_ENRICHED - For refining with enriched ores +REFINE_COST_OVER10_HD - For refining over +10 with HD ores +REFINE_COST_HOLINK - For refining at Holink in Malangdo +REFINE_COST_WAGJAK - For refining at Refining Machine Wagjak in the Novice Academy +REFINE_COST_BLESSED - For refining using Blessed Ore +REFINE_COST_EVT_ENRICHED - For refining with enriched ores with event rates +REFINE_COST_EVT_OVER10_HD - For refining over +10 with HD ores with event rates This function will return required cost for refining based on argument. @@ -2835,6 +2839,8 @@ REFINE_ZENY_COST - Zeny REFINE_MATERIAL_ID - Material Item ID REFINE_BREAKABLE - If the equipment will be broken by using this material on a failed atempt +REFINE_BS_BLESSING - Only for REFINE_COST_BS_BLESSING to return the number of + Blacksmith Blessing needed This function will return -1 on failure. The function fails if the cost type is invalid or if there is no item in the equipment slot. diff --git a/npc/merchants/advanced_refiner.txt b/npc/merchants/advanced_refiner.txt index 397553cc4ae..2c4089f7c4b 100644 --- a/npc/merchants/advanced_refiner.txt +++ b/npc/merchants/advanced_refiner.txt @@ -66,7 +66,7 @@ payon,157,146,6 script Suhnbi#cash 85,{ mes "[Suhnbi]"; mes "Clang! Clang! Clang!"; - if (getequippercentrefinery(.@part, true) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_ENRICHED) > rand(100)) { successrefitem .@part; next; emotion ET_BEST; @@ -113,7 +113,7 @@ S_RefineValidate: mes "Would you like to continue?"; next; if(select("Yes:No") == 1) { - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part,REFINE_COST_ENRICHED) < 100) { if (.@weapon_lvl) { mes "[Suhnbi]"; mes "Wow!!"; diff --git a/npc/merchants/refine.txt b/npc/merchants/refine.txt index 6bc8abef8b4..4517e41986c 100644 --- a/npc/merchants/refine.txt +++ b/npc/merchants/refine.txt @@ -658,7 +658,7 @@ function script refinemain { mes "rush. Take your time."; close; } - if(getequippercentrefinery(.@part) < 100) { + if(getequippercentrefinery(.@part, REFINE_COST_NORMAL) < 100) { mes "["+ .@npc_name$ +"]"; mes "Oh no! If I continue to"; mes "refine this, there's a risk it could"; @@ -709,7 +709,7 @@ function script refinemain { close; } - if(getequippercentrefinery(.@part) <= rand(100)) { + if(getequippercentrefinery(.@part, REFINE_COST_NORMAL) <= rand(100)) { failedrefitem .@part; mes "["+ .@npc_name$ +"]"; emotion (!rand(5))?ET_MONEY:ET_HUK; @@ -822,7 +822,7 @@ function script refinemain { } // anti-hack if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || - callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt) || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) { + callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt) || (.@menu2 == 1 && getequippercentrefinery(.@part, REFINE_COST_NORMAL) < 100)) { mes "["+ .@npc_name$ +"]"; mes "Clang... No, but did you imagine I could be so stupid?!"; mes "You changed it..."; @@ -830,7 +830,7 @@ function script refinemain { close; } mes "Clang, clang!!!"; - if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) { + if(.@menu2 == 2 && getequippercentrefinery(.@part, REFINE_COST_NORMAL) <= rand(100)) { failedrefitem .@part; emotion ET_HUK; mes "["+ .@npc_name$ +"]"; diff --git a/npc/quests/seals/mjolnir_seal.txt b/npc/quests/seals/mjolnir_seal.txt index 267045b9864..d61f2a577fe 100644 --- a/npc/quests/seals/mjolnir_seal.txt +++ b/npc/quests/seals/mjolnir_seal.txt @@ -1972,7 +1972,7 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ mes "Oh, this is excellent! This piece here has been perfectly refined! But this isn't what I want. I can't do any work on this at all."; close; } - if (GetEquipPercentRefinery(.@part) == 100) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) == 0) { mes "[Vestri]"; mes "This item isn't even a challenge to upgrade. You can get humans to do this kind of beginner's stuff. Get them to refine it first."; next; @@ -2044,7 +2044,7 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@equip_refine)) close; - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part,REFINE_COST_NORMAL) > rand(100)) { mes "^3355FF*Clang Clang!*^000000"; successrefitem .@part; next; @@ -2196,7 +2196,7 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ mes "Oh, this is excellent! This piece here has been perfectly refined! But this isn't what I want. I can't do any work on this at all."; close; } - if (GetEquipPercentRefinery(.@part) == 100) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) == 0) { mes "[Vestri]"; mes "This item isn't even a challenge to upgrade. You can get humans to do this kind of beginner's stuff. Get them to refine it first."; next; @@ -2262,7 +2262,7 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@equip_refine)) close; - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part,REFINE_COST_NORMAL) > rand(100)) { mes "^3355FF*Clang Clang!*^000000"; successrefitem .@part; next; diff --git a/npc/re/jobs/2e/kagerou_oboro.txt b/npc/re/jobs/2e/kagerou_oboro.txt index c9e68bbc5d5..f62137ebad8 100644 --- a/npc/re/jobs/2e/kagerou_oboro.txt +++ b/npc/re/jobs/2e/kagerou_oboro.txt @@ -2462,7 +2462,7 @@ job_ko,121,121,0 script Refinement Tools#ko_01 844,{ mes "This equipment is perfectly refined. Keep it for yourself!"; //custom translation close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) < 100) { mes "This is very well refined equipment. Do you want to continue? Refine skill decreases by 1 if refinement fails."; next; if(select("Continue.:Stop.") == 2) { diff --git a/npc/re/jobs/novice/academy.txt b/npc/re/jobs/novice/academy.txt index 31e659a9812..f3c43a6d551 100644 --- a/npc/re/jobs/novice/academy.txt +++ b/npc/re/jobs/novice/academy.txt @@ -12879,7 +12879,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ mes "Cancel the refining."; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part,REFINE_COST_WAGJAK) < 100) { mes "[Refining Machine Wagjak]"; mes "-Ddarritt!-"; mes "The user's confirmation required."; @@ -12894,7 +12894,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ // anti-hack if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) close; - if (getequippercentrefinery(.@part) <= rand(100)) { + if (getequippercentrefinery(.@part,REFINE_COST_WAGJAK) <= rand(100)) { failedrefitem .@part; mes "[Refining Machine Wagjak]"; mes "Result : Fail"; @@ -12932,7 +12932,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ mes "Refining has been cancelled as per the user's request."; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) < 100) { mes "[Refining Machine Wagjak]"; mes "-Ddarritt!-"; mes "The user's confirmation required."; @@ -12963,7 +12963,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ mes "You are short of refining price."; close; } - if (getequippercentrefinery(.@part) <= rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) <= rand(100)) { failedrefitem .@part; mes "[Refining Machine Wagjak]"; mes "Result : Fail"; diff --git a/npc/re/merchants/advanced_refiner.txt b/npc/re/merchants/advanced_refiner.txt index 48393a6cbef..7321fe9801a 100644 --- a/npc/re/merchants/advanced_refiner.txt +++ b/npc/re/merchants/advanced_refiner.txt @@ -110,7 +110,7 @@ malangdo,221,174,6 script Holink#mal_cash 559,{ mes "You don't believe in refine master Holink, meow?~"; close; } - if (getequippercentrefinery(.@part, true) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_ENRICHED) < 100) { mes "[Holink]"; mes "Meow!!"; if (.@type$ == "armor") @@ -159,7 +159,7 @@ malangdo,221,174,6 script Holink#mal_cash 559,{ close; } - if (getequippercentrefinery(.@part, true) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_HOLINK) > rand(100)) { successrefitem .@part; mes "[Holink]"; mes "Me~ Me~ Meow! Fun fun refining~"; diff --git a/npc/re/merchants/blessed_refiner.txt b/npc/re/merchants/blessed_refiner.txt index 5eedd4a6c4a..d8ad6b3611d 100644 --- a/npc/re/merchants/blessed_refiner.txt +++ b/npc/re/merchants/blessed_refiner.txt @@ -78,31 +78,23 @@ close; } set .@equip_lv, getequipweaponlv(.@part); + .@material = getequiprefinecost(.@part, REFINE_COST_BLESSED, REFINE_MATERIAL_ID); + .@price = getequiprefinecost(.@part, REFINE_COST_BLESSED, REFINE_ZENY_COST); switch(.@equip_lv) { default: case 0: - set .@price,20000; - set .@material,6439; //Unbreakable_Def set .@type$,"Armor"; break; case 1: - set .@price,1000; - set .@material,6438; //Unbreakable_Weap set .@type$,"Weapon"; break; case 2: - set .@price,2000; - set .@material,6438; //Unbreakable_Weap set .@type$,"Weapon"; break; case 3: - set .@price,20000; - set .@material,6438; //Unbreakable_Weap set .@type$,"Weapon"; break; case 4: - set .@price,40000; - set .@material,6438; //Unbreakable_Weap set .@type$,"Weapon"; break; } @@ -116,7 +108,7 @@ mes "I am busy, don't joke with me!"; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_BLESSED) < 100) { mes "[Blacksmith Dister]"; mes "This "+.@type$+" has been refined many times. Although it will not disappear upon failure, the "+.@ore$+" will disappear!"; next; @@ -144,7 +136,7 @@ mes "[Blacksmith Dister]"; mes "Tac! Tac! Tac!"; - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_BLESSED) > rand(100)) { specialeffect EF_BLESSING; successrefitem .@part; next; diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index a87f13a79ce..9fad69b1dfa 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -99,7 +99,7 @@ mes "I will wait until you are ready."; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_HD) < 100) { mes "[Blacksmith Mighty Hammer]"; mes "It looks like this item will likely fail to be refined."; mes "Well, even if it fails, it only decreases by 1 refine level."; @@ -156,7 +156,7 @@ mes "[Blacksmith Mighty Hammer]"; mes "Tac! Tac! Tac!"; - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_HD) > rand(100)) { successrefitem .@part; next; emotion ET_BEST; @@ -286,7 +286,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF mes "Okay. If that's what you want..."; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_OVER10_HD) < 100) { mes "[Basta]"; mes "This " + .@type$ + " has already been refined pretty high."; mes "If you try to refine it more, the refine level could decrease."; @@ -348,7 +348,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF } mes "Pow! Pow! Pow! Pow!"; - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_OVER10_HD) > rand(100)) { successrefitem .@part; next; emotion ET_BEST; diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt index 57972379d71..43298f1f509 100644 --- a/npc/re/merchants/refine.txt +++ b/npc/re/merchants/refine.txt @@ -125,7 +125,7 @@ function script refinenew { close; } if (getarg(1) != 1) { - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_OVER10) < 100) { mes "["+ .@npc_name$ +"]"; mes "This "+.@type$+" already has been refined serveral times."; mes "It could be destroyed if I try again."; @@ -166,7 +166,7 @@ function script refinenew { close; } - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_OVER10) > rand(100)) { mes "Clang! Clang! Clang! Clang!"; successrefitem .@part; next; @@ -277,14 +277,14 @@ function script refinenew { callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) close; - if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) { + if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part, REFINE_COST_OVER10) < 100)) { mes "["+ .@npc_name$ +"]"; mes "Clang... No, but did you imagine I could be so stupid?!"; mes "You changed it..."; mes "Get out before I stun you with my Hammer!!"; close; } - if (getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_OVER10) > rand(100)) { mes "Clang! Clang! Clang! Clang!"; successrefitem .@part; .@refinecnt = .@refinecnt - 1; @@ -485,7 +485,7 @@ malangdo,224,172,6 script Clink#mal_normal 544,{ mes "I knew you were not worth trying my magical refining hammer for."; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) < 100) { mes "[Clink]"; mes "Wow!!"; mes "This "+.@type$+" has been refined quite a bit, huh?"; @@ -524,7 +524,7 @@ malangdo,224,172,6 script Clink#mal_normal 544,{ close; } - if (getequippercentrefinery(.@part) <= rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) <= rand(100)) { failedrefitem .@part; mes "[Clink]"; mes "Cry Hammer!! Cry!!!"; diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index b139d1db2f5..1e853980a27 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -56,7 +56,6 @@ .@material[0] = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_MATERIAL_ID); .@material[1] = getequiprefinecost(.@part, REFINE_COST_ENRICHED, REFINE_MATERIAL_ID); .@material[2] = getequiprefinecost(.@part, REFINE_COST_HD, REFINE_MATERIAL_ID); - .@is_enriched = false; if (countitem(.@material[0])) .@mate$[0] = getitemname(.@material[0]); @@ -74,19 +73,21 @@ switch( select( .@mate$[0], .@mate$[1], .@mate$[2], "Cancel" ) ) { case 1:// NORMAL .@choose = .@material[0]; + .@refine_type = REFINE_COST_NORMAL; break; case 2:// ENRICHED - .@is_enriched = true; .@choose = .@material[1]; + .@refine_type = REFINE_COST_ENRICHED; break; case 3:// HD if (.@equip_refine < 7) { mes "[Shadow Blacksmith]"; - mes "HD Ore can only used for +7 or higher refine level items."; + mes "You've cancelled refining."; close; } .@hoihoi = 1; .@choose = .@material[2]; + .@refine_type = REFINE_COST_HD; break; case 4: mes "[Shadow Blacksmith]"; @@ -113,7 +114,7 @@ mes "This item cannot be refined."; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, .@refine_type) < 100) { mes "[Shadow Blacksmith]"; mes "The safety refine level for Shadow Equipment is +4."; if (!.@hoihoi) @@ -137,7 +138,7 @@ if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@equip_refine)) close; - if (getequippercentrefinery(.@part, .@option == 2) > rand(100)) { + if (getequippercentrefinery(.@part, .@refine_type) > rand(100)) { successrefitem .@part; mes "[Shadow Blacksmith]"; mes "It worked! It worked!"; diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 3106873180e..26ec5c6d076 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -8556,14 +8556,13 @@ static const struct _battle_data { { "guild_alliance_onlygm", &battle_config.guild_alliance_onlygm, 0, 0, 1, }, { "feature.achievement", &battle_config.feature_achievement, 1, 0, 1, }, { "allow_bound_sell", &battle_config.allow_bound_sell, 0, 0, 0x3, }, - { "event_refine_chance", &battle_config.event_refine_chance, 0, 0, 1, }, + { "feature.refineui", &battle_config.feature_refineui, 0, 0, 3, }, { "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, }, { "broadcast_hide_name", &battle_config.broadcast_hide_name, 2, 0, NAME_LENGTH, }, { "skill_drop_items_full", &battle_config.skill_drop_items_full, 0, 0, 1, }, { "feature.homunculus_autofeed", &battle_config.feature_homunculus_autofeed, 1, 0, 1, }, { "summoner_trait", &battle_config.summoner_trait, 3, 0, 3, }, { "homunculus_autofeed_always", &battle_config.homunculus_autofeed_always, 1, 0, 1, }, - { "feature.refineui", &battle_config.feature_refineui, 0, 0, 3, }, #include "../custom/battle_config_init.inc" }; diff --git a/src/map/battle.hpp b/src/map/battle.hpp index c10b8a8a81f..0925b0cd10d 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -636,14 +636,13 @@ struct Battle_Config int guild_alliance_onlygm; int feature_achievement; int allow_bound_sell; - int event_refine_chance; + int feature_refineui; int autoloot_adjust; int broadcast_hide_name; int skill_drop_items_full; int feature_homunculus_autofeed; int summoner_trait; int homunculus_autofeed_always; - int feature_refineui; #include "../custom/battle_config_struct.inc" }; diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 29214f14b03..93d1bb841dc 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -6435,6 +6435,7 @@ void clif_map_property_mapall(int map_idx, enum map_property property) /// 0 = success /// 1 = failure /// 2 = downgrade +/// 3 = failure without breaking nor downgrade void clif_refine(int fd, int fail, int index, int val) { WFIFOHEAD(fd,packet_len(0x188)); @@ -20340,6 +20341,9 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d return false; } + if (!status_get_refine_cost(id->wlv, type, REFINE_REFINEUI_ENABLED)) + return false; + // Get the material that is required to refine this item materials[index].cost.nameid = status_get_refine_cost( id->wlv, type, REFINE_MATERIAL_ID ); // Get the amount of zeny that is required to refine the item with this material @@ -20347,7 +20351,7 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d // Get the breaking chance of the item with this material materials[index].cost.breakable = status_get_refine_cost( id->wlv, type, REFINE_BREAKABLE ); // Get the chance for refining the item with this material - materials[index].chance = status_get_refine_chance( (enum refine_type)id->wlv, item->refine, type == REFINE_COST_ENRICHED ); + materials[index].chance = status_get_refine_chance( (enum refine_type)id->wlv, item->refine, type); // Either of the values was not set if( materials[index].cost.nameid == 0 || materials[index].cost.zeny == 0 || materials[index].chance == 0 ){ @@ -20372,33 +20376,18 @@ static inline uint8 clif_refineui_materials( struct item *item, struct item_data // Zero the memory memset( materials, 0, sizeof(struct refine_materials)*REFINEUI_MAT_CNT ); - // Is the item +10 or above - if( item->refine >= 10 ){ - // Normal refine requirements for +10 and above - if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_OVER10 ) ){ - count++; - } + /** + * Default material indexing is follow as + * 0: Normal refine for +1 ~ +10 or +11 ~ +20 + * 1: HD materials for +7 ~ +9 and +11 ~ +20 + * 2: Enriched + * 3: Undecided yet, you can add yours later + * 4: Is always for 'Blacksmith Blessing' item to prevent downrefine/break + **/ - // HD refine requirements for +10 and above - if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_OVER10_HD ) ){ - count++; - } - }else{ - // Normal refine requirements - if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_NORMAL ) ){ + for (int i = 0; i < REFINE_COST_MAX; i++) { + if (clif_refineui_materials_sub(item, id, materials, count, (enum refine_cost_type)i)) count++; - } - - // HD refine requirements only if the refine is +7 ~ +9 - // TODO: Remove this hardcoded check, add HD values separetd from 'normal' rates - if( item->refine >= 7 && item->refine <= 9 && clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_HD ) ){ - count++; - } - } - - // Enriched refine requirements - if( clif_refineui_materials_sub( item, id, materials, count, REFINE_COST_ENRICHED ) ){ - count++; } // Blacksmith Blessing requirements if any @@ -20617,6 +20606,9 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ return; } } + else { + use_blacksmith_blessing = false; + } // Try to refine the item if( materials[i].chance >= rnd() % 100 ){ @@ -20630,7 +20622,7 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ // Failure if (use_blacksmith_blessing) { // Blacksmith Blessing were used, no break & no down refine - clif_refine(fd, 1, index, item->refine); + clif_refine(fd, 3, index, item->refine); clif_refineui_info(sd, index); } else if (materials[i].cost.breakable) { // Delete the item if it is breakable clif_refine( fd, 1, index, item->refine ); diff --git a/src/map/script.cpp b/src/map/script.cpp index 488750dba23..10080f6c49f 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -8881,12 +8881,12 @@ BUILDIN_FUNC(getequipweaponlv) BUILDIN_FUNC(getequippercentrefinery) { int i = -1,num; - bool enriched = false; + enum refine_cost_type cost_type = REFINE_COST_NORMAL; TBL_PC *sd; num = script_getnum(st,2); - if (script_hasdata(st, 3)) - enriched = script_getnum(st, 3) != 0; + cost_type = (enum refine_cost_type)script_getnum(st, 3); + if (!script_charid2sd(4, sd)) { script_pushint(st,0); @@ -8899,7 +8899,7 @@ BUILDIN_FUNC(getequippercentrefinery) enum refine_type type = REFINE_TYPE_SHADOW; if (sd->inventory_data[i]->type != IT_SHADOWGEAR) type = (enum refine_type)sd->inventory_data[i]->wlv; - script_pushint(st, status_get_refine_chance(type, (int)sd->inventory.u.items_inventory[i].refine, enriched)); + script_pushint(st, status_get_refine_chance(type, (int)sd->inventory.u.items_inventory[i].refine, cost_type)); } else script_pushint(st,0); @@ -24209,7 +24209,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(getequipisenableref,"i?"), BUILDIN_DEF(getequiprefinerycnt,"i?"), BUILDIN_DEF(getequipweaponlv,"i?"), - BUILDIN_DEF(getequippercentrefinery,"i?"), + BUILDIN_DEF(getequippercentrefinery,"ii?"), BUILDIN_DEF(successrefitem,"i??"), BUILDIN_DEF(failedrefitem,"i?"), BUILDIN_DEF(downrefitem,"i??"), diff --git a/src/map/skill.cpp b/src/map/skill.cpp index e7b3c2cd3d1..13dcadcac81 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -16816,7 +16816,7 @@ void skill_weaponrefine(struct map_session_data *sd, int idx) clif_upgrademessage(sd->fd, 3, material[ditem->wlv]); return; } - per = status_get_refine_chance(static_cast(ditem->wlv), (int)item->refine, false); + per = status_get_refine_chance(static_cast(ditem->wlv), (int)item->refine, REFINE_COST_NORMAL); if( sd->class_&JOBL_THIRD ) per += 10; else diff --git a/src/map/status.cpp b/src/map/status.cpp index 6beecf0e4f7..b4ffa86a0b1 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -47,7 +47,7 @@ enum e_regen { // Bonus values and upgrade chances for refining equipment static struct { - int chance[REFINE_CHANCE_TYPE_MAX][MAX_REFINE]; /// Success chance + int chance[REFINE_COST_MAX][MAX_REFINE]; /// Success chance int bonus[MAX_REFINE]; /// Cumulative fixed bonus damage int randombonus_max[MAX_REFINE]; /// Cumulative maximum random bonus damage struct refine_cost cost[REFINE_COST_MAX]; @@ -14297,28 +14297,16 @@ static int status_natural_heal_timer(int tid, unsigned int tick, int id, intptr_ * Get the chance to upgrade a piece of equipment * @param wlv: The weapon type of the item to refine (see see enum refine_type) * @param refine: The target's refine level + * @param type: refine type for cost & rate * @return The chance to refine the item, in percent (0~100) */ -int status_get_refine_chance(enum refine_type wlv, int refine, bool enriched) +int status_get_refine_chance(enum refine_type wlv, int refine, enum refine_cost_type type) { - enum e_refine_chance_type type; + if (refine < 0 || refine >= MAX_REFINE) + return 0; - if ( refine < 0 || refine >= MAX_REFINE) + if (type < REFINE_COST_NORMAL || type >= REFINE_COST_MAX) return 0; - - if( battle_config.event_refine_chance ){ - if( enriched ){ - type = REFINE_CHANCE_EVENT_ENRICHED; - }else{ - type = REFINE_CHANCE_EVENT_NORMAL; - } - }else{ - if( enriched ){ - type = REFINE_CHANCE_ENRICHED; - }else{ - type = REFINE_CHANCE_NORMAL; - } - } return refine_info[wlv].chance[type][refine]; } @@ -14454,87 +14442,138 @@ static bool status_yaml_readdb_refine_sub(const YAML::Node &node, int refine_inf if (refine_info_index < 0 || refine_info_index >= REFINE_TYPE_MAX) return false; - int bonus_per_level = node["StatsPerLevel"].as(); - int random_bonus_start_level = node["RandomBonusStartLevel"].as(); - int random_bonus = node["RandomBonusValue"].as(); + int bonus_per_level = yaml_get_int(wrapper, "StatsPerLevel"); + int random_bonus_start_level = yaml_get_int(wrapper, "RandomBonusStartLevel"); + int random_bonus = yaml_get_int(wrapper, "RandomBonusValue"); + struct s_refine_type { + char *str; + int id; + }; + struct s_refine_type **refine_types = NULL; + uint8 refine_type_num = 0; + yamlwrapper* costs = yaml_get_subnode(wrapper, "Costs"); + yamliterator* it = yaml_get_iterator(costs); + if (yaml_iterator_is_valid(it)) { + for (yamlwrapper* type = yaml_iterator_first(it); yaml_iterator_has_next(it); type = yaml_iterator_next(it)) { + int idx = 0, price; + unsigned short material; + static char* keys[] = { "Type", "Price", "Material" }; + char* result; - if (file_name.find("import") != std::string::npos) { // Import file, reset refine bonus before calculation - for (int refine_level = 0; refine_level < MAX_REFINE; ++refine_level) - refine_info[refine_info_index].bonus[refine_level] = 0; - } + if ((result = yaml_verify_nodes(type, ARRAYLENGTH(keys), keys)) != NULL) { + ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", result, file_name); + yaml_destroy_wrapper(type); + continue; + } - const YAML::Node &costs = node["Costs"]; + char* refine_cost_const = yaml_get_c_string(type, "Type"); + if (!script_get_constant(refine_cost_const, &idx)) { + ShowError("status_yaml_readdb_refine_sub: Cost type '%s' is not defined. The type must be defined as script constants.\n", refine_cost_const); + continue; + } + price = yaml_get_int(type, "Price"); + material = yaml_get_uint16(type, "Material"); - for (const auto costit : costs) { - const YAML::Node &type = costit; - int idx = 0, price; - unsigned short material; - const std::string keys[] = { "Type", "Price", "Material" }; + int len = strlen(refine_cost_const) + 1; + if (refine_types && refine_type_num) { + int i; + ARR_FIND(0, refine_type_num, i, strcmpi(refine_cost_const, refine_types[i]->str) == 0); + if (i < refine_type_num) { + ShowError("status_yaml_readdb_refine_sub: Redifinition of cost type '%s'\n", refine_cost_const); + continue; + } + } + RECREATE(refine_types, struct s_refine_type*, refine_type_num + 1); + CREATE(refine_types[refine_type_num], struct s_refine_type, 1); + CREATE(refine_types[refine_type_num]->str, char, len); + safestrncpy(refine_types[refine_type_num]->str, refine_cost_const, len); + refine_types[refine_type_num]->id = idx; + refine_type_num++; + + refine_info[refine_info_index].cost[idx].nameid = material; + refine_info[refine_info_index].cost[idx].zeny = price; + if (yaml_node_is_defined(type, "Breakable")) { + refine_info[refine_info_index].cost[idx].breakable = yaml_get_boolean(type, "Breakable"); + } + else { + refine_info[refine_info_index].cost[idx].breakable = true; + } + if (yaml_node_is_defined(type, "RefineUI")) { + refine_info[refine_info_index].cost[idx].refineui = yaml_get_boolean(type, "RefineUI"); + } + else { + refine_info[refine_info_index].cost[idx].refineui = true; + } - for (int i = 0; i < ARRAYLENGTH(keys); i++) { - if (!type[keys[i]].IsDefined()) - ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", keys[i].c_str(), file_name.c_str()); + aFree(refine_cost_const); + yaml_destroy_wrapper(type); } + } + yaml_destroy_wrapper(costs); + yaml_iterator_destroy(it); - std::string refine_cost_const = type["Type"].as(); - if (ISDIGIT(refine_cost_const[0])) - idx = atoi(refine_cost_const.c_str()); - else - script_get_constant(refine_cost_const.c_str(), &idx); - price = type["Price"].as(); - material = type["Material"].as(); - - refine_info[refine_info_index].cost[idx].nameid = material; - refine_info[refine_info_index].cost[idx].zeny = price; - if (type["Breakable"].IsDefined()) - refine_info[refine_info_index].cost[idx].breakable = type["Breakable"].as(); - else - refine_info[refine_info_index].cost[idx].breakable = true; + if (!refine_type_num || !refine_types) { + ShowError("status_yaml_readdb_refine_sub: No refine type defined.\n"); + return false; } - const YAML::Node &rates = node["Rates"]; + yamlwrapper* rates = yaml_get_subnode(wrapper, "Rates"); + it = yaml_get_iterator(rates); - for (const auto rateit : rates) { - const YAML::Node &level = rateit; - int refine_level = level["Level"].as() - 1; + if (yaml_iterator_is_valid(it)) { + for (yamlwrapper* level = yaml_iterator_first(it); yaml_iterator_has_next(it); level = yaml_iterator_next(it)) { + int refine_level = yaml_get_int(level, "Level") - 1; - if (refine_level >= MAX_REFINE) - continue; + if (refine_level >= MAX_REFINE) { + yaml_destroy_wrapper(level); + continue; + } - if (level["NormalChance"].IsDefined()) - refine_info[refine_info_index].chance[REFINE_CHANCE_NORMAL][refine_level] = level["NormalChance"].as(); - if (level["EnrichedChance"].IsDefined()) - refine_info[refine_info_index].chance[REFINE_CHANCE_ENRICHED][refine_level] = level["EnrichedChance"].as(); - if (level["EventNormalChance"].IsDefined()) - refine_info[refine_info_index].chance[REFINE_CHANCE_EVENT_NORMAL][refine_level] = level["EventNormalChance"].as(); - if (level["EventEnrichedChance"].IsDefined()) - refine_info[refine_info_index].chance[REFINE_CHANCE_EVENT_ENRICHED][refine_level] = level["EventEnrichedChance"].as(); - if (level["Bonus"].IsDefined()) - refine_info[refine_info_index].bonus[refine_level] = level["Bonus"].as(); - - if (refine_level >= random_bonus_start_level - 1) - refine_info[refine_info_index].randombonus_max[refine_level] = random_bonus * (refine_level - random_bonus_start_level + 2); - - // Blacksmith Blessing - if (yaml_node_is_defined(level, "BlacksmithBlessing")) { - yamlwrapper* bswrap = yaml_get_subnode(level, "BlacksmithBlessing"); - static char* keys[] = { "ItemID", "Count" }; - char* result; + if (yaml_node_is_defined(level, "Bonus")) + refine_info[refine_info_index].bonus[refine_level] = yaml_get_int(level, "Bonus"); - if ((result = yaml_verify_nodes(bswrap, ARRAYLENGTH(keys), keys)) != NULL) { - ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", result, file_name); - yaml_destroy_wrapper(bswrap); + for (int i = 0; i < refine_type_num; i++) { + if (yaml_node_is_defined(level, refine_types[i]->str)) { + refine_info[refine_info_index].chance[refine_types[i]->id][refine_level] = yaml_get_int(level, refine_types[i]->str); + } } - else { - refine_info[refine_info_index].bs_blessing[refine_level].nameid = yaml_get_int(bswrap, "ItemID"); - refine_info[refine_info_index].bs_blessing[refine_level].count = yaml_get_uint16(bswrap, "Count"); - yaml_destroy_wrapper(bswrap); + + if (refine_level >= random_bonus_start_level - 1) + refine_info[refine_info_index].randombonus_max[refine_level] = random_bonus * (refine_level - random_bonus_start_level + 2); + + // Blacksmith Blessing + if (yaml_node_is_defined(level, "BlacksmithBlessing")) { + yamlwrapper* bswrap = yaml_get_subnode(level, "BlacksmithBlessing"); + static char* keys[] = { "ItemID", "Count" }; + char* result; + + if ((result = yaml_verify_nodes(bswrap, ARRAYLENGTH(keys), keys)) != NULL) { + ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", result, file_name); + yaml_destroy_wrapper(bswrap); + } + else { + refine_info[refine_info_index].bs_blessing[refine_level].nameid = yaml_get_int(bswrap, "ItemID"); + refine_info[refine_info_index].bs_blessing[refine_level].count = yaml_get_uint16(bswrap, "Count"); + yaml_destroy_wrapper(bswrap); + } } + + yaml_destroy_wrapper(level); + } + for (int refine_level = 0; refine_level < MAX_REFINE; ++refine_level) { + refine_info[refine_info_index].bonus[refine_level] += bonus_per_level + (refine_level > 0 ? refine_info[refine_info_index].bonus[refine_level - 1] : 0); } } - for (int refine_level = 0; refine_level < MAX_REFINE; ++refine_level) - refine_info[refine_info_index].bonus[refine_level] += bonus_per_level + (refine_level > 0 ? refine_info[refine_info_index].bonus[refine_level - 1] : 0); - + yaml_destroy_wrapper(rates); + yaml_iterator_destroy(it); + for (uint8 i = 0; i < refine_type_num; i++) { + if (refine_types[i] && refine_types[i]->str) { + aFree(refine_types[i]->str); + } + aFree(refine_types[i]); + } + if (refine_types) + aFree(refine_types); return true; } @@ -14581,6 +14620,8 @@ int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what) return refine_info[weapon_lv].cost[type].zeny; case REFINE_BREAKABLE: return refine_info[weapon_lv].cost[type].breakable; + case REFINE_REFINEUI_ENABLED: + return refine_info[weapon_lv].cost[type].refineui; } return 0; @@ -14670,10 +14711,10 @@ int status_readdb(void) { memset(&refine_info[i].cost, 0, sizeof(struct refine_cost)*REFINE_COST_MAX); memset(&refine_info[i].bs_blessing, 0, sizeof(struct refine_bs_blessing)*MAX_REFINE); - for(j = 0; j < REFINE_CHANCE_TYPE_MAX; j++) + for(j = 0; j < REFINE_COST_MAX; j++) for(k=0;k Date: Sun, 8 Jul 2018 20:38:38 +0700 Subject: [PATCH 14/27] Constant update --- src/map/script_constants.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 5a415806737..875d131f7c4 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -5017,6 +5017,9 @@ export_constant(REFINE_COST_OVER10_HD); export_constant(REFINE_COST_HOLINK); export_constant(REFINE_COST_WAGJAK); + export_constant(REFINE_COST_BLESSED); + export_constant(REFINE_COST_EVT_ENRICHED); + export_constant(REFINE_COST_EVT_OVER10_HD); export_constant(REFINE_COST_MAX); /* refine information types */ From 50b0e5c923353c5a7e492568644d886dd5eaaa53 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 20:43:47 +0700 Subject: [PATCH 15/27] Rework on Refine DB Refactor --- db/pre-re/refine_db.yml | 600 +++++++++++++------ db/re/refine_db.yml | 1248 +++++++++++++++++++++++++++------------ src/map/status.cpp | 189 +++--- 3 files changed, 1365 insertions(+), 672 deletions(-) diff --git a/db/pre-re/refine_db.yml b/db/pre-re/refine_db.yml index 2dda4bd3ed3..288044e92d8 100644 --- a/db/pre-re/refine_db.yml +++ b/db/pre-re/refine_db.yml @@ -35,45 +35,85 @@ Armor: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 6 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 7 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 - Level: 10 - REFINE_COST_NORMAL: 9 - REFINE_COST_ENRICHED: 20 - REFINE_COST_EVT_ENRICHED: 35 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 WeaponLv1: StatsPerLevel: 200 RandomBonusStartLevel: 8 @@ -91,45 +131,85 @@ WeaponLv1: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 6 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 7 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 8 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 9 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 85 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 85 - Level: 10 - REFINE_COST_NORMAL: 19 - REFINE_COST_ENRICHED: 30 - REFINE_COST_EVT_ENRICHED: 55 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 19 + - Type: REFINE_COST_ENRICHED + Rate: 30 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 55 WeaponLv2: StatsPerLevel: 300 RandomBonusStartLevel: 7 @@ -147,45 +227,85 @@ WeaponLv2: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 6 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 7 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 8 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 85 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 85 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 60 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 - Level: 10 - REFINE_COST_NORMAL: 19 - REFINE_COST_ENRICHED: 30 - REFINE_COST_EVT_ENRICHED: 45 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 19 + - Type: REFINE_COST_ENRICHED + Rate: 30 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 45 WeaponLv3: StatsPerLevel: 500 RandomBonusStartLevel: 6 @@ -203,45 +323,85 @@ WeaponLv3: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 6 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 7 - REFINE_COST_NORMAL: 50 - REFINE_COST_ENRICHED: 80 - REFINE_COST_EVT_ENRICHED: 90 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 50 + - Type: REFINE_COST_ENRICHED + Rate: 80 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 90 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 70 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 70 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 60 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 - Level: 10 - REFINE_COST_NORMAL: 19 - REFINE_COST_ENRICHED: 30 - REFINE_COST_EVT_ENRICHED: 45 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 19 + - Type: REFINE_COST_ENRICHED + Rate: 30 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 45 WeaponLv4: StatsPerLevel: 700 RandomBonusStartLevel: 5 @@ -259,87 +419,167 @@ WeaponLv4: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 6 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 7 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 60 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 - Level: 10 - REFINE_COST_NORMAL: 9 - REFINE_COST_ENRICHED: 20 - REFINE_COST_EVT_ENRICHED: 35 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 Shadow: StatsPerLevel: 0 RandomBonusStartLevel: 0 RandomBonusValue: 0 Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 6 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 7 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 - Level: 10 - REFINE_COST_NORMAL: 9 - REFINE_COST_ENRICHED: 20 - REFINE_COST_EVT_ENRICHED: 35 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index f6ad2069f41..2902ef8df4c 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -63,125 +63,211 @@ Armor: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 Bonus: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 Bonus: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 Bonus: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 Bonus: 100 - Level: 5 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 Bonus: 200 - Level: 6 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 Bonus: 200 - Level: 7 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_BLESSED: 40 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_BLESSED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 Bonus: 200 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_BLESSED: 20 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 Bonus: 200 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_BLESSED: 20 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - REFINE_COST_NORMAL: 9 - REFINE_COST_HD: 9 - REFINE_COST_ENRICHED: 20 - REFINE_COST_BLESSED: 9 - REFINE_COST_EVT_ENRICHED: 35 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_HD + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_BLESSED + Rate: 9 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_BLESSED: 8 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_BLESSED: 8 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 300 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_BLESSED: 8 - REFINE_COST_EVT_OVER10_HD: 16 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 16 Bonus: 400 - Level: 14 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_EVT_OVER10_HD: 16 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 16 Bonus: 400 - Level: 15 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 400 - Level: 16 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 400 - Level: 17 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 14 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 14 Bonus: 500 - Level: 18 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 14 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 14 Bonus: 500 - Level: 19 - REFINE_COST_OVER10: 5 - REFINE_COST_OVER10_HD: 5 - REFINE_COST_EVT_OVER10_HD: 10 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 5 + - Type: REFINE_COST_OVER10_HD + Rate: 5 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 10 Bonus: 500 - Level: 20 - REFINE_COST_OVER10: 5 - REFINE_COST_OVER10_HD: 5 - REFINE_COST_EVT_OVER10_HD: 10 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 5 + - Type: REFINE_COST_OVER10_HD + Rate: 5 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 10 Bonus: 500 WeaponLv1: StatsPerLevel: 200 @@ -228,114 +314,204 @@ WeaponLv1: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 6 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 7 - REFINE_COST_NORMAL: 100 - REFINE_COST_BLESSED: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_BLESSED + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 8 - REFINE_COST_NORMAL: 60 - REFINE_COST_HD: 60 - REFINE_COST_BLESSED: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_HD + Rate: 60 + - Type: REFINE_COST_BLESSED + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - REFINE_COST_NORMAL: 40 - REFINE_COST_HD: 40 - REFINE_COST_BLESSED: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 85 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_HD + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 85 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - REFINE_COST_NORMAL: 19 - REFINE_COST_HD: 19 - REFINE_COST_BLESSED: 19 - REFINE_COST_ENRICHED: 30 - REFINE_COST_EVT_ENRICHED: 55 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 19 + - Type: REFINE_COST_HD + Rate: 19 + - Type: REFINE_COST_BLESSED + Rate: 19 + - Type: REFINE_COST_ENRICHED + Rate: 30 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 55 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 40 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 40 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 40 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 40 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 35 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 35 - Level: 14 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_EVT_OVER10_HD: 35 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 35 - Level: 15 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_EVT_OVER10_HD: 30 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 30 - Level: 16 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 30 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 30 Bonus: 300 - Level: 17 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 300 - Level: 18 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 300 - Level: 19 - REFINE_COST_OVER10: 15 - REFINE_COST_OVER10_HD: 15 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 15 + - Type: REFINE_COST_OVER10_HD + Rate: 15 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 300 - Level: 20 - REFINE_COST_OVER10: 15 - REFINE_COST_OVER10_HD: 15 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 15 + - Type: REFINE_COST_OVER10_HD + Rate: 15 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 300 WeaponLv2: StatsPerLevel: 300 @@ -382,114 +558,204 @@ WeaponLv2: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 6 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 7 - REFINE_COST_NORMAL: 60 - REFINE_COST_BLESSED: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_BLESSED + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 8 - REFINE_COST_NORMAL: 40 - REFINE_COST_HD: 40 - REFINE_COST_BLESSED: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 85 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_HD + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 85 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_BLESSED: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 60 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - REFINE_COST_NORMAL: 19 - REFINE_COST_HD: 19 - REFINE_COST_BLESSED: 19 - REFINE_COST_ENRICHED: 30 - REFINE_COST_EVT_ENRICHED: 45 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 19 + - Type: REFINE_COST_HD + Rate: 19 + - Type: REFINE_COST_BLESSED + Rate: 19 + - Type: REFINE_COST_ENRICHED + Rate: 30 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 45 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 40 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 40 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 40 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 40 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 35 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 35 - Level: 14 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_EVT_OVER10_HD: 35 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 35 - Level: 15 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_EVT_OVER10_HD: 30 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 30 - Level: 16 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 30 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 30 Bonus: 600 - Level: 17 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 600 - Level: 18 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 600 - Level: 19 - REFINE_COST_OVER10: 15 - REFINE_COST_OVER10_HD: 15 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 15 + - Type: REFINE_COST_OVER10_HD + Rate: 15 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 600 - Level: 20 - REFINE_COST_OVER10: 15 - REFINE_COST_OVER10_HD: 15 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 15 + - Type: REFINE_COST_OVER10_HD + Rate: 15 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 600 WeaponLv3: StatsPerLevel: 500 @@ -536,114 +802,204 @@ WeaponLv3: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 6 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 7 - REFINE_COST_NORMAL: 50 - REFINE_COST_BLESSED: 50 - REFINE_COST_ENRICHED: 80 - REFINE_COST_EVT_ENRICHED: 90 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 50 + - Type: REFINE_COST_BLESSED + Rate: 50 + - Type: REFINE_COST_ENRICHED + Rate: 80 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 90 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_BLESSED: 20 - REFINE_COST_EVT_ENRICHED: 70 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 70 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_BLESSED: 20 - REFINE_COST_EVT_ENRICHED: 60 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - REFINE_COST_NORMAL: 19 - REFINE_COST_HD: 19 - REFINE_COST_ENRICHED: 30 - REFINE_COST_BLESSED: 19 - REFINE_COST_EVT_ENRICHED: 45 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 19 + - Type: REFINE_COST_HD + Rate: 19 + - Type: REFINE_COST_ENRICHED + Rate: 30 + - Type: REFINE_COST_BLESSED + Rate: 19 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 45 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 40 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 40 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 40 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 40 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_BLESSED: 18 - REFINE_COST_EVT_OVER10_HD: 35 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_BLESSED + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 35 - Level: 14 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_EVT_OVER10_HD: 35 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 35 - Level: 15 - REFINE_COST_OVER10: 18 - REFINE_COST_OVER10_HD: 18 - REFINE_COST_EVT_OVER10_HD: 30 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 18 + - Type: REFINE_COST_OVER10_HD + Rate: 18 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 30 - Level: 16 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 30 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 30 Bonus: 900 - Level: 17 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 900 - Level: 18 - REFINE_COST_OVER10: 17 - REFINE_COST_OVER10_HD: 17 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 17 + - Type: REFINE_COST_OVER10_HD + Rate: 17 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 Bonus: 900 - Level: 19 - REFINE_COST_OVER10: 15 - REFINE_COST_OVER10_HD: 15 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 15 + - Type: REFINE_COST_OVER10_HD + Rate: 15 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 900 - Level: 20 - REFINE_COST_OVER10: 15 - REFINE_COST_OVER10_HD: 15 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 15 + - Type: REFINE_COST_OVER10_HD + Rate: 15 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 900 WeaponLv4: StatsPerLevel: 700 @@ -690,114 +1046,204 @@ WeaponLv4: RefineUI: false Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 6 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 7 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_BLESSED: 40 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_BLESSED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_BLESSED: 20 - REFINE_COST_EVT_ENRICHED: 60 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 BlacksmithBlessing: ItemID: 6635 Count: 1 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_BLESSED: 20 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 BlacksmithBlessing: ItemID: 6635 Count: 2 - Level: 10 - REFINE_COST_NORMAL: 9 - REFINE_COST_HD: 9 - REFINE_COST_ENRICHED: 20 - REFINE_COST_BLESSED: 9 - REFINE_COST_EVT_ENRICHED: 35 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_HD + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_BLESSED + Rate: 9 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 BlacksmithBlessing: ItemID: 6635 Count: 4 - Level: 11 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_BLESSED: 8 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 BlacksmithBlessing: ItemID: 6635 Count: 7 - Level: 12 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_BLESSED: 8 - REFINE_COST_EVT_OVER10_HD: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 BlacksmithBlessing: ItemID: 6635 Count: 11 - Level: 13 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_BLESSED: 8 - REFINE_COST_EVT_OVER10_HD: 16 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 16 - Level: 14 - REFINE_COST_OVER10: 8 - REFINE_COST_OVER10_HD: 8 - REFINE_COST_EVT_OVER10_HD: 16 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 16 - Level: 15 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 - Level: 16 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 Bonus: 1200 - Level: 17 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 14 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 14 Bonus: 1200 - Level: 18 - REFINE_COST_OVER10: 7 - REFINE_COST_OVER10_HD: 7 - REFINE_COST_EVT_OVER10_HD: 14 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 14 Bonus: 1200 - Level: 19 - REFINE_COST_OVER10: 5 - REFINE_COST_OVER10_HD: 5 - REFINE_COST_EVT_OVER10_HD: 10 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 5 + - Type: REFINE_COST_OVER10_HD + Rate: 5 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 10 Bonus: 1200 - Level: 20 - REFINE_COST_OVER10: 5 - REFINE_COST_OVER10_HD: 5 - REFINE_COST_EVT_OVER10_HD: 10 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 5 + - Type: REFINE_COST_OVER10_HD + Rate: 5 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 10 Bonus: 1200 Shadow: StatsPerLevel: 0 @@ -816,58 +1262,102 @@ Shadow: Material: 7619 Rates: - Level: 1 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 2 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 3 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 4 - REFINE_COST_NORMAL: 100 - REFINE_COST_ENRICHED: 100 - REFINE_COST_EVT_ENRICHED: 100 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 - Level: 5 - REFINE_COST_NORMAL: 60 - REFINE_COST_ENRICHED: 90 - REFINE_COST_EVT_ENRICHED: 95 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 - Level: 6 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 7 - REFINE_COST_NORMAL: 40 - REFINE_COST_ENRICHED: 70 - REFINE_COST_EVT_ENRICHED: 80 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 - Level: 8 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 # BlacksmithBlessing: # ItemID: 6635 # Count: 1 - Level: 9 - REFINE_COST_NORMAL: 20 - REFINE_COST_HD: 20 - REFINE_COST_ENRICHED: 40 - REFINE_COST_EVT_ENRICHED: 50 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 # BlacksmithBlessing: # ItemID: 6635 # Count: 2 - Level: 10 - REFINE_COST_NORMAL: 9 - REFINE_COST_HD: 9 - REFINE_COST_ENRICHED: 20 - REFINE_COST_EVT_ENRICHED: 35 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_HD + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 # BlacksmithBlessing: # ItemID: 6635 # Count: 4 #- Level: 11 + # Chances: # BlacksmithBlessing: # ItemID: 6635 # Count: 7 diff --git a/src/map/status.cpp b/src/map/status.cpp index b4ffa86a0b1..bb98d67056d 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -14442,138 +14442,101 @@ static bool status_yaml_readdb_refine_sub(const YAML::Node &node, int refine_inf if (refine_info_index < 0 || refine_info_index >= REFINE_TYPE_MAX) return false; - int bonus_per_level = yaml_get_int(wrapper, "StatsPerLevel"); - int random_bonus_start_level = yaml_get_int(wrapper, "RandomBonusStartLevel"); - int random_bonus = yaml_get_int(wrapper, "RandomBonusValue"); - struct s_refine_type { - char *str; - int id; - }; - struct s_refine_type **refine_types = NULL; - uint8 refine_type_num = 0; - yamlwrapper* costs = yaml_get_subnode(wrapper, "Costs"); - yamliterator* it = yaml_get_iterator(costs); - if (yaml_iterator_is_valid(it)) { - for (yamlwrapper* type = yaml_iterator_first(it); yaml_iterator_has_next(it); type = yaml_iterator_next(it)) { - int idx = 0, price; - unsigned short material; - static char* keys[] = { "Type", "Price", "Material" }; - char* result; - - if ((result = yaml_verify_nodes(type, ARRAYLENGTH(keys), keys)) != NULL) { - ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", result, file_name); - yaml_destroy_wrapper(type); - continue; - } + int bonus_per_level = node["StatsPerLevel"].as(); + int random_bonus_start_level = node["RandomBonusStartLevel"].as(); + int random_bonus = node["RandomBonusValue"].as(); + const YAML::Node &costs = node["Costs"]; - char* refine_cost_const = yaml_get_c_string(type, "Type"); - if (!script_get_constant(refine_cost_const, &idx)) { - ShowError("status_yaml_readdb_refine_sub: Cost type '%s' is not defined. The type must be defined as script constants.\n", refine_cost_const); - continue; - } - price = yaml_get_int(type, "Price"); - material = yaml_get_uint16(type, "Material"); + for (const auto costit : costs) { + const YAML::Node &type = costit; + int idx = 0, price; + unsigned short material; + const std::string keys[] = { "Type", "Price", "Material" }; - int len = strlen(refine_cost_const) + 1; - if (refine_types && refine_type_num) { - int i; - ARR_FIND(0, refine_type_num, i, strcmpi(refine_cost_const, refine_types[i]->str) == 0); - if (i < refine_type_num) { - ShowError("status_yaml_readdb_refine_sub: Redifinition of cost type '%s'\n", refine_cost_const); - continue; - } - } - RECREATE(refine_types, struct s_refine_type*, refine_type_num + 1); - CREATE(refine_types[refine_type_num], struct s_refine_type, 1); - CREATE(refine_types[refine_type_num]->str, char, len); - safestrncpy(refine_types[refine_type_num]->str, refine_cost_const, len); - refine_types[refine_type_num]->id = idx; - refine_type_num++; + for (int i = 0; i < ARRAYLENGTH(keys); i++) { + if (!type[keys[i]].IsDefined()) + ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", keys[i].c_str(), file_name.c_str()); + } - refine_info[refine_info_index].cost[idx].nameid = material; - refine_info[refine_info_index].cost[idx].zeny = price; - if (yaml_node_is_defined(type, "Breakable")) { - refine_info[refine_info_index].cost[idx].breakable = yaml_get_boolean(type, "Breakable"); - } - else { - refine_info[refine_info_index].cost[idx].breakable = true; - } - if (yaml_node_is_defined(type, "RefineUI")) { - refine_info[refine_info_index].cost[idx].refineui = yaml_get_boolean(type, "RefineUI"); - } - else { - refine_info[refine_info_index].cost[idx].refineui = true; - } + std::string refine_cost_const = type["Type"].as(); + if (ISDIGIT(refine_cost_const[0])) + idx = atoi(refine_cost_const.c_str()); + else + script_get_constant(refine_cost_const.c_str(), &idx); + price = type["Price"].as(); + material = type["Material"].as(); - aFree(refine_cost_const); - yaml_destroy_wrapper(type); - } + refine_info[refine_info_index].cost[idx].nameid = material; + refine_info[refine_info_index].cost[idx].zeny = price; + refine_info[refine_info_index].cost[idx].breakable = (type["Breakable"].IsDefined()) ? type["Breakable"].as() : true; + refine_info[refine_info_index].cost[idx].refineui = (type["RefineUI"].IsDefined()) ? type["RefineUI"].as() : true; } - yaml_destroy_wrapper(costs); - yaml_iterator_destroy(it); - if (!refine_type_num || !refine_types) { - ShowError("status_yaml_readdb_refine_sub: No refine type defined.\n"); - return false; - } + const YAML::Node &rates = node["Rates"]; - yamlwrapper* rates = yaml_get_subnode(wrapper, "Rates"); - it = yaml_get_iterator(rates); + for (const auto rateit : rates) { + const YAML::Node &level = rateit; + int refine_level = level["Level"].as() - 1; - if (yaml_iterator_is_valid(it)) { - for (yamlwrapper* level = yaml_iterator_first(it); yaml_iterator_has_next(it); level = yaml_iterator_next(it)) { - int refine_level = yaml_get_int(level, "Level") - 1; + if (refine_level >= MAX_REFINE) + continue; - if (refine_level >= MAX_REFINE) { - yaml_destroy_wrapper(level); - continue; - } + if (level["Chances"].IsDefined()) { + const YAML::Node &chances = level["Chances"]; + for (const auto chanceit : chances) { + int i; + const YAML::Node &chance = chanceit; + const std::string keys[] = { "Type", "Rate" }; - if (yaml_node_is_defined(level, "Bonus")) - refine_info[refine_info_index].bonus[refine_level] = yaml_get_int(level, "Bonus"); + for (i = 0; i < ARRAYLENGTH(keys); i++) { + if (!chance[keys[i]].IsDefined()) { + ShowWarning("status_yaml_readdb_refine_sub: Invalid Chances with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", keys[i].c_str(), file_name.c_str()); + break; + } + } + if (i != ARRAYLENGTH(keys)) { + ShowError("status_yaml_readdb_refine_sub: Skipping incomplete node for Chances list.\n"); + continue; + } - for (int i = 0; i < refine_type_num; i++) { - if (yaml_node_is_defined(level, refine_types[i]->str)) { - refine_info[refine_info_index].chance[refine_types[i]->id][refine_level] = yaml_get_int(level, refine_types[i]->str); + std::string chance_type = chance["Type"].as(); + int chance_idx = 0; + if (!script_get_constant(chance_type.c_str(), &chance_idx)) { + ShowWarning("status_yaml_readdb_refine_sub: Invalid Chance Type " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", chance_type.c_str(), file_name.c_str()); + continue; } + refine_info[refine_info_index].chance[chance_idx][refine_level] = chance["Rate"].as(); } + } - if (refine_level >= random_bonus_start_level - 1) - refine_info[refine_info_index].randombonus_max[refine_level] = random_bonus * (refine_level - random_bonus_start_level + 2); - - // Blacksmith Blessing - if (yaml_node_is_defined(level, "BlacksmithBlessing")) { - yamlwrapper* bswrap = yaml_get_subnode(level, "BlacksmithBlessing"); - static char* keys[] = { "ItemID", "Count" }; - char* result; + if (level["BlacksmithBlessing"].IsDefined()) { + int i = 0; + const YAML::Node &bb = level["BlacksmithBlessing"]; + const std::string keys[] = { "ItemID", "Count" }; - if ((result = yaml_verify_nodes(bswrap, ARRAYLENGTH(keys), keys)) != NULL) { - ShowWarning("status_yaml_readdb_refine_sub: Invalid refine cost with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", result, file_name); - yaml_destroy_wrapper(bswrap); - } - else { - refine_info[refine_info_index].bs_blessing[refine_level].nameid = yaml_get_int(bswrap, "ItemID"); - refine_info[refine_info_index].bs_blessing[refine_level].count = yaml_get_uint16(bswrap, "Count"); - yaml_destroy_wrapper(bswrap); + for (i = 0; i < ARRAYLENGTH(keys); i++) { + if (!bb[keys[i]].IsDefined()) { + ShowWarning("status_yaml_readdb_refine_sub: Invalid BlacksmithBlessing with undefined " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", keys[i].c_str(), file_name.c_str()); + break; } } - - yaml_destroy_wrapper(level); - } - for (int refine_level = 0; refine_level < MAX_REFINE; ++refine_level) { - refine_info[refine_info_index].bonus[refine_level] += bonus_per_level + (refine_level > 0 ? refine_info[refine_info_index].bonus[refine_level - 1] : 0); - } - } - yaml_destroy_wrapper(rates); - yaml_iterator_destroy(it); - for (uint8 i = 0; i < refine_type_num; i++) { - if (refine_types[i] && refine_types[i]->str) { - aFree(refine_types[i]->str); + if (i != ARRAYLENGTH(keys)) { + ShowError("status_yaml_readdb_refine_sub: Skipping incomplete node for BlacksmithBlessing list.\n"); + continue; + } + refine_info[refine_info_index].bs_blessing[refine_level].nameid = bb["ItemID"].as(); + refine_info[refine_info_index].bs_blessing[refine_level].count = bb["Count"].as(); } - aFree(refine_types[i]); + + if (level["Bonus"].IsDefined()) + refine_info[refine_info_index].bonus[refine_level] = level["Bonus"].as(); + + if (refine_level >= random_bonus_start_level - 1) + refine_info[refine_info_index].randombonus_max[refine_level] = random_bonus * (refine_level - random_bonus_start_level + 2); } - if (refine_types) - aFree(refine_types); + for (int refine_level = 0; refine_level < MAX_REFINE; ++refine_level) + refine_info[refine_info_index].bonus[refine_level] += bonus_per_level + (refine_level > 0 ? refine_info[refine_info_index].bonus[refine_level - 1] : 0); + return true; } From 3c41b17988172d048ae3fe0d84d90668bb41cd2f Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 20:50:43 +0700 Subject: [PATCH 16/27] Removed 'Breakable', added 'OnFail' * 'Break' is percentage number to break the equip on fail, 100 = 100% * 'DownRefine' is percentage number to downrefine the equip on fail, 100 = 100% (checked after 'Break' chance if passed) * 'DownRefineNum' is number of down refine --- db/re/refine_db.yml | 136 +++++++++++++++++++++++++++-------- src/map/clif.cpp | 59 +++++++++------ src/map/script_constants.hpp | 1 - src/map/status.cpp | 28 ++++++-- src/map/status.hpp | 7 +- 5 files changed, 173 insertions(+), 58 deletions(-) diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index 2902ef8df4c..6fb1a2a2ae9 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -29,17 +29,27 @@ Armor: - Type: REFINE_COST_OVER10 Price: 100000 Material: 6223 + OnFail: + Break: 80 + DownRefine: 20 + DownRefineNum: 3 - Type: REFINE_COST_HD Price: 20000 Material: 6241 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7619 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6225 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_HOLINK Price: 15000 Material: 7619 @@ -49,14 +59,19 @@ Armor: - Type: REFINE_COST_BLESSED Price: 20000 Material: 6439 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 0 # 'Event' rates - Type: REFINE_COST_EVT_OVER10_HD Price: 100000 Material: 6225 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_EVT_ENRICHED Price: 2000 Material: 7619 @@ -280,17 +295,27 @@ WeaponLv1: - Type: REFINE_COST_OVER10 Price: 100000 Material: 6224 + OnFail: + Break: 80 + DownRefine: 20 + DownRefineNum: 3 - Type: REFINE_COST_HD Price: 20000 Material: 6240 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_HOLINK Price: 500 Material: 7620 @@ -300,14 +325,19 @@ WeaponLv1: - Type: REFINE_COST_BLESSED Price: 1000 Material: 6438 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 0 # 'Event' rates - Type: REFINE_COST_EVT_OVER10_HD Price: 100000 Material: 6226 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_EVT_ENRICHED Price: 2000 Material: 7620 @@ -524,17 +554,27 @@ WeaponLv2: - Type: REFINE_COST_OVER10 Price: 100000 Material: 6224 + OnFail: + Break: 80 + DownRefine: 20 + DownRefineNum: 3 - Type: REFINE_COST_HD Price: 20000 Material: 6240 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_HOLINK Price: 2000 Material: 7620 @@ -544,14 +584,19 @@ WeaponLv2: - Type: REFINE_COST_BLESSED Price: 2000 Material: 6438 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 0 # 'Event' rates - Type: REFINE_COST_EVT_OVER10_HD Price: 100000 Material: 6226 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_EVT_ENRICHED Price: 2000 Material: 7620 @@ -768,17 +813,27 @@ WeaponLv3: - Type: REFINE_COST_OVER10 Price: 100000 Material: 6224 + OnFail: + Break: 80 + DownRefine: 20 + DownRefineNum: 3 - Type: REFINE_COST_HD Price: 20000 Material: 6240 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_HOLINK Price: 20000 Material: 7620 @@ -788,17 +843,22 @@ WeaponLv3: - Type: REFINE_COST_BLESSED Price: 20000 Material: 6438 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 0 # 'Event' rates - - Type: REFINE_COST_EVT_ENRICHED - Price: 2000 - Material: 7620 - RefineUI: false - Type: REFINE_COST_EVT_OVER10_HD Price: 100000 Material: 6226 - Breakable: false + RefineUI: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 RefineUI: false Rates: - Level: 1 @@ -1012,17 +1072,27 @@ WeaponLv4: - Type: REFINE_COST_OVER10 Price: 100000 Material: 6224 + OnFail: + Break: 80 + DownRefine: 20 + DownRefineNum: 3 - Type: REFINE_COST_HD Price: 20000 Material: 6240 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_ENRICHED Price: 2000 Material: 7620 - Type: REFINE_COST_OVER10_HD Price: 100000 Material: 6226 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_HOLINK Price: 50000 Material: 7620 @@ -1032,17 +1102,22 @@ WeaponLv4: - Type: REFINE_COST_BLESSED Price: 40000 Material: 6438 - Breakable: false RefineUI: false + OnFail: + Break: 0 + DownRefine: 0 # 'Event' rates - - Type: REFINE_COST_EVT_ENRICHED - Price: 2000 - Material: 7620 - RefineUI: false - Type: REFINE_COST_EVT_OVER10_HD Price: 100000 Material: 6226 - Breakable: false + RefineUI: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 RefineUI: false Rates: - Level: 1 @@ -1256,7 +1331,10 @@ Shadow: - Type: REFINE_COST_HD Price: 20000 Material: 6241 - Breakable: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 - Type: REFINE_COST_ENRICHED Price: 20000 Material: 7619 diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 93d1bb841dc..2c02be65b8f 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20341,15 +20341,11 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d return false; } - if (!status_get_refine_cost(id->wlv, type, REFINE_REFINEUI_ENABLED)) + struct refine_cost *cost = status_get_refine_cost_(id->wlv, type); + if (!cost || !cost->refineui) return false; + memcpy(&materials[index].cost, cost, sizeof(struct refine_cost)); - // Get the material that is required to refine this item - materials[index].cost.nameid = status_get_refine_cost( id->wlv, type, REFINE_MATERIAL_ID ); - // Get the amount of zeny that is required to refine the item with this material - materials[index].cost.zeny = status_get_refine_cost( id->wlv, type, REFINE_ZENY_COST ); - // Get the breaking chance of the item with this material - materials[index].cost.breakable = status_get_refine_cost( id->wlv, type, REFINE_BREAKABLE ); // Get the chance for refining the item with this material materials[index].chance = status_get_refine_chance( (enum refine_type)id->wlv, item->refine, type); @@ -20357,7 +20353,6 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d if( materials[index].cost.nameid == 0 || materials[index].cost.zeny == 0 || materials[index].chance == 0 ){ // Reset all entries properly materials[index].cost.nameid = materials[index].cost.zeny = materials[index].chance = 0; - materials[index].cost.breakable = true; return false; }else{ // Everything was set properly @@ -20397,6 +20392,16 @@ static inline uint8 clif_refineui_materials( struct item *item, struct item_data return count; } +void clif_refineui_notrefineable(struct map_session_data *sd, uint16 index) { + int fd = sd->fd; + WFIFOHEAD(fd, 7); + WFIFOW(fd, 0) = 0x0AA2; + WFIFOW(fd, 2) = 7; + WFIFOW(fd, 4) = index + 2; + WFIFOB(fd, 6) = 0; + WFIFOSET(fd, 7); +} + /** * Adds the selected item into the refine UI and sends the possible materials * to the client. @@ -20420,6 +20425,7 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ // Check if the item can be refined if( id->flag.no_refine ){ + clif_refineui_notrefineable(sd, index); return; } @@ -20438,16 +20444,19 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ // Check if the item is identified if( !item->identify ){ + clif_refineui_notrefineable(sd, index); return; } // Check if the item is broken if( item->attribute ){ + clif_refineui_notrefineable(sd, index); return; } // Check the current refine level if( item->refine < 0 || item->refine >= MAX_REFINE ){ + clif_refineui_notrefineable(sd, index); return; } @@ -20456,6 +20465,7 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ // No possibilities were found if( material_count == 0 ){ + clif_refineui_notrefineable(sd, index); return; } @@ -20507,7 +20517,7 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ #if PACKETVER >= 20161012 uint16 index = RFIFOW( fd, 2 ) - 2; uint16 material = RFIFOW( fd, 4 ); - bool use_blacksmith_blessing = RFIFOB( fd, 6 ) != 0; // TODO: add logic + bool use_blacksmith_blessing = RFIFOB( fd, 6 ) != 0; struct refine_materials materials[REFINEUI_MAT_CNT]; uint8 i, material_count; uint16 j; @@ -20586,7 +20596,7 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ return; } - // Try to pay for the refine + // Try to pay for the refine. By default, client checked if player has enough zeny or not if( pc_payzeny( sd, materials[i].cost.zeny, LOG_TYPE_CONSUME, NULL ) ){ clif_npc_buy_result( sd, 1 ); // "You do not have enough zeny." return; @@ -20621,19 +20631,26 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ }else{ // Failure - if (use_blacksmith_blessing) { // Blacksmith Blessing were used, no break & no down refine + do { + if (!use_blacksmith_blessing) { + int r = rnd() % 100; + if (r < materials[i].cost.breaking) { // Breaking chance + clif_refine(fd, 1, index, item->refine); + pc_delitem(sd, index, 1, 0, 0, LOG_TYPE_CONSUME); + break; + } + else if (r < (materials[i].cost.breaking + materials[i].cost.downrefine)) { // Downrefine chance + item->refine = cap_value(item->refine - materials[i].cost.downrefine_num, 0, MAX_REFINE); + clif_refine(fd, 2, index, item->refine); + clif_refineui_info(sd, index); + break; + } + } + // Blacksmith Blessing were used, no break & no down refine clif_refine(fd, 3, index, item->refine); clif_refineui_info(sd, index); - } else if (materials[i].cost.breakable) { // Delete the item if it is breakable - clif_refine( fd, 1, index, item->refine ); - pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_CONSUME ); - }else{ - // Otherwise downgrade it - item->refine = cap_value( item->refine - 1, 0, MAX_REFINE ); - clif_refine( fd, 2, index, item->refine ); - clif_refineui_info(sd, index); - } - + } while (0); + clif_misceffect( &sd->bl, 2 ); achievement_update_objective( sd, AG_REFINE_FAIL, 1, 1 ); } diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 875d131f7c4..9ece7fa0b69 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -5025,7 +5025,6 @@ /* refine information types */ export_constant(REFINE_MATERIAL_ID); export_constant(REFINE_ZENY_COST); - export_constant(REFINE_BREAKABLE); /* NPC view ids */ // Special macro to strip the prefix 'JT_' diff --git a/src/map/status.cpp b/src/map/status.cpp index bb98d67056d..870779e3f5c 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -14468,8 +14468,18 @@ static bool status_yaml_readdb_refine_sub(const YAML::Node &node, int refine_inf refine_info[refine_info_index].cost[idx].nameid = material; refine_info[refine_info_index].cost[idx].zeny = price; - refine_info[refine_info_index].cost[idx].breakable = (type["Breakable"].IsDefined()) ? type["Breakable"].as() : true; refine_info[refine_info_index].cost[idx].refineui = (type["RefineUI"].IsDefined()) ? type["RefineUI"].as() : true; + + if (type["OnFail"].IsDefined()) { + const YAML::Node &onfail = type["OnFail"]; + if (onfail["Break"].IsDefined()) { + refine_info[refine_info_index].cost[idx].breaking = onfail["Break"].as(); + } + if (onfail["DownRefine"].IsDefined()) { + refine_info[refine_info_index].cost[idx].downrefine = onfail["DownRefine"].as(); + refine_info[refine_info_index].cost[idx].downrefine_num = onfail["DownRefineNum"].IsDefined() ? onfail["DownRefineNum"].as() : 1; + } + } } const YAML::Node &rates = node["Rates"]; @@ -14581,8 +14591,6 @@ int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what) return refine_info[weapon_lv].cost[type].nameid; case REFINE_ZENY_COST: return refine_info[weapon_lv].cost[type].zeny; - case REFINE_BREAKABLE: - return refine_info[weapon_lv].cost[type].breakable; case REFINE_REFINEUI_ENABLED: return refine_info[weapon_lv].cost[type].refineui; } @@ -14590,6 +14598,14 @@ int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what) return 0; } +struct refine_cost *status_get_refine_cost_(int weapon_lv, int type) { + if (weapon_lv < REFINE_TYPE_ARMOR || weapon_lv >= REFINE_TYPE_MAX) + return NULL; + if (type < REFINE_COST_NORMAL || type >= REFINE_COST_MAX) + return NULL; + return &refine_info[weapon_lv].cost[type]; +} + /** * Read attribute fix database for attack calculations * Function stores information in the attr_fix_table @@ -14674,13 +14690,15 @@ int status_readdb(void) { memset(&refine_info[i].cost, 0, sizeof(struct refine_cost)*REFINE_COST_MAX); memset(&refine_info[i].bs_blessing, 0, sizeof(struct refine_bs_blessing)*MAX_REFINE); - for(j = 0; j < REFINE_COST_MAX; j++) - for(k=0;k Date: Sun, 8 Jul 2018 20:56:34 +0700 Subject: [PATCH 17/27] Added `RefineUI: false` for Wagjak and Holink --- db/re/refine_db.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index 6fb1a2a2ae9..f74d53c017e 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -53,9 +53,11 @@ Armor: - Type: REFINE_COST_HOLINK Price: 15000 Material: 7619 + RefineUI: false - Type: REFINE_COST_WAGJAK Price: 20000 Material: 985 + RefineUI: false - Type: REFINE_COST_BLESSED Price: 20000 Material: 6439 @@ -319,9 +321,11 @@ WeaponLv1: - Type: REFINE_COST_HOLINK Price: 500 Material: 7620 + RefineUI: false - Type: REFINE_COST_WAGJAK Price: 1000 Material: 1010 + RefineUI: false - Type: REFINE_COST_BLESSED Price: 1000 Material: 6438 @@ -578,9 +582,11 @@ WeaponLv2: - Type: REFINE_COST_HOLINK Price: 2000 Material: 7620 + RefineUI: false - Type: REFINE_COST_WAGJAK Price: 2000 Material: 1011 + RefineUI: false - Type: REFINE_COST_BLESSED Price: 2000 Material: 6438 @@ -837,9 +843,11 @@ WeaponLv3: - Type: REFINE_COST_HOLINK Price: 20000 Material: 7620 + RefineUI: false - Type: REFINE_COST_WAGJAK Price: 10000 Material: 984 + RefineUI: false - Type: REFINE_COST_BLESSED Price: 20000 Material: 6438 @@ -1096,9 +1104,11 @@ WeaponLv4: - Type: REFINE_COST_HOLINK Price: 50000 Material: 7620 + RefineUI: false - Type: REFINE_COST_WAGJAK Price: 20000 Material: 984 + RefineUI: false - Type: REFINE_COST_BLESSED Price: 40000 Material: 6438 From 3bae92246effd30b85bd7d870a45180fa723a237 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 21:15:25 +0700 Subject: [PATCH 18/27] Wagjak rate is using Normal Rate --- npc/re/jobs/novice/academy.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npc/re/jobs/novice/academy.txt b/npc/re/jobs/novice/academy.txt index f3c43a6d551..6f04f388207 100644 --- a/npc/re/jobs/novice/academy.txt +++ b/npc/re/jobs/novice/academy.txt @@ -12879,7 +12879,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ mes "Cancel the refining."; close; } - if (getequippercentrefinery(.@part,REFINE_COST_WAGJAK) < 100) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) < 100) { mes "[Refining Machine Wagjak]"; mes "-Ddarritt!-"; mes "The user's confirmation required."; @@ -12894,7 +12894,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ // anti-hack if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) close; - if (getequippercentrefinery(.@part,REFINE_COST_WAGJAK) <= rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_NORMAL) <= rand(100)) { failedrefitem .@part; mes "[Refining Machine Wagjak]"; mes "Result : Fail"; From 17952fb0231f9fcf4a1c0b8a7601d9d2bcbe5326 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 22:01:39 +0700 Subject: [PATCH 19/27] Added `getblacksmithblessing` * `getblacksmithblessing(,{,})` to get info of Blacksmith Blessing usage for refining --- doc/script_commands.txt | 13 ++++++++++ npc/re/merchants/hd_refiner.txt | 42 ++++++++++++--------------------- src/map/script.cpp | 33 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 27 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 3e703a216c4..0928afbc0af 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2847,6 +2847,19 @@ is invalid or if there is no item in the equipment slot. --------------------------------------- +*getblacksmithblessing(,{,}) + +Get info about 'Blacksmith Blessing' item used for specified and +. The info will be stored in .@refinebb array. + + .@refinebb[0] = Item ID acknowledged as Blacksmith Blessing + .@refinebb[1] = Amount needed + +If is specified, it will replaces .@refinebb as default array. This +script also returns 1 on success and 0 on failure or no info. + +--------------------------------------- + *refineui({}) Opens the refine UI for the attached player or the given character id. diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index 9fad69b1dfa..434f08d01a7 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -68,17 +68,9 @@ mes "This item can't be refined."; close; } - switch( getequiprefinerycnt(.@part) ) { - case 7: - .@blacksmith_blessing_count = 1; - break; - case 8: - .@blacksmith_blessing_count = 2; - break; - case 9: - .@blacksmith_blessing_count = 4; - break; - default: + .@weapon_lvl = getequipweaponlv(.@part); + .@bb = getblacksmithblessing(.@weapon_lvl .@refine_count); + if (!.@bb) { mes "[Blacksmith Mighty Hammer]"; mes "I only handle items with refine levels from +7 to +9."; close; @@ -105,7 +97,7 @@ mes "Well, even if it fails, it only decreases by 1 refine level."; mes "Would you like to continue refining?"; next; - if (countitem(6635) < .@blacksmith_blessing_count) + if (countitem(.@refinebb[0]) < .@refinebb[1]) setarray .@menu$[1], "Yes", "Not yet"; else { mes "[Blacksmith Mighty Hammer]"; @@ -113,11 +105,10 @@ mes "With the Blacksmith Blessing, the equipment won't vanish if the refine is failed!"; next; mes "[Blacksmith Mighty Hammer]"; - .@weapon_lvl = getequipweaponlv(.@part); if (.@weapon_lvl < 1 || .@weapon_lvl > 4) - mes "For +" + getequiprefinerycnt(.@part) + " equipment, refine with^316AC5 " + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; + mes "For +" + getequiprefinerycnt(.@part) + " equipment, refine with^316AC5 " + .@refinebb[1] + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; else - mes "For +" + getequiprefinerycnt(.@part) + " weapon, refine with^316AC5 " + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; + mes "For +" + getequiprefinerycnt(.@part) + " weapon, refine with^316AC5 " + .@refinebb[1] + " unit(s) Blacksmith Blessing^000000 can prevent the equipment to be vanished. Do you want use it to refine?"; next; setarray .@menu$[0], "Use it to refine", "Refine directly without it", "Don't refine yet"; } @@ -133,13 +124,13 @@ close; } } - if ((.@bless_who && countitem(6635) < .@blacksmith_blessing_count) || countitem(.@material) == 0 || Zeny < .@price) { + if ((.@bless_who && countitem(.@refinebb[0]) < .@refinebb[1]) || countitem(.@material) == 0 || Zeny < .@price) { mes "[Blacksmith Mighty Hammer]"; mes "Didn't you just say you had everything ready?"; close; } if (.@bless_who) - delitem 6635, .@blacksmith_blessing_count; + delitem .@refinebb[0],.@refinebb[1]; delitem .@material,1; Zeny = Zeny - .@price; @@ -256,11 +247,9 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF mes "Haven't I told you? I only refine equipments that are +10 and above."; close; } - else if (.@refine_count == 10) - .@blacksmith_blessing_count = 7; - else if (.@refine_count == 11) - .@blacksmith_blessing_count = 11; - else if (.@refine_count == 20) { + .@weapon_lvl = getequipweaponlv(.@part); + .@bb = getblacksmithblessing(.@weapon_lvl .@refine_count); + if (!.@bb) { mes "[Basta]"; mes "This weapon is perfect, no need to refine it anymore~"; close; @@ -271,7 +260,6 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF .@price = getequiprefinecost(.@part, REFINE_COST_OVER10_HD, REFINE_ZENY_COST); .@material = getequiprefinecost(.@part, REFINE_COST_OVER10_HD, REFINE_MATERIAL_ID); - .@weapon_lvl = getequipweaponlv(.@part); if (.@weapon_lvl < 1 || .@weapon_lvl > 4) .@type$ = "armor"; else @@ -296,7 +284,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF mes "It is impossible that the refine level will drop by, say, 3 or 4... that sounds scary."; mes "Here it can only decrease by 1 level."; next; - if (.@blacksmith_blessing_count == 0 || countitem(6635) < .@blacksmith_blessing_count) { + if (.@refinebb[1] == 0 || countitem(.@refinebb[0]) < .@refinebb[1]) { mes "[Basta]"; mes "Compared to other blacksmiths, the risk is smaller."; mes "I've given all precautions. Do you want to try it?"; @@ -308,7 +296,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF mes "Woh~ is it the ^316AC5Blacksmith Blessing^000000? It is difficult to get it~ But, you has get it!"; next; mes "[Basta]"; - mes "For +" + .@refine_count + " " + .@type$ + " need ^316AC5" + .@blacksmith_blessing_count + " unit(s) Blacksmith Blessing^000000 can prevent the equipment is vanished. Do you want to refine with Blacksmith Blessing?"; + mes "For +" + .@refine_count + " " + .@type$ + " need ^316AC5" + .@refinebb[1] + " unit(s) Blacksmith Blessing^000000 can prevent the equipment is vanished. Do you want to refine with Blacksmith Blessing?"; next; setarray .@menu$[0], "Refine with Blacksmith Blessing", "Refine without Blacksmith Blessing", "Don't refine yet"; } @@ -325,14 +313,14 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF close; } } - if ((.@bless_who && countitem(6635) < .@blacksmith_blessing_count) || countitem(.@material) == 0 || Zeny < .@price) { + if ((.@bless_who && countitem(.@refinebb[0]) < .@refinebb[1]) || countitem(.@material) == 0 || Zeny < .@price) { mes "[Basta]"; mes "Hmm... You didn't bring all the materials needed."; mes "Come back when you have them all."; close; } if (.@bless_who) - delitem 6635, .@blacksmith_blessing_count; + delitem .@refinebb[0],.@refinebb[1]; delitem .@material,1; Zeny = Zeny - .@price; diff --git a/src/map/script.cpp b/src/map/script.cpp index 10080f6c49f..bab14b47b79 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -24044,6 +24044,38 @@ BUILDIN_FUNC(open_roulette){ #endif } +/* +* getblacksmithblessing(,{,}) +* Return info Blacksmith Blessing in (specified) an array +* .@refinebb[0] = Blacksmith Blessing ID +* .@refinebb[1] = Amount +*/ +BUILDIN_FUNC(getblacksmithblessing) { + struct refine_bs_blessing bb; + int type = script_getnum(st, 2); + int refine = script_getnum(st, 3); + struct script_data *data = script_hasdata(st, 4) ? script_getdata(st, 4) : NULL; + char *name; + + memset(&bb, 0, sizeof(struct refine_bs_blessing)); + if (!status_get_refine_blacksmithBlessing(&bb, (enum refine_type)type, refine)) { + script_pushint(st, 0); + return SCRIPT_CMD_FAILURE; + } + + if (data && data_isreference(data)) { + name = reference_getname(data); + setd_sub(st, NULL, name, 0, (void *)__64BPRTSIZE((int)bb.nameid), data->ref); + setd_sub(st, NULL, name, 1, (void *)__64BPRTSIZE((int)bb.count), data->ref); + } + else { + setd_sub(st, NULL, ".@refinebb", 0, (void *)__64BPRTSIZE((int)bb.nameid), NULL); + setd_sub(st, NULL, ".@refinebb", 1, (void *)__64BPRTSIZE((int)bb.count), NULL); + } + script_pushint(st, (bb.nameid) ? 1 : 0); + return SCRIPT_CMD_SUCCESS; +} + BUILDIN_FUNC(refineui){ #if PACKETVER < 20161012 ShowError( "buildin_refineui: This command requires packet version 2016-10-12 or newer.\n" ); @@ -24715,6 +24747,7 @@ struct script_function buildin_func[] = { // Refine UI BUILDIN_DEF(getequiprefinecost,"iii?"), + BUILDIN_DEF(getblacksmithblessing, "ii"), BUILDIN_DEF(refineui,"?"), BUILDIN_DEF2(round, "round", "i"), From 3d3cda21d8b59dc61952438b1a65a85cc23027bf Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 22:14:59 +0700 Subject: [PATCH 20/27] A little clean up * Removed unnecessary changes were changed on merge * Updated `getequippercentrefinery` to allow without type --- src/map/clif.cpp | 8 ++++---- src/map/script.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 2c02be65b8f..65e098d3da4 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20173,7 +20173,7 @@ void clif_parse_sale_remove( int fd, struct map_session_data* sd ){ /** * Sends all achievement data to the client (ZC_ALL_AG_LIST). - * 0a23 .W .L .L + * 0a23 .W .W .L .L */ void clif_achievement_list_all(struct map_session_data *sd) { @@ -20218,7 +20218,7 @@ void clif_achievement_list_all(struct map_session_data *sd) /** * Sends a single achievement's data to the client (ZC_AG_UPDATE). - * 0a24 .L + * 0a24 .W .L */ void clif_achievement_update(struct map_session_data *sd, struct achievement *ach, int count) { @@ -20254,7 +20254,7 @@ void clif_achievement_update(struct map_session_data *sd, struct achievement *ac /** * Checks if an achievement reward can be rewarded (CZ_REQ_AG_REWARD). - * 0a25 .L + * 0a25 .W .L */ void clif_parse_AchievementCheckReward(int fd, struct map_session_data *sd) { @@ -20268,7 +20268,7 @@ void clif_parse_AchievementCheckReward(int fd, struct map_session_data *sd) /** * Returns the result of achievement_check_reward (ZC_REQ_AG_REWARD_ACK). - * 0a26 .W .L + * 0a26 .W .W .L */ void clif_achievement_reward_ack(int fd, unsigned char result, int achievement_id) { diff --git a/src/map/script.cpp b/src/map/script.cpp index bab14b47b79..0a7d6e788be 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -8876,7 +8876,7 @@ BUILDIN_FUNC(getequipweaponlv) * return (npc) * x : refine chance * 0 : false (max refine level or unequip..) - * getequippercentrefinery({,,}) + * getequippercentrefinery(,{,}) *------------------------------------------*/ BUILDIN_FUNC(getequippercentrefinery) { From 5acae3c7e9f74e8c5793a7d2bafb4dd143598c4c Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 8 Jul 2018 23:12:25 +0700 Subject: [PATCH 21/27] Typo in getblacksmithblessing usages --- npc/re/merchants/hd_refiner.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index 434f08d01a7..0fe308f0103 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -69,7 +69,7 @@ close; } .@weapon_lvl = getequipweaponlv(.@part); - .@bb = getblacksmithblessing(.@weapon_lvl .@refine_count); + .@bb = getblacksmithblessing(.@weapon_lvl,.@refine_count); if (!.@bb) { mes "[Blacksmith Mighty Hammer]"; mes "I only handle items with refine levels from +7 to +9."; @@ -248,7 +248,7 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF close; } .@weapon_lvl = getequipweaponlv(.@part); - .@bb = getblacksmithblessing(.@weapon_lvl .@refine_count); + .@bb = getblacksmithblessing(.@weapon_lvl,.@refine_count); if (!.@bb) { mes "[Basta]"; mes "This weapon is perfect, no need to refine it anymore~"; From dfc21863e53c9374905831d135f3a4053cf25112 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Fri, 13 Jul 2018 20:20:08 +0700 Subject: [PATCH 22/27] Removed 'event_refine_chance' from conf/battle/items.conf * Thanks to @ecdarreola --- conf/battle/items.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/conf/battle/items.conf b/conf/battle/items.conf index f2118d24ebe..3a26db2cebe 100644 --- a/conf/battle/items.conf +++ b/conf/battle/items.conf @@ -117,11 +117,6 @@ default_bind_on_equip: 4 // 0x2 = Sell restricted items are able to be sold at Itemshops allow_bound_sell: 0x0 -// Turn on event refine chance (see db/{pre-}re/refine_db.yml) -// no = normal refine chances in effect (official/default value) -// yes = event refine chances in effect -event_refine_chance: no - // Hide n last characters of player's name with asterisk (*) when the player // obtained an item with special broadcast flag. // Note: Players with short names can be fully converted to asterisks if this From 3863d77e095fe872104740fbeb9227d9a8a0e215 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Tue, 17 Jul 2018 20:15:56 +0700 Subject: [PATCH 23/27] Typo fixes * Corrected REFINE_COST_HOLINK usage in getequippercentrefinery to REFINE_COST_ENRICHED, since the known value (from rAthena) is using Enriched rate * Thanks to @ecdarreola --- npc/re/merchants/advanced_refiner.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npc/re/merchants/advanced_refiner.txt b/npc/re/merchants/advanced_refiner.txt index 7321fe9801a..66383b38298 100644 --- a/npc/re/merchants/advanced_refiner.txt +++ b/npc/re/merchants/advanced_refiner.txt @@ -159,7 +159,7 @@ malangdo,221,174,6 script Holink#mal_cash 559,{ close; } - if (getequippercentrefinery(.@part, REFINE_COST_HOLINK) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_COST_ENRICHED) > rand(100)) { successrefitem .@part; mes "[Holink]"; mes "Me~ Me~ Meow! Fun fun refining~"; From bc00ff777e0882f622830cee44ca59a406502362 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sat, 1 Sep 2018 20:35:31 +0700 Subject: [PATCH 24/27] Refine UI Updates * Depreciate wlv for refine_info[] lookup, changed with new variable 'refine_type' in each item defined while loading the item_db * REFINE_TYPE_MAX if item is not IT_WEAPON, IT_ARMOR, or IT_SHADOWGEAR * The values are using 'enum refine_type' from status.hpp * Replaced some code that use item_data->wlv to follow this change * Removed hardcoded only IT_WEAPON and IT_ARMOR for refining using Refine UI, invalidy check if refine_info is REFINE_TYPE_MAX * Separate 'Costume' from 'Armor' data in refine_db.yml (just because idRO add custom NPC to refine costumes, so just think maybe can be separated and can be modified later). And costumes refine_type is REFINE_TYPE_COSTUME * See itemdb.cpp::itemdb_set_refine_type how it be separated * Fixed Shadow gear cannot be refined by Refine UI * script_commands.txt updates: * Removed unused doc for 'getequiprefinecost' * Explained for 'getblacksmithblessing' --- db/pre-re/refine_db.yml | 96 +++++++++++++ db/re/refine_db.yml | 271 +++++++++++++++++++++++++++++++++++ doc/script_commands.txt | 13 +- src/map/clif.cpp | 18 +-- src/map/itemdb.cpp | 12 ++ src/map/itemdb.hpp | 1 + src/map/script.cpp | 15 +- src/map/script_constants.hpp | 8 ++ src/map/skill.cpp | 2 +- src/map/status.cpp | 53 ++++--- src/map/status.hpp | 9 +- 11 files changed, 441 insertions(+), 57 deletions(-) diff --git a/db/pre-re/refine_db.yml b/db/pre-re/refine_db.yml index 288044e92d8..f9c7c3d8d51 100644 --- a/db/pre-re/refine_db.yml +++ b/db/pre-re/refine_db.yml @@ -114,6 +114,102 @@ Armor: Rate: 20 - Type: REFINE_COST_EVT_ENRICHED Rate: 35 +Costume: + StatsPerLevel: 66 + RandomBonusStartLevel: 0 + RandomBonusValue: 0 + Costs: + - Type: REFINE_COST_NORMAL + Price: 2000 + Material: 985 + - Type: REFINE_COST_ENRICHED + Price: 2000 + Material: 7619 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7619 + RefineUI: false + Rates: + - Level: 1 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 2 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 3 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 4 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 5 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 + - Level: 6 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + - Level: 7 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + - Level: 8 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 + - Level: 9 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 + - Level: 10 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 WeaponLv1: StatsPerLevel: 200 RandomBonusStartLevel: 8 diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index f74d53c017e..72ea1399b18 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -286,6 +286,274 @@ Armor: - Type: REFINE_COST_EVT_OVER10_HD Rate: 10 Bonus: 500 +Costume: + StatsPerLevel: 0 + RandomBonusStartLevel: 0 + RandomBonusValue: 0 + Costs: + - Type: REFINE_COST_NORMAL + Price: 2000 + Material: 985 + - Type: REFINE_COST_OVER10 + Price: 100000 + Material: 6223 + OnFail: + Break: 80 + DownRefine: 20 + DownRefineNum: 3 + - Type: REFINE_COST_HD + Price: 20000 + Material: 6241 + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_ENRICHED + Price: 2000 + Material: 7619 + - Type: REFINE_COST_OVER10_HD + Price: 100000 + Material: 6225 + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_HOLINK + Price: 15000 + Material: 7619 + RefineUI: false + - Type: REFINE_COST_WAGJAK + Price: 20000 + Material: 985 + RefineUI: false + - Type: REFINE_COST_BLESSED + Price: 20000 + Material: 6439 + RefineUI: false + OnFail: + Break: 0 + DownRefine: 0 + # 'Event' rates + - Type: REFINE_COST_EVT_OVER10_HD + Price: 100000 + Material: 6225 + RefineUI: false + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7619 + RefineUI: false + Rates: + - Level: 1 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + Bonus: 100 + - Level: 2 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + Bonus: 100 + - Level: 3 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + Bonus: 100 + - Level: 4 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + Bonus: 100 + - Level: 5 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 + Bonus: 200 + - Level: 6 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + Bonus: 200 + - Level: 7 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_BLESSED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + Bonus: 200 + - Level: 8 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 + Bonus: 200 + BlacksmithBlessing: + ItemID: 6635 + Count: 1 + - Level: 9 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_BLESSED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 + Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 2 + - Level: 10 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_HD + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_BLESSED + Rate: 9 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 + Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 4 + - Level: 11 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 + Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 7 + - Level: 12 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 20 + Bonus: 300 + BlacksmithBlessing: + ItemID: 6635 + Count: 11 + - Level: 13 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_BLESSED + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 16 + Bonus: 400 + - Level: 14 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 8 + - Type: REFINE_COST_OVER10_HD + Rate: 8 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 16 + Bonus: 400 + - Level: 15 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 + Bonus: 400 + - Level: 16 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 15 + Bonus: 400 + - Level: 17 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 14 + Bonus: 500 + - Level: 18 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 7 + - Type: REFINE_COST_OVER10_HD + Rate: 7 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 14 + Bonus: 500 + - Level: 19 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 5 + - Type: REFINE_COST_OVER10_HD + Rate: 5 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 10 + Bonus: 500 + - Level: 20 + Chances: + - Type: REFINE_COST_OVER10 + Rate: 5 + - Type: REFINE_COST_OVER10_HD + Rate: 5 + - Type: REFINE_COST_EVT_OVER10_HD + Rate: 10 + Bonus: 500 WeaponLv1: StatsPerLevel: 200 RandomBonusStartLevel: 8 @@ -1338,9 +1606,11 @@ Shadow: - Type: REFINE_COST_NORMAL Price: 20000 Material: 985 + RefineUI: true - Type: REFINE_COST_HD Price: 20000 Material: 6241 + RefineUI: true OnFail: Break: 0 DownRefine: 100 @@ -1348,6 +1618,7 @@ Shadow: - Type: REFINE_COST_ENRICHED Price: 20000 Material: 7619 + RefineUI: true Rates: - Level: 1 Chances: diff --git a/doc/script_commands.txt b/doc/script_commands.txt index e7405381e88..34d5a309abc 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2837,10 +2837,6 @@ Valid information types are: REFINE_ZENY_COST - Zeny REFINE_MATERIAL_ID - Material Item ID -REFINE_BREAKABLE - If the equipment will be broken by using this material - on a failed atempt -REFINE_BS_BLESSING - Only for REFINE_COST_BS_BLESSING to return the number of - Blacksmith Blessing needed This function will return -1 on failure. The function fails if the cost type is invalid or if there is no item in the equipment slot. @@ -2855,6 +2851,15 @@ Get info about 'Blacksmith Blessing' item used for specified and .@refinebb[0] = Item ID acknowledged as Blacksmith Blessing .@refinebb[1] = Amount needed + is can be 0 for armor type, 1-4 for weapons level 1 to 4 or + REFINE_TYPE_ARMOR = Armor + REFINE_TYPE_WEAPON1 = Weapon Lv 1 + REFINE_TYPE_WEAPON2 = Weapon Lv 2 + REFINE_TYPE_WEAPON3 = Weapon Lv 3 + REFINE_TYPE_WEAPON4 = Weapon Lv 4 + REFINE_TYPE_SHADOW = Shadowgear + REFINE_TYPE_COSTUME = Costume + If is specified, it will replaces .@refinebb as default array. This script also returns 1 on success and 0 on failure or no info. diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 95eff7979ca..da951d13d78 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20551,13 +20551,13 @@ static inline bool clif_refineui_materials_sub( struct item *item, struct item_d return false; } - struct refine_cost *cost = status_get_refine_cost_(id->wlv, type); + struct refine_cost *cost = status_get_refine_cost_((enum refine_type)id->refine_type, type); if (!cost || !cost->refineui) return false; memcpy(&materials[index].cost, cost, sizeof(struct refine_cost)); // Get the chance for refining the item with this material - materials[index].chance = status_get_refine_chance( (enum refine_type)id->wlv, item->refine, type); + materials[index].chance = status_get_refine_chance((enum refine_type)id->refine_type, item->refine, type); // Either of the values was not set if( materials[index].cost.nameid == 0 || materials[index].cost.zeny == 0 || materials[index].chance == 0 ){ @@ -20629,7 +20629,7 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ id = sd->inventory_data[index]; // No item data was found - if( id == NULL ){ + if( id == NULL || id->refine_type == REFINE_TYPE_MAX){ return; } @@ -20639,11 +20639,6 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){ return; } - // Only weapons and armors can be refined in the refine UI - if( id->type != IT_WEAPON && id->type != IT_ARMOR ){ - return; - } - // Check the inventory item = &sd->inventory.u.items_inventory[index]; @@ -20748,7 +20743,7 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ id = sd->inventory_data[index]; // No item data was found - if( id == NULL ){ + if( id == NULL || id->refine_type == REFINE_TYPE_MAX){ return; } @@ -20757,11 +20752,6 @@ void clif_parse_refineui_refine( int fd, struct map_session_data* sd ){ return; } - // Only weapons and armors can be refined in the refine UI - if( id->type != IT_WEAPON && id->type != IT_ARMOR ){ - return; - } - // Check the inventory item = &sd->inventory.u.items_inventory[index]; diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index d791292b8fe..47e1e473a76 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -1247,6 +1247,16 @@ static void itemdb_re_split_atoi(char *str, int *val1, int *val2) { return; } +static inline uint8 itemdb_set_refine_type(int type, int wlv, int loc) { + if (type == IT_WEAPON) + return (enum refine_type)wlv; + if (type == IT_ARMOR) + return (loc&EQP_COSTUME) ? REFINE_TYPE_COSTUME : REFINE_TYPE_ARMOR; + if (type == IT_SHADOWGEAR) + return REFINE_TYPE_SHADOW; + return REFINE_TYPE_MAX; +} + /** * Processes one itemdb entry */ @@ -1381,6 +1391,8 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr if (*str[21]) id->unequip_script = parse_script(str[21], source, line, scriptopt); + id->refine_type = itemdb_set_refine_type(id->type, id->wlv, id->equip); + if (!id->nameid) { id->nameid = nameid; uidb_put(itemdb, nameid, id); diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 6942551f986..c287d4da7d5 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -861,6 +861,7 @@ struct item_data struct item_combo **combos; unsigned char combos_count; short delay_sc; ///< Use delay group if any instead using player's item_delay data [Cydh] + uint8 refine_type; /// pre-defined refine type, depreciate wlv for refine_info[] lookup. REFINE_TYPE_MAX for not IT_WEAPON, IT_ARMOR, or IT_SHADOWGEAR }; // Struct for item random option [Secret] diff --git a/src/map/script.cpp b/src/map/script.cpp index e25a564be12..9cdf2ab12de 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -8858,10 +8858,7 @@ BUILDIN_FUNC(getequippercentrefinery) if (equip_index_check(num)) i = pc_checkequip(sd,equip_bitmask[num]); if (i >= 0 && sd->inventory.u.items_inventory[i].nameid && sd->inventory.u.items_inventory[i].refine < MAX_REFINE) { - enum refine_type type = REFINE_TYPE_SHADOW; - if (sd->inventory_data[i]->type != IT_SHADOWGEAR) - type = (enum refine_type)sd->inventory_data[i]->wlv; - script_pushint(st, status_get_refine_chance(type, (int)sd->inventory.u.items_inventory[i].refine, cost_type)); + script_pushint(st, status_get_refine_chance((enum refine_type)sd->inventory_data[i]->refine_type, (int)sd->inventory.u.items_inventory[i].refine, cost_type)); } else script_pushint(st,0); @@ -23460,15 +23457,7 @@ BUILDIN_FUNC(getequiprefinecost) { return SCRIPT_CMD_SUCCESS; } - int weapon_lv = sd->inventory_data[i]->wlv; - if (sd->inventory_data[i]->type == IT_SHADOWGEAR) { - if (sd->inventory_data[i]->equip == EQP_SHADOW_WEAPON) - weapon_lv = REFINE_TYPE_WEAPON4; - else - weapon_lv = REFINE_TYPE_SHADOW; - } - - script_pushint(st, status_get_refine_cost(weapon_lv, type, (enum refine_info_type)info)); + script_pushint(st, status_get_refine_cost((enum refine_type)sd->inventory_data[i]->refine_type, type, (enum refine_info_type)info)); return SCRIPT_CMD_SUCCESS; } diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index fe5ef0578c8..4ad6b11de6e 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -7258,6 +7258,14 @@ export_constant(MD_STATUS_IMMUNE); export_constant(MD_SKILL_IMMUNE); + export_constant(REFINE_TYPE_ARMOR); + export_constant(REFINE_TYPE_WEAPON1); + export_constant(REFINE_TYPE_WEAPON2); + export_constant(REFINE_TYPE_WEAPON3); + export_constant(REFINE_TYPE_WEAPON4); + export_constant(REFINE_TYPE_SHADOW); + export_constant(REFINE_TYPE_COSTUME); + /* guild storage flags */ export_constant(GSTORAGE_OPEN); export_constant(GSTORAGE_STORAGE_ALREADY_OPEN); diff --git a/src/map/skill.cpp b/src/map/skill.cpp index b38b969762e..8b674313db3 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -16817,7 +16817,7 @@ void skill_weaponrefine(struct map_session_data *sd, int idx) clif_upgrademessage(sd->fd, 3, material[ditem->wlv]); return; } - per = status_get_refine_chance(static_cast(ditem->wlv), (int)item->refine, REFINE_COST_NORMAL); + per = status_get_refine_chance(static_cast(ditem->refine_type), (int)item->refine, REFINE_COST_NORMAL); if( sd->class_&JOBL_THIRD ) per += 10; else diff --git a/src/map/status.cpp b/src/map/status.cpp index 312af58b984..8a8f0f86006 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -3535,8 +3535,8 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt) struct weapon_data *wd; struct weapon_atk *wa; - if(wlv >= REFINE_TYPE_MAX) - wlv = REFINE_TYPE_MAX - 1; + if(wlv >= REFINE_TYPE_WEAPON4) + wlv = REFINE_TYPE_WEAPON4 - 1; if(i == EQI_HAND_L && sd->inventory.u.items_inventory[index].equip == EQP_HAND_L) { wd = &sd->left_weapon; // Left-hand weapon wa = &base_status->lhw; @@ -3546,15 +3546,15 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt) } wa->atk += sd->inventory_data[index]->atk; if(r) - wa->atk2 = refine_info[wlv].bonus[r-1] / 100; + wa->atk2 = refine_info[sd->inventory_data[index]->refine_type].bonus[r-1] / 100; #ifdef RENEWAL wa->matk += sd->inventory_data[index]->matk; wa->wlv = wlv; if(r && sd->weapontype1 != W_BOW) // Renewal magic attack refine bonus - wa->matk += refine_info[wlv].bonus[r-1] / 100; + wa->matk += refine_info[sd->inventory_data[index]->refine_type].bonus[r-1] / 100; #endif if(r) // Overrefine bonus. - wd->overrefine = refine_info[wlv].randombonus_max[r-1] / 100; + wd->overrefine = refine_info[sd->inventory_data[index]->refine_type].randombonus_max[r-1] / 100; wa->range += sd->inventory_data[index]->range; if(sd->inventory_data[index]->script && (pc_has_permission(sd,PC_PERM_USE_ALL_EQUIPMENT) || !itemdb_isNoEquip(sd->inventory_data[index],sd->bl.m))) { if (wd == &sd->left_weapon) { @@ -3582,7 +3582,7 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt) int r; if ( (r = sd->inventory.u.items_inventory[index].refine) ) - refinedef += refine_info[REFINE_TYPE_ARMOR].bonus[r-1]; + refinedef += refine_info[sd->inventory_data[index]->refine_type].bonus[r-1]; if(sd->inventory_data[index]->script && (pc_has_permission(sd,PC_PERM_USE_ALL_EQUIPMENT) || !itemdb_isNoEquip(sd->inventory_data[index],sd->bl.m))) { if( i == EQI_HAND_L ) // Shield sd->state.lr_flag = 3; @@ -14316,7 +14316,7 @@ static TIMER_FUNC(status_natural_heal_timer){ * @param type: refine type for cost & rate * @return The chance to refine the item, in percent (0~100) */ -int status_get_refine_chance(enum refine_type wlv, int refine, enum refine_cost_type type) +int status_get_refine_chance(enum refine_type refine_type, int refine, enum refine_cost_type type) { if (refine < 0 || refine >= MAX_REFINE) return 0; @@ -14324,7 +14324,7 @@ int status_get_refine_chance(enum refine_type wlv, int refine, enum refine_cost_ if (type < REFINE_COST_NORMAL || type >= REFINE_COST_MAX) return 0; - return refine_info[wlv].chance[type][refine]; + return refine_info[refine_type].chance[type][refine]; } /** @@ -14339,7 +14339,7 @@ bool status_get_refine_blacksmithBlessing(struct refine_bs_blessing* bs, enum re if (refine < 0 || refine >= MAX_REFINE) return false; - if (type < REFINE_TYPE_ARMOR || type > REFINE_TYPE_SHADOW) + if (type < REFINE_TYPE_ARMOR || type >= REFINE_TYPE_MAX) return false; memcpy(bs, &refine_info[type].bs_blessing[refine], sizeof(struct refine_bs_blessing)); @@ -14454,7 +14454,7 @@ static bool status_readdb_sizefix(char* fields[], int columns, int current) * @param file_name: File name for displaying only * @return True on success or false on failure */ -static bool status_yaml_readdb_refine_sub(const YAML::Node &node, int refine_info_index, const std::string &file_name) { +static bool status_yaml_readdb_refine_sub(const YAML::Node &node, enum refine_type refine_info_index, const std::string &file_name) { if (refine_info_index < 0 || refine_info_index >= REFINE_TYPE_MAX) return false; @@ -14573,7 +14573,18 @@ static bool status_yaml_readdb_refine_sub(const YAML::Node &node, int refine_inf */ static void status_yaml_readdb_refine(const std::string &directory, const std::string &file) { int count = 0; - const std::string labels[] = { "Armor", "WeaponLv1", "WeaponLv2", "WeaponLv3", "WeaponLv4", "Shadow" }; + struct s_labels { + enum refine_type type; + const std::string label; + } labels[] = { + { REFINE_TYPE_ARMOR, "Armor"}, + { REFINE_TYPE_WEAPON1, "WeaponLv1" }, + { REFINE_TYPE_WEAPON2, "WeaponLv2" }, + { REFINE_TYPE_WEAPON3, "WeaponLv3" }, + { REFINE_TYPE_WEAPON4, "WeaponLv4" }, + { REFINE_TYPE_SHADOW, "Shadow" }, + { REFINE_TYPE_COSTUME, "Costume" }, + }; const std::string current_file = directory + "/" + file; YAML::Node config; @@ -14586,9 +14597,9 @@ static void status_yaml_readdb_refine(const std::string &directory, const std::s } for (int i = 0; i < ARRAYLENGTH(labels); i++) { - const YAML::Node &node = config[labels[i]]; + const YAML::Node &node = config[labels[i].label]; - if (node.IsDefined() && status_yaml_readdb_refine_sub(node, i, current_file)) + if (node.IsDefined() && status_yaml_readdb_refine_sub(node, labels[i].type, current_file)) count++; } ShowStatus("Done reading '" CL_WHITE "%d" CL_RESET "' entries in '" CL_WHITE "%s" CL_RESET "'.\n", count, current_file.c_str()); @@ -14596,30 +14607,30 @@ static void status_yaml_readdb_refine(const std::string &directory, const std::s /** * Returns refine cost (zeny or item) for a weapon level. - * @param weapon_lv Weapon level + * @param refine_type Refine type see enum refine_type * @param type Refine type (can be retrieved from refine_cost_type enum) * @param what true = returns zeny, false = returns item id * @return Refine cost for a weapon level */ -int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what) { +int status_get_refine_cost(enum refine_type refine_type, int type, enum refine_info_type what) { switch( what ){ case REFINE_MATERIAL_ID: - return refine_info[weapon_lv].cost[type].nameid; + return refine_info[refine_type].cost[type].nameid; case REFINE_ZENY_COST: - return refine_info[weapon_lv].cost[type].zeny; + return refine_info[refine_type].cost[type].zeny; case REFINE_REFINEUI_ENABLED: - return refine_info[weapon_lv].cost[type].refineui; + return refine_info[refine_type].cost[type].refineui; } return 0; } -struct refine_cost *status_get_refine_cost_(int weapon_lv, int type) { - if (weapon_lv < REFINE_TYPE_ARMOR || weapon_lv >= REFINE_TYPE_MAX) +struct refine_cost *status_get_refine_cost_(enum refine_type refine_type, int type) { + if (refine_type < REFINE_TYPE_ARMOR || refine_type >= REFINE_TYPE_MAX) return NULL; if (type < REFINE_COST_NORMAL || type >= REFINE_COST_MAX) return NULL; - return &refine_info[weapon_lv].cost[type]; + return &refine_info[refine_type].cost[type]; } /** diff --git a/src/map/status.hpp b/src/map/status.hpp index 1c5253830c8..f999703883c 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -35,7 +35,8 @@ enum refine_type { REFINE_TYPE_WEAPON3 = 3, REFINE_TYPE_WEAPON4 = 4, REFINE_TYPE_SHADOW = 5, - REFINE_TYPE_MAX = 6 + REFINE_TYPE_COSTUME = 6, + REFINE_TYPE_MAX }; /// Refine cost & chance type @@ -74,10 +75,10 @@ struct refine_bs_blessing { }; /// Get refine chance -int status_get_refine_chance(enum refine_type wlv, int refine, enum refine_cost_type type); -int status_get_refine_cost(int weapon_lv, int type, enum refine_info_type what); +int status_get_refine_chance(enum refine_type refine_type, int refine, enum refine_cost_type type); +int status_get_refine_cost(enum refine_type refine_type, int type, enum refine_info_type what); bool status_get_refine_blacksmithBlessing(struct refine_bs_blessing* bs, enum refine_type type, int refine); -struct refine_cost *status_get_refine_cost_(int weapon_lv, int type); +struct refine_cost *status_get_refine_cost_(enum refine_type refine_type, int type); /// Status changes listing. These code are for use by the server. enum sc_type : int16 { From e56dba8cbc9d9e2428f4748683c4a7c788b5088e Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sun, 2 Sep 2018 18:47:14 +0700 Subject: [PATCH 25/27] Refine DB Updates * follow up bc00ff777e0882f622830cee44ca59a406502362 * Added forgotten 'ShadowWeapon' type --- db/pre-re/refine_db.yml | 132 ++++++++++++++++++++++++++++++++++++++++ db/re/refine_db.yml | 129 +++++++++++++++++++++++++++++++++++++++ src/map/itemdb.cpp | 2 +- src/map/status.cpp | 1 + src/map/status.hpp | 15 ++--- 5 files changed, 271 insertions(+), 8 deletions(-) diff --git a/db/pre-re/refine_db.yml b/db/pre-re/refine_db.yml index f9c7c3d8d51..24dff1bc0d7 100644 --- a/db/pre-re/refine_db.yml +++ b/db/pre-re/refine_db.yml @@ -598,6 +598,28 @@ Shadow: StatsPerLevel: 0 RandomBonusStartLevel: 0 RandomBonusValue: 0 + Costs: + - Type: REFINE_COST_NORMAL + Price: 20000 + Material: 985 + RefineUI: true + - Type: REFINE_COST_HD + Price: 20000 + Material: 6241 + RefineUI: true + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_ENRICHED + Price: 20000 + Material: 7619 + RefineUI: true + # 'Event' rates + - Type: REFINE_COST_EVT_ENRICHED + Price: 20000 + Material: 7619 + RefineUI: false Rates: - Level: 1 Chances: @@ -679,3 +701,113 @@ Shadow: Rate: 20 - Type: REFINE_COST_EVT_ENRICHED Rate: 35 +ShadowWeapon: + StatsPerLevel: 0 + RandomBonusStartLevel: 0 + RandomBonusValue: 0 + Costs: + - Type: REFINE_COST_NORMAL + Price: 20000 + Material: 984 + - Type: REFINE_COST_HD + Price: 20000 + Material: 6240 + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_ENRICHED + Price: 2000 + Material: 7620 + # 'Event' rates + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false + Rates: + - Level: 1 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 2 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 3 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 4 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 5 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 + - Level: 6 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + - Level: 7 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + - Level: 8 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 + - Level: 9 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 + - Level: 10 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_HD + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 diff --git a/db/re/refine_db.yml b/db/re/refine_db.yml index 72ea1399b18..b2280dc8f4a 100644 --- a/db/re/refine_db.yml +++ b/db/re/refine_db.yml @@ -1619,6 +1619,11 @@ Shadow: Price: 20000 Material: 7619 RefineUI: true + # 'Event' rates + - Type: REFINE_COST_EVT_ENRICHED + Price: 20000 + Material: 7619 + RefineUI: false Rates: - Level: 1 Chances: @@ -1720,3 +1725,127 @@ Shadow: # BlacksmithBlessing: # ItemID: 6635 # Count: 7 +ShadowWeapon: + StatsPerLevel: 0 + RandomBonusStartLevel: 0 + RandomBonusValue: 0 + Costs: + - Type: REFINE_COST_NORMAL + Price: 20000 + Material: 984 + - Type: REFINE_COST_HD + Price: 20000 + Material: 6240 + OnFail: + Break: 0 + DownRefine: 100 + DownRefineNum: 1 + - Type: REFINE_COST_ENRICHED + Price: 2000 + Material: 7620 + # 'Event' rates + - Type: REFINE_COST_EVT_ENRICHED + Price: 2000 + Material: 7620 + RefineUI: false + Rates: + - Level: 1 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 2 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 3 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 4 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 100 + - Type: REFINE_COST_ENRICHED + Rate: 100 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 100 + - Level: 5 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 60 + - Type: REFINE_COST_ENRICHED + Rate: 90 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 95 + - Level: 6 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + - Level: 7 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 40 + - Type: REFINE_COST_ENRICHED + Rate: 70 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 80 + - Level: 8 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 60 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 1 + - Level: 9 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 20 + - Type: REFINE_COST_HD + Rate: 20 + - Type: REFINE_COST_ENRICHED + Rate: 40 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 50 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 2 + - Level: 10 + Chances: + - Type: REFINE_COST_NORMAL + Rate: 9 + - Type: REFINE_COST_HD + Rate: 9 + - Type: REFINE_COST_ENRICHED + Rate: 20 + - Type: REFINE_COST_EVT_ENRICHED + Rate: 35 + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 4 + #- Level: 11 + # Chances: + # BlacksmithBlessing: + # ItemID: 6635 + # Count: 7 diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index 47e1e473a76..251d574da39 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -1253,7 +1253,7 @@ static inline uint8 itemdb_set_refine_type(int type, int wlv, int loc) { if (type == IT_ARMOR) return (loc&EQP_COSTUME) ? REFINE_TYPE_COSTUME : REFINE_TYPE_ARMOR; if (type == IT_SHADOWGEAR) - return REFINE_TYPE_SHADOW; + return (loc == EQP_SHADOW_WEAPON) ? REFINE_TYPE_SHADOW_WEAPON : REFINE_TYPE_SHADOW; return REFINE_TYPE_MAX; } diff --git a/src/map/status.cpp b/src/map/status.cpp index 8a8f0f86006..993bbeaf0b2 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -14583,6 +14583,7 @@ static void status_yaml_readdb_refine(const std::string &directory, const std::s { REFINE_TYPE_WEAPON3, "WeaponLv3" }, { REFINE_TYPE_WEAPON4, "WeaponLv4" }, { REFINE_TYPE_SHADOW, "Shadow" }, + { REFINE_TYPE_SHADOW_WEAPON, "ShadowWeapon" }, { REFINE_TYPE_COSTUME, "Costume" }, }; const std::string current_file = directory + "/" + file; diff --git a/src/map/status.hpp b/src/map/status.hpp index f999703883c..b66ab136080 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -29,13 +29,14 @@ struct status_change; /// Refine type enum refine_type { - REFINE_TYPE_ARMOR = 0, - REFINE_TYPE_WEAPON1 = 1, - REFINE_TYPE_WEAPON2 = 2, - REFINE_TYPE_WEAPON3 = 3, - REFINE_TYPE_WEAPON4 = 4, - REFINE_TYPE_SHADOW = 5, - REFINE_TYPE_COSTUME = 6, + REFINE_TYPE_ARMOR = 0, + REFINE_TYPE_WEAPON1, + REFINE_TYPE_WEAPON2, + REFINE_TYPE_WEAPON3, + REFINE_TYPE_WEAPON4, + REFINE_TYPE_SHADOW, + REFINE_TYPE_SHADOW_WEAPON, + REFINE_TYPE_COSTUME, REFINE_TYPE_MAX }; From a07093999c877761ee7de61fbd593d3056bd1721 Mon Sep 17 00:00:00 2001 From: Cydh Date: Sun, 4 Aug 2019 11:12:01 +0700 Subject: [PATCH 26/27] Set feature.refineui to 3 --- conf/battle/feature.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf index 8fae98ec157..57d1c7a351f 100644 --- a/conf/battle/feature.conf +++ b/conf/battle/feature.conf @@ -109,4 +109,4 @@ feature.privateairship: on // 0 = Disabled // 1 = Enabled // 2 = Enabled in existing official scripts (old dialogs were removed and replaced by the UI) -feature.refineui: 2 +feature.refineui: 3 From 5c726644b087d554f9cda984d03657331f2da3dd Mon Sep 17 00:00:00 2001 From: Cydh Date: Thu, 23 Apr 2020 02:12:18 +0700 Subject: [PATCH 27/27] follow up 2cae7f359029214921889fb180238b1437ea23e0 --- src/map/script.cpp | 8 ++++---- src/map/status.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/script.cpp b/src/map/script.cpp index b84c48a0b92..b0e8f272174 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -24575,12 +24575,12 @@ BUILDIN_FUNC(getblacksmithblessing) { if (data && data_isreference(data)) { name = reference_getname(data); - setd_sub(st, NULL, name, 0, (void *)__64BPRTSIZE((int)bb.nameid), data->ref); - setd_sub(st, NULL, name, 1, (void *)__64BPRTSIZE((int)bb.count), data->ref); + setd_sub_num(st, NULL, name, 0, bb.nameid, data->ref); + setd_sub_num(st, NULL, name, 1, bb.count, data->ref); } else { - setd_sub(st, NULL, ".@refinebb", 0, (void *)__64BPRTSIZE((int)bb.nameid), NULL); - setd_sub(st, NULL, ".@refinebb", 1, (void *)__64BPRTSIZE((int)bb.count), NULL); + setd_sub_num(st, NULL, ".@refinebb", 0, bb.nameid, NULL); + setd_sub_num(st, NULL, ".@refinebb", 1, bb.count, NULL); } script_pushint(st, (bb.nameid) ? 1 : 0); return SCRIPT_CMD_SUCCESS; diff --git a/src/map/status.cpp b/src/map/status.cpp index 10dcd097b5c..d23575323bf 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -15428,7 +15428,7 @@ static bool status_yaml_readdb_refine_sub(const YAML::Node &node, enum refine_ty } std::string chance_type = chance["Type"].as(); - int chance_idx = 0; + int64 chance_idx = 0; if (!script_get_constant(chance_type.c_str(), &chance_idx)) { ShowWarning("status_yaml_readdb_refine_sub: Invalid Chance Type " CL_WHITE "%s" CL_RESET "in file" CL_WHITE "%s" CL_RESET ".\n", chance_type.c_str(), file_name.c_str()); continue;