"1", "TwoHandSword" => "1", "Dagger" => "1", "TwinEdge" => "1", "Spear" => "1", "Pike" => "1", "Axe" => "1", "Hatchet" => "1", "Wand" => "1", "Staff" => "1", "Mace" => "1", "Hammer" => "1", "Bow" => "1", "CrossBow" => "1", "DualGun" => "1", "GunKnife" => "1", "Whip" => "1", "Instrument" => "1", "Card" => "1", "Dart" => "1", "Dice" => "1", "Shield" => "1", "MainGauche" => "1", "Book" => "1", "Gauntlet" => "1", "Bracelet" => "1", "Armor" => "1", "Cloth" => "1", "Robe" => "1", "Item" => "1", "Portion" => "1", "SkillBook" => "1", "Material" => "1", ); } ////////////////////////////////////////////////// // 精錬可能なアイテムの種類 function CanRefineType() { return array( "Sword","TwoHandSword","MasterSword","Dagger","TwinEdge","Spear","Pike","Axe","Hatchet", "Wand","Staff","Mace","Hammer","Bow","CrossBow","DualGun","GunKnife", "Whip","Instrument","Card","Dart","Dice", "Shield","MainGauche","Book","Gauntlet","Bracelet", "Armor","Cloth","Robe", ); } ////////////////////////////////////////////////// // 期限切れアカウントの一斉削除 function DeleteAbandonAccount() { $list = glob(USER."*"); $now = time(); // ユーザー一覧を取得する foreach($list as $file) { if(!is_dir($file)) continue; $UserID = substr($file,strrpos($file,"/")+1); $user = new user($UserID,true); // 消されるユーザー if($user->IsAbandoned()) { // ランキングを読む if(!isset($Ranking)) { include_once(CLASS_RANKING); $Ranking = new Ranking(); $RankChange = false;// ランキングデータが変更されたか } // ランキングから消す if( $Ranking->DeleteRank($UserID) ) { $RankChange = true;// 変更された } RecordManage(date("Y M d G:i:s",$now).": user ".$user->id." deleted."); $user->DeleteUser(false);//ランキングからは消さないようにfalse } // 消されないユーザー else { $user->fpCloseAll(); unset($user); } } // 一通りユーザチェックが終わったのでランキングをどうするか if($RankChange === true) $Ranking->SaveRanking(); else if($RankChange === false) $Ranking->fpclose(); //print("
".print_r($list,1)."
"); } ////////////////////////////////////////////////// // 定期的に管理する何か function RegularControl($value=null) { /* サーバが重(混み)そうな時間帯は後回しにする。 PM 7:00 - AM 2:00 は処理しない。 ※時刻は or なのに注意! */ if(19 <= date("H") || date("H") <= 1) return false; $now = time(); $fp = FileLock(CTRL_TIME_FILE,true); if(!$fp) return false; //$ctrltime = file_get_contents(CTRL_TIME_FILE); $ctrltime = trim(fgets($fp, 1024)); // 周期がまだなら終了 if($now < $ctrltime) { fclose($fp); unset($fp); return false; } // 管理の処理 RecordManage(date("Y M d G:i:s",$now).": auto regular control by {$value}."); DeleteAbandonAccount();//その1 放棄ユーザの掃除 // 定期管理が終わったら次の管理時刻を書き込んで終了する。 WriteFileFP($fp,$now + CONTROL_PERIOD); fclose($fp); unset($fp); } ////////////////////////////////////////////////// // $id が過去登録されたかどうか function is_registered($id) { if($registered = @file(REGISTER)): if(array_search($id."\n",$registered)!==false && !ereg("[\.\/]+",$id) )//改行記号必須 return true; else return false; endif; } ////////////////////////////////////////////////// // ファイルロックしたファイルポインタを返す。 function FileLock($file,$noExit=false) { if(!file_exists($file)) return false; $fp = @fopen($file,"r+") or die("Error!"); if(!$fp) return false; $i=0; do{ if(flock($fp, LOCK_EX | LOCK_NB)) { stream_set_write_buffer($fp, 0); return $fp; } else { usleep(10000);//0.01秒 $i++; } }while($i<5); if($noExit) { return false; } else { ob_clean(); exit("file lock error."); } //flock($fp, LOCK_EX);//排他 //flock($fp, LOCK_SH);//共有ロック //flock($fp,LOCK_EX); return $fp; } ////////////////////////////////////////////////// // ファイルに書き込む(引数:ファイルポインタ) function WriteFileFP($fp,$text,$check=false) { if(!$check && !trim($text))//$textが空欄なら終わる return false; /*if(file_exists($file)): ftruncate() else: $fp = fopen($file,"w+");*/ ftruncate($fp,0); rewind($fp); //$fp = fopen($file,"w+"); //flock($fp,LOCK_EX); fputs($fp,$text); //print("
"."
".$text); } ////////////////////////////////////////////////// // ファイルに書き込む function WriteFile($file,$text,$check=false) { if(!$check && !$text)//$textが空欄なら終わる return false; /*if(file_exists($file)): ftruncate() else: $fp = fopen($file,"w+");*/ $fp = fopen($file,"w+"); flock($fp,LOCK_EX); fputs($fp,$text); } ////////////////////////////////////////////////// // ファイルを読んで配列に格納(引数:ファイルポインタ) function ParseFileFP($fp) { if(!$fp) return false; while( !feof($fp) ) { $str = fgets($fp); $str = trim($str); if(!$str) continue; $pos = strpos($str,"="); if($pos === false) continue; $key = substr($str,0,$pos); $val = substr($str,++$pos); $data[$key] = trim($val); } //print("
");
		//print_r($data);
		//print("
