summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorSmokexyz <sagunxp@gmail.com>2015-08-29 15:04:04 +0530
committerSmokexyz <sagunxp@gmail.com>2015-10-02 00:42:13 +0530
commit993138361b5d712afbd7afee6aba5d5c52bdcc4f (patch)
treed5572d3a5291044e7f890c8f7b9b160c5a1d733f /db
parentf7a97b556e05373711998d4f819cf7d89e4b0ce8 (diff)
downloadhercules-993138361b5d712afbd7afee6aba5d5c52bdcc4f.tar.gz
hercules-993138361b5d712afbd7afee6aba5d5c52bdcc4f.tar.bz2
hercules-993138361b5d712afbd7afee6aba5d5c52bdcc4f.tar.xz
hercules-993138361b5d712afbd7afee6aba5d5c52bdcc4f.zip
Convert refine_db.txt to refine_db.conf (libconfig)
Thanks for Haru and 4414 for pointing out inefficiency in code, edited as suggested. Rework - Changed refine_db.conf format to a more concise one, thanks to Haru for suggesting. [2/10/15] Updated with corrections pointed out by Haru. Updated warning and error messages.
Diffstat (limited to 'db')
-rw-r--r--db/pre-re/refine_db.conf131
-rw-r--r--db/pre-re/refine_db.txt39
-rw-r--r--db/re/refine_db.conf330
-rw-r--r--db/re/refine_db.txt40
4 files changed, 461 insertions, 79 deletions
diff --git a/db/pre-re/refine_db.conf b/db/pre-re/refine_db.conf
new file mode 100644
index 000000000..46f660834
--- /dev/null
+++ b/db/pre-re/refine_db.conf
@@ -0,0 +1,131 @@
+/********************************************************************************
+ * Pre-Renewal Refine Database *
+ ********************************************************************************
+Refine Database Structure -
+
+Armor/WeaponLevel1~4: { (0 - Armors, 1 - Level 1 Weapons, 2 - Level 2 Weapons, 3 - Level 3 Weapons, 4 - Level 4 Weapons)
+ - For armors, values of 100 add 1 armor defense.
+ - For weapons, values of 100 add 1 ATK.
+ StatsPerLevel: (int) This value is applied for ever level.
+ RandomBonusStartLevel: (int) This value specifies the start point for those levels that give a random bonus value (usually the first unsafe upgrade).
+ RandomBonusValue: (int) A random number between 0 and (Random bonus start level - Upgrade level + 1) * this value is applied for all upgrades past.
+ Random bonus start level. This is only applied for weapons, and not displayed client-side.
+ Rates: { Per level configuration of the refine rates.
+ Lv1~10: { Level of refine
+ Chance: (int) Chance of successful refine (100 = 100% success).
+ Note: If not mentioned, defaults to 100.
+ Bonus: (int) Bonus for this level of refine (Optional Field) defaults to 0.
+ Note: If not mentioned, defaults to 0.
+ }
+ }
+}
+
+* -- Refine levels that use default values need not be listed. (Example: Lv1: Chance: 100 Bonus: 0)
+******************************************************************************/
+Armors: {
+ StatsPerLevel: 66
+ RandomBonusStartLevel: 0
+ RandomBonusValue: 0
+ Rates: {
+ Lv5: {
+ Chance: 60
+ }
+ Lv6: {
+ Chance: 40
+ }
+ Lv7: {
+ Chance: 40
+ }
+ Lv8: {
+ Chance: 20
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 10
+ }
+ }
+}
+WeaponLevel1: {
+ StatsPerLevel: 200
+ RandomBonusStartLevel: 8
+ RandomBonusValue: 300
+ Rates: {
+ Lv8: {
+ Chance: 60
+ }
+ Lv9: {
+ Chance: 40
+ }
+ Lv10: {
+ Chance: 20
+ }
+ }
+}
+WeaponLevel2: {
+ StatsPerLevel: 300
+ RandomBonusStartLevel: 7
+ RandomBonusValue: 500
+ Rates: {
+ Lv7: {
+ Chance: 60
+ }
+ Lv8: {
+ Chance: 40
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 20
+ }
+ }
+}
+WeaponLevel3: {
+ StatsPerLevel: 500
+ RandomBonusStartLevel: 6
+ RandomBonusValue: 800
+ Rates: {
+ Lv6: {
+ Chance: 60
+ }
+ Lv7: {
+ Chance: 50
+ }
+ Lv8: {
+ Chance: 20
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 20
+ }
+ }
+}
+WeaponLevel4: {
+ StatsPerLevel: 700
+ RandomBonusStartLevel: 5
+ RandomBonusValue: 1300
+ Rates: {
+ Lv5: {
+ Chance: 60
+ }
+ Lv6: {
+ Chance: 40
+ }
+ Lv7: {
+ Chance: 40
+ }
+ Lv8: {
+ Chance: 20
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 10
+ }
+ }
+}
diff --git a/db/pre-re/refine_db.txt b/db/pre-re/refine_db.txt
deleted file mode 100644
index 457fd370f..000000000
--- a/db/pre-re/refine_db.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-// Pre-renewal Version
-//
-// Type,Stats per level,Random bonus start level,Random bonus value,Chance+1:Bonus+1,Chance+2:Bonus+2,Chance+3:Bonus+3,...
-//
-// IMPORTANT: changing the number of upgrade levels requires modifying MAX_REFINE in status.h
-//
-// For armors, values of 100 add 1 armor defense.
-// For weapons, values of 100 add 1 ATK.
-//
-// Type:
-// 0 - Armors
-// 1 - Level 1 weapons
-// 2 - Level 2 weapons
-// 3 - Level 3 weapons
-// 4 - Level 4 weapons
-//
-// Stats per level:
-// This value is applied for every upgrade level.
-//
-// Random bonus start level:
-// This value specifies the start point for those levels that give a random bonus value.
-//
-// Random bonus value:
-// A random number between 0 and (Random bonus start level - Upgrade level + 1) * this value is applied for all upgrades past
-// Random bonus start level (usually the first unsafe upgrade). This is only applied for weapons, and not displayed client-side.
-//
-// Chance:
-// 100 = 100%
-
-// Armors
-0,66,0,0,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0
-// Level 1 weapons
-1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0
-// Level 2 weapons
-2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0
-// Level 3 weapons
-3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0
-// Level 4 weapons
-4,700,5,1300,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0
diff --git a/db/re/refine_db.conf b/db/re/refine_db.conf
new file mode 100644
index 000000000..5a6bdfe24
--- /dev/null
+++ b/db/re/refine_db.conf
@@ -0,0 +1,330 @@
+/********************************************************************************
+ * Renewal Refine Database *
+ ********************************************************************************
+Refine Database Structure -
+
+Armors/WeaponLevel1~4: { (0 - Armors, 1 - Level 1 Weapons, 2 - Level 2 Weapons, 3 - Level 3 Weapons, 4 - Level 4 Weapons)
+ - For armors, values of 100 add 1 armor defense.
+ - For weapons, values of 100 add 1 ATK&MATK.
+ StatsPerLevel: (int) This value is applied for ever level.
+ RandomBonusStartLevel: (int) This value specifies the start point for those levels that give a random bonus value (usually the first unsafe upgrade).
+ RandomBonusValue: (int) A random number between 0 and (Random bonus start level - Upgrade level + 1) * this value is applied for all upgrades past.
+ Random bonus start level. This is only applied for weapons, and not displayed client-side.
+ Rates: { Per level configuration of the refine rates.
+ Lv1~10: { Level of refine
+ Chance: (int) Chance of successful refine (100 = 100%)
+ Note: If not mentioned, defaults to 100.
+ Bonus: (int) Bonus for this level of refine (Optional Field)
+ Note: If not mentioned, defaults to 0.
+ }
+ }
+}
+
+* -- Refine levels that use default values need not be listed. (Example: Lv1: Chance: 100 Bonus: 0)
+* -- A note about renewal Armors, there may or may not be another bonus, according to iRO wiki: Every upgrade gives floor[( 3 + current upgrade ) / 4]
+******************************************************************************/
+Armors: {
+ StatsPerLevel: 0
+ RandomBonusStartLevel: 0
+ RandomBonusValue: 0
+ Rates: {
+ Lv1: {
+ Bonus: 100
+ }
+ Lv2: {
+ Bonus: 100
+ }
+ Lv3: {
+ Bonus: 100
+ }
+ Lv4: {
+ Bonus: 100
+ }
+ Lv5: {
+ Chance: 60
+ Bonus: 200
+ }
+ Lv6: {
+ Chance: 40
+ Bonus: 200
+ }
+ Lv7: {
+ Chance: 40
+ Bonus: 200
+ }
+ Lv8: {
+ Chance: 20
+ Bonus: 200
+ }
+ Lv9: {
+ Chance: 20
+ Bonus: 300
+ }
+ Lv10: {
+ Chance: 10
+ Bonus: 300
+ }
+ Lv11: {
+ Chance: 8
+ Bonus: 300
+ }
+ Lv12: {
+ Chance: 8
+ Bonus: 300
+ }
+ Lv13: {
+ Chance: 8
+ Bonus: 400
+ }
+ Lv14: {
+ Chance: 8
+ Bonus: 400
+ }
+ Lv15: {
+ Chance: 7
+ Bonus: 400
+ }
+ Lv16: {
+ Chance: 7
+ Bonus: 400
+ }
+ Lv17: {
+ Chance: 7
+ Bonus: 500
+ }
+ Lv18: {
+ Chance: 7
+ Bonus: 500
+ }
+ Lv19: {
+ Chance: 5
+ Bonus: 500
+ }
+ Lv20: {
+ Chance: 5
+ Bonus: 500
+ }
+ }
+}
+WeaponLevel1: {
+ StatsPerLevel: 200
+ RandomBonusStartLevel: 8
+ RandomBonusValue: 300
+ Rates: {
+ Lv8: {
+ Chance: 60
+ }
+ Lv9: {
+ Chance: 40
+ }
+ Lv10: {
+ Chance: 20
+ }
+ Lv11: {
+ Chance: 18
+ }
+ Lv12: {
+ Chance: 18
+ }
+ Lv13: {
+ Chance: 18
+ }
+ Lv14: {
+ Chance: 18
+ }
+ Lv15: {
+ Chance: 18
+ }
+ Lv16: {
+ Chance: 17
+ Bonus: 300
+ }
+ Lv17: {
+ Chance: 17
+ Bonus: 300
+ }
+ Lv18: {
+ Chance: 17
+ Bonus: 300
+ }
+ Lv19: {
+ Chance: 15
+ Bonus: 300
+ }
+ Lv20: {
+ Chance: 15
+ Bonus: 300
+ }
+ }
+}
+WeaponLevel2: {
+ StatsPerLevel: 300
+ RandomBonusStartLevel: 7
+ RandomBonusValue: 500
+ Rates: {
+ Lv7: {
+ Chance: 60
+ }
+ Lv8: {
+ Chance: 40
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 20
+ }
+ Lv11: {
+ Chance: 18
+ }
+ Lv12: {
+ Chance: 18
+ }
+ Lv13: {
+ Chance: 18
+ }
+ Lv14: {
+ Chance: 18
+ }
+ Lv15: {
+ Chance:18
+ }
+ Lv16: {
+ Chance: 17
+ Bonus: 600
+ }
+ Lv17: {
+ Chance: 17
+ Bonus: 600
+ }
+ Lv18: {
+ Chance: 17
+ Bonus: 600
+ }
+ Lv19: {
+ Chance: 15
+ Bonus: 600
+ }
+ Lv20: {
+ Chance: 15
+ Bonus: 600
+ }
+ }
+}
+WeaponLevel3: {
+ StatsPerLevel: 500
+ RandomBonusStartLevel: 6
+ RandomBonusValue: 800
+ Rates: {
+ Lv6: {
+ Chance: 60
+ }
+ Lv7: {
+ Chance: 50
+ }
+ Lv8: {
+ Chance: 20
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 20
+ }
+ Lv11: {
+ Chance: 18
+ }
+ Lv12: {
+ Chance: 18
+ }
+ Lv13: {
+ Chance: 18
+ }
+ Lv14: {
+ Chance: 18
+ }
+ Lv15: {
+ Chance: 18
+ }
+ Lv16: {
+ Chance: 17
+ Bonus: 900
+ }
+ Lv17: {
+ Chance: 17
+ Bonus: 900
+ }
+ Lv18: {
+ Chance: 17
+ Bonus: 900
+ }
+ Lv19: {
+ Chance: 15
+ Bonus: 900
+ }
+ Lv20: {
+ Chance: 15
+ Bonus: 900
+ }
+ }
+}
+WeaponLevel4: {
+ StatsPerLevel: 700
+ RandomBonusStartLevel: 5
+ RandomBonusValue: 1400
+ Rates: {
+ Lv5: {
+ Chance: 60
+ }
+ Lv6: {
+ Chance: 40
+ }
+ Lv7: {
+ Chance: 40
+ }
+ Lv8: {
+ Chance: 20
+ }
+ Lv9: {
+ Chance: 20
+ }
+ Lv10: {
+ Chance: 10
+ }
+ Lv11: {
+ Chance: 8
+ }
+ Lv12: {
+ Chance: 8
+ }
+ Lv13: {
+ Chance: 8
+ }
+ Lv14: {
+ Chance: 8
+ }
+ Lv15: {
+ Chance: 7
+ }
+ Lv16: {
+ Chance: 7
+ Bonus: 1200
+ }
+ Lv17: {
+ Chance: 7
+ Bonus: 1200
+ }
+ Lv18: {
+ Chance: 7
+ Bonus: 1200
+ }
+ Lv19: {
+ Chance: 5
+ Bonus: 1200
+ }
+ Lv20: {
+ Chance: 5
+ Bonus: 1200
+ }
+ }
+}
diff --git a/db/re/refine_db.txt b/db/re/refine_db.txt
deleted file mode 100644
index 2b78a9d44..000000000
--- a/db/re/refine_db.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Renewal Version
-//
-// Type,Stats per level,Random bonus start level,Random bonus value,Chance+1:Bonus+1,Chance+2:Bonus+2,Chance+3:Bonus+3,...
-//
-// IMPORTANT: changing the number of upgrade levels requires modifying MAX_REFINE in status.h
-//
-// For armors, values of 100 add 1 armor defense.
-// For weapons, values of 100 add 1 ATK&MATK.
-//
-// Type:
-// 0 - Armors
-// 1 - Level 1 weapons
-// 2 - Level 2 weapons
-// 3 - Level 3 weapons
-// 4 - Level 4 weapons
-//
-// Stats per level:
-// This value is applied for every upgrade level.
-//
-// Random bonus start level:
-// This value specifies the start point for those levels that give a random bonus value (usually the first unsafe upgrade).
-//
-// Random bonus value:
-// A random number between 0 and (Random bonus start level - Upgrade level + 1) * this value is applied for all upgrades past
-// Random bonus start level. This is only applied for weapons, and not displayed client-side.
-//
-// Chance:
-// 100 = 100%
-//
-// A note about renewal Armors, there may or may not be another bonus, according to iRO wiki: Every upgrade gives floor[( 3 + current upgrade ) / 4] equipment DEF)
-
-0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,8:300,8:300,8:400,8:400,7:400,7:400,7:500,7:500,5:500,5:500
-// Level 1 weapons
-1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,18:0,18:0,18:0,18:0,18:0,17:300,17:300,17:300,15:300,15:300
-// Level 2 weapons
-2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,18:0,18:0,18:0,18:0,18:0,17:600,17:600,17:600,15:600,15:600
-// Level 3 weapons
-3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,18:0,18:0,18:0,18:0,18:0,17:900,17:900,17:900,15:900,15:900
-// Level 4 weapons
-4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,8:0,8:0,8:0,8:0,8:0,7:1200,7:1200,7:1200,5:1200,5:1200