I do this with PHP, its for me the easyer code to do "advanced things" but only coded 16 to 32 bytes item code :/
Code:
Function UpdateItem($item,$t) {
if($item != 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') {
$ItemType = substr($item, 0, 4);
$itempart1 = substr($item, 0, 6);
$serial = substr($item, 6, 8);
$itempart2 = substr($item, 14, 8);
$seeds = substr($item, 22, 6);
$end = substr($item, 28, 4);
if($seeds != '000000') { $seeds = 'FFFFFF'; }
$totalitem = $itempart1.$serial.$itempart2.$seeds.$end;
echo ''.$item.' => '.$totalitem .' (S: '.$serial.') OK<br/>';
} else {
$totalitem = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
}
return $totalitem;
}
I used this with a foreach in the warehouse, you can implement handling ware and inventorys, all its the same.
Always starts with 0x, you need to remove it.
Use this code of example for creating 32b items. The structure its a little bit similar. You can use the editor for know and understand all the parts of the item, and a hexa to decimal converter for see the values.
When you create new items, maybe need to create serials like dataserver, executing WZ_GETITEMSERIAL from the DB, and updating Itemcount in the DB too for prevent duplicated serials.
For read warehouse and write it in another DB:
Code:
Function CopyWHContent($Acc1,$Acc2) {
$warehouse = '';
$WareQuery = mssql_query("declare @[I][B][URL="http://forum.ragezone.com/members/237319.html"]Vault[/URL][/B][/I] varbinary(3840); set @[I][B][URL="http://forum.ragezone.com/members/237319.html"]Vault[/URL][/B][/I]=(SELECT Items FROM [MuOnlineOld].[dbo].[warehouse] where AccountId='$Acc1');print @[I][B][URL="http://forum.ragezone.com/members/237319.html"]Vault[/URL][/B][/I];");
$WareContent = substr(mssql_get_last_message(),2);
$WareItem = str_split($WareContent, 32);
$indx = 0;
$t = 1;
$tx = 1;
while($indx <= 119) {
if($WareItem[$indx] != 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' ) {
//echo $WareItem[$indx].' -> COPY (tx '.$tx.') <br/>' ;
}
$warehouse .= UpdateItem($WareItem[$indx],$tx);
$indx++;
}
mssql_query("INSERT INTO [MuOnlineNew].[dbo].[warehouse] (AccountID) VALUES ('$Acc2')");
mssql_query("UPDATE [MuOnlineNew].[dbo].[warehouse] SET [Items]=0x$warehouse WHERE AccountID='$Acc2'");
}
remember too check the size of the cells in the DB and edit the code in @
Vault varbinary(3840);