/** * Load Vault Bonus * * @return void */ private function loadVaultBonus($bonus, $account) { $serialize_file = CTM_FileManage::Lib('ReadScript')->CheckSerializeFile("Web_RegisterVault.serialize.dat") == false; $structure_file = CTM_FileManage::Lib('ReadScript')->StructureFile(CTM_CONTROL_PATH . "Data/RegisterVault.txt", "Web_RegisterVault.serialize.dat", FALSE); $serialize_data = CTM_FileManage::Lib('ReadScript')->ReadScript(); CTM_MuOnline::Lib('Item')->Vault()->OpenVault($account); $itemCount = 0; foreach ($serialize_data[$bonus] as $value) { $itemSize = array(); $hexItem = NULL; if (preg_replace("/(.*?),(.*?)/i", "\$1", $value[15]) > -2) { $value[14] = "0,0"; } elseif (preg_replace("/(.*?),(.*?)/i", "\$1", $value[16]) > -2) { $value[14] = "0,0"; } elseif (preg_replace("/(.*?),(.*?)/i", "\$1", $value[17]) > -2) { $value[14] = "0,0"; } elseif (preg_replace("/(.*?),(.*?)/i", "\$1", $value[18]) > -2) { $value[14] = "0,0"; } elseif (preg_replace("/(.*?),(.*?)/i", "\$1", $value[19]) > -2) { $value[14] = "0,0"; } CTM_MuOnline::Lib('Item')->Database()->GetItemSize($value[0], $value[1], $itemSize); CTM_MuOnline::Lib('Item')->MakeItemHex($value[0], $value[1], array("Level" => $value[2], "Option" => $value[5], "Skill" => $value[4] == 1, "Luck" => $value[3] == 1, "Excellent" => array(0 => $value[6] == 1, 1 => $value[7] == 1, 2 => $value[8] == 1, 3 => $value[9] == 1, 4 => $value[10] == 1, 5 => $value[11] == 1), "Ancient" => $value[12], "Refine" => $value[13] == 1, "Harmony" => explode(",", $value[14]), "SocketOption" => array(0 => explode(",", $value[15]), 1 => explode(",", $value[16]), 2 => explode(",", $value[17]), 3 => explode(",", $value[18]), 4 => explode(",", $value[19]))), $hexItem); CTM_MuOnline::Lib('Item')->Vault()->FindSlotFree($itemSize['x'], $itemSize['y'], $itemCount); CTM_MuOnline::Lib('Item')->Vault()->InsertItem($hexItem, $itemCount++); } CTM_MuOnline::Lib('Item')->Vault()->CloseVault(true); unset($itemData, $itemCount); }
/** * Reload Auth Session * * @return void */ public static function ReloadSession() { $_SESSION['ACCOUNT_DATA'] = CTM_MuOnline::Lib('Member')->Load(USER_ACCOUNT); $_SESSION['AUTH_SESSION'] = CTM_Cookies::GetCookie("AuthSession"); }
/** * Load Item Details * Get the item details for tooltip * * @param array Item parse * @param array Char parse * @return array */ public function LoadItemDetails($parse, $char = array()) { CTM_MuOnline::Lib('Item')->Database()->GetItemName($parse['Section'], $parse['Index'], $parse['Level'], $itemName); CTM_MuOnline::Lib('Item')->Database()->GetItemData($parse['Section'], $parse['Index'], $parse['Level'], $itemData); $setItem = 0; $use[0] = $itemData['ClassUse']['SM']; $use[1] = $itemData['ClassUse']['BK']; $use[2] = $itemData['ClassUse']['ME']; $use[3] = $itemData['ClassUse']['MG']; $use[4] = $itemData['ClassUse']['DL']; $use[5] = $itemData['ClassUse']['SU']; $use[6] = $itemData['ClassUse']['RF']; $req[0] = $itemData['Requirement']['Level']; $req[1] = $itemData['Requirement']['Strength']; $req[2] = $itemData['Requirement']['Dexterity']; $req[3] = $itemData['Requirement']['Vitality']; $req[4] = $itemData['Requirement']['Energy']; $req[5] = $itemData['Requirement']['Command']; if ($req[0] > 0) { $data['Requirement'][0] = $req[0]; } if ($req[1] > 0) { $data['Requirement'][1] = $req[1]; } if ($req[2] > 0) { $data['Requirement'][2] = $req[2]; } if ($req[3] > 0) { $data['Requirement'][3] = $req[3]; } if ($req[4] > 0) { $data['Requirement'][4] = $req[4]; } if ($req[5] > 0) { $data['Requirement'][5] = $req[5]; } if ($char['Class']) { $tmp = $char['Class']; $class = array(); $class[0] = !$this->CheckUseItem(array($tmp, "SM"), $use[0]) ? 1 : 0; $class[1] = !$this->CheckUseItem(array($tmp, "BK"), $use[1]) ? 1 : 0; $class[2] = !$this->CheckUseItem(array($tmp, "ME"), $use[2]) ? 1 : 0; $class[3] = !$this->CheckUseItem(array($tmp, "MG"), $use[3]) ? 1 : 0; $class[4] = !$this->CheckUseItem(array($tmp, "DL"), $use[4]) ? 1 : 0; $class[5] = !$this->CheckUseItem(array($tmp, "SU"), $use[5]) ? 1 : 0; $class[6] = !$this->CheckUseItem(array($tmp, "RF"), $use[6]) ? 1 : 0; } $data['Begin'] .= $this->ItemInfoString(0) . " " . $parse['Durability']; if ($use[0] > 0) { $data['ClassUse'][0] = array($this->ReturnClass("SM", $use[0]), $class[0]); } if ($use[1] > 0) { $data['ClassUse'][1] = array($this->ReturnClass("BK", $use[1]), $class[1]); } if ($use[2] > 0) { $data['ClassUse'][2] = array($this->ReturnClass("ME", $use[2]), $class[2]); } if ($use[3] > 0) { $data['ClassUse'][3] = array($this->ReturnClass("MG", $use[3]), $class[3]); } if ($use[4] > 0) { $data['ClassUse'][4] = array($this->ReturnClass("DL", $use[4]), $class[4]); } if ($use[5] > 0) { $data['ClassUse'][5] = array($this->ReturnClass("SU", $use[5]), $class[5]); } if ($use[6] > 0) { $data['ClassUse'][6] = array($this->ReturnClass("RF", $use[6]), $class[6]); } if ($parse['Luck'] == 1) { $data['Options'] .= $this->ItemInfoString(2, 0) . "{#}"; } if ($parse['Luck'] == 1) { $data['Options'] .= $this->ItemInfoString(2, 1) . "{#}"; } if ($parse['Option'] > 0) { $data['Options'] .= str_replace("{x}", $parse['Option'], $this->ItemInfoString(3, 0)) . "{#}"; } if ($parse['Excellent']['Count'] > 0) { $excellent = CTM_MuOnline::Lib('Item')->Strings()->GetExcellentData($parse['Section'], $parse['Index'], $parse['Level'], $itemData['Slot']); $excellent = $excellent[$this->lang->language]; $itemName = "Excellent " . $itemName; $setItem = 2; if ($parse['Excellent'][0] == 1 && $excellent[0] != "NONE") { $data['Options'] .= $excellent[0] . "{#}"; } if ($parse['Excellent'][1] == 1 && $excellent[1] != "NONE") { $data['Options'] .= $excellent[1] . "{#}"; } if ($parse['Excellent'][2] == 1 && $excellent[2] != "NONE") { $data['Options'] .= $excellent[2] . "{#}"; } if ($parse['Excellent'][3] == 1 && $excellent[3] != "NONE") { $data['Options'] .= $excellent[3] . "{#}"; } if ($parse['Excellent'][4] == 1 && $excellent[4] != "NONE") { $data['Options'] .= $excellent[4] . "{#}"; } if ($parse['Excellent'][5] == 1 && $excellent[5] != "NONE") { $data['Options'] .= $excellent[5] . "{#}"; } } if (MUSERVER_VERSION >= 3 && $parse['JewelOfHarmony'][0] > 0) { CTM_MuOnline::Lib('Item')->Strings()->GetHarmonyData($parse['Section'], $parse['JewelOfHarmony'][0], $parse['JewelOfHarmony'][1], $harmony); $data['Harmony'] = $harmony['Name'] . " + " . $harmony['Value']; } if (MUSERVER_VERSION >= 6 && $parse['SocketOption']['Count'] > 0) { $data['Socket'][0] = CTM_MuOnline::Lib('Item')->Strings()->GetSocketData(1, $parse['SocketOption'][0][0], $parse['SocketOption'][0][1]); $data['Socket'][1] = CTM_MuOnline::Lib('Item')->Strings()->GetSocketData(2, $parse['SocketOption'][1][0], $parse['SocketOption'][1][1]); $data['Socket'][2] = CTM_MuOnline::Lib('Item')->Strings()->GetSocketData(3, $parse['SocketOption'][2][0], $parse['SocketOption'][2][1]); $data['Socket'][3] = CTM_MuOnline::Lib('Item')->Strings()->GetSocketData(4, $parse['SocketOption'][3][0], $parse['SocketOption'][3][1]); $data['Socket'][4] = CTM_MuOnline::Lib('Item')->Strings()->GetSocketData(5, $parse['SocketOption'][4][0], $parse['SocketOption'][4][1]); $setItem = 3; } if ($parse['Ancient'] > 0) { $setItem = 1; } $define = CTM_MuOnline::Lib('Item')->Database()->CheckDefineItemName($parse['Section'], $parse['Index'], $parse['Level']); $data['Name'] = $itemName . ($parse['Level'] > 0 && $define == false ? " +" . $parse['Level'] : NULL); $data['Set_Item'] = $setItem; $tooltip = array(); $tooltip['Begin'] = $data['Begin']; $tooltip['Options'] = $data['Options']; if (count($char) < 1) { $char['cLevel'] = 700000; $char['Strength'] = 700000; $char['Dexterity'] = 700000; $char['Vitality'] = 700000; $char['Energy'] = 700000; $char[COLUMN_COMMAND] = 700000; } switch ($data['Set_Item']) { case 1: $tooltip['Set_Item'] = "ancient"; break; case 2: $tooltip['Set_Item'] = "excellent"; break; case 3: $tooltip['Set_Item'] = "socket"; break; default: $tooltip['Set_Item'] = NULL; break; } if ($data['Requirement'][0] > 0) { $noReq = $char['cLevel'] < $data['Requirement'][0] ? " class='no'" : NULL; $tooltip['Requirement'] .= "<li{$noReq}>" . $this->ItemInfoString(1, 0) . " " . $data['Requirement'][0] . "</li>\\\n"; } if ($data['Requirement'][1] > 0) { $noReq = $char['Strength'] < $data['Requirement'][1] ? " class='no'" : NULL; $tooltip['Requirement'] .= "<li{$noReq}>" . $this->ItemInfoString(1, 1) . " " . $data['Requirement'][1] . "</li>\\\n"; } if ($data['Requirement'][2] > 0) { $noReq = $char['Dexterity'] < $data['Requirement'][2] ? " class='no'" : NULL; $tooltip['Requirement'] .= "<li{$noReq}>" . $this->ItemInfoString(1, 2) . " " . $data['Requirement'][2] . "</li>\\\n"; } if ($data['Requirement'][3] > 0) { $noReq = $char['Vitality'] < $data['Requirement'][3] ? " class='no'" : NULL; $tooltip['Requirement'] .= "<li{$noReq}>" . $this->ItemInfoString(1, 3) . " " . $data['Requirement'][3] . "</li>\\\n"; } if ($data['Requirement'][4] > 0) { $noReq = $char['Energy'] < $data['Requirement'][4] ? " class='no'" : NULL; $tooltip['Requirement'] .= "<li{$noReq}>" . $this->ItemInfoString(1, 4) . " " . $data['Requirement'][4] . "</li>\\\n"; } if ($data['Requirement'][5] > 0) { $noReq = $char['Command'] < $data['Requirement'][5] ? " class='no'" : NULL; $tooltip['Requirement'] .= "<li{$noReq}>" . $this->ItemInfoString(1, 5) . " " . $data[0]['Requirement'][5] . "</li>\\\n"; } if (isset($data['ClassUse'])) { $tooltip['ClassUse'] = NULL; foreach ($data['ClassUse'] as $key => $value) { $noClass = $value[1] == 1 ? " class='no'" : NULL; $tooltip['ClassUse'] .= "<li{$noClass}>" . $this->ItemInfoString(0, 1) . " " . $value[0] . "</li>\\\n"; } } $tooltip['Harmony'] = isset($data['Harmony']) ? "<p class='harmony'>" . $data['Harmony'] . "</p><br />\\" : "\\"; if (isset($data['Socket'])) { $tooltip['Socket'] = "<span class='socketTitle'>" . $this->ItemInfoString(3, 3) . "</span>{#}{#}"; $tooltip['Socket'] .= "<ul class='itemBlue'>\\\n"; if ($parse['SocketOption'][0][0] > -2) { $tooltip['Socket'] .= "<li" . (strstr($data['Socket'][0], "Free Slot") ? " class='socketFree'" : NULL) . ">" . $data['Socket'][0] . "</li>\\\n"; } if ($parse['SocketOption'][1][0] > -2) { $tooltip['Socket'] .= "<li" . (strstr($data['Socket'][1], "Free Slot") ? " class='socketFree'" : NULL) . ">" . $data['Socket'][1] . "</li>\\\n"; } if ($parse['SocketOption'][2][0] > -2) { $tooltip['Socket'] .= "<li" . (strstr($data['Socket'][2], "Free Slot") ? " class='socketFree'" : NULL) . ">" . $data['Socket'][2] . "</li>\\\n"; } if ($parse['SocketOption'][3][0] > -2) { $tooltip['Socket'] .= "<li" . (strstr($data['Socket'][3], "Free Slot") ? " class='socketFree'" : NULL) . ">" . $data['Socket'][3] . "</li>\\\n"; } if ($parse['SocketOption'][4][0] > -2) { $tooltip['Socket'] .= "<li" . (strstr($data['Socket'][4], "Free Slot") ? " class='socketFree'" : NULL) . ">" . $data['Socket'][4] . "</li>\\\n"; } $tooltip['Socket'] .= "</ul>\\"; } else { $tooltip['Socket'] = NULL; } return array("Name" => $data['Name'], "Tooltip" => $tooltip); }
/** * Get Mu Library class * * @param string Library * @return object */ protected function MuLib($lib) { return CTM_MuOnline::Lib($lib); }