Logged in as admin, loading engine/XML/items.xml file and updating cache.

"; // ITEMS XML TO PHP ARRAY $itemsXML = simplexml_load_file("engine/XML/items.xml"); if ($itemsXML !== false) { $types = array(); $type_attr = array(); $groups = array(); // This empty array will eventually contain all items grouped by type and indexed by item type $items = array(); // Loop through each XML item object foreach ($itemsXML as $type => $item) { // Get item types if (!in_array($type, $types)) { $types[] = $type; $type_attr[$type] = array(); } // Get item attributes $attributes = array(); // Extract attribute values from the XML object and store it in a more manage friendly way $attributes foreach ($item->attributes() as $aName => $aValue) $attributes["$aName"] = "$aValue"; // Remove unececsary attributes if (isset($attributes['plural'])) unset($attributes['plural']); //if (isset($attributes['id'])) unset($attributes['id']); //if (isset($attributes['fromid'])) unset($attributes['fromid']); //if (isset($attributes['toid'])) unset($attributes['toid']); if (isset($attributes['editorsuffix'])) unset($attributes['editorsuffix']); if (isset($attributes['article'])) unset($attributes['article']); // Populate type attributes foreach (array_keys($attributes) as $attr) { if (!in_array($attr, $type_attr[$type])) $type_attr[$type][] = $attr; } // Loop through every object inside the object $item_attributes = array(); $iai = array(); foreach ($item as $attribute) { foreach ($attribute->attributes() as $aName => $aValue) { if($aName == 'key') { $attribute_attributes["$aName"] = "$aValue"; $iai[] = $attribute_attributes[$aName]; } } } foreach ($item as $attribute) { foreach ($attribute->attributes() as $aName => $aValue) { $attribute_attributes["$aName"] = "$aValue"; if(in_array($attribute_attributes[$aName], $iai)) { $whatis = $attribute_attributes[$aName]; } else { $item_attributes[$whatis] = (isset($attribute_attributes[$aName])) ? $attribute_attributes[$aName] : false; } } } foreach (array_keys($attributes) as $attr) { if (!in_array($attr, $type_attr[$type])) $type_attr[$type][] = $attr; } // Add items with slotType or weaponType (TFS 1.x default) if(isset($attributes['id'])) $id = (isset($attributes['id'])) ? $attributes['id'] : false; if(isset($attributes['fromid'])) $id = (isset($attributes['name'])) ? $attributes['name'] : false; if (isset($item_attributes['slotType']) || isset($item_attributes['weaponType'])) { $items[$type][$id] = array('attributes' => $item_attributes); // Populate item array with potential relevant attributes for the item type foreach ($type_attr[$type] as $att) $items[$type][$id][$att] = (isset($attributes[$att])) ? $attributes[$att] : false; } $save = array($items); } $itemsCache->setContent($items); $itemsCache->save(); } else { echo "

Failed to load engine/XML/items.xml file.

"; } } else { $items = $itemsCache->load(); ?>
load(); } // End loading items list if ($items) { // Preparing data $types = array_keys($items); $itemServer = 'http://'.$config['shop']['imageServer'].'/'; //slotType values and names if(isset($_GET['slot'])) { switch($_GET['slot']) { case 'helmet': $slottype = 'head'; $slottype_name = 'Helmets'; break; case 'sword': $slottype = 'sword'; $slottype_name = 'Swords'; break; case 'distance': $slottype = 'distance'; $slottype_name = 'Distance Weapons'; break; case 'wand': $slottype = 'wand'; $slottype_name = 'Wands & Rods'; break; case 'armor': $slottype = 'body'; $slottype_name = 'Armors'; break; case 'club': $slottype = 'club'; $slottype_name = 'Clubs'; break; case 'ammunition': $slottype = 'ammunition'; $slottype_name = 'Ammunition'; break; case 'book': $slottype = 'shield'; $slottype_name = 'Spellbooks'; break; case 'legs': $slottype = 'legs'; $slottype_name = 'Legs'; break; case 'axe': $slottype = 'axe'; $slottype_name = 'Axes'; break; case 'necklace': $slottype = 'necklace'; $slottype_name = 'Amulets & Necklaces'; break; case 'feet': $slottype = 'feet'; $slottype_name = 'Boots'; break; case 'shield': $slottype = 'shield'; $slottype_name = 'Shields & Spellbooks'; break; case 'backpack': $slottype = 'backpack'; $slottype_name = 'Backpacks'; break; case 'ring': $slottype = 'ring'; $slottype_name = 'Rings'; break; default: $slottype_name = 'null'; break; } } // Render HTML if(isset($_GET['slot']) && ($slottype_name == 'null')) header("Location:items.php"); ?>

