Register for your free account! | Forgot your password?

You last visited: Today at 04:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



.sql zu .txt? [40K]

Discussion on .sql zu .txt? [40K] within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
.sql zu .txt? [40K]

Moin moin,

mich würde es mal interessieren, ob es möglich ist seine alte DB, also item_proto.sql zu der item_proto.txt und item_names.txt zu konvertieren. Da iMers Lib ja nicht bei der 40k Game geladen werden kann ist es ziemlich belastend, alle meine alten Einträge manuell in die txts zu bringen...

LG Sogma
Sogma is offline  
Old 04/24/2014, 11:16   #2
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
schick mir mal ein beispiel wie die txt aussehen soll. Ich hab ein webscript das aus der db eine itemproto.xml erstellt das gleich kann ich abändern...
theo1990 is offline  
Old 04/24/2014, 11:23   #3
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
item_proto.txt
Code:
"Vnum"	"Name"	"Type"	"SubType"	"Size"	"AntiFlags"	"Flags"	"WearFlags"	"ImmuneFlags"	"Gold"	"ShopBuyPrice"	"RefinedVnum"	"RefineSet"	"AlterToMagicItemPercent"	"LimitType0"	"LimitValue0"	"LimitType1"	"LimitValue1"	"ApplyType0"	"ApplyValue0"	"ApplyType1"	"ApplyValue1"	"ApplyType2"	"ApplyValue2"	"Value0"	"Value1"	"Value2"	"Value3"	"Value4"	"Value5"	"Specular"	"GainSocketPercent"	"AddonType"
1	"µ·²Ù·¯¹Ì"	"ITEM_ELK"	0	1	"NONE"	"NONE"	"NONE"	"NONE"	0	0	0	0	0	"LIMIT_NONE"	0	"LIMIT_NONE"	0	"APPLY_NONE"	0	"APPLY_NONE"	0	"APPLY_NONE"	0	0	0	0	0	0	0	0	0	0
2	"PYTHON_10302012"	"ITEM_NONE"	0	1	"NONE"	"NONE"	"NONE"	"NONE"	0	0	0	0	0	"LIMIT_NONE"	0	"LIMIT_NONE"	0	"APPLY_NONE"	0	"APPLY_NONE"	0	"APPLY_NONE"	0	0	0	0	0	0	0	0	0	0
10	"µµ+0"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	0	0	11	1	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	0	0	1	0
11	"µµ+1"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	100	12	2	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	7	0	1	0
12	"µµ+2"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	100	13	3	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	14	0	1	0
13	"µµ+3"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	150	14	4	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	21	0	1	0
14	"µµ+4"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	150	15	5	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	28	30	1	0
15	"µµ+5"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	200	16	6	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	35	40	1	0
16	"µµ+6"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	250	17	7	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	42	50	1	0
17	"µµ+7"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	350	18	8	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	49	65	1	0
18	"µµ+8"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	500	19	9	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	56	80	1	0
19	"µµ+9"	"ITEM_WEAPON"	"WEAPON_SWORD"	2	"ANTI_MUDANG"	"ITEM_TUNABLE"	"WEAR_WEAPON"	"NONE"	100	750	0	0	22	"LEVEL"	0	"LIMIT_NONE"	0	"APPLY_ATT_SPEED"	22	"APPLY_NONE"	0	"APPLY_NONE"	0	0	15	19	13	15	63	100	1	0
item_names.txt
Code:
VNUM	LOCALE_NAME
1	Yang
2	Deutsche Version
10	Schwert+0
11	Schwert+1
12	Schwert+2
13	Schwert+3
14	Schwert+4
15	Schwert+5
16	Schwert+6
17	Schwert+7
18	Schwert+8
19	Schwert+9
Sogma is offline  
Old 04/24/2014, 11:25   #4
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
ok es müssen tabulatoren dazwischen sein?
theo1990 is offline  
Old 04/24/2014, 11:30   #5
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Ja, das ist halt die Stadardformatierung seit den 34k files
Sogma is offline  
Old 04/24/2014, 11:33   #6
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
ok ich setzt mich dran
theo1990 is offline  
Old 04/24/2014, 11:38   #7
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Generiert dein Script dann auch die item_names?
Sogma is offline  
Old 04/24/2014, 11:39   #8
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
kannst du mir gerade eine itemproto irgendwie geben damit ich das script testen kann? muss keine echte von dir sein

Ja das werde ich berücksichtigen
theo1990 is offline  
Old 04/24/2014, 11:55   #9
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Ja ich gebe es hier in den Anhang
Attached Files
File Type: rar item_proto.rar (158.8 KB, 61 views)
Sogma is offline  
Old 04/24/2014, 11:56   #10
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
ich brauch ein dump von der db sorry falsch ausgedrückt, damit ich testen kann^^
theo1990 is offline  
Old 04/24/2014, 11:58   #11
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Serverside?
Sogma is offline  
Old 04/24/2014, 12:01   #12
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
ein dump von ner itemproto tabelle . Also nicht die MYD dateien sondern .sql
theo1990 is offline  
Old 04/24/2014, 12:02   #13
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Ahja, ok, ist im Anhang!
Attached Files
File Type: rar item_proto.rar (114.5 KB, 20 views)
Sogma is offline  
Old 04/24/2014, 13:02   #14
 
