Page 1 of 1
various questions (item table and drop calc)
Posted: Tue May 10, 2011 4:58 pm
by TheDarkKnight
hello,
i found that one:
http://l2jdb.l2jdp.com/ and was thinking about programming the same and using it for my website.
1) but before starting to programm, is that a open source drop calc maybe?! can i get access to it somewhere?
2) if its not for free then maybe can someone tell me where i can find the SQL file where the Item ID is connected with the Item Name? I dont find item names anywhere in the l2j datapack

or recipes? where is the recipe table (+ ingredients)?
3) also what is the path for all related images? i mean every item in l2 has a certain picture. where is the pictures library in the l2j server files? i downloaded datapack and server from night life and installed it. but i cant find these images anywhere.
thanks a lot in advance for your replys!
Re: various questions (item table and drop calc)
Posted: Tue May 10, 2011 5:19 pm
by jurchiks
data/stats/items/*.xml:
Code: Select all
<set name="icon" val="icon.weapon_small_sword_i00" />
same for item ID.
That website is made and maintained by some of the l2j devs, I doubt someone will share the code, it's already open for access.
P.S. what makes you think everything is in SQL tables?
Re: various questions (item table and drop calc)
Posted: Tue May 10, 2011 5:24 pm
by TheDarkKnight
hi,
thx for the fast reply, nothing made me think everything is in SQL, but i hoped so

i see the reference to the image now, thx but where is the actual image? i mean it must be placed somewhere as a PNG or JPG or somewhere with the name "weapon_small_sword_i00" or? any hint?
to be honest i also need a SQL table which looks like column 1 item ID colum 2 item name column 3 item image path.. any idea how to extract the infos from the xml to a sql file?
Re: various questions (item table and drop calc)
Posted: Tue May 10, 2011 8:57 pm
by jurchiks
the images are only in client.
Re: various questions (item table and drop calc)
Posted: Wed May 11, 2011 8:26 am
by TheDarkKnight
i thought that already too, but i couldnt find them.. are they in some texture files or something like that? is there any chance to strip them out? and how about the process to strip the information from the XML file to some PHP array or SQL? any idea?
Re: various questions (item table and drop calc)
Posted: Wed May 11, 2011 4:39 pm
by jurchiks
PHP has 3rd-party XML processing libraries, you just have to find them.
You can also parse them to SQL using Java.
You will have to find out how to strip them out of the client using google, nobody here will help you with that (at the very least not publicly).
Re: various questions (item table and drop calc)
Posted: Wed May 11, 2011 6:03 pm
by Bloodshed
Here is a simple id/name/icon xml to sql, this should get you going while you figure out how to do this yourself (for the other stats etc).
xmlToSql.rar
Re: various questions (item table and drop calc)
Posted: Wed May 11, 2011 6:46 pm
by TheDarkKnight
oh, that tool also looks really nice and helpful! but unfortunately its not working? whats the requirement to use it? 64bit machine or something?
EDIT: net framework was missing, now i can run it
but its not working for recipes/chars/skills xml.. only works for items.. and even there not all infos are getting stripped. are there more tools like that? also i would prefer some php way to do it.. so i can setup a cronjob to update the DC with the latest infos every night from night release datapack.
shame i need to develop the wheel again from the scratch even if such a nice thing like l2jdb already exists.. is there no chance to contact the developer of that tool? i read the name "warp" but could find any contact details..
btw. i found a source where to get the images already.. i dont need to worry about that anymore i guess..
still i cant find infos on google how to strip infos from l2 client.. would be interesting for fishing, skill descriptions, quest names (start npc, etc..)
Re: various questions (item table and drop calc)
Posted: Wed May 11, 2011 7:11 pm
by mochitto
Here is php script what load all xml files (from dir items) and store it to one array, but speed is lower. It read only base tag item and set.
Code: Select all
<?php echo "<pre>";$dir = "./items";if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if (strpos($file, ".xml") !== false) { //echo "Loaded file $file...\n"; $file = $dir . "/" . $file; $item_list = array(); if (!($fp = fopen($file, "r"))) { echo "Cant open XML file: " . $file; continue; } $data = fread($fp, filesize($file)); fclose($fp); $xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser, $data, $vals, $index); xml_parser_free($xml_parser); foreach ($vals as $xml_element) { if ($xml_element["tag"] != "ITEM" && $xml_element["tag"] != "SET" && $xml_element["tag"] != "FOR") continue; switch ($xml_element["type"]) { case "open": if ($xml_element["tag"] == "ITEM") { $item["id"] = $xml_element["attributes"]["ID"]; $item["type"] = $xml_element["attributes"]["TYPE"]; $item["name"] = $xml_element["attributes"]["NAME"]; } break; case "complete": if ($xml_element["tag"] == "SET" && array_key_exists("NAME", $xml_element["attributes"]) && $xml_element["level"] == 3) $item[$xml_element["attributes"]["NAME"]] = $xml_element["attributes"]["VAL"]; break; case "close": if ($xml_element["tag"] == "ITEM" && $xml_element["level"] == 2) { $item_list[$item["id"]] = $item; unset($item); } break; } } } } closedir($handle);} /* * Can by used for import to db * $keys = array(); foreach ($item_list as $data) { foreach ($data as $key => $data2) { if (!in_array($key, $keys)) $keys[] = $key; } } // echo $keys; */ //print_r($item_list);echo $item_list[22171]["name"];
//EDIT
Somebody was faster than me. x)
Re: various questions (item table and drop calc)
Posted: Thu May 12, 2011 3:55 pm
by TheDarkKnight
thx mochitto, works slick!!
i edited it a bit to suite my wishes a bit more.(also reads pdef,mdef,patk, etc) in case you need it:
Code: Select all
$dir = "extension/dropcalc/src/items"; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if (strpos($file, ".xml") !== false) { echo "Loaded file $file...\n"; $file = $dir . "/" . $file; $item_list = array(); if (!($fp = fopen($file, "r"))) { echo "Cant open XML file: " . $file; continue; } $data = fread($fp, filesize($file)); fclose($fp); $xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser, $data, $vals, $index); xml_parser_free($xml_parser); foreach ($vals as $xml_element) { if ($xml_element["tag"] != "ITEM" && $xml_element["tag"] != "SET" && $xml_element["tag"] != "FOR" && $xml_element["tag"] != "ADD") continue; switch ($xml_element["type"]) { case "open": if ($xml_element["tag"] == "ITEM") { $item["id"] = $xml_element["attributes"]["ID"]; $item["type"] = $xml_element["attributes"]["TYPE"]; $item["name"] = $xml_element["attributes"]["NAME"]; } break; case "complete": if ($xml_element["tag"] == "SET" && array_key_exists("NAME", $xml_element["attributes"]) && $xml_element["level"] == 3) { $item[$xml_element["attributes"]["NAME"]] = $xml_element["attributes"]["VAL"]; } #adds "patk/matk/.." information for weapons if ($xml_element["tag"] == "SET" && array_key_exists("STAT", $xml_element["attributes"]) && $xml_element["level"] == 4) { $item[$xml_element["attributes"]["STAT"]] = $xml_element["attributes"]["VAL"]; } #adds "pdef/mdef/.." information for armor if ($xml_element["tag"] == "ADD" && array_key_exists("STAT", $xml_element["attributes"]) && $xml_element["level"] == 4) { $item[$xml_element["attributes"]["STAT"]] = $xml_element["attributes"]["VAL"]; } break; case "close": if ($xml_element["tag"] == "ITEM" && $xml_element["level"] == 2) { $item_list[$item["id"]] = $item; unset($item); } break; } } foreach ($item_list as $data) { #DB INSERT HERE #var_dump($data); } //print_r($item_list); <----- Thats the result array! (rob) //var_dump(count($item_list)); } } closedir($handle);}else{ echo "Cant open directory!";}
but anyone know where i can find fishing open rates, quest description information etc from client?
mochitto maybe you have a script for the recipe/char/augementation and skills xml?
Re: various questions (item table and drop calc)
Posted: Fri May 13, 2011 12:24 pm
by TheDarkKnight
nvm

i made a script for the recipes as well
hmm .. i now have an automatic update, all necessary tables and images. i guess thats all i need. rest is simply php programming.. thx all who helped me!!! you can close the topic if you want.. very helpful, cheers!
Re: various questions (item table and drop calc)
Posted: Sat May 14, 2011 5:08 pm
by TheDarkKnight
ahhh, another question. where can i find item descriptions? example: " A sphere containing Reiria's Soul. Take it to Maestro Reorin." (for soul orb) ???
(same question for skill and quest list

Re: various questions (item table and drop calc)
Posted: Sat May 14, 2011 5:13 pm
by Bloodshed
Same answer as the images, they are stored in the client files.
Re: various questions (item table and drop calc)
Posted: Sat May 14, 2011 5:55 pm
by TheDarkKnight
shame
any hint how to get them out of the client?

Re: various questions (item table and drop calc)
Posted: Sat May 14, 2011 8:15 pm
by jurchiks
l2encdec