Items

Helmets
Swords
Shields & Spellbooks
Amulets
Armors
Clubs
Wands & Rods
Ammunition
Legs
Axes
Rings
Boots
Distance
Backpacks
$value) { if($att == 'slotType' || $att == 'weaponType') $slotType = $value; if(!empty($slotType) && $slotType == $slottype) $show = true; else $show = false; } } if($show == true) { ?>
Name Attributes
$value) { $extra = NULL; if($value > 0) $extra = '+'; switch ($array) { case 'weight': echo ucwords($array).': '.intval($value/100).'.'.substr($value, -2).' oz
'; break; case 'containerSize': echo 'Slots: '.$value.'
'; break; case 'armor': echo ucwords($array).': '.$value.'
'; break; case 'attack': echo ucwords($array).': '.$value; if($element != NULL) echo ' ('.$element.')'; echo '
'; break; case 'defense': echo ucwords($array).': '.$value; if($extradef != NULL) echo ' ('.$extradef.')'; echo '
'; break; case 'skillFist': echo 'Fist Fighting: '.$extra.$value.'
'; break; case 'skillAxe': echo 'Axe Fighting: '.$extra.$value.'
'; break; case 'skillSword': echo 'Sword Fighting: '.$extra.$value.'
'; break; case 'skillClub': echo 'Club Fighting: '.$extra.$value.'
'; break; case 'skillAxe': echo 'Axe Fighting: '.$extra.$value.'
'; break; case 'skillDist': echo 'Distance Fighting: '.$extra.$value.'
'; break; case 'skillShield': echo 'Shielding: '.$extra.$value.'
'; break; case 'range': echo ucwords($array).': '.$value.'
'; break; case 'shootType': echo 'Shoot Type: '.ucwords($value).'
'; break; case 'hitChance': echo 'Hit: '.$extra.$value.'%
'; break; case 'magiclevelpoints': echo 'Magic Level: '.$extra.$value.'
'; break; case 'absorbPercentEnergy': echo 'Energy Protection: '.$extra.$value.'%
'; break; case 'absorbPercentFire': echo 'Fire Protection: '.$extra.$value.'%
'; break; case 'absorbPercentEarth': echo 'Earth Protection: '.$extra.$value.'%
'; break; case 'absorbPercentPoison': echo 'Poison Protection: '.$extra.$value.'%
'; break; case 'absorbPercentIce': echo 'Ice Protection: '.$extra.$value.'%
'; break; case 'absorbPercentHoly': echo 'Holy Protection: '.$extra.$value.'%
'; break; case 'absorbPercentDeath': echo 'Death Protection: '.$extra.$value.'%
'; break; case 'absorbPercentLifeDrain': echo 'Life Drain Protection: '.$extra.$value.'%
'; break; case 'absorbPercentManaDrain': echo 'Mana Drain Protection: '.$extra.$value.'%
'; break; case 'absorbPercentDrown': echo 'Drown Protection: '.$extra.$value.'%
'; break; case 'absorbPercentPhysical': echo 'Physical Protection: '.$extra.$value.'%
'; break; case 'absorbPercentIce': echo 'Ice Protection: '.$extra.$value.'%
'; break; /**case 'suppressDrunk': echo 'Suppress Drunk: Yes
'; break; case 'suppressEnergy': echo 'Suppress Energy: Yes
'; break; case 'suppressFire': echo 'Suppress Fire: Yes
'; break; case 'suppressPoison': echo 'Suppress Poison: Yes
'; break; case 'suppressDrown': echo 'Suppress Drown: Yes
'; break; case 'suppressPhysical': echo 'Suppress Bleeding: Yes
'; break; case 'suppressFreeze': echo 'Suppress Freeze: Yes
'; break; case 'suppressDazzle': echo 'Suppress Dazzle: Yes
'; break; case 'suppressCurse': echo 'Suppress Curse: Yes
'; break; Those are not necessary in my opinion, but if you want to show **/ case 'speed': echo 'Speed: '.$extra.($value/2).'
'; break; case 'charges': echo 'Charges: '.$value.'
'; break; } } ?>

Items

Items have currently not been loaded into the website by the server admin.