"); if($data) return $data; else return false; } ////////////////////////////////////////////////// // ファイルを読んで配列に格納 function ParseFile($file) { $fp = fopen($file,"r+"); if(!$fp) return false; flock($fp, LOCK_EX | LOCK_NB); while( !feof($fp) ) { $str = fgets($fp); $str = trim($str); if(!$str) continue; $pos = strpos($str,"="); if($pos === false) continue; $key = substr($str,0,$pos); $val = substr($str,++$pos); $data[$key] = trim($val); } //print("
");
		//print_r($data);
		//print("
"); if($data) return $data; else return false; } ////////////////////////////////////////////////// // function UserAmount() { static $amount; if($amount) { return $amount; } else { $amount = count(glob(USER."*")); return $amount; } } ////////////////////////////////////////////////// // function JudgeList(){ // 自動読み込み(forでループさせてるから無駄な処理) if(JUDGE_LIST_AUTO_LOAD) { for($i=1000; $i<2500; $i++) { if( LoadJudgeData($i) !== false) $list[]=$i; } return $list; // 手動(追加した判断は自分で書き足せ) } else { return array( 1000, 1001, 1099, //HP 1100, 1101, 1105, 1106, 1110, 1111, 1121, 1125, 1126, 1130, 1135, 1199, //SP 1200, 1201, 1205, 1206, 1210, 1211, 1221, 1225, 1226, 1299, //ステータス 1300, 1301, 1310, 1311, 1320, 1321, 1330, 1331, 1340, 1341, 1350, 1351, 1355, 1360, 1361, 1365, 1370, 1371, 1375, 1380, 1381, 1385, 1399, //生死(味方) 1400, 1401, 1405, 1406, 1410, 1415, 1416, 1420, 1421, 1449, //生死(敵) 1450, 1451, 1455, 1456, 1499, //チャージ+詠唱 1500, 1501, 1505, 1506, 1510, 1511, 1520, 1521, 1525, 1526, 3545, 3546, 3547, 3548, 3550, 3551, 3555, 3556, 1549, //チャージ+詠唱(敵) 1550, 1551, 1555, 1556, 1560, 1561, 1563, 1564, 1565, 1566, 1599, //毒 1600, 1610, 1611, 1612, 1613, 1620, 1630, 1631, 1632, 1633, 1640, 1650, 1651, 1652, 1653, 1660, 1670, 1671, 1672, 1673, 1680, 1690, 1691, 1692, 1693, 1614, //毒(敵) 1615, 1616, 1617, 1618, 1635, 1636, 1637, 1638, 1655, 1656, 1657, 1658, 1675, 1676, 1677, 1678, 1699,//隊列 1700, 1701, 1710, 1711, 1712, 1715, 1716, 1717, 1749, //隊列(敵) 1750, 1751, 1752, 1755, 1756, 1757, 1799, //召喚 1800, 1801, 1805, 1810, 1811, 1812, 3810, 3811, 3812, 1815, 1816, 1817, 1819, //召喚(敵) 1820, 1821, 1825, 1830, 1831, 1832, 3830, 3831, 3832, 1839, //魔法陣 1840, 1841, 1845, 1847, 1848, 1849, //魔法陣 1850, 1851, 1855, 2399, //地相 2400, 2401, 2405, 2406, 2410, 2411, 2415, 2416, 2420, 2421, 2425, 2426, 2430, 2431, 2435, 2436, 2440, 2441, 2445, 2446, 2450, 2451, 1856, //ボイス 1857, 1858, 1859, //チェイン 1860, 1861, 1864, //レイズ 1865, 1866, 1869, //状態 1867, 1868, 3867, 3868, 3869, 3870, 3875, 3876, 3877, 3878, 3879, 3880, 1880, 1881, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 3881, 3882, 3883, 3884, 1884, //状態(敵) 1882, 1883, 3885, 3886, 1885, 1886, 1887, 1888, 1891, 1892, 1889, 1890, 1899, //指定行動回数 1900, 1901, 1902, 1905, 1910, 1911, 1919, //回数制限 1920, 1939, //確率 1940, 1999, //職業判定(要Telegnosis) 2000, 2001, 2005, 2006, 2010, 2011, 2015, 2016, 2020, 2021, 2025, 2026, 2030, 2031, 2035, 2036, 2040, 2041, 2045, 2046, 2050, 2051, 2055, 2056, 2060, 2061, 2065, 2066, 2070, 2071, 2075, 2076, 2080, 2081, 2085, 2086, 2090, 2091, 2095, 2096, 2100, 2101, 2105, 2106, 2110, 2111, 2115, 2116, 2120, 2121, 2125, 2126, 2130, 2131, 2135, 2136, 2140, 2141, 2145, 2146, 2150, 2151, 2155, 2156, 2160, 2161, 2165, 2166, 2170, 2171, 2175, 2176, 2180, 2181, 2185, 2186, 2190, 2191, 2195, 2196, 2200, 2201, 2205, 2206, 2210, 2211, 2215, 2216, 2299, //ステータス判定(要Clairvoyance) 2300, 2305, 2306, 2310, 2315, 2316, ); } } ////////////////////////////////////////////////// // お金の表示方式 function MoneyFormat($number) { return '$ '.number_format($number); } ////////////////////////////////////////////////// // function ItemSellPrice($item) { $price = (isset($item["sell"]) ? $item["sell"] : round($item["buy"]*SELLING_PRICE)); return $price; } ////////////////////////////////////////////////// // 戦闘ログの表示 function ShowLogList() { print("
\n"); /*// ログ少ないなら全部表示すればいい。↓ // common print("

