Jump to content

ahhak1989

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

Recent Profile Visitors

1074 profile views

ahhak1989's Achievements

Poring

Poring (1/15)

0

Reputation

  1. Line 114 : $equipLocationCombinations = preg_grep("/.*?$combinationName.*?/i", Flux::config('EquipLocationCombinations')->toArray()); But view Monster Database is no problem my index.php <?php if (!defined('FLUX_ROOT')) exit; //$this->loginRequired(); $title = 'List Items'; require_once 'Flux/TemporaryTable.php'; try { $tableName = "{$server->charMapDatabase}.items"; $fromTables = array("{$server->charMapDatabase}.item_db", "{$server->charMapDatabase}.item_db2"); $tempTable = new Flux_TemporaryTable($server->connection, $tableName, $fromTables); $shopTable = Flux::config('FluxTables.ItemShopTable'); // Statement parameters, joins and conditions. $bind = array(); $sqlpartial = "LEFT OUTER JOIN {$server->charMapDatabase}.$shopTable ON $shopTable.nameid = items.id "; $sqlpartial .= "WHERE 1=1 "; $itemID = $params->get('item_id'); if ($itemID) { $sqlpartial .= "AND items.id = ? "; $bind[] = $itemID; } else { $opMapping = array('eq' => '=', 'gt' => '>', 'lt' => '<'); $opValues = array_keys($opMapping); $itemName = $params->get('name'); $itemType = $params->get('type'); $equipLoc = $params->get('equip_loc'); $npcBuy = $params->get('npc_buy'); $npcBuyOp = $params->get('npc_buy_op'); $npcSell = $params->get('npc_sell'); $npcSellOp = $params->get('npc_sell_op'); $weight = $params->get('weight'); $weightOp = $params->get('weight_op'); $attack = $params->get('attack'); $attackOp = $params->get('attack_op'); $defense = $params->get('defense'); $defenseOp = $params->get('defense_op'); $range = $params->get('range'); $rangeOp = $params->get('range_op'); $slots = $params->get('slots'); $slotsOp = $params->get('slots_op'); $refineable = $params->get('refineable'); $forSale = $params->get('for_sale'); $custom = $params->get('custom'); if ($itemName) { $sqlpartial .= "AND (name_japanese LIKE ? OR name_japanese = ?) "; $bind[] = "%$itemName%"; $bind[] = $itemName; } if ($itemType && $itemType !== '-1') { if (count($itemTypeSplit = explode('-', $itemType)) == 2) { $itemType = $itemTypeSplit[0]; $itemType2 = $itemTypeSplit[1]; } if (is_numeric($itemType) && (floatval($itemType) == intval($itemType))) { $itemTypes = Flux::config('ItemTypes')->toArray(); if (array_key_exists($itemType, $itemTypes) && $itemTypes[$itemType]) { $sqlpartial .= "AND type = ? "; $bind[] = $itemType; } else { $sqlpartial .= 'AND type IS NULL '; } if (count($itemTypeSplit) == 2 && is_numeric($itemType2) && (floatval($itemType2) == intval($itemType2))) { $itemTypes2 = Flux::config('ItemTypes2')->toArray(); if (array_key_exists($itemType, $itemTypes2) && array_key_exists($itemType2, $itemTypes2[$itemType]) && $itemTypes2[$itemType][$itemType2]) { $sqlpartial .= "AND view = ? "; $bind[] = $itemType2; } else { $sqlpartial .= 'AND view IS NULL '; } } } else { $typeName = preg_quote($itemType, '/'); $itemTypes = preg_grep("/.*?$typeName.*?/i", Flux::config('ItemTypes')->toArray()); if (count($itemTypes)) { $itemTypes = array_keys($itemTypes); $sqlpartial .= "AND ("; $partial = ''; foreach ($itemTypes as $id) { $partial .= "type = ? OR "; $bind[] = $id; } $partial = preg_replace('/\s*OR\s*$/', '', $partial); $sqlpartial .= "$partial) "; } else { $sqlpartial .= 'AND type IS NULL '; } } } if ($equipLoc !== false && $equipLoc !== '-1') { if(is_numeric($equipLoc) && (floatval($equipLoc) == intval($equipLoc))) { $equipLocationCombinations = Flux::config('EquipLocationCombinations')->toArray(); if (array_key_exists($equipLoc, $equipLocationCombinations) && $equipLocationCombinations[$equipLoc]) { if ($equipLoc === '0') { $sqlpartial .= "AND (equip_locations = 0 OR equip_locations IS NULL) "; } else { $sqlpartial .= "AND equip_locations = ? "; $bind[] = $equipLoc; } } } else { $combinationName = preg_quote($equipLoc, '/'); $equipLocationCombinations = preg_grep("/.*?$combinationName.*?/i", Flux::config('EquipLocationCombinations')->toArray()); if (count($equipLocationCombinations)) { $equipLocationCombinations = array_keys($equipLocationCombinations); $sqlpartial .= "AND ("; $partial = ''; foreach ($equipLocationCombinations as $id) { if ($id === 0) { $partial .= "(equip_locations = 0 OR equip_locations IS NULL) OR "; } else { $partial .= "equip_locations = ? OR "; $bind[] = $id; } } $partial = preg_replace('/\s*OR\s*$/', '', $partial); $sqlpartial .= "$partial) "; } } } if (in_array($npcBuyOp, $opValues) && trim($npcBuy) != '') { $op = $opMapping[$npcBuyOp]; if ($op == '=' && $npcBuy === '0') { $sqlpartial .= "AND (price_buy IS NULL OR price_buy = 0) "; } else { $sqlpartial .= "AND price_buy $op ? "; $bind[] = $npcBuy; } } if (in_array($npcSellOp, $opValues) && trim($npcSell) != '') { $op = $opMapping[$npcSellOp]; if ($op == '=' && $npcSell === '0') { $sqlpartial .= "AND IFNULL(price_sell, FLOOR(price_buy/2)) = 0 "; } else { $sqlpartial .= "AND IFNULL(price_sell, FLOOR(price_buy/2)) $op ? "; $bind[] = $npcSell; } } if (in_array($weightOp, $opValues) && trim($weight) != '') { $op = $opMapping[$weightOp]; if ($op == '=' && $weight === '0') { $sqlpartial .= "AND (weight IS NULL OR weight = 0) "; } else { $sqlpartial .= "AND CAST(weight/10 AS UNSIGNED INTEGER) $op ? "; $bind[] = $weight; } } if (in_array($attackOp, $opValues) && trim($attack) != '') { $op = $opMapping[$attackOp]; if ($op == '=' && $attack === '0') { $sqlpartial .= "AND (attack IS NULL OR attack = 0) "; } else { $sqlpartial .= "AND attack $op ? "; $bind[] = $attack; } } if (in_array($defenseOp, $opValues) && trim($defense) != '') { $op = $opMapping[$defenseOp]; if ($op == '=' && $defense === '0') { $sqlpartial .= "AND (defence IS NULL OR defence = 0) "; } else { $sqlpartial .= "AND defence $op ? "; $bind[] = $defense; } } if (in_array($rangeOp, $opValues) && trim($range) != '') { $op = $opMapping[$rangeOp]; if ($op == '=' && $range === '0') { $sqlpartial .= "AND (`range` IS NULL OR `range` = 0) "; } else { $sqlpartial .= "AND `range` $op ? "; $bind[] = $range; } } if (in_array($slotsOp, $opValues) && trim($slots) != '') { $op = $opMapping[$slotsOp]; if ($op == '=' && $slots === '0') { $sqlpartial .= "AND (slots IS NULL OR slots = 0) "; } else { $sqlpartial .= "AND slots $op ? "; $bind[] = $slots; } } if ($refineable) { if ($refineable == 'yes') { $sqlpartial .= "AND refineable > 0 "; } elseif ($refineable == 'no') { $sqlpartial .= "AND IFNULL(refineable, 0) < 1 "; } } if ($forSale) { if ($forSale == 'yes') { $sqlpartial .= "AND $shopTable.cost > 0 "; } elseif ($forSale == 'no') { $sqlpartial .= "AND IFNULL($shopTable.cost, 0) < 1 "; } } if ($custom) { if ($custom == 'yes') { $sqlpartial .= "AND origin_table LIKE '%item_db2' "; } elseif ($custom == 'no') { $sqlpartial .= "AND origin_table LIKE '%item_db' "; } } } // Get total count and feed back to the paginator. $sth = $server->connection->getStatement("SELECT COUNT(DISTINCT items.id) AS total FROM $tableName $sqlpartial"); $sth->execute($bind); $paginator = $this->getPaginator($sth->fetch()->total); $paginator->setSortableColumns(array( 'item_id' => 'asc', 'name', 'type', 'equip_locations', 'price_buy', 'price_sell', 'weight', 'attack', 'defense', 'range', 'slots', 'refineable', 'cost', 'origin_table' )); $col = "origin_table, items.id AS item_id, name_japanese AS name, type, "; $col .= "IFNULL(equip_locations, 0) AS equip_locations, price_buy, weight/10 AS weight, attack, "; $col .= "defence AS defense, `range`, slots, refineable, cost, $shopTable.id AS shop_item_id, "; $col .= "IFNULL(price_sell, FLOOR(price_buy/2)) AS price_sell, view"; $sql = $paginator->getSQL("SELECT $col FROM $tableName $sqlpartial GROUP BY items.id"); $sth = $server->connection->getStatement($sql); $sth->execute($bind); $items = $sth->fetchAll(); $authorized = $auth->actionAllowed('item', 'view'); if ($items && count($items) === 1 && $authorized && Flux::config('SingleMatchRedirectItem')) { $this->redirect($this->url('item', 'view', array('id' => $items[0]->item_id))); } } catch (Exception $e) { if (isset($tempTable) && $tempTable) { // Ensure table gets dropped. $tempTable->drop(); } // Raise the original exception. $class = get_class($e); throw new $class($e->getMessage()); } ?> my view.php <?php if (!defined('FLUX_ROOT')) exit; //$this->loginRequired(); $title = 'Viewing Item'; require_once 'Flux/TemporaryTable.php'; $tableName = "{$server->charMapDatabase}.items"; $fromTables = array("{$server->charMapDatabase}.item_db", "{$server->charMapDatabase}.item_db2"); $tempTable = new Flux_TemporaryTable($server->connection, $tableName, $fromTables); $shopTable = Flux::config('FluxTables.ItemShopTable'); $itemID = $params->get('id'); $col = 'items.id AS item_id, name_english AS identifier, '; $col .= 'name_japanese AS name, type, '; $col .= 'price_buy, price_sell, weight/10 AS weight, attack, defence, `range`, slots, '; $col .= 'equip_jobs, equip_upper, equip_genders, equip_locations, '; $col .= 'weapon_level, equip_level, refineable, view, script, '; $col .= 'equip_script, unequip_script, origin_table, '; $col .= "$shopTable.cost, $shopTable.id AS shop_item_id"; $sql = "SELECT $col FROM {$server->charMapDatabase}.items "; $sql .= "LEFT OUTER JOIN {$server->charMapDatabase}.$shopTable ON $shopTable.nameid = items.id "; $sql .= "WHERE items.id = ? LIMIT 1"; $sth = $server->connection->getStatement($sql); $sth->execute(array($itemID)); $item = $sth->fetch(); $isCustom = null; if ($item) { $title = "Viewing Item ($item->name)"; $isCustom = (bool)preg_match('/item_db2$/', $item->origin_table); $mobDB = "{$server->charMapDatabase}.monsters"; $fromTables = array("{$server->charMapDatabase}.mob_db", "{$server->charMapDatabase}.mob_db2"); $mobTable = new Flux_TemporaryTable($server->connection, $mobDB, $fromTables); $col = 'ID AS monster_id, iName AS monster_name, LV AS monster_level, '; $col .= 'Race AS monster_race, (Element%10) AS monster_element, (Element/20) AS monster_ele_lv, '; // Normal drops. $col .= 'Drop1id AS drop1_id, Drop1per AS drop1_chance, '; $col .= 'Drop2id AS drop2_id, Drop2per AS drop2_chance, '; $col .= 'Drop3id AS drop3_id, Drop3per AS drop3_chance, '; $col .= 'Drop4id AS drop4_id, Drop4per AS drop4_chance, '; $col .= 'Drop5id AS drop5_id, Drop5per AS drop5_chance, '; $col .= 'Drop6id AS drop6_id, Drop6per AS drop6_chance, '; $col .= 'Drop7id AS drop7_id, Drop7per AS drop7_chance, '; $col .= 'Drop8id AS drop8_id, Drop8per AS drop8_chance, '; $col .= 'Drop9id AS drop9_id, Drop9per AS drop9_chance, '; // Card drops. $col .= 'DropCardid AS dropcard_id, DropCardper AS dropcard_chance, '; // MVP rewards. $col .= 'MVP1id AS mvpdrop1_id, MVP1per AS mvpdrop1_chance, '; $col .= 'MVP2id AS mvpdrop2_id, MVP2per AS mvpdrop2_chance, '; $col .= 'MVP3id AS mvpdrop3_id, MVP3per AS mvpdrop3_chance'; $sql = "SELECT $col FROM $mobDB WHERE "; // Normal drops. $sql .= 'Drop1id = ? OR '; $sql .= 'Drop2id = ? OR '; $sql .= 'Drop3id = ? OR '; $sql .= 'Drop4id = ? OR '; $sql .= 'Drop5id = ? OR '; $sql .= 'Drop6id = ? OR '; $sql .= 'Drop7id = ? OR '; $sql .= 'Drop8id = ? OR '; $sql .= 'Drop9id = ? OR '; // Card drops. $sql .= 'DropCardid = ? OR '; // MVP rewards. $sql .= 'MVP1id = ? OR '; $sql .= 'MVP2id = ? OR '; $sql .= 'MVP3id = ? '; //$sql .= 'GROUP BY ID, iName'; $sth = $server->connection->getStatement($sql); $res = $sth->execute(array_fill(0, 13, $itemID)); $dropResults = $sth->fetchAll(); $itemDrops = array(); $dropNames = array( 'drop1', 'drop2', 'drop3', 'drop4', 'drop5', 'drop6', 'drop7', 'drop8', 'drop9', 'dropcard', 'mvpdrop1', 'mvpdrop2', 'mvpdrop3' ); // Sort callback. function __tmpSortDrops($arr1, $arr2) { if ($arr1['drop_chance'] == $arr2['drop_chance']) { return strcmp($arr1['monster_name'], $arr2['monster_name']); } return $arr1['drop_chance'] < $arr2['drop_chance'] ? 1 : -1; } foreach ($dropResults as $drop) { foreach ($dropNames as $dropName) { $dropID = $drop->{$dropName.'_id'}; $dropChance = $drop->{$dropName.'_chance'}; if ($dropID == $itemID) { $dropArray = array( 'monster_id' => $drop->monster_id, 'monster_name' => $drop->monster_name, 'monster_level' => $drop->monster_level, 'monster_race' => $drop->monster_race, 'monster_element' => $drop->monster_element, 'monster_ele_lv' => $drop->monster_ele_lv, 'drop_id' => $itemID, 'drop_chance' => $dropChance ); if (preg_match('/^dropcard/', $dropName)) { $dropArray['drop_chance'] = $dropArray['drop_chance']*$server->cardDropRates/100; $dropArray['type'] = 'card'; } elseif (preg_match('/^drop/', $dropName)) { $dropArray['drop_chance'] = $dropArray['drop_chance']*$server->dropRates/100; $dropArray['type'] = 'normal'; } elseif (preg_match('/^mvp/', $dropName)) { $dropArray['drop_chance'] = $dropArray['drop_chance']*$server->mvpDropRates/100; $dropArray['type'] = 'mvp'; } if ($dropArray['drop_chance'] > 100) { $dropArray['drop_chance'] = 100; } $itemDrops[] = $dropArray; } } } // Sort so that monsters are ordered by drop chance and name. usort($itemDrops, '__tmpSortDrops'); } ?> Anyone please help me? T.T
  2. As title, my table in view Monster Database is Name Level State Rate Cast Time Delay Cancelable Target Condition Value I want to hide the column "Condition & Value" I go to remove the following : 'condition' => $row[10], 'value' => $row[11], 'val1' => $row[12], 'val2' => $row[13], 'val3' => $row[14], 'val4' => $row[15], 'val5' => $row[16], 'emotion' => $row[17], 'chat' => $row[18] in modules/monster/view.php but error come out... Anyone know how to do it?
  3. I just change my themes, previously was working perfectly, but after update to my new theme, the following error appear: Please help me T.T
  4. As subject, my thor patcher failed to communicate with patcher, this is my first server running. I've look for many post but I still cant solve my problem >.< So I hope someone can assist on this... Tools/Config.ini [Config:Main] RootURL='http://myprivatehost.net/ROPatcher/' RemoteConfigFile='main.ini' TimeOut=0 StatusFile='hakronServer.dat' DefaultGRF='hdata.grf' ClientEXE='Hakron.exe' ClientParameter='-1sak1' FinishOnConnectionFailure=false [Config:Window] AutoResize=true Style='none' Width= Height= DragHandling=true Background='images/bg.bmp' FadeOnDrag=false [Config:BGM] File= Loop=true Volume=20 Directory= [Config:Misc] Title='HAKRON Ragnarok Patcher' HideProgressBarWhenFinish=true[/font][/color] [color=#282828][font=helvetica, arial, sans-serif][ProgressBar:bar1] Width=342 Height=10 Left=23 Top=486 BackColorStart=$009DEEEF BackColorEnd=$00C2F1F1 FrontColorStart=$006ED5B0 FrontColorEnd=$0080DDCA FrontImage= BackImage= Hook='ProgressChange'[/font][/color] [color=#282828][font=helvetica, arial, sans-serif][Label:Status] AutoResize = false Width=369 Height= Left=15 Top=498 Alignment='center' FontColor=$000000 FontName = '' FontSize = Text='' Hook='StatusChange' [NoticeBox:Box0] Width=347 Height=250 Left=21 Top=217 URL='http://myprivatehost.net/ROPatcher/thor/hakron/Web/notice.html'[/font][/color] [color=#282828][font=helvetica, arial, sans-serif][button:Start] Default='images/start1.png' OnHover='images/start2.png' OnDown='images/start3.png' Left=383 Top=211 Hook='Start' [button:Exit] Default='images/Exit1.png' OnHover='images/Exit2.png' OnDown='images/Exit3.png' Left=383 Top=244 Hook='Exit' [button:Cancel] Default='images/Exit1.png' OnHover='images/Exit2.png' OnDown='images/Exit3.png' Left=383 Top=211 Hook='Cancel' Web/main.ini //Thor Patcher remote config file [Main] //Allow patching or not? allow=true //Should patcher ignore everything else and finish patch immediately? Force_Start=false //if not, what message should appear? policy_msg=Server is taking a nap. //file_url - patch files should ALL put here. // This config entry will override the one in embed config. // o HTTP: // http://domain.com/dir/ // o FTP: // ftp://domain.com/dir/ // o With <Username> [Password] [Port] // ftp://username:[email protected]:port/dir/ // o Note: username is required if want put password, otherwise everything is optional. file_url=http://myprivatehost.net/ROPatcher/DATA/ [Patch] //use CheckSum tool, hash for client & patcher // used to make sure exe is up to date // (leave empty to disable this feature) ClientSum= PatcherSum=[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]//This is compressed file for patcher & client update // To make these work, ClientSum and/or PatcherSum can't be empty // Note: these files should put same place as patch file (file_url in internal config) //Relative address, not FULL URL! ClientPath= PatcherPath= // Patch list file PatchList=plist.txt [stars] // Shining o.O (Anyways, its for start button clones) // Since orignal client has check sum.. why not for clones? XD[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]//How many? (it should same as amount of start button clone, but of course it's your choice) clients=0 // _sum - checksum, use CheckSum tool. //client1_sum= // _Name - Filename of exe //client1_Name= // _Path - Path for file [Compressed] //client1_Path= [Misc] //Set a limit for fragment, when reach this limit, patcher will ask user to defrag FragmentLimit=50 Anyone please help me on this??? PS: I using my own hosting
×
×
  • Create New...