summaryrefslogtreecommitdiff
path: root/tools/item_db.pl
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-25 16:11:39 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-25 16:11:39 +0000
commitcece111a565a6d53790248eaa01bf68615d3a4b1 (patch)
tree8f700012e57e71524231c539ca5e93aff0bfb42c /tools/item_db.pl
parent539d0677923e7b668266e500975d452ab442a277 (diff)
downloadhercules-cece111a565a6d53790248eaa01bf68615d3a4b1.tar.gz
hercules-cece111a565a6d53790248eaa01bf68615d3a4b1.tar.bz2
hercules-cece111a565a6d53790248eaa01bf68615d3a4b1.tar.xz
hercules-cece111a565a6d53790248eaa01bf68615d3a4b1.zip
Updated conversion tools for mob_db & item_db
Updated SQL Files (item & mobs) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12138 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'tools/item_db.pl')
-rwxr-xr-xtools/item_db.pl33
1 files changed, 17 insertions, 16 deletions
diff --git a/tools/item_db.pl b/tools/item_db.pl
index 101ff3961..f19737f1e 100755
--- a/tools/item_db.pl
+++ b/tools/item_db.pl
@@ -43,29 +43,30 @@ while ($ligne=<STDIN>)
$ligne = $&;
if ($ligne =~ /^\/\//)
{
- printf("# %s\n", $ligne);
+ printf("# ");
+ $ligne = substr($ligne, 2);
+ }
+ if ($ligne =~ $line_format) {
+ @champ = ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22);
} else {
- if ($ligne =~ $line_format) {
- @champ = ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22);
- } else {
- @champ = ();
- }
- if ($#champ != $nb_columns - 1)
+ @champ = ();
+ }
+ if ($#champ != $nb_columns - 1)
+ {
+ # Can't parse, it's a real comment
+ printf ("%s\n", $ligne);
+ } else {
+ printf("REPLACE INTO `%s` VALUES (", $db);
+ for ($i=0; $i<$#champ; $i++)
{
- printf ("# WARNING BAD LINE : %d (%s)\n", $#champ, $ligne);
- printf STDERR ("Warning : can't parse %s\n", $ligne);
- } else {
- printf("REPLACE INTO `%s` VALUES (", $db);
- for ($i=0; $i<$#champ; $i++)
- {
- printField($champ[$i],",",$i);
- }
- printField($champ[$#champ],");\n",$#champ);
+ printField($champ[$i],",",$i);
}
+ printField($champ[$#champ],");\n",$#champ);
}
}
}
+
sub printField {
my ($str, $suffix, $idCol) = @_;
# Remove first { and last }