Example #1
0
 function details()
 {
     global $smarty;
     $item = new dogma($this->typeID);
     if (!$item->isValid()) {
         $this->page->setTitle('Error');
         return 'This ID is not a valid dogma ID.';
     }
     $this->page->setTitle('Item details - ' . $item->get('typeName'));
     $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />');
     $smarty->assignByRef('item', $item);
     if ($item->get('itt_cat') == 6) {
         //we have a ship, so get it from the db
         $ship = Ship::getByID($item->get('typeID'));
         $smarty->assign('shipImage', $ship->getImage(64));
         $smarty->assign('armour', array('armorHP', 'armorEmDamageResonance', 'armorExplosiveDamageResonance', 'armorKineticDamageResonance', 'armorThermalDamageResonance'));
         $smarty->assign('shield', array('shieldCapacity', 'shieldRechargeRate', 'shieldEmDamageResonance', 'shieldExplosiveDamageResonance', 'shieldKineticDamageResonance', 'shieldThermalDamageResonance'));
         $smarty->assign('propulsion', array('maxVelocity', 'agility', 'droneCapacity', 'capacitorCapacity', 'rechargeRate'));
         $smarty->assign('fitting', array('hiSlots', 'medSlots', 'lowSlots', 'rigSlots', 'upgradeCapacity', 'droneBandwidth', 'launcherSlotsLeft', 'turretSlotsLeft', 'powerOutput', 'cpuOutput'));
         $smarty->assign('targetting', array('maxTargetRange', 'scanResolution', 'maxLockedTargets', 'scanRadarStrength', 'scanLadarStrength', 'scanMagnetometricStrength', 'scanGravimetricStrength', 'signatureRadius'));
         $smarty->assign('miscellaneous', array('techLevel', 'propulsionFusionStrength', 'propulsionIonStrength', 'propulsionMagpulseStrength', 'propulsionPlasmaStrength'));
         $html = $smarty->fetch(get_tpl('invtype_ship'));
     } else {
         $i = new Item($this->typeID);
         $smarty->assign('itemImage', $i->getIcon(64, false));
         $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false);
         $html = $smarty->fetch(get_tpl('invtype_item'));
     }
     return $html;
 }
Example #2
0
 function generate()
 {
     global $smarty;
     $this->toplist->generate();
     while ($row = $this->toplist->getRow()) {
         $item = new Item($row['itm_id']);
         $rows[] = array('rank' => false, 'name' => $item->getName(), 'uri' => edkURI::build(array('a', 'invtype', true), array('id', $item->getID(), true)), 'icon' => $item->getIcon(32), 'count' => $row['cnt']);
     }
     $smarty->assign('tl_name', Language::get('weapon'));
     $smarty->assign('tl_type', Language::get('kills'));
     $smarty->assignByRef('tl_rows', $rows);
     return $smarty->fetch(get_tpl('toplisttable'));
 }
