From c1ef0aa4ce9393e351a7c20bf3b213ccbc393dac Mon Sep 17 00:00:00 2001 From: aleos89 Date: Fri, 31 Mar 2017 12:24:24 -0400 Subject: [PATCH 1/7] Fixed invalid vending items being saved * Fixes #2030 * Resolves a potential case of an invalid item being saved to the vending table resulting in a random item being sold for 0 zeny. Thanks to @Tokeiburu! --- src/map/vending.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/vending.c b/src/map/vending.c index 0b3d16b551..54b1713d89 100755 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -353,9 +353,9 @@ int8 vending_openvending(struct map_session_data* sd, const char* message, const StringBuf_Init(&buf); StringBuf_Printf(&buf, "INSERT INTO `%s`(`vending_id`,`index`,`cartinventory_id`,`amount`,`price`) VALUES", vending_items_table); - for (i = 0; i < count; i++) { - StringBuf_Printf(&buf, "(%d,%d,%d,%d,%d)", sd->vender_id, i, sd->cart.u.items_cart[sd->vending[i].index].id, sd->vending[i].amount, sd->vending[i].value); - if (i < count-1) + for (j = 0; j < i; j++) { + StringBuf_Printf(&buf, "(%d,%d,%d,%d,%d)", sd->vender_id, j, sd->cart.u.items_cart[sd->vending[j].index].id, sd->vending[j].amount, sd->vending[j].value); + if (j < i-1) StringBuf_AppendStr(&buf, ","); } if (SQL_ERROR == Sql_QueryStr(mmysql_handle, StringBuf_Value(&buf))) From e655a73815a93d2d44140a7b2f5cd327d9919b8b Mon Sep 17 00:00:00 2001 From: Aleos Date: Fri, 31 Mar 2017 12:40:53 -0400 Subject: [PATCH 2/7] Corrected a random option warning * Fixed a small typo in the itemdb_read_randomopt. --- src/map/itemdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 8e55162dc0..9f9557d258 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1605,7 +1605,7 @@ static bool itemdb_read_randomopt(const char* basedir, bool silent) { if (!strchr(p, ',')) { - ShowError("itemdb_read_combos: Insufficient columns in line %d of \"%s\", skipping.\n", lines, path); + ShowError("itemdb_read_randomopt: Insufficient columns in line %d of \"%s\", skipping.\n", lines, path); continue; } From 82967fceb49381d8f4d08e396f8916905bd8414e Mon Sep 17 00:00:00 2001 From: Atemo Date: Sat, 1 Apr 2017 16:42:39 +0200 Subject: [PATCH 3/7] Updated doc/sample/instancing.txt follow up https://github.com/rathena/rathena/commit/cb703c5bfafa8c1ef2a2dbeb5428c2df03e389f4 --- doc/sample/instancing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sample/instancing.txt b/doc/sample/instancing.txt index 5e175d87ee..07198c6c6c 100644 --- a/doc/sample/instancing.txt +++ b/doc/sample/instancing.txt @@ -10,7 +10,7 @@ // Before running this script, add the entry below to // 'db/(pre-)re/instance_db.txt': -// 12,Abyss Lake Instance,3600,abyss_03,160,155,abyss_03 +// 100,Abyss Lake Instance,3600,300,abyss_03,160,155 // Instance Creation //============================================================ From f0b7feb3f68d5017e99d08df3550beadd2d84cc9 Mon Sep 17 00:00:00 2001 From: Jeybla Date: Mon, 3 Apr 2017 15:31:22 +0200 Subject: [PATCH 4/7] Makes Breeze Armor (Shadow) 24024 refineable. (#2034) --- 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 9407805a33..1f8a583de5 100644 --- a/db/re/item_db.txt +++ b/db/re/item_db.txt @@ -11126,7 +11126,7 @@ 24021,S_Magical_Earring,Magical Earring (Shadow),12,0,,0,,0,,0,0xFFFFFFFF,63,2,1048576,,1,1,0,{ bonus bVariableCastrate,-(getrefine()>=7)?2:1; },{},{} 24022,S_Magical_Weapon,Magical Weapon (Shadow),12,0,,0,,0,,0,0xFFFFFFFF,63,2,131072,,1,1,0,{ bonus bMatk,10; if(getrefine()>=7) { bonus bMatkRate,1; } },{},{} 24023,S_Magical_Pendant,Magical Pencil (Shadow),12,0,,0,,0,,0,0xFFFFFFFF,63,2,2097152,,1,1,0,{ bonus bMaxSP,50; if(getrefine()>=7) { bonus bMaxSPrate,1; } },{},{} -24024,S_Breezy_Armor,Breeze Armor (Shadow),12,0,,0,,,,0,0xFFFFFFFF,63,2,65536,,1,,,{ bonus bFlee,5+(getrefine()>=7 ? 10 : 0); },{},{} +24024,S_Breezy_Armor,Breeze Armor (Shadow),12,0,,0,,,,0,0xFFFFFFFF,63,2,65536,,1,1,0,{ bonus bFlee,5+(getrefine()>=7 ? 10 : 0); },{},{} 24025,S_Champion_Shoes,Champion Shoes (Shadow),12,0,,0,,0,,0,0xFFFFFFFF,63,2,524288,,1,1,0,{ bonus bMaxHP,20; bonus bMaxSP,20; if(getrefine()>=7) { bonus bMaxHP,1; bonus bMaxSP,1; } },{},{} 24026,S_Athena_Shield,Athena Shield (Shadow),12,0,,0,,0,,0,0xFFFFFFFF,63,2,262144,,1,1,0,{ bonus bDef,(getrefine()>=7)?20:10; },{},{} 24027,S_Immune_Armor,Immune Shadow Armor,12,0,,0,,0,,0,0xFFFFFFFF,63,2,65536,,1,1,0,{ bonus2 bSubEle,0,1; },{},{} From 6d589468647c3e2c7211488a3233dbf71cc59482 Mon Sep 17 00:00:00 2001 From: rAthenaAPI Date: Mon, 3 Apr 2017 15:31:27 +0200 Subject: [PATCH 5/7] 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 c2907b751e..60e8f4598a 100644 --- a/sql-files/item_db_re.sql +++ b/sql-files/item_db_re.sql @@ -11158,7 +11158,7 @@ REPLACE INTO `item_db_re` VALUES (24020,'S_Physical_Pendant','Physical Pendant ( REPLACE INTO `item_db_re` VALUES (24021,'S_Magical_Earring','Magical Earring (Shadow)',12,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,1048576,NULL,'1',1,0,'bonus bVariableCastrate,-(getrefine()>=7)?2:1;',NULL,NULL); REPLACE INTO `item_db_re` VALUES (24022,'S_Magical_Weapon','Magical Weapon (Shadow)',12,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,131072,NULL,'1',1,0,'bonus bMatk,10; if(getrefine()>=7) { bonus bMatkRate,1; }',NULL,NULL); REPLACE INTO `item_db_re` VALUES (24023,'S_Magical_Pendant','Magical Pencil (Shadow)',12,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,2097152,NULL,'1',1,0,'bonus bMaxSP,50; if(getrefine()>=7) { bonus bMaxSPrate,1; }',NULL,NULL); -REPLACE INTO `item_db_re` VALUES (24024,'S_Breezy_Armor','Breeze Armor (Shadow)',12,0,NULL,0,NULL,NULL,NULL,0,0xFFFFFFFF,63,2,65536,NULL,'1',NULL,NULL,'bonus bFlee,5+(getrefine()>=7 ? 10 : 0);',NULL,NULL); +REPLACE INTO `item_db_re` VALUES (24024,'S_Breezy_Armor','Breeze Armor (Shadow)',12,0,NULL,0,NULL,NULL,NULL,0,0xFFFFFFFF,63,2,65536,NULL,'1',1,0,'bonus bFlee,5+(getrefine()>=7 ? 10 : 0);',NULL,NULL); REPLACE INTO `item_db_re` VALUES (24025,'S_Champion_Shoes','Champion Shoes (Shadow)',12,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,524288,NULL,'1',1,0,'bonus bMaxHP,20; bonus bMaxSP,20; if(getrefine()>=7) { bonus bMaxHP,1; bonus bMaxSP,1; }',NULL,NULL); REPLACE INTO `item_db_re` VALUES (24026,'S_Athena_Shield','Athena Shield (Shadow)',12,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,262144,NULL,'1',1,0,'bonus bDef,(getrefine()>=7)?20:10;',NULL,NULL); REPLACE INTO `item_db_re` VALUES (24027,'S_Immune_Armor','Immune Shadow Armor',12,0,NULL,0,NULL,0,NULL,0,0xFFFFFFFF,63,2,65536,NULL,'1',1,0,'bonus2 bSubEle,0,1;',NULL,NULL); From 5d90380fcc0a730f3662cb4725ddc8225db28a74 Mon Sep 17 00:00:00 2001 From: Playtester Date: Mon, 3 Apr 2017 20:33:55 +0200 Subject: [PATCH 6/7] Claymore Trap, Blast Mine, Land Mine renewal damage (fixes #2036) - Fixed a rounding issue when calculating trap damage --- src/map/battle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/battle.c b/src/map/battle.c index d6e6acfd28..6090b89a4c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6353,7 +6353,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * case MA_LANDMINE: case HT_BLASTMINE: case HT_CLAYMORETRAP: - md.damage = skill_lv * sstatus->dex * (3 + status_get_lv(src) / 100) * (1 + sstatus->int_ / 35); + md.damage = skill_lv * sstatus->dex * (3.0 + (float)status_get_lv(src) / 100.0) * (1.0 + (float)sstatus->int_ / 35.0); md.damage += md.damage * (rnd()%20 - 10) / 100; md.damage += (sd ? pc_checkskill(sd,RA_RESEARCHTRAP) * 40 : 0); break; From 4369b4715b0172db964df8172fea49b891157829 Mon Sep 17 00:00:00 2001 From: Playtester Date: Mon, 3 Apr 2017 20:40:09 +0200 Subject: [PATCH 7/7] Fixed compiler warning (follow-up to 5d90380) --- src/map/battle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/battle.c b/src/map/battle.c index 6090b89a4c..c036375f42 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6353,7 +6353,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * case MA_LANDMINE: case HT_BLASTMINE: case HT_CLAYMORETRAP: - md.damage = skill_lv * sstatus->dex * (3.0 + (float)status_get_lv(src) / 100.0) * (1.0 + (float)sstatus->int_ / 35.0); + md.damage = (int64)(skill_lv * sstatus->dex * (3.0 + (float)status_get_lv(src) / 100.0) * (1.0 + (float)sstatus->int_ / 35.0)); md.damage += md.damage * (rnd()%20 - 10) / 100; md.damage += (sd ? pc_checkskill(sd,RA_RESEARCHTRAP) * 40 : 0); break;