01-21-2015, 09:32 AM
Hello..
I remember talking in a topic on LCDEV board about a php script Wizatek created that connects to your DB an can dump data into a lod file.
Well I'm in bad need of this if anyone has any info on it or saved the code from that board.
I'm looking for shop / npc / skills / quest
reason?.. I have found my old EP1 project database but I don't have the client an I'm working hard on restoring the client but its taking so much time. With these php scripts I could have it done so much faster.
Wizatek! I know you don't see eye to eye with me but maybe you could help me with this??
<?php
class LCFile
{
var $fp;
/**
* Creates a new binary file to write to
* @param string $fileName The name of the file to create
*/
function Create($fileName)
{
$this->fp = fopen($fileName, 'wb');
if ( !$this->fp )
return false;
return true;
}
/**
* Write a signed 32bit integer to the file
* @param int $val the integer to write to the file
*/
function WriteInt($val)
{
fwrite($this->fp, pack('l', $val));
}
/**
* Writes a signed short to the file
* @param short $val the value to write to the file
*/
function WriteShort($val)
{
fwrite($this->fp, pack('s', $val));
}
/**
* Writes a signed byte to the file
* @param byte $val the value to write to the file
*/
function WriteByte($val)
{
fwrite($this->fp, pack('C', $val));
}
/**
* Writes a float to the file
* @param float $val the value to write to the file
*/
function WriteFloat($val)
{
fwrite($this->fp, pack('f', $val));
}
/**
* Writes a string to the file
* @param string $val the value to write to the file
*/
function WriteString($val)
{
if ( strlen($val) > 0 )
{
$this->WriteInt(strlen($val));
fwrite($this->fp, $val);
}
else
$this->WriteInt(0);
}
}
?>


im at work and very sleepy XD