Example #3
0
 function moduleInfo($param_moduleArray)
 {
     $low = 0;
     $mid = 0;
     $hig = 0;
     $rig = 0;
     $slots = array(7 => "", 3 => "[empty low slot]", 2 => "[empty mid slot]", 1 => "[empty high slot]", 5 => "[empty rig slot]", 6 => "", 10 => "", 11 => "");
     /*echo "<pre>";
     	print_r($param_moduleArray);
     	echo "</pre>";*/
     /*
     [0] => Array
         (
     		[name] => E500 Prototype Energy Vampire
     		[groupID] => 68
     		[chargeSize] =>
     		[itemid] => 16501
     		[id] => 16501
     		[capacity] => 0
     		[mass] => 1000
     		[volume] => 5
     		[icon] => 01_03
     		[slot] => 1
         )
     */
     foreach ($slots as $j => $slot) {
         $moduleArr = null;
         $moduleArr = array();
         if ($param_moduleArray[$j]) {
             foreach ($param_moduleArray[$j] as $i => $value) {
                 //echo $value['itemid']." -> <br />";
                 $item = new Item($value[itemid]);
                 if (array_key_exists($value['itemid'], $moduleArr)) {
                     //echo $value[itemid]." -> ".$moduleArr[$value[itemid]]['name']." - > ".self::$moduleCount." -> ".$moduleArr[$value[itemid]]["ignore"]."<br />";
                     if ($moduleArr[$value[itemid]]["ignore"] !== true) {
                         self::$modSlots[$j][] = array('id' => $moduleArr[$value[itemid]]['id'], 'name' => $moduleArr[$value[itemid]]['name'], 'groupID' => $moduleArr[$value[itemid]]['groupID'], 'icon' => $moduleArr[$value[itemid]]['icon'], 'iconloc' => $moduleArr[$value[itemid]]['iconloc'], 'metaLevel' => $moduleArr[$value[itemid]]["metaLevel"], 'techLevel' => $moduleArr[$value[itemid]]["techLevel"], 'capacity' => $moduleArr[$value[itemid]]['capacity'], 'volume' => $moduleArr[$value[itemid]]['volume'], 'mass' => $moduleArr[$value[itemid]]['mass']);
                         $valueinput = explode(",", $moduleArr[$value[itemid]]['value']);
                         $attributeName = explode(",", $moduleArr[$value[itemid]]['attributeName']);
                         $displayName = explode(",", $moduleArr[$value[itemid]]['displayName']);
                         $stackable = explode(",", $moduleArr[$value[itemid]]['stackable']);
                         $unit = explode(",", $moduleArr[$value[itemid]]['unit']);
                         //echo $moduleArr[$value[itemid]]['name']." -> <br />";
                         for ($k = 0; $k < count($valueinput); $k++) {
                             if ($valueinput != "") {
                                 if ($unit[$k] == "%") {
                                     $type = $unit[$k];
                                 } else {
                                     $type = "+";
                                 }
                                 $neg = fittingTools::negRules($stackable[$k], $unit[$k]);
                                 if ($j == 6) {
                                     fittingTools::applyDroneSkills(abs($valueinput[$k]), "+", $type, $attributeName[$k], false, 1, $neg, $moduleArr[$value[itemid]]['groupID'], $moduleArr[$value[itemid]]['capacity'], $moduleArr[$value[itemid]]['name'], $moduleArr[$value[itemid]]["techLevel"], $j);
                                 } else {
                                     //echo $moduleArr[$value[itemid]]['name']."<br />";
                                     fittingTools::applyShipSkills(abs($valueinput[$k]), "+", $type, $attributeName[$k], false, 1, $neg, $moduleArr[$value[itemid]]['groupID'], $moduleArr[$value[itemid]]['capacity'], $moduleArr[$value[itemid]]['name'], $moduleArr[$value[itemid]]["techLevel"], $j, $moduleArr[$value[itemid]]['mass']);
                                 }
                             }
                         }
                     } else {
                         if (self::$droneArr[$value[itemid]]['name']) {
                             self::$droneArr[$value[itemid]]['count']++;
                         }
                     }
                 } else {
                     if (fittingTools::advancedModuleSettings($value['name']) == "mwd") {
                         //i removed icon thing here :: note
                         self::$shipStats->setIsMWD(true);
                     }
                     if (fittingTools::advancedModuleSettings($value['name']) == "ab") {
                         self::$shipStats->setIsAB(true);
                     }
                     //self::$modSlots[$j][] = array('id'=> $value['id'],'name'=> $value['name'], 'icon'=> $value['itemid'], 'metaLevel' => $value["meta"], 'techLevel' => $value["tech"], 'capacity' => $value["capacity"], 'volume' => $value["volume"], 'mass' => $value["mass"]);
                     if ($j == 10 || $j == 6) {
                         self::$modSlots[$j][] = array('id' => $value['id'], 'name' => $value['name'], 'groupID' => $value['groupID'], 'icon' => $value['icon'], 'iconloc' => $item->getIcon(32), 'metaLevel' => $value["meta"], 'techLevel' => $value["tech"], 'capacity' => $value["capacity"], 'volume' => $value["volume"], 'mass' => $value["mass"]);
                     } else {
                         self::$modSlots[$j][] = array('id' => $value['id'], 'name' => $value['name'], 'groupID' => $value['groupID'], 'icon' => $value['icon'], 'iconloc' => $item->getIcon(64, false), 'metaLevel' => $value["meta"], 'techLevel' => $value["tech"], 'capacity' => $value["capacity"], 'volume' => $value["volume"], 'mass' => $value["mass"]);
                     }
                     /*echo "<br/>-----------------------<br/>";
                     		echo "<pre>";
                     		print_r($value);
                     		echo "</pre>";*/
                     //echo "not found -> ".$typeID['typeName']." ".$value['itemid']."<br />";
                     if ($j == 7) {
                         self::$shipStats->setMass(fittingTools::statOntoShip(self::$shipStats->getMass(), fittingTools::calculateMass($value['mass']), "+", "+", 1));
                     }
                     ////////////////////////////////////////
                     //add in functionality here
                     //get module stats on the fly
                     //see how it displays
                     //limit the amount of queries here
                     $qry2 = new DBQuery();
                     $qry2->execute("select kb3_dgmtypeattributes.value, kb3_dgmattributetypes.attributeName, kb3_dgmattributetypes.displayName, kb3_dgmattributetypes.stackable, kb3_eveunits.displayName as unit\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nleft join kb3_eveunits on kb3_dgmattributetypes.unitID = kb3_eveunits.unitID\nwhere typeID = " . $value['itemid']);
                     while ($row = $qry2->getRow()) {
                         //echo $row['value']." ".$row['attributeName']."<br/>";
                         //echo abs($row['value'])." "+" ".$row['unit']." ".$row['attributeName']." ".false." 1 ".$row['stackable']."<br />";
                         if ($row['unit'] == "%") {
                             $type = $row['unit'];
                         } else {
                             $type = "+";
                         }
                         $neg = fittingTools::negRules($row['stackable'], $row['unit']);
                         if ($j == 6) {
                             //applyDroneSkills
                             //echo fittingTools::dumpDrones($typeID['typeName'])."<br />";
                             if (fittingTools::applyDroneSkills(abs($row['value']), "+", $type, $row['attributeName'], false, 1, $neg, $value['groupID'], $value['volume'], $value['name'], $value["tech"], 6)) {
                                 $moduleArr[$value[itemid]]['value'] .= $row['value'] . ",";
                                 $moduleArr[$value[itemid]]['attributeName'] .= $row['attributeName'] . ",";
                                 $moduleArr[$value[itemid]]['displayName'] .= $row['displayName'] . ",";
                                 $moduleArr[$value[itemid]]['stackable'] .= $row['stackable'] . ",";
                                 $moduleArr[$value[itemid]]['unit'] .= $row['unit'] . ",";
                                 $moduleArr[$value[itemid]]['id'] = $value['id'];
                                 $moduleArr[$value[itemid]]['name'] = $value['name'];
                                 $moduleArr[$value[itemid]]['groupID'] = $value['groupID'];
                                 $moduleArr[$value[itemid]]['techLevel'] = $value['tech'];
                                 $moduleArr[$value[itemid]]['metaLevel'] = $value['meta'];
                                 $moduleArr[$value[itemid]]['icon'] = $value['icon'];
                                 $moduleArr[$value[itemid]]['iconloc'] = $item->getIcon(32);
                                 $moduleArr[$value[itemid]]['capacity'] = $value['capacity'];
                                 $moduleArr[$value[itemid]]['volume'] = $value['volume'];
                                 $moduleArr[$value[itemid]]['mass'] = $value['mass'];
                                 self::$droneArr[$value[itemid]]['name'] = $value['name'];
                                 self::$droneArr[$value[itemid]]['count'] = 1;
                             } else {
                                 $moduleArr[$value[itemid]]['ignore'] = true;
                             }
                             $drone_count++;
                         } else {
                             if (fittingTools::applyShipSkills(abs($row['value']), "+", $type, $row['attributeName'], false, 1, $neg, $value['groupID'], $j == 10 ? $value['volume'] : $value['capacity'], $value['name'], $value["tech"], $j, $value['mass'])) {
                                 //echo $value['name']." - ".abs($row['value']). " - G". $value['groupID'] ." - ".$type." -".$row['attributeName']." -".$neg." - I".$typeID['icon']." -".$typeID['capacity']." -".$typeID['typeName']." -".$tech["value"]." -".$j."<br/>";
                                 //echo $j." - ".$value['icon']." - ".$moduleArr[$value[itemid]]['iconloc']." - ".$value[itemid]."<br />";
                                 $moduleArr[$value[itemid]]['value'] .= $row['value'] . ",";
                                 $moduleArr[$value[itemid]]['attributeName'] .= $row['attributeName'] . ",";
                                 $moduleArr[$value[itemid]]['displayName'] .= $row['displayName'] . ",";
                                 $moduleArr[$value[itemid]]['stackable'] .= $row['stackable'] . ",";
                                 $moduleArr[$value[itemid]]['unit'] .= $row['unit'] . ",";
                                 $moduleArr[$value[itemid]]['id'] = $value['id'];
                                 $moduleArr[$value[itemid]]['name'] = $value['name'];
                                 $moduleArr[$value[itemid]]['groupID'] = $value['groupID'];
                                 $moduleArr[$value[itemid]]['techLevel'] = $value['tech'];
                                 $moduleArr[$value[itemid]]['metaLevel'] = $value['meta'];
                                 $moduleArr[$value[itemid]]['icon'] = $value['icon'];
                                 if ($j == 10 || $j == 6) {
                                     $moduleArr[$value[itemid]]['iconloc'] = $item->getIcon(32);
                                     //echo "10 ".$moduleArr[$value[itemid]]['icon']."<br />";
                                 } else {
                                     //$moduleArr[$value[itemid]]['icon'] 		= $value['icon'];
                                     $moduleArr[$value[itemid]]['iconloc'] = $item->getIcon(64, false);
                                     //echo $moduleArr[$value[itemid]]['icon']."<br />";
                                 }
                                 $moduleArr[$value[itemid]]['capacity'] = $j == 10 ? $value['volume'] : $value['capacity'];
                                 $moduleArr[$value[itemid]]['volume'] = $value['volume'];
                                 $moduleArr[$value[itemid]]['mass'] = $value['mass'];
                             }
                         }
                     }
                 }
                 if ($j != 10) {
                     self::$moduleCount++;
                 }
                 /////////////////////////////////////////
                 if ($j == 1) {
                     $hig++;
                 } else {
                     if ($j == 2) {
                         $mid++;
                     } else {
                         if ($j == 3) {
                             $low++;
                         } else {
                             if ($j == 5) {
                                 $rig++;
                             }
                         }
                     }
                 }
             }
         }
     }
     /*echo "<pre>";
     	print_r(self::$droneArr);
     	echo "</pre>";*/
     //echo $hig." ".$mid." ".$low." ".$rig;
     //fittingTools::curPageURL()
     $arr = self::$shipStats->getShipSlots();
     for ($h = $hig; $h < $arr['hislots']; $h++) {
         self::$modSlots[1][] = array('id' => 0, 'name' => 'Empty High Slot', 'iconloc' => (self::$simpleurl ? fittingTools::curPageURL() : "") . 'mods/ship_tool_kb/images/equipment/icon00_hig.png', 'metaLevel' => 0, 'techLevel' => 0, 'capacity' => 0, 'volume' => 0, 'mass' => 0);
     }
     for ($m = $mid; $m < $arr['medslots']; $m++) {
         self::$modSlots[2][] = array('id' => 0, 'name' => 'Empty Mid Slot', 'iconloc' => (self::$simpleurl ? fittingTools::curPageURL() : "") . 'mods/ship_tool_kb/images/equipment/icon00_mid.png', 'metaLevel' => 0, 'techLevel' => 0, 'capacity' => 0, 'volume' => 0, 'mass' => 0);
     }
     for ($l = $low; $l < $arr['lowslots']; $l++) {
         self::$modSlots[3][] = array('id' => 0, 'name' => 'Empty Low Slot', 'iconloc' => (self::$simpleurl ? fittingTools::curPageURL() : "") . 'mods/ship_tool_kb/images/equipment/icon00_low.png', 'metaLevel' => 0, 'techLevel' => 0, 'capacity' => 0, 'volume' => 0, 'mass' => 0);
     }
     for ($r = $rig; $r < $arr['rigslots']; $r++) {
         self::$modSlots[5][] = array('id' => 0, 'name' => 'Empty Rig Slot', 'iconloc' => (self::$simpleurl ? fittingTools::curPageURL() : "") . 'mods/ship_tool_kb/images/equipment/icon00_rig.png', 'metaLevel' => 0, 'techLevel' => 0, 'capacity' => 0, 'volume' => 0, 'mass' => 0);
     }
     if (!empty(self::$modSlots[7])) {
         foreach (self::$modSlots[7] as $i => $value) {
             fittingTools::subsystemaddon($value['name']);
         }
     }
     /*echo "<pre>";
     	print_r(self::$modSlots);
     	//print_r(self::$shipStats->getShipSlots());
     	echo "</pre>";*/
 }