最近の戦闘(Recent Battles)

\n"); $log = @glob(LOG_BATTLE_NORMAL."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file); } // union print("

ユニオン戦(Union Battle Log)

\n"); $log = @glob(LOG_BATTLE_UNION."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"UNION"); } // rank print("

ランキング戦(Rank Battle Log)

\n"); $log = @glob(LOG_BATTLE_RANK."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"RANK"); } */ print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // common print("

最近の戦闘 - 全表示(Recent Battles)

\n"); $log = @glob(LOG_BATTLE_NORMAL."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file); $limit++; if(10 <= $limit) { break; } } // union $limit = 0; print("

ユニオン戦 - 全表示(Union Battle Log)

\n"); $log = @glob(LOG_BATTLE_UNION."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"UNION"); $limit++; if(10 <= $limit) { break; } } // party $limit = 0; print("

パーティ戦闘 - 全表示(Party Battle Log)

\n"); $log = @glob(LOG_BATTLE_PARTY."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"PARTY"); $limit++; if(10 <= $limit) { break; } } // partyunion $limit = 0; print("

パーティユニオン戦闘 - 全表示(Party Union Battle Log)

\n"); $log = @glob(LOG_BATTLE_PARTYUNION."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"PARTYUNION"); $limit++; if(10 <= $limit) { break; } } // rank $limit = 0; print("

通常対戦 ランキング - 全表示(Classic Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_RANK."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"RANK"); $limit++; if(10 <= $limit) { break; } } // squad $limit = 0; print("

10人対戦 ランキング - 全表示(Squad Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_SQUAD."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"SQUAD"); $limit++; if(10 <= $limit) { break; } } // duel $limit = 0; print("

1対1対戦 ランキング - 全表示(Duel Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_DUEL."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"DUEL"); $limit++; if(10 <= $limit) { break; } } // old $limit = 0; print("

4職限定対戦 ランキング - 全表示(Old-fashion Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_OLD."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"OLD"); $limit++; if(10 <= $limit) { break; } } // arena $limit = 0; print("

通常対戦 アリーナ - 全表示(Classic Arena Battle Log)

\n"); $log = @glob(LOG_BATTLE_ARENA."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"ARENA"); $limit++; if(10 <= $limit) { break; } } // arenasquad $limit = 0; print("

10人対戦 アリーナ - 全表示(Squad Arena Battle Log)

\n"); $log = @glob(LOG_BATTLE_ARENASQUAD."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"ARENASQUAD"); $limit++; if(10 <= $limit) { break; } } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示 function LogShowCommon() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // common print("

最近の戦闘 - 全ログ(Recent Battles)

\n"); $log = @glob(LOG_BATTLE_NORMAL."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(union) function LogShowUnion() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // union print("

ユニオン戦 - 全ログ(Union Battle Log)

\n"); $log = @glob(LOG_BATTLE_UNION."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"UNION"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(party) function LogShowParty() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // union print("

パーティ戦闘 - 全ログ(Party Battle Log)

\n"); $log = @glob(LOG_BATTLE_PARTY."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"PARTY"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(partyunion) function LogShowPartyUnion() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // union print("

パーティユニオン戦闘 - 全ログ(Party Union Battle Log)

\n"); $log = @glob(LOG_BATTLE_PARTYUNION."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"PARTYUNION"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(ranking) function LogShowRanking() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // rank print("

