LCKB
serial calculation - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Guides & Help Section (https://lckb.dev/forum/forumdisplay.php?fid=193)
+---- Forum: Tutorials & Guides (https://lckb.dev/forum/forumdisplay.php?fid=124)
+----- Forum: Ep1 Guides (https://lckb.dev/forum/forumdisplay.php?fid=178)
+----- Thread: serial calculation (/showthread.php?tid=203)



- Falo - 10-02-2011


<p>You maybe noticed, in t_inven or t_stash you see a strange number example: "LR9JCa08R", this is the serial,

 

you can decode this into:

itemguid: 523
creation date: 19.09.2011
creation time: 12:36
server: 1
channel 1

but how is it calculated ? it's usefull to know this for a webmall, here a sample php code:

 

how to use: 2 any number

function calcSerial($item_guid){

$arrSerial = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$year = (int)date("Y");
$month = (int)date("m");
$day = (int)date("d");
$hour = (int)date("G");
$minute = (int)date("i");
$second = (int)date("s");
$server = (int)1;
$channel = (int)1;
$serial = array(20);

// calculate Server + Channel
$temp1 = (20 * $server + $channel) % 62;
if ($temp1 < 0 ) $temp1 = 0;
$serial[0] = $arrSerial[$temp1 % 62];

// calculate time
$serial[1] = $arrSerial[$year % 62];
$serial[2] = $arrSerial[$month % 62];
$serial[3] = $arrSerial[$day % 62];
$serial[4] = $arrSerial[$hour % 62];
$serial[5] = $arrSerial[$minute % 62];
$serial[6] = $arrSerial[$second % 62];

// avoid negative guid
If ($item_guid < 0) $item_guid = -$item_guid;

// calculate item guid
$temp2 = $item_guid % 238328;
$temp3 = (int)($temp2 / 62);
$temp4 = (int)($temp3 / 62);

$serial[7] = $arrSerial[$temp4 % 62];
$serial[8] = $arrSerial[$temp3 % 62];
$serial[9] = $arrSerial[$temp2 % 62];

//return
return $serial[0].$serial[1].$serial[2].$serial[3].$serial[4].$serial[5].$serial[7].$serial[8].$serial[9];
}




- Wizatek - 10-02-2011


Ah lol, i didnt know that info was in it Tongue

Seems like i have been using it all wrong in my Emulator then Big Grin




- Falo - 10-03-2011


what dus this do lol?Alli get is this

 

The php code calculates a given item_guid into a valid serial.

Its only usefull, when you code a Webmall or emulator.

 

I think i made a mistake, it should be "$serial = array(20);" or whatever, xampp didnt gave me any error, im not good in php ^^




- maxig - 10-04-2011


error in NPC-

521

522

523

524

CODE PHP

INSERT INTO `t_zonedata` VALUES (21, Theos Tomb, 1536, 1536, 1, data/Dratan_siegeWarfare_dungeon_1536_1536_0.sat, data/Dratan_siegeWarfare_dungeon_1536_1536_0.[CeNsOrEd], 1, 0, 1, 0, 775, 310, 775, 305, , 1, 0, 0, null, null, null, null, null, null, null);

not found Theos Tomb, i`m add in Newstobm

[Zones]

Count=18

 

[Zone_16]

No=23

Remote=FALSE

 

[Zone_17]

No=21

Remote=FALSE

 

:confused: Help Plz

[ATTACH=CONFIG]348[/ATTACH]




- rioking - 10-11-2011


How edit Newstrom bin for Theos Tomb Help Plz Sad

If somebody have sat [CeNsOrEd] files for Mondshine capell egehas caves please add

Thy anyway