Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('config.php');
- $conn = sqlsrv_connect($svName, $conn_info);
- if(! $conn)
- {
- //echo "Connection could not be established.\n";
- die( print_r( sqlsrv_errors(), true));
- exit();
- }
- $data = simplexml_load_file('./itemsDB.xml');
- foreach( $data->WeaponsArmory->Weapon as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Weapons] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Weapons] VALUES (
- ".$tmp_data['itemID']."
- ,N'".($tmp_data['FNAME']?$tmp_data['FNAME']:substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30))."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,N'".trim($tmp_data->Model['muzzlerOffset.x']." "
- .$tmp_data->Model['muzzlerOffset.y']." "
- .$tmp_data->Model['muzzlerOffset.z'])."'
- ,N'".$tmp_data->MuzzleModel['file']."'
- ,N'".$tmp_data->Animation['type']."'
- ,N'".$tmp_data->PrimaryFire['bullet']."'
- ,N'".$tmp_data->Sound['shoot']."'
- ,N'".$tmp_data->Sound['reload']."'
- ,".(double)$tmp_data->PrimaryFire['damage']."
- ,".($tmp_data->PrimaryFire['immediate'] == 'true'?1:0)."
- ,".(double)$tmp_data->PrimaryFire['mass']."
- ,".(int)$tmp_data->PrimaryFire['speed']."
- ,".(double)$tmp_data->PrimaryFire['decay']."
- ,".(double)$tmp_data->PrimaryFire['area']."
- ,".(double)$tmp_data->PrimaryFire['delay']."
- ,".(double)$tmp_data->PrimaryFire['timeout']."
- ,".(int)$tmp_data->PrimaryFire['numShells']."
- ,".(int)$tmp_data->PrimaryFire['clipSize']."
- ,".(double)$tmp_data->PrimaryFire['reloadTime']."
- ,".(double)$tmp_data->PrimaryFire['activeReloadTick']."
- ,".(double)$tmp_data->PrimaryFire['rateOfFire']."
- ,".(double)$tmp_data->PrimaryFire['spread']."
- ,".(double)$tmp_data->PrimaryFire['recoil']."
- ,".(double)$tmp_data->PrimaryFire['numgrenades']."
- ,N'".$tmp_data->PrimaryFire['grenadename']."'
- ,N'".$tmp_data->PrimaryFire['firemode']."'
- ,30
- ,N'".$tmp_data->PrimaryFire['ScopeType']."'
- ,".(double)$tmp_data->PrimaryFire['ScopeZoom']."
- ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data['upgrade']."
- ,".(double)$tmp_data->FPS['IsFPS']."
- ,".(double)$tmp_data->FPS['i0']."
- ,".(double)$tmp_data->FPS['i1']."
- ,".(double)$tmp_data->FPS['i2']."
- ,".(double)$tmp_data->FPS['i3']."
- ,".(double)$tmp_data->FPS['i4']."
- ,".(double)$tmp_data->FPS['i5']."
- ,".(double)$tmp_data->FPS['i6']."
- ,".(double)$tmp_data->FPS['i7']."
- ,".(double)$tmp_data->FPS['i8']."
- ,".(double)$tmp_data->FPS['d0']."
- ,".(double)$tmp_data->FPS['d1']."
- ,".(double)$tmp_data->FPS['d2']."
- ,".(double)$tmp_data->FPS['d3']."
- ,".(double)$tmp_data->FPS['d4']."
- ,".(double)$tmp_data->FPS['d5']."
- ,".(double)$tmp_data->FPS['d6']."
- ,".(double)$tmp_data->FPS['d7']."
- ,".(double)$tmp_data->FPS['d8']."
- ,N'".($tmp_data->Model['AnimPrefix']?$tmp_data->Model['AnimPrefix']:$tmp_data['FNAME'])."'
- ,".(int)$tmp_data['Weight']."
- ,".(int)$tmp_data->Dur['u']."
- ,".(int)$tmp_data->Dur['r1']."
- ,".(int)$tmp_data->Dur['r2']."
- ,".(int)$tmp_data->Dur['r3']."
- ,".(int)$tmp_data->Res['r1']."
- ,".(int)$tmp_data->Res['r2']."
- ,".(int)$tmp_data->Res['r3'].")";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Weapons]
- SET [FNAME] = N'".($tmp_data['FNAME']?$tmp_data['FNAME']:substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30))."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[MuzzleOffset] = N'".trim($tmp_data->Model['muzzlerOffset.x']." ".$tmp_data->Model['muzzlerOffset.y']." ".$tmp_data->Model['muzzlerOffset.z'])."'
- ,[MuzzleParticle] = N'".$tmp_data->MuzzleModel['file']."'
- ,[Animation] = N'".$tmp_data->Animation['type']."'
- ,[BulletID] = N'".$tmp_data->PrimaryFire['bullet']."'
- ,[Sound_Shot] = N'".$tmp_data->Sound['shoot']."'
- ,[Sound_Reload] = N'".$tmp_data->Sound['reload']."'
- ,[Damage] = ".(double)$tmp_data->PrimaryFire['damage']."
- ,[isImmediate] = ".($tmp_data->PrimaryFire['immediate'] == 'true'?1:0)."
- ,[Mass] = ".(double)$tmp_data->PrimaryFire['mass']."
- ,[Speed] = ".(int)$tmp_data->PrimaryFire['speed']."
- ,[DamageDecay] = ".(double)$tmp_data->PrimaryFire['decay']."
- ,[Area] = ".(double)$tmp_data->PrimaryFire['area']."
- ,[Delay] = ".(double)$tmp_data->PrimaryFire['delay']."
- ,[Timeout] = ".(double)$tmp_data->PrimaryFire['timeout']."
- ,[NumClips] = ".(int)$tmp_data->PrimaryFire['numShells']."
- ,[Clipsize] = ".(int)$tmp_data->PrimaryFire['clipSize']."
- ,[ReloadTime] = ".(double)$tmp_data->PrimaryFire['reloadTime']."
- ,[ActiveReloadTick] = ".(double)$tmp_data->PrimaryFire['activeReloadTick']."
- ,[RateOfFire] = ".(double)$tmp_data->PrimaryFire['rateOfFire']."
- ,[Spread] = ".(double)$tmp_data->PrimaryFire['spread']."
- ,[Recoil] = ".(double)$tmp_data->PrimaryFire['recoil']."
- ,[NumGrenades] = ".(double)$tmp_data->PrimaryFire['numgrenades']."
- ,[GrenadeName] = N'".$tmp_data->PrimaryFire['grenadename']."'
- ,[Firemode] = N'".$tmp_data->PrimaryFire['firemode']."'
- ,[ScopeType] = N'".$tmp_data->PrimaryFire['ScopeType']."'
- ,[ScopeZoom] = ".(double)$tmp_data->PrimaryFire['ScopeZoom']."
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[IsUpgradeable] = ".(double)$tmp_data['upgrade']."
- ,[IsFPS] = ".(double)$tmp_data->FPS['IsFPS']."
- ,[FPSSpec0] = ".(double)$tmp_data->FPS['i0']."
- ,[FPSSpec1] = ".(double)$tmp_data->FPS['i1']."
- ,[FPSSpec2] = ".(double)$tmp_data->FPS['i2']."
- ,[FPSSpec3] = ".(double)$tmp_data->FPS['i3']."
- ,[FPSSpec4] = ".(double)$tmp_data->FPS['i4']."
- ,[FPSSpec5] = ".(double)$tmp_data->FPS['i5']."
- ,[FPSSpec6] = ".(double)$tmp_data->FPS['i6']."
- ,[FPSSpec7] = ".(double)$tmp_data->FPS['i7']."
- ,[FPSSpec8] = ".(double)$tmp_data->FPS['i8']."
- ,[FPSAttach0] = ".(double)$tmp_data->FPS['d0']."
- ,[FPSAttach1] = ".(double)$tmp_data->FPS['d1']."
- ,[FPSAttach2] = ".(double)$tmp_data->FPS['d2']."
- ,[FPSAttach3] = ".(double)$tmp_data->FPS['d3']."
- ,[FPSAttach4] = ".(double)$tmp_data->FPS['d4']."
- ,[FPSAttach5] = ".(double)$tmp_data->FPS['d5']."
- ,[FPSAttach6] = ".(double)$tmp_data->FPS['d6']."
- ,[FPSAttach7] = ".(double)$tmp_data->FPS['d7']."
- ,[FPSAttach8] = ".(double)$tmp_data->FPS['d8']."
- ,[AnimPrefix] = N'".($tmp_data->Model['AnimPrefix']?$tmp_data->Model['AnimPrefix']:$tmp_data['FNAME'])."'
- ,[Weight] = ".(int)$tmp_data['Weight']."
- ,[DurabilityUse] = ".(double)$tmp_data->Dur['u']."
- ,[RepairAmount] = ".(double)$tmp_data->Dur['r1']."
- ,[PremRepairAmount] = ".(double)$tmp_data->Dur['r2']."
- ,[RepairPriceGD] = ".(double)$tmp_data->Dur['r3']."
- ,[ResWood] = ".(int)$tmp_data->Res['r1']."
- ,[ResStone] = ".(int)$tmp_data->Res['r2']."
- ,[ResMetal] = ".(int)$tmp_data->Res['r3']."
- WHERE [ItemID] = '".$tmp_data['itemID']."'";
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd); }
- foreach( $data->FoodArmory->Item as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Weapons] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Weapons] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,N'' ,N'' ,N'' ,N'' ,N'' ,N'' ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Property['stamina']."
- ,0 ,0 ,0
- ,".(int)$tmp_data->Property['shopSS']."
- ,".(double)$tmp_data->Property['health']."
- ,0
- ,".(double)$tmp_data->Property['toxicity']."
- ,".(double)$tmp_data->Property['water']."
- ,".(double)$tmp_data->Property['food']."
- ,0 ,N'' ,N'' ,30 ,N'' ,0 ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,N''
- ,".(int)$tmp_data['Weight']."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Weapons]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[Area] = ".(double)$tmp_data->Property['stamina']."
- ,[Clipsize] = ".(int)$tmp_data->Property['shopSS']."
- ,[ReloadTime] = ".(double)$tmp_data->Property['health']."
- ,[RateOfFire] = ".(double)$tmp_data->Property['toxicity']."
- ,[Spread] = ".(double)$tmp_data->Property['water']."
- ,[Recoil] = ".(double)$tmp_data->Property['food']."
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->VehicleArmory->Item as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Weapons] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Weapons] VALUES (
- ".$tmp_data['itemID']."
- ,N'".$tmp_data->Property['fname']."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,N'' ,N'' ,N'' ,N'' ,N'' ,N'' ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Property['fuel']."
- ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Property['durability']."
- ,".(double)$tmp_data->Property['armor']."
- ,0
- ,".(double)$tmp_data->Property['torque']."
- ,".(double)$tmp_data->Property['omega']."
- ,0 ,N'' ,N'' ,30 ,N'' ,0 ,0 ,0 ,0 ,0 ,0 ,0
- ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,N''
- ,".(int)$tmp_data['Weight']."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Weapons]
- SET [FNAME] = N'".$tmp_data->Property['fname']."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[Area] = ".(double)$tmp_data->Property['fuel']."
- ,[ReloadTime] = ".(double)$tmp_data->Property['durability']."
- ,[ActiveReloadTick] = ".(double)$tmp_data->Property['armor']."
- ,[Spread] = ".(double)$tmp_data->Property['torque']."
- ,[Recoil] = ".(double)$tmp_data->Property['omega']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->CraftComponentsArmory->Item as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Generic] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Generic] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0
- ,".(int)$tmp_data['Weight']."
- ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Generic]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->CraftRecipeArmory->Item as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Generic] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Generic] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0
- ,".(int)$tmp_data['Weight']."
- ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Generic]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->GearArmory->Gear as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Gear] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Gear] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],29,strlen($tmp_data->Model['file'])-33)."'
- ,N'".str_replace("'","''",$tmp_data->Store['name'])."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,".$tmp_data['category']."
- ,".(int)$tmp_data['Weight']."
- ,".(int)$tmp_data->Armor['damagePerc']."
- ,".(int)$tmp_data->Armor['damageMax']."
- ,".(int)$tmp_data->Armor['bulkiness']."
- ,".(int)$tmp_data->Armor['inaccuracy']."
- ,".(int)$tmp_data->Armor['stealth']."
- ,0 ,0 ,0 ,0 ,0
- ,".(int)$tmp_data->Armor['ProtectionLevel']."
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0
- ,".(int)$tmp_data->Dur['u']."
- ,".(int)$tmp_data->Dur['r1']."
- ,".(int)$tmp_data->Dur['r2']."
- ,".(int)$tmp_data->Dur['r3']."
- ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Gear]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],29,strlen($tmp_data->Model['file'])-33)."'
- ,[Name] = N'".str_replace("'","''",$tmp_data->Store['name'])."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[Category] = ".$tmp_data['category']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- ,[DamagePerc] = ".(int)$tmp_data->Armor['damagePerc']."
- ,[DamageMax] = ".(int)$tmp_data->Armor['damageMax']."
- ,[Bulkiness] = ".(int)$tmp_data->Armor['bulkiness']."
- ,[Inaccuracy] = ".(int)$tmp_data->Armor['inaccuracy']."
- ,[Stealth] = ".(int)$tmp_data->Armor['stealth']."
- ,[ProtectionLevel] = ".(int)$tmp_data->Armor['ProtectionLevel']."
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[DurabilityUse] = ".(int)$tmp_data->Dur['u']."
- ,[RepairAmount] = ".(int)$tmp_data->Dur['r1']."
- ,[PremRepairAmount] = ".(int)$tmp_data->Dur['r2']."
- ,[RepairPriceGD] = ".(int)$tmp_data->Dur['r3']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->HeroArmory->Hero as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Gear] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Gear] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],29,strlen($tmp_data->Model['file'])-29)."'
- ,N'".str_replace("'","''",$tmp_data->Store['name'])."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,".$tmp_data['category']."
- ,".(int)$tmp_data['Weight']."
- ,".(int)$tmp_data->HeroDesc['damagePerc']."
- ,".(int)$tmp_data->HeroDesc['damageMax']."
- ,".(int)$tmp_data->HeroDesc['maxHeads']."
- ,".(int)$tmp_data->HeroDesc['maxBodys']."
- ,".(int)$tmp_data->HeroDesc['maxLegs']."
- ,0 ,0 ,0 ,0 ,0
- ,".(int)$tmp_data->HeroDesc['ProtectionLevel']."
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Gear]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],29,strlen($tmp_data->Model['file'])-29)."'
- ,[Name] = N'".str_replace("'","''",$tmp_data->Store['name'])."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[Category] = ".$tmp_data['category']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- ,[DamagePerc] = ".(int)$tmp_data->HeroDesc['damagePerc']."
- ,[DamageMax] = ".(int)$tmp_data->HeroDesc['damageMax']."
- ,[Bulkiness] = ".(int)$tmp_data->HeroDesc['maxHeads']."
- ,[Inaccuracy] = ".(int)$tmp_data->HeroDesc['maxBodys']."
- ,[Stealth] = ".(int)$tmp_data->HeroDesc['maxLegs']."
- ,[ProtectionLevel] = ".(int)$tmp_data->HeroDesc['ProtectionLevel']."
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[DurabilityUse] = ".(int)$tmp_data->Dur['u']."
- ,[RepairAmount] = ".(int)$tmp_data->Dur['r1']."
- ,[PremRepairAmount] = ".(int)$tmp_data->Dur['r2']."
- ,[RepairPriceGD] = ".(int)$tmp_data->Dur['r3']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->BackpackArmory->Backpack as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Gear] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Gear] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],29,strlen($tmp_data->Model['file'])-33)."'
- ,N'".str_replace("'","''",$tmp_data->Store['name'])."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,".$tmp_data['category']."
- ,".(int)$tmp_data['Weight']."
- ,0 ,0
- ,".(int)$tmp_data->Desc['maxSlots']."
- ,".(int)$tmp_data->Desc['maxWeight']."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Gear]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],29,strlen($tmp_data->Model['file'])-33)."'
- ,[Name] = N'".str_replace("'","''",$tmp_data->Store['name'])."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[Category] = ".$tmp_data['category']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- ,[Bulkiness] = ".(int)$tmp_data->Desc['maxSlots']."
- ,[Inaccuracy] = ".(int)$tmp_data->Desc['maxWeight']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->ItemsDB->Item as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Generic] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Generic] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Store['icon'],25,strlen($tmp_data->Store['icon'])-29)."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0
- ,".(int)$tmp_data['Weight']."
- ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Generic]
- SET [FNAME] = N'".substr($tmp_data->Store['icon'],25,strlen($tmp_data->Store['icon'])-29)."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->AttachmentArmory->Attachment as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Attachments] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Attachments] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,".(int)$tmp_data['type']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,N'".$tmp_data->Model['MuzzleParticle']."'
- ,N'".$tmp_data->Model['FireSound']."'
- ,".(double)$tmp_data->Upgrade['damage']."
- ,".(double)$tmp_data->Upgrade['range']."
- ,".(double)$tmp_data->Upgrade['firerate']."
- ,".(double)$tmp_data->Upgrade['recoil']."
- ,".(double)$tmp_data->Upgrade['spread']."
- ,".(double)$tmp_data->Upgrade['clipsize']."
- ,".(double)$tmp_data->Upgrade['ScopeMag']."
- ,N'".$tmp_data->Upgrade['ScopeType']."'
- ,N'".$tmp_data->Model['ScopeAnim']."'
- ,".(int)$tmp_data['SpecID']."
- ,".($tmp_data['category']?$tmp_data['category']:19)."
- ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,".(int)$tmp_data['Weight']."
- ,".(int)$tmp_data->Dur['u']."
- ,".(int)$tmp_data->Dur['r1']."
- ,".(int)$tmp_data->Dur['r2']."
- ,".(int)$tmp_data->Dur['r3']."
- ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Attachments]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,[Type] = ".(int)$tmp_data['type']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[MuzzleParticle] = N'".$tmp_data->Model['MuzzleParticle']."'
- ,[FireSound] = N'".$tmp_data->Model['FireSound']."'
- ,[Damage] = ".(double)$tmp_data->Upgrade['damage']."
- ,[Range] = ".(double)$tmp_data->Upgrade['range']."
- ,[Firerate] = ".(double)$tmp_data->Upgrade['firerate']."
- ,[Recoil] = ".(double)$tmp_data->Upgrade['recoil']."
- ,[Spread] = ".(double)$tmp_data->Upgrade['spread']."
- ,[Clipsize] = ".(double)$tmp_data->Upgrade['clipsize']."
- ,[ScopeMag] = ".(double)$tmp_data->Upgrade['ScopeMag']."
- ,[ScopeType] = N'".$tmp_data->Upgrade['ScopeType']."'
- ,[AnimPrefix] = N'".$tmp_data->Model['ScopeAnim']."'
- ,[SpecID] = ".(int)$tmp_data['SpecID']."
- ,[Category] = ".($tmp_data['category']?$tmp_data['category']:19)."
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- ,[DurabilityUse] = ".(int)$tmp_data->Dur['u']."
- ,[RepairAmount] = ".(int)$tmp_data->Dur['r1']."
- ,[PremRepairAmount] = ".(int)$tmp_data->Dur['r2']."
- ,[RepairPriceGD] = ".(int)$tmp_data->Dur['r3']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->LootBoxDB->LootBox as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_Generic] WHERE [ItemID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_Generic] VALUES (
- ".$tmp_data['itemID']."
- ,N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,".$tmp_data['category']."
- ,N'".$tmp_data->Store['name']."'
- ,N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,0 ,0 ,0 ,0 ,0
- ,".(double)$tmp_data->Store['LevelRequired']."
- ,0 ,0 ,0 ,0
- ,".(int)$tmp_data['Weight']."
- ,0 ,0 ,0)";
- echo " Status: New!<br>";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_Generic]
- SET [FNAME] = N'".substr($tmp_data->Model['file'],26,strlen($tmp_data->Model['file'])-30)."'
- ,[Category] = ".$tmp_data['category']."
- ,[Name] = N'".$tmp_data->Store['name']."'
- ,[Description] = N'".str_replace("'","''",$tmp_data->Store['desc'])."'
- ,[LevelRequired] = ".(double)$tmp_data->Store['LevelRequired']."
- ,[Weight] = ".(int)$tmp_data['Weight']."
- WHERE [ItemID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- foreach( $data->LootBoxDB->LootBox as $tmp_data ){
- $sql = "SELECT * FROM [dbo].[Items_LootSrvModifiers] WHERE [LootID] = '".$tmp_data['itemID']."'";
- $stmt = sqlsrv_query($conn, $sql , array(), array("Scrollable"=>"buffered"));
- echo "ItemID: ".$tmp_data['itemID']." Name: ".$tmp_data->Store['name'];
- if(sqlsrv_num_rows($stmt) == 0){
- $sql_cmd = "INSERT INTO [dbo].[Items_LootSrvModifiers] VALUES (
- ".$tmp_data['itemID']."
- ,100 ,100 ,200)";
- }else{
- $sql_cmd = "UPDATE [dbo].[Items_LootSrvModifiers]
- SET [SrvNormal] = 100
- ,[SrvTrial] = 100
- ,[SrvPremium] = 200
- WHERE [LootID] = ".$tmp_data['itemID'];
- echo " Status: Update<br>";
- }
- $stmt = sqlsrv_query($conn, $sql_cmd);
- }
- ?>
Add Comment
Please, Sign In to add comment