通常対戦 ランキング - 全ログ(Classic Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_RANK."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"RANK"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(squad) function LogShowSquad() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // rank print("

10人対戦 ランキング - 全ログ(Squad Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_SQUAD."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"SQUAD"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(duel) function LogShowDuel() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // rank print("

1対1対戦 ランキング - 全ログ(Duel Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_DUEL."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"DUEL"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(old) function LogShowOld() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // rank print("

4職限定対戦 ランキング - 全ログ(Old-fashion Ranking Battle Log)

\n"); $log = @glob(LOG_BATTLE_OLD."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"OLD"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(Arena) function LogShowArena() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // rank print("

通常対戦 アリーナ - 全ログ(Classic Arena Battle Log)

\n"); $log = @glob(LOG_BATTLE_ARENA."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"ARENA"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの表示(ArenaSquad) function LogShowArenaSquad() { print("
\n"); print("All "); print("Common "); print("Union "); print("Party "); print("Party-Union "); print("
"); print("Classic "); print("Squad "); print("Duel "); print("Old-fashion"); print("
"); print("Classic-Arena "); print("Squad-Arena"); // rank print("

10人対戦 アリーナ - 全ログ(Squad Arena Battle Log)

\n"); $log = @glob(LOG_BATTLE_ARENASQUAD."*"); foreach(array_reverse($log) as $file) { BattleLogDetail($file,"ARENASQUAD"); } print("
\n"); } ////////////////////////////////////////////////// // 戦闘ログの詳細を表示(リンク) function BattleLogDetail($log,$type=false) { $fp = fopen($log,"r"); // 数行だけ読み込む。 $time = fgets($fp);//開始時間 1行目 $team = explode("<>",fgets($fp));//チーム名 2行目 $number = explode("<>",trim(fgets($fp)));//人数 3行目 $avelv = explode("<>",trim(fgets($fp)));//平均レベル 4行目 $win = trim(fgets($fp));// 勝利チーム 5行目 $act = trim(fgets($fp));// 総行動数 6行目 fclose($fp); $date = date("m/d H:i:s",substr($time,0,10)); // 勝利チームによって色を分けて表示 if($type == "RANK") print("[ {$date} ] \n"); else if($type == "SQUAD") print("[ {$date} ] \n"); else if($type == "DUEL") print("[ {$date} ] \n"); else if($type == "OLD") print("[ {$date} ] \n"); else if($type == "UNION") print("[ {$date} ] \n"); else if($type == "PARTY") print("[ {$date} ] \n"); else if($type == "PARTYUNION") print("[ {$date} ] \n"); else if($type == "ARENA") print("[ {$date} ] \n"); else if($type == "ARENASQUAD") print("[ {$date} ] \n"); else print("[ {$date} ] \n"); print("$actturns \n");//総ターン数 if($win === "0") print("{$team[0]}"); else if($win === "1") print("{$team[0]}"); else print("{$team[0]}"); print("({$number[0]}:{$avelv[0]})"); print(" vs "); if($win === "0") print("{$team[1]}"); else if($win === "1") print("{$team[1]}"); else print("{$team[1]}"); print("({$number[1]}:{$avelv[1]})
"); } ////////////////////////////////////////////////// // 戦闘ログを回覧する function ShowBattleLog($no,$type=false) { if($type == "RANK") $file = LOG_BATTLE_RANK.$no.".dat"; else if($type == "SQUAD") $file = LOG_BATTLE_SQUAD.$no.".dat"; else if($type == "DUEL") $file = LOG_BATTLE_DUEL.$no.".dat"; else if($type == "OLD") $file = LOG_BATTLE_OLD.$no.".dat"; else if($type == "UNION") $file = LOG_BATTLE_UNION.$no.".dat"; else if($type == "PARTY") $file = LOG_BATTLE_PARTY.$no.".dat"; else if($type == "PARTYUNION") $file = LOG_BATTLE_PARTYUNION.$no.".dat"; else if($type == "ARENA") $file = LOG_BATTLE_ARENA.$no.".dat"; else if($type == "ARENASQUAD") $file = LOG_BATTLE_ARENASQUAD.$no.".dat"; else $file = LOG_BATTLE_NORMAL.$no.".dat"; if(!file_exists($file)) {//ログが無い print("log doesnt exists"); return false; } $log = file($file); $row = 6;//ログの何行目から書き出すか? $time = substr($log[0],0,10); //print('
'."\n"); print('
'); print("

battle log*

"); print("\nthis battle starts at
"); print(date("m/d H:i:s",substr($time,0,10))); print("
\n"); //print("
\n"); while($log["$row"]) { print($log["$row"]); $row++; } } ////////////////////////////////////////////////// // 技の詳細を表示 function ShowSkillDetail($skill,$radio=false) { if(!$skill) return false; if($radio) print(''); print(''); print("{$skill[name]}"); if($radio) print(" / {$skill[learn]}pt"); if($skill[target][0] == "all")//対象 print(" / {$skill[target][0]}"); else if($skill[target][0] == "enemy") print(" / {$skill[target][0]}"); else if($skill[target][0] == "friend") print(" / {$skill[target][0]}"); else if($skill[target][0] == "self") print(" / {$skill[target][0]}"); else if(isset($skill[target][0])) print(" / {$skill[target][0]}"); if($skill[target][1] == "all")//単体or複数or全体 print(" - {$skill[target][1]}"); else if($skill[target][1] == "individual") print(" - {$skill[target][1]}"); else if($skill[target][1] == "multi") print(" - {$skill[target][1]}"); else if(isset($skill[target][1])) print(" - {$skill[target][1]}"); if(isset($skill["sacrifice"])) print(" / Sacrifice:{$skill[sacrifice]}%"); // 消費SP if(isset($skill["sp"])) print(" / {$skill[sp]}sp"); // 消費魔方陣 if($skill["MagicCircleDeleteTeam"]) print(" / MagicCircle x".$skill["MagicCircleDeleteTeam"].""); if($skill["pow"]) { if($skill["counter"]) { print(" / {$skill[pow]}%x"); if($skill["hitbias"]) print($skill["counterhit"] * $skill["hitbias"]); else print($skill["counterhit"]); } else { print(" / {$skill[pow]}%x"); if($skill["hitbias"]) print(( $skill["target"][2] ? ($skill["target"][2] * $skill["hitbias"]) : $skill["hitbias"] ) ); else print(( $skill["target"][2] ? $skill["target"][2] : "1" ) ); } } else if($skill["target"][2] > 1) { print(" / x"); if($skill["hitbias"]) print(( $skill["target"][2] ? ($skill["target"][2] * $skill["hitbias"]) : $skill["hitbias"] ) ); else print(( $skill["target"][2] ? $skill["target"][2] : "1" ) ); } if($skill["type"] == 1) print(" / Magic"); if($skill["jump"] == 1) print(" / Jump"); if($skill["ward"]) print(" / Ward"); if($skill["field"]) print(" / Field"); if($skill["song"]) print(" / Song"); if($skill["chain"]) print(" / Chain ".$skill[chain]."%"); if($skill["CircleSympathy"]) print(" / CircleSympathy"); if($skill["passive"]) print(" / Passive"); if($skill["quick"]) print(" / Quick"); if($skill["halfquick"]) print(" / HalfQuick"); if($skill["FirstQuick"]) print(" / FirstQuick"); if($skill["invalid"]) print(" / invalid"); if($skill["priority"] == "Back" && !$skill["support"]) print(" / BackAttack"); if($skill["CureBadStatus"]) print(" / CureBadStatus"); if($skill["CurePoison"]) print(" / CurePoison"); if($skill["SpRecoveryRate"]) print(" / SpRecovery+".$skill[SpRecoveryRate].""); if($skill["delay"]) print(" / Delay-".$skill[delay]."%"); // if($skill["support"]) // print(" / support"); if($skill["UpMAXHP"]) print(" / MaxHP+".$skill[UpMAXHP]."%"); if($skill["UpMAXSP"]) print(" / MaxSP+".$skill[UpMAXSP]."%"); if($skill["UpSTR"]) print(" / Str+".$skill[UpSTR]."%"); if($skill["UpINT"]) print(" / Int+".$skill[UpINT]."%"); if($skill["UpDEX"]) print(" / Dex+".$skill[UpDEX]."%"); if($skill["UpSPD"]) print(" / Spd+".$skill[UpSPD]."%"); if($skill["UpLUK"]) print(" / Luk+".$skill[UpLUK]."%"); if($skill["UpATK"]) print(" / Atk+".$skill[UpATK]."%"); if($skill["UpMATK"]) print(" / Matk+".$skill[UpMATK]."%"); if($skill["UpDEF"]) print(" / Def+".$skill[UpDEF]."%"); if($skill["UpMDEF"]) print(" / Mdef+".$skill[UpMDEF]."%"); if($skill["DownMAXHP"]) print(" / MaxHP-".$skill[DownMAXHP]."%"); if($skill["DownMAXSP"]) print(" / MaxSP-".$skill[DownMAXSP]."%"); if($skill["DownSTR"]) print(" / Str-".$skill[DownSTR]."%"); if($skill["DownINT"]) print(" / Int-".$skill[DownINT]."%"); if($skill["DownDEX"]) print(" / Dex-".$skill[DownDEX]."%"); if($skill["DownSPD"]) print(" / Spd-".$skill[DownSPD]."%"); if($skill["DownLUK"]) print(" / Luk-".$skill[DownLUK]."%"); if($skill["DownATK"]) print(" / Atk-".$skill[DownATK]."%"); if($skill["DownMATK"]) print(" / Matk-".$skill[DownMATK]."%"); if($skill["DownDEF"]) print(" / Def-".$skill[DownDEF]."%"); if($skill["DownMDEF"]) print(" / Mdef-".$skill[DownMDEF]."%"); if($skill["PlusMAXHP"]) print(" / MaxHP+".$skill[PlusMAXHP].""); if($skill["PlusMAXSP"]) print(" / MaxSP+".$skill[PlusMAXSP].""); if($skill["PlusSTR"]) print(" / Str+".$skill[PlusSTR].""); if($skill["PlusINT"]) print(" / Int+".$skill[PlusINT].""); if($skill["PlusDEX"]) print(" / Dex+".$skill[PlusDEX].""); if($skill["PlusSPD"]) print(" / Spd+".$skill[PlusSPD].""); if($skill["PlusLUK"]) print(" / Luk+".$skill[PlusLUK].""); if($skill["charge"]["0"] || $skill["charge"]["1"]) { print(" / (".($skill["charge"]["0"]?$skill["charge"]["0"]:"0").":"); print(($skill["charge"]["1"]?$skill["charge"]["1"]:"0").")"); } // 武器制限表示 if($skill["limit"]) { $Limit = " / Limit:"; foreach($skill["limit"] as $type => $bool) { $Limit .= $type.", "; } print(substr($Limit,0,-2)); } if($skill["exp"]) print(" / {$skill[exp]}"); print("\n"); } ////////////////////////////////////////////////// // アイテムの詳細を返す...ちょっと修正したいな。 function ShowItemDetail($item,$amount=false,$text=false,$need=false) { if(!$item) return false; $html = ""; // 精錬値 if($item["refine"]) $html .= "+{$item[refine]} "; if($item["AddName"]) $html .= "{$item[AddName]} "; $html .= "{$item[base_name]}";// 名前 if($item["drefine"]) { $html .= " "; for($i=0; $i<$item["drefine"]; $i++) { $html .= "+"; } } if($item["type"]) $html .= " ({$item[type]})"; if($amount) {//数量 $html .= " x{$amount}"; } if($item["atk"]["0"])//物理攻撃 $html .= ' / Atk:'.$item[atk][0].''; if($item["atk"]["1"])//魔法攻撃 $html .= ' / Matk:'.$item[atk][1].''; if($item["def"]) { $html .= " / Def:{$item[def][0]}+{$item[def][1]}"; $html .= " / Mdef:{$item[def][2]}+{$item[def][3]}"; } if($item["P_SUMMON"]) $html .= ' / Summon+'.$item["P_SUMMON"].'%'; if(isset($item["handle"])) $html .= ' / h:'.$item[handle].''; if($item["option"]) $html .= ' / '.substr($item["option"],0,-2).""; if($need && $item["need"]) { $html .= " /"; foreach($item["need"] as $M_itemNo => $M_amount) { $M_item = LoadItemData($M_itemNo); $html .= ""; $html .= "{$M_item[base_name]}";// 名前 $html .= " x{$M_amount}"; if($need["$M_itemNo"]) $html .= "(".$need["$M_itemNo"].")"; } } if($text) return $html; print($html); } ////////////////////////////////////////////////// // 赤い警告文でエラー表示 function ShowResult($message,$add=false) { if($add) $add = " ".$add; if(is_string($message)) print('
'.$message.'
'."\n"); } ////////////////////////////////////////////////// // 赤い警告文でエラー表示 function ShowError($message,$add=false) { if($add) $add = " ".$add; if(is_string($message)) print('
'.$message.'
'."\n"); } ////////////////////////////////////////////////// // マニュアルを表示する function ShowManual() { include(MANUAL); return true; } ////////////////////////////////////////////////// // マニュアルを表示する function ShowManual2() { include(MANUAL_HIGH); return true; } ////////////////////////////////////////////////// // チュートリアルを表示する function ShowTutorial() { include(TUTORIAL); return true; } ////////////////////////////////////////////////// // Data Boardを表示する function ShowDataBoard() { include(DATA_BOARD); return true; } ////////////////////////////////////////////////// // Data Boardを表示する function ShowDataBoardMaster() { include(DATA_BOARD_MASTER); return true; } ////////////////////////////////////////////////// // 更新内容の表示 function ShowUpDate() { print('
'); print("

Back
to bottom

"); if($_POST["updatetext"]) { $update = htmlspecialchars($_POST["updatetext"],ENT_QUOTES); $update = stripslashes($update); } else $update = @file_get_contents(UPDATE); print('
'); if($_POST["updatepass"] == UP_PASS) { print('
'); print(''); print('リロード
'); } print(nl2br($update)."\n"); print('
'); if($_POST["updatepass"] == UP_PASS && $_POST["updatetext"]) { $fp = fopen(UPDATE,"w"); $text = htmlspecialchars($_POST["updatetext"],ENT_QUOTES); $text = stripslashes($text); flock($fp,2); fputs($fp,$text); fclose($fp); } print <<< EOD
EOD; print("

Back

"); } ////////////////////////////////////////////////// // げーむでーた function ShowGameData() { ?>

GameData

| 職(Job) | アイテム(item) | 判定 | モンスター |
$var) { $name[$key] = trim($name[$key]); if($name[$key] === "") unset($name[$key]); } return $name; } else { return array(); } } ////////////////////////////////////////////////// // function userNameAdd($add) { foreach(userNameLoad() as $name) { $string .= $name."\n"; } $string .= $add."\n"; $fp = fopen(USER_NAME,"w+"); flock($fp, LOCK_EX); fwrite($fp,$string); fclose($fp); } ////////////////////////////////////////////////// // 全ランキングの表示 function RankAllShow() { print('
'."\n"); print('

Classic Ranking - '.date("Y年n月j日 G時i分s秒").'

'."\n"); include(CLASS_RANKING); $Rank = new Ranking(); $Rank->ShowRanking(); print('
'."\n"); } ////////////////////////////////////////////////// // 全ランキングの表示 function SquadAllShow() { print('
'."\n"); print('

Squad Ranking - '.date("Y年n月j日 G時i分s秒").'

'."\n"); include(CLASS_SQUAD); $Squad = new Squad(); $Squad->ShowRanking(); print('
'."\n"); } ////////////////////////////////////////////////// // 全ランキングの表示 function DuelAllShow() { print('
'."\n"); print('

Duel Ranking - '.date("Y年n月j日 G時i分s秒").'

'."\n"); include(CLASS_DUEL); $Duel = new Duel(); $Duel->ShowRanking(); print('
'."\n"); } ////////////////////////////////////////////////// // 全ランキングの表示 function OldAllShow() { print('
'."\n"); print('

Old-fashion Ranking - '.date("Y年n月j日 G時i分s秒").'

'."\n"); include(CLASS_OLD); $Old = new Old(); $Old->ShowRanking(); print('
'."\n"); } ////////////////////////////////////////////////// // 全ランキングの表示 function ArenaAllShow() { print('
'."\n"); print('

Classic Arena - '.date("Y年n月j日 G時i分s秒").'

'."\n"); include(CLASS_ARENA); $Arena = new Arena(); $Arena->ShowRanking(); print('
'."\n"); } ////////////////////////////////////////////////// // 全ランキングの表示 function ArenaSquadAllShow() { print('
'."\n"); print('

Squad Arena - '.date("Y年n月j日 G時i分s秒").'

'."\n"); include(CLASS_ARENASQUAD); $ArenaSquad = new ArenaSquad(); $ArenaSquad->ShowRanking(); print('
'."\n"); } ////////////////////////////////////////////////// // function RecordManage($string) { $file = MANAGE_LOG_FILE; $fp = @fopen($file,"r+") or die(); $text = fread($fp,2048); ftruncate($fp,0); rewind($fp); fwrite($fp,$string."\n".$text); } /* * 入力された文字列を確認する * 返り値 * 成功 = array(true,変換($string)); * 失敗 = array(false,失敗理由); */ function CheckString($string,$maxLength=16) { $string = trim($string); $string = stripslashes($string); if(is_numeric(strpos($string,"\t"))) { return array(false,"不正な文字"); } if(is_numeric(strpos($string,"\n"))) { return array(false,"不正な文字"); } if (!$string) { return array(false,"未入力"); } $length = strlen($string); if ( 0 == $length || $maxLength < $length) { return array(false,"長すぎか短すぎる"); } $string = htmlspecialchars($string,ENT_QUOTES); return array(true,$string); } /////////////////////////////////////////////////// // 端末を判断。 function isMobile() { if(strstr($_SERVER['HTTP_USER_AGENT'],"DoCoMo")){ $env = 'i'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"Vodafone")){ $env = 'i'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"SoftBank")){ $env = 'i'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"MOT-")){ $env = 'i'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"J-PHONE")){ $env = 'i'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"KDDI")){ //$env = 'ez'; $env = 'ez'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"UP.Browser")){ $env = 'i'; }elseif(strstr($_SERVER['HTTP_USER_AGENT'],"WILLCOM")){ $env = 'ez'; }else{ $env = 'pc'; } return $env; } ////////////////////////////////////////////////// // DUMP if(!function_exists("dump")) { function dump($array) { print("
".print_r($array,1)."
"); } } ?>Number = basename($file,".dat"); $this->file = $file; $this->fp = FileLock($file); $data = ParseFileFP($this->fp); $this->SetCharData($data); } ////////////////////////////////////////////////// // ファイルポインタが開かれていれば閉じる function fpclose() { if(is_resource($this->fp)) { //print("who?.".$this->Name()."
\n"); //print("FP閉じた"); fclose($this->fp); unset($this->fp); } } ////////////////////////////////////////////////// // 召喚力?召喚した時の召喚モンスターの強さ function SummonPower() { $DEX_PART = sqrt($this->DEX) * 5;// DEX分の強化分 $Strength = 1 + ($DEX_PART + $this->LUK)/250; $Multiply = 100; if($this->SPECIAL["Summon"]) $Multiply += $this->SPECIAL["Summon"]; if($this->SPECIAL["Vampire"]) $Multiply += 100; $Strength *= $Multiply/100; return $Strength; } ////////////////////////////////////////////////// // HPの犠牲 function SacrificeHp($rate) { if(!$rate) return false; $SelfDamage = ceil( $this->MAXHP*($rate/100) ); if($this->POSITION != "front") $SelfDamage *= 2; print("".$this->Name(bold)." sacrifice "); print("$SelfDamage HP\n"); $this->HpDamage($SelfDamage); print("
\n"); } ////////////////////////////////////////////////// // 特殊技能?の追加 function GetSpecial($name,$value) { if(is_bool($value)) { $this->SPECIAL["$name"] = $value; } else if (is_array($value)) { foreach($value as $key => $val) { $this->SPECIAL["$name"]["$key"] += $val; } } else { $this->SPECIAL["$name"] += $value; } } ////////////////////////////////////////////////// // 変身解除 function ShapeOriginal() { print($this->Name(bold)." returns to original.
\n"); $this->img = $this->IMG; $this->SPECIAL["AutoSkill"] = false; if($this->SPECIAL["Weawolf"]) { $this->GetSpecial("Weawolf",false); print($this->Name(bold)." HP({$this->HP}) down to "); $this->HP = round($this->HP * (1 - 33/100)); print("{$this->HP}
\n"); $this->DownMAXHP(33); $this->DownDEF(33); } else if($this->SPECIAL["Vampire"]) { $this->GetSpecial("Vampire",false); $this->DownINT(50); print($this->Name(bold)."'s SummonPower down 100%
\n"); } else if($this->SPECIAL["DarkWizard"]) { $this->GetSpecial("DarkWizard",false); $this->DownMAXSP(39); } else if($this->SPECIAL["Shademan"]) { $this->GetSpecial("Shademan",false); $this->DownDEF(9); $this->DownMDEF(9); } else if($this->SPECIAL["Falcon"]) { $this->GetSpecial("Falcon",false); $this->DownSPD(20); } else if($this->SPECIAL["Phoenix"]) { $this->GetSpecial("Phoenix",false); $this->DownMDEF(33); } else if($this->SPECIAL["Enchanter"]) { $this->GetSpecial("Enchanter",false); print($this->Name(bold)." HP({$this->HP}) down to "); $this->HP = round($this->HP * (1 - 20/100)); print("{$this->HP}
\n"); $this->DownMAXHP(20); $this->DownMAXSP(24); $this->DownDEF(20); } else if($this->SPECIAL["ElfinMage"]) { $this->GetSpecial("ElfinMage",false); $this->DownDEX(33); } else if($this->SPECIAL["SpellLinker"]) { $this->GetSpecial("SpellLinker",false); $this->DownINT(33); $this->DownSPD(13); } else if($this->SPECIAL["Animist"]) { $this->GetSpecial("Animist",false); $this->DownMAXSP(24); $this->DownMDEF(20); $this->SPECIAL["HealBoost"] -= 100; print($this->Name(bold)."'s HealBoost down 100%
\n"); } else if($this->SPECIAL["EvilCleric"]) { $this->GetSpecial("EvilCleric",false); $this->DownMAXSP(24); $this->DownMDEF(20); } else if($this->SPECIAL["Turtle"]) { $this->GetSpecial("Turtle",false); $this->UpSTR(233); $this->UpINT(233); $this->UpSPD(233); $this->DownDEF(20); } else if($this->SPECIAL["Panda"]) { $this->GetSpecial("Turtle",false); $this->UpMAXSP(100); $this->UpDEF(50); $this->UpMDEF(50); } else if($this->SPECIAL["Evolution"]) { $this->GetSpecial("Evolution",false); print($this->Name(bold)." HP({$this->HP}) down to "); $this->HP = round($this->HP * (1 - 33/100)); print("{$this->HP}
\n"); $this->DownMAXHP(33); $this->DownMAXSP(33); $this->DownSTR(50); $this->DownINT(50); $this->DownSPD(50); $this->DownATK(100); $this->DownMATK(100); $this->DownDEF(100); $this->DownMDEF(100); } } ////////////////////////////////////////////////// // Ward解除 function ResetWard() { if($this->SPECIAL["Ward"]) print("".$this->Name(bold)."'s ".$this->SPECIAL["Ward"]." end.
\n"); $this->SPECIAL["Ward"] = false; $this->SPECIAL["ShortWard"] = false; $this->SPECIAL["AggressiveWard"] = false; $this->SPECIAL["DefensiveWard"] = false; $this->SPECIAL["AccelerateWard"] = false; $this->SPECIAL["CheerWard"] = false; $this->SPECIAL["MentalWard"] = false; $this->SPECIAL["PierceWard"] = false; $this->SPECIAL["ImpromptuWard"] = false; $this->SPECIAL["AnimaWard"] = false; $this->SPECIAL["CircleWard"] = false; } ////////////////////////////////////////////////// // Auto解除 function EndAutoSpell() { print($this->Name(bold)."'s ".$this->SPECIAL["AutoName"]." end.
\n"); $this->SPECIAL["AutoSpell"] = false; $this->SPECIAL["AutoSkill"] = false; $this->SPECIAL["AutoName"] = false; } ////////////////////////////////////////////////// // HPSP持続回復 function AutoRegeneration() { // HP回復 $HpRegen = 0; if($this->SPECIAL["HpRegen"]) $HpRegen += $this->SPECIAL["HpRegen"]; if($this->SPECIAL["AnimaWard"]) $HpRegen += $this->SPECIAL["AnimaWard"]; if($HpRegen) { $Regen = round($this->MAXHP * $HpRegen/100); if($this->SPECIAL["Berserk"]) $Regen = 0; print('* '.$this->Name(bold)." Auto Regenerate ".$Regen." HP "); $this->HpRecover($Regen); print("
\n"); } // SP回復 $SpRegen = 0; if($this->SPECIAL["SpRegen"]) $SpRegen += $this->SPECIAL["SpRegen"]; if($this->SPECIAL["AnimaWard"]) $SpRegen += $this->SPECIAL["AnimaWard"]; if($SpRegen) { $Regen = round($this->MAXSP * $SpRegen/100); if($this->SPECIAL["Berserk"]) $Regen = 0; print('* '.$this->Name(bold)." Auto Regenerate ".$Regen." SP "); $this->SpRecover($Regen); print("
\n"); } } ////////////////////////////////////////////////// // キャラステータスの一番上のやつ。 function ShowCharDetail() { $P_MAXHP = round($this->maxhp * $this->M_MAXHP/100) + $this->P_MAXHP; $P_MAXSP = round($this->maxsp * $this->M_MAXSP/100) + $this->P_MAXSP; ?>
ShowCharLink();?>
Exp :