function soul($char,$del=false){
$query= mssql_query("declare @it varbinary(760); set @it=(SELECT [Inventory] FROM [Character] WHERE [Name]='$char'); print @it");
$items = substr(mssql_get_last_message(),2);
$br=0;
for($i=0;$i<76;$i++){
if(substr($items,$i*20,2)=="CE"){
$br++;
if($del){
$items=substr_replace($items,"FFFFFFFFFFFFFFFFFFFF",$i*20,20);
}
}
}
if($del){
$new_warehouse=mssql_query("update [Character] set [Inventory]=0x$items where [Name]='$char'");
}
return $br;
}
function bless($char,$del=false){
$query= mssql_query("declare @it varbinary(760); set @it=(SELECT [Inventory] FROM [Character] WHERE [Name]='$char'); print @it");
$items = substr(mssql_get_last_message(),2);
$br=0;
for($i=0;$i<76;$i++){
if(substr($items,$i*20,2)=="CD"){
$br++;
if($del){
$items=substr_replace($items,"FFFFFFFFFFFFFFFFFFFF",$i*20,20);
}
}
}
if($del){
$new_warehouse=mssql_query("update [Character] set [Inventory]=0x$items where [Name]='$char'");
}
return $br;
}