From 052b9bc81976d2cd3c3930b92bcbaeb4ab5e0938 Mon Sep 17 00:00:00 2001 From: anity99 <32048650+anity99@users.noreply.github.com> Date: Sat, 23 Sep 2017 01:19:50 +0700 Subject: [PATCH 01/11] Fix duplicate location (#2442) * Corrected Shadow Blacksmith overlapping with Mighty Hammer. Thanks to @anity99! --- npc/re/merchants/shadow_refiner.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index 603ff2dd23..f867c7f154 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -140,4 +140,4 @@ } //moc_paraup,45,185,5 duplicate(ShadowBlacksmith) Shadow Blacksmith#eden1 4_F_JOB_BLACKSMITH // Commented out until it's added to the map index -prt_in,59,54,3 duplicate(ShadowBlacksmith) Shadow Blacksmith#itemmall 4_F_JOB_BLACKSMITH +prt_in,61,54,3 duplicate(ShadowBlacksmith) Shadow Blacksmith#itemmall 4_F_JOB_BLACKSMITH From cd43f32ffbeb8ee6c7292a9f0af1cf0697a76f28 Mon Sep 17 00:00:00 2001 From: Vincent Stumpf Date: Sun, 24 Sep 2017 06:53:40 -0700 Subject: [PATCH 02/11] Shadow Refiner and getequiprefinecost (#2447) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixes #2445 and fixes #2446. * Fixed shadow refiner. — The script uses the values of the array instead of the indexes to loop through it. * Fixed segfault in getequiprefinecost. — No checks in getequiprefinecost meant there were possibilities using negative indexes in arrays. * Added to the script documentation what happens on failure when calling getequiprefinecost (it returns -1). Thanks to @vstmpf, @crazystorm2017, and @hendra814! --- doc/script_commands.txt | 3 +++ npc/re/merchants/shadow_refiner.txt | 19 ++++++++++++++----- src/map/script.cpp | 11 +++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 4ef760762d..0b7f35f6a4 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2760,6 +2760,9 @@ Valid information types are: 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. + --------------------------------------- *getareadropitem("",,,,,) diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index f867c7f154..0f30a819a5 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -15,12 +15,12 @@ mes "Do you want to refine a shadow item? Pick yer poison!"; next; setarray .@indices[1], EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON, EQI_SHADOW_SHIELD, EQI_SHADOW_SHOES, EQI_SHADOW_ACC_R, EQI_SHADOW_ACC_L; - for(.@i = 1; .@i <= EQI_SHADOW_ACC_L; .@i++) + .@indlen = getarraysize(.@indices) - 1; + for(.@i = 1; .@i <= .@indlen; .@i++) .@menu$ = .@menu$ + (getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Not equipped]") +":"; .@menu$ = .@menu$ + "Refine info"; - .@part = .@indices[select(.@menu$)]; - - if (.@part == EQI_SHADOW_ACC_L + 1) { // Refine info + .@choice = select(.@menu$); + if (.@choice == .@indlen + 1) { // Refine info mes "[Shadow Blacksmith]"; mes "When a shadow item is refined, it gains extra bonuses very much like normal items."; next; @@ -35,6 +35,15 @@ mes "HD ores can be used for gear that is at least refine level +7 and will prevent breaking as long as you stay talking to me."; close; } + + .@part = .@indices[.@choice]; + + if (!getequipisequiped(.@part)) { + mes "[Shadow Blacksmith]"; + mes "There's nothing here!"; + close; + } + while(1) { mes "[Shadow Blacksmith]"; mes "I require " + callfunc("F_InsertComma", .@zeny_cost) + " zeny as a fee for EACH refine attempt."; @@ -84,7 +93,7 @@ .@choose = .@material[.@option-1]; if (!countitem(.@choose)) { mes "[Shadow Blacksmith]"; - mes "You do not have enough "+ getitemname(.@choose) +" / "+ getitemname(.@choose) +"."; + mes "You do not have enough "+ getitemname(.@choose) +"."; close; } if (Zeny < .@zeny_cost) { diff --git a/src/map/script.cpp b/src/map/script.cpp index 2f326280b4..aa7e2f8c96 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -23565,6 +23565,7 @@ BUILDIN_FUNC(achievementupdate) { /** * Get an equipment's refine cost * getequiprefinecost(,,{,}) + * returns -1 on fail */ BUILDIN_FUNC(getequiprefinecost) { int i = -1, slot, type, info; @@ -23579,9 +23580,19 @@ BUILDIN_FUNC(getequiprefinecost) { return SCRIPT_CMD_FAILURE; } + if (type < 0 || type >= REFINE_COST_MAX) { + script_pushint(st, -1); + return SCRIPT_CMD_SUCCESS; + } + if (equip_index_check(slot)) i = pc_checkequip(sd, equip_bitmask[slot]); + if (i < 0) { + script_pushint(st, -1); + 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) From 549d6f5b55faeb28f8d450eb7825196b9eb5f616 Mon Sep 17 00:00:00 2001 From: aleos89 Date: Tue, 26 Sep 2017 10:32:35 -0400 Subject: [PATCH 03/11] Corrected Bawaya Agimat Tattoo item bonus * Fixes #2422. * Adjusted bonus from variable cast time to fixed cast time. Thanks to @esu1214! --- db/re/item_db.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/re/item_db.txt b/db/re/item_db.txt index a1382a9420..2400920f81 100644 --- a/db/re/item_db.txt +++ b/db/re/item_db.txt @@ -2110,7 +2110,7 @@ 2904,Naqsh,Naqsi,4,0,,0,,0,,0,0xFFFFFFFF,63,2,136,,0,0,0,{ skill "BS_MAXIMIZE",5; skill "BS_WEAPONPERFECT",5; skill "WL_RECOGNIZEDSPELL",5; skill "ECL_SNOWFLIP",1; skill "ECL_PEONYMAMY",1; skill "ECL_SADAGUI",1; skill "ECL_SEQUOIADUST",1; bonus2 bSkillCooldown,"WL_RECOGNIZEDSPELL",-180000; bonus bDelayRate,-100; },{},{} 2905,Super_Ora_Ora,Super Ora Ora,4,0,,1000,,0,,0,0xFFFFFFFF,63,2,136,,0,0,0,{},{},{} 2906,Happy_Gauntlet,Happy Gauntlet,4,20,,1000,,3,,1,0xFFFFFFFF,63,2,136,,70,0,0,{ bonus bMdef,3; },{},{} -2907,Buwaya_Tattoo,Bawaya Agimat Tattoo,4,20,,100,,0,,0,0xFFFFFFFF,63,2,136,,1,0,0,{ bonus bMatkRate,7; bonus bVariableCastrate,-7; },{},{} +2907,Buwaya_Tattoo,Bawaya Agimat Tattoo,4,20,,100,,0,,0,0xFFFFFFFF,63,2,136,,1,0,0,{ bonus bMatkRate,7; bonus bFixedCastrate,-7; },{},{} 2908,Light_Ring,Light Ring,4,20,,100,,0,,1,0xFFFFFFFF,63,2,136,,0,0,0,{},{},{} 2909,Darkness_Ring,Darkness Ring,4,20,,100,,0,,1,0xFFFFFFFF,63,2,136,,0,0,0,{},{},{} 2910,Bakonawa_Tattoo,Bakunawa Agimat Tattoo,4,20,,100,,0,,0,0xFFFFFFFF,63,2,136,,1,0,0,{ bonus2 bAddClass,Class_All,7; bonus bAspdRate,10; },{},{} From 9b66c32ef7bd5087b0474b076158ddc3efc80a7c Mon Sep 17 00:00:00 2001 From: rAthenaAPI Date: Tue, 26 Sep 2017 16:32:54 +0200 Subject: [PATCH 04/11] SQL synchronization --- sql-files/item_db_re.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql index 9ca1aa9443..08848c4b18 100644 --- a/sql-files/item_db_re.sql +++ b/sql-files/item_db_re.sql @@ -2142,7 +2142,7 @@ REPLACE INTO `item_db_re` VALUES (2903,'Morpheus\'s_Armlet_','Morpheus\'s Armlet REPLACE INTO `item_db_re` VALUES (2904,'Naqsh','Naqsi',4,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,136,NULL,'0',0,0,'skill "BS_MAXIMIZE",5; skill "BS_WEAPONPERFECT",5; skill "WL_RECOGNIZEDSPELL",5; skill "ECL_SNOWFLIP",1; skill "ECL_PEONYMAMY",1; skill "ECL_SADAGUI",1; skill "ECL_SEQUOIADUST",1; bonus2 bSkillCooldown,"WL_RECOGNIZEDSPELL",-180000; bonus bDelayRate,-100;',NULL,NULL); REPLACE INTO `item_db_re` VALUES (2905,'Super_Ora_Ora','Super Ora Ora',4,0,NULL,1000,NULL,0,NULL,0,0xFFFFFFFF,63,2,136,NULL,'0',0,0,NULL,NULL,NULL); REPLACE INTO `item_db_re` VALUES (2906,'Happy_Gauntlet','Happy Gauntlet',4,20,NULL,1000,NULL,3,NULL,1,0xFFFFFFFF,63,2,136,NULL,'70',0,0,'bonus bMdef,3;',NULL,NULL); -REPLACE INTO `item_db_re` VALUES (2907,'Buwaya_Tattoo','Bawaya Agimat Tattoo',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,63,2,136,NULL,'1',0,0,'bonus bMatkRate,7; bonus bVariableCastrate,-7;',NULL,NULL); +REPLACE INTO `item_db_re` VALUES (2907,'Buwaya_Tattoo','Bawaya Agimat Tattoo',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,63,2,136,NULL,'1',0,0,'bonus bMatkRate,7; bonus bFixedCastrate,-7;',NULL,NULL); REPLACE INTO `item_db_re` VALUES (2908,'Light_Ring','Light Ring',4,20,NULL,100,NULL,0,NULL,1,0xFFFFFFFF,63,2,136,NULL,'0',0,0,NULL,NULL,NULL); REPLACE INTO `item_db_re` VALUES (2909,'Darkness_Ring','Darkness Ring',4,20,NULL,100,NULL,0,NULL,1,0xFFFFFFFF,63,2,136,NULL,'0',0,0,NULL,NULL,NULL); REPLACE INTO `item_db_re` VALUES (2910,'Bakonawa_Tattoo','Bakunawa Agimat Tattoo',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,63,2,136,NULL,'1',0,0,'bonus2 bAddClass,Class_All,7; bonus bAspdRate,10;',NULL,NULL); From 2572bbbcb9e87ef9d06c3f9e0ce4692a6a25d670 Mon Sep 17 00:00:00 2001 From: aleos Date: Tue, 26 Sep 2017 16:16:19 -0400 Subject: [PATCH 05/11] Updated script command callshop documentation * Fixes #2419. * Updated documentation to show that the option parameter only works on the 'shop' type NPC. Thanks to @anacondaqq! --- doc/script_commands.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 0b7f35f6a4..ae2bc4dc20 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -6537,6 +6537,8 @@ The options are: 1 = The buy window 2 = The sell window +Note: The