theo1990's Avatar
 
elite*gold: 260
Join Date: Jul 2009
Posts: 1,123
Received Thanks: 180
PHP Code:
 <?php
error_reporting
(E_ALL);

$tmpfname fopen"item_proto.txt" ,  "w" );

//$tmpfname = fopen('item_proto.xml', 'w');


$test fwrite($tmpfname,  "Vnum \t Name \t Type \t SubType \t Size \t AntiFlags \t Flags \t WearFlags \t ImmuneFlags \t Gold \t ShopBuyPrice \t RefinedVnum \t RefineSet \t AlterToMagicItemPercent \t LimitType0 \t LimitValue0 \t LimitType1 \t LimitValue1 \t ApplyType0 \t ApplyValue0 \t ApplyType1 \t ApplyValue1 \t ApplyType2 \t ApplyValue2 \t Value0 \t Value1 \t Value2 \t Value3 \t Value4 \t Value5 \t Specular \t GainSocketPercent      AddonType 1\t µ·²Ù·¯¹Ì \t ITEM_ELK \t0\1\t NONE \t NONE \t NONE \t NONE \t0\t0\t0\0\t0\t LIMIT_NONE \t0\t LIMIT_NONE \t0\t APPLY_NONE \t0\t APPLY_NONE \t0\t APPLY_NONE \t0\t0\t0\t0\t0\t0\t0\t0\t0\t0 \r\n ");


$c mysql_connect('localhost''root''');
$db mysql_select_db('mt2');

$result mysql_query('SELECT * FROM item_proto ORDER BY vnum ASC');
while (
$row mysql_fetch_object($result)) {
    
//$value = ($field !== 'name') ? $value = utf8_decode($value) : $value;
    
$tmp = array();
    
$tmp['vnum'] = $row->vnum;
    
$tmp['hashName'] = trim($row->name);
    
//$tmp['name'] = trim($row->locale_name);
    
$tmp['type'] = $row->type;
    
$tmp['subtype'] = $row->subtype;
    
$tmp['weight'] = $row->weight;
    
$tmp['size'] = $row->size;
    
$tmp['antiflag'] = $row->antiflag;
    
$tmp['flag'] = $row->flag;
    
$tmp['wearflag'] = $row->wearflag;
    
$tmp['immuneflag'] = floatval($row->immuneflag);
    
$tmp['gold'] = $row->gold;
    
$tmp['buy_price'] = $row->shop_buy_price;
    
$tmp['limittype0'] = $row->limittype0;
    
$tmp['limitvalue0'] = $row->limitvalue0;
    
$tmp['limittype1'] = $row->limittype1;
    
$tmp['limitvalue1'] = $row->limitvalue1;
    
$tmp['applytype0'] = $row->applytype0;
    
$tmp['applyvalue0'] = $row->applyvalue0;
    
$tmp['applytype1'] = $row->applytype1;
    
$tmp['applyvalue1'] = $row->applyvalue1;
    
$tmp['applytype2'] = $row->applytype2;
    
$tmp['applyvalue2'] = $row->applyvalue2;
    
$tmp['value0'] = $row->value0;
    
$tmp['value1'] = $row->value1;
    
$tmp['value2'] = $row->value2;
    
$tmp['value3'] = $row->value3;
    
$tmp['value4'] = $row->value4;
    
$tmp['value5'] = $row->value5;
    
$tmp['socket0'] = $row->socket0;
    
$tmp['socket1'] = $row->socket1;
    
$tmp['socket2'] = $row->socket2;
    
$tmp['socket3'] = $row->socket3;
    
$tmp['socket4'] = $row->socket4;
    
$tmp['socket5'] = $row->socket5;
    
$tmp['refine_vnum'] = $row->refined_vnum;
    
$tmp['refine_set'] = $row->refine_set;
    
$tmp['magic_pct'] = $row->magic_pct;
    
$tmp['specular'] = $row->specular;
    
$tmp['socket_pct'] = $row->socket_pct;

    
$t = array();
    foreach (
$tmp as $key => $value) {
        if(!
preg_match('/[a-zA-Z]/',$value))
        {
            
$t[] = (int) $value;
        }
        else
        {
            
$t[] = "'" $value "'" ;
        }
    }
    unset(
$tmp);

    
fwrite($tmpfnameimplode("\t "$t) . "\r\n" );
}

var_dump($tmpfname);

if (
ini_get('zlib.output_compression'))  {
    
ini_set('zlib.output_compression''Off');
}

header"Pragma: public" );
header"Cache-Control: must-revalidate, post-check=0, pre-check=0 ");
header"Expires: 0 ");
header"Content-Transfer-Encoding: binary ");
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename= item_proto.txt ');
readfile"item_proto.txt" );
fclose($tmpfname);
exit;
Sooo also das sollte nun funktionieren. das gibt jetzt die item_proto.txt aus.
Um die andere rauszubekommen musste einfach nur alle felder rausnehmen bis auf vnum und den namen halt.
theo1990 is offline  
Thanks
1 User
Old 04/24/2014, 13:06   #15
 
Sogma's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 670
Received Thanks: 137
Alles klar um das jetzt benutzen zu können einfach eine php-Datei erstellen und auf einem Webspace ausführen?
Sogma is offline  
Reply




All times are GMT +1. The time now is 04:29.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.