setReadOnly(); $db = DB::db(); $connect=$db->get(); $count = count($turn); for($i=0; $i < $count; $i++) { if($turn[$i] == 100 || $turn[$i] == 99 || $turn[$i] == 98) { } elseif($turn[$i] >= 0 || $turn[$i] <= 23) { } else { unset($turn); $turn[0] = 100; break; } } if($turn[0] == 100) { unset($turn); for($i=0; $i < 24; $i++) $turn[$i] = $i; } elseif($turn[0] == 99) { unset($turn); for($i=0, $j=0; $i < 24; $i+=2, $j++) $turn[$j] = $i; } elseif($turn[0] == 98) { unset($turn); for($i=1, $j=0; $i < 24; $i+=2, $j++) $turn[$j] = $i; } switch($commandtype) { case 0: command_Single($turn, 0); break; //휴식 case 1: command_Single($turn, 1); break; //농업 case 2: command_Single($turn, 2); break; //상업 case 3: command_Single($turn, 3); break; //기술 case 4: command_Single($turn, 4); break; //선정 case 5: command_Single($turn, 5); break; //수비 case 6: command_Single($turn, 6); break; //성벽 case 7: command_Single($turn, 7); break; //정착 장려 case 8: command_Single($turn, 8); break; //치안 강화 case 9: command_Single($turn, 9); break; //자금 조달 case 11: command_11( $turn, 11, false); break; //징병 case 12: command_11( $turn, 12, true); break; //모병 case 13: command_Single($turn, 13); break; //훈련 case 14: command_Single($turn, 14); break; //사기진작 //case 15: command_Single($turn, 0); break; //전투태세 case 16: command_16( $turn, 16); break; //전쟁 case 17: command_Single($turn, 17); break; //소집해제 case 21: command_21( $turn, 21); break; //이동 case 22: command_22( $turn, 22); break; //등용 //TODO:등용장 재 디자인 case 23: command_23( $turn, 23); break; //포상 case 24: command_24( $turn, 24); break; //몰수 case 25: command_25( $turn, 25); break; //임관 case 26: command_Single($turn, 26); break; //집합 case 27: command_27( $turn, 27); break; //발령 case 28: command_Single($turn, 28); break; //귀환 case 29: command_Single($turn, 29); break; //인재탐색 case 30: command_30( $turn, 30); break; //강행 case 31: command_31($turn, 31); break; //첩보 case 32: command_32($turn, 32); break; //화계 case 33: command_33($turn, 33); break; //탈취 case 34: command_34($turn, 34); break; //파괴 case 35: command_35($turn, 35); break; //선동 case 41: command_Single($turn, 41); break; //단련 case 42: command_Single($turn, 42); break; //견문 case 43: command_43( $turn, 43); break; //증여 case 44: command_44( $turn, 44); break; //헌납 case 45: command_Single($turn, 45); break; //하야 case 46: command_46( $turn, 46); break; //건국 case 47: command_Single($turn, 47); break; //방랑 case 48: command_48( $turn, 48); break; //장비구입 case 49: command_49( $turn, 49); break; //군량매매 case 50: command_Single($turn, 50); break; //요양 case 51: command_51($turn, 51); break; //항복권고 case 52: command_52($turn, 52); break; //원조 case 53: command_53($turn, 53); break; //통합제의 case 54: command_54($turn, 54); break; //선양 case 55: command_Single($turn, 55); break; //거병 case 56: command_Single($turn, 56); break; //해산 case 57: command_Single($turn, 57); break; //모반 시도 case 61: command_61($turn, 61); break; //불가침 case 62: command_62($turn, 62); break; //선포 case 63: command_63($turn, 63); break; //종전 case 64: command_64($turn, 64); break; //파기 case 65: command_65($turn, 65); break; //초토화 case 66: command_66($turn, 66); break; //천도 case 67: command_67($turn, 67); break; //증축 case 68: command_68($turn, 68); break; //감축 case 71: command_Chief($turn, 71); break; //필사즉생 case 72: command_72($turn, 72); break; //백성동원 case 73: command_73($turn, 73); break; //수몰 case 74: command_74($turn, 74); break; //허보 case 75: command_75($turn, 75); break; //피장파장 case 76: command_Chief($turn, 76); break; //의병모집 case 77: command_77($turn, 77); break; //이호경식 case 78: command_78($turn, 78); break; //급습 case 81: command_81($turn, 81); break; //국기변경 case 99: command_99($turn); break; //수뇌부 휴식 default:command_Single($turn, 0); break; //휴식 } function starter($name, $type=0) { ?> <?=$name?>
"; } function command_99($turn) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); $query = "select nation,level from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); if($me['level'] >= 5) { $command = EncodeCommand(0, 0, 0, 99); for($i=0; $i < count($turn); $i++) { $query = "update nation set l{$me['level']}turn{$turn[$i]}='{$command}' where nation='{$me['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } } header('location:b_chiefcenter.php'); } function command_11($turn, $command, bool $is모병 = false) { $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $userID = Session::getUserID(); $me = $db->queryFirstRow( 'SELECT no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where owner=%i', $userID ); [$nationLevel, $tech] = $db->queryFirstList('SELECT level,tech FROM nation WHERE nation=%i', $me['nation']); if(!$nationLevel){ $nationLevel = 0; } if(!$tech){ $tech = 0; } $lbonus = setLeadershipBonus($me, $nationLevel); $ownCities = []; $ownRegions = []; [$year, $startyear] = $gameStor->getValuesAsArray(['year','startyear']); $relativeYear = $year - $startyear; foreach(DB::db()->query('SELECT city, region from city where nation = %i', $me['nation']) as $city){ $ownCities[$city['city']] = 1; $ownRegions[$city['region']] = 1; } $leader = getGeneralLeadership($me, true, true, true); $fullLeader = getGeneralLeadership($me, false, true, true); $abil = getTechAbil($tech); $armTypes = []; foreach(GameUnitConst::allType() as $armType => $armName){ $armTypeCrews = []; foreach(GameUnitConst::byType($armType) as $unit){ $crewObj = new \stdClass; if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){ continue; //TODO: 불가능한 병종도 보여줄 필요가 있음. } $crewObj->id = $unit->id; if($unit->reqTech == 0){ $crewObj->bgcolor = 'green'; } else{ $crewObj->bgcolor = 'limegreen'; } $crewObj->baseRice = $unit->rice * getTechCost($tech); $crewObj->baseCost = CharCost($unit->costWithTech($tech), $me['personal']); $armType = $unit->armType; if($me['special2'] == 50 && $armType == GameUnitConst::T_FOOTMAN){ $crewObj->baseCost *= 0.9; } else if($me['special2'] == 51 && $armType == GameUnitConst::T_ARCHER){ $crewObj->baseCost *= 0.9; } else if($me['special2'] == 52 && $armType == GameUnitConst::T_CAVALRY){ $crewObj->baseCost *= 0.9; } else if($me['special2'] == 53 && $armType == GameUnitConst::T_WIZARD){ $crewObj->baseCost *= 0.9; } else if($me['special2'] == 54 && $armType == GameUnitConst::T_SIEGE){ $crewObj->baseCost *= 0.9; } else if($me['special2'] == 72) { $crewObj->baseCost *= 0.5; } $crewObj->name = $unit->name; $crewObj->attack = $unit->attack + $abil; $crewObj->defence = $unit->defence + $abil; $crewObj->speed = $unit->speed; $crewObj->avoid = $unit->avoid; if($gameStor->show_img_level < 2) { $crewObj->img = ServConfig::$sharedIconPath."/default.jpg"; } else{ $crewObj->img = ServConfig::$gameImagePath."/weap".$unit->id.".png"; } $crewObj->baseRiceShort = round($crewObj->baseRice, 1); $crewObj->baseCostShort = round($crewObj->baseCost, 1); $crewObj->info = join('
', $unit->info); $armTypeCrews[] = $crewObj; } $armTypes[] = [$armName, $armTypeCrews]; } if($is모병){ $commandName = '모병'; starter("모병"); } else{ $commandName = '징병'; starter("징병"); } $templates = new \League\Plates\Engine('templates'); echo $templates->render('recruitCrewForm', [ 'command'=>$command, 'commandName'=>$commandName, 'techLevelText'=>getTechCall($tech), 'tech'=>$tech, 'leader'=>$leader, 'fullLeader'=>$fullLeader, 'crewType'=>GameUnitConst::byId($me['crewtype'])->id, 'crewTypeName'=>GameUnitConst::byId($me['crewtype'])->name, 'crew'=>$me['crew'], 'gold'=>$me['gold'], 'turn'=>$turn, 'armTypes'=>$armTypes, ]); ender(); } function command_15($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("재편성"); $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $me = $general['no']; $query = "select no,name from general where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $gencount = MYDB_num_rows($result); echo " 자신의 병사를 다른 장수에게 보냅니다.
00명 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_16($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("출병"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시로 침공을 합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 1); ender(); } function command_21($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("이동"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시로 이동합니다.
인접 도시로만 이동이 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 1); ender(); } function command_22($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("등용"); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 재야나 타국의 장수를 등용합니다.
서신은 개인 메세지로 전달됩니다.
등용할 장수를 목록에서 선택하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_23($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("포상", 1); $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select no,name,level,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $gencount = MYDB_num_rows($result); echo " 국고로 장수에게 자금이나 군량을 지급합니다.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_24($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("몰수", 1); $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select no,name,level,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $gencount = MYDB_num_rows($result); echo " 장수의 자금이나 군량을 몰수합니다.
몰수한것은 국가재산으로 귀속됩니다.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_25($turn, $command) { $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $connect=$db->get(); $userID = Session::getUserID(); starter("임관"); $query = "select no,nations from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); $joinedNations = Json::decode($me['nations']); $query = "select nation,name,color,scout,scoutmsg,sabotagelimit,gennum from nation order by gennum"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); $nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg,gennum FROM nation ORDER BY rand()'); echo " 국가에 임관합니다.
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.
바로 군주의 위치로 이동합니다.
임관할 국가를 목록에서 선택하세요.
!!!는 방랑군을 포함한 랜덤임관입니다. 유니크를 기대하신다면!
???는 방랑군을 제외한 랜덤임관입니다. 유니크 혜택은 없습니다.
임관 금지이거나 초기 제한중인 국가는 붉은색 배경으로 표시됩니다.
870px x 200px를 넘어서는 내용은 표시되지 않습니다.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; echo getInvitationList($nationList); ender(); } function command_27($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("발령", 1); $query = "select no,nation,level from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); $query = "select no,name,level,npc from general where nation='{$me['nation']}' and no!='{$me['no']}' order by npc,binary(name)"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $gencount = MYDB_num_rows($result); echo getMapHtml(); echo "
선택된 도시로 아국 장수를 발령합니다.
아국 도시로만 발령이 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
=> "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_30($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("강행"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시로 강행합니다.
최대 3칸내 도시로만 강행이 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 3); ender(); } function command_31($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("첩보"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 첩보를 실행합니다.
인접도시일 경우 많은 정보를 얻을 수 있습니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; echo " 모든 도시가 가능하지만 많은 정보를 얻을 수 있는
"; printCitiesBasedOnDistance($currentcity['city'], 2); ender(); } function command_32($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("화계"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 화계를 실행합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 2); ender(); } function command_33($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("탈취"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 탈취를 실행합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 2); ender(); } function command_34($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("파괴"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 파괴를 실행합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 2); ender(); } function command_35($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("선동"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 선동을 실행합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 2); ender(); } function command_36($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("기습"); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select city,name from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 기습을 실행합니다.
목록을 선택하거나 도시를 클릭하세요.
{$currentcity['name']} => "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; printCitiesBasedOnDistance($currentcity['city'], 2); ender(); } function command_43($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("증여"); $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select no,name,level,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $gencount = MYDB_num_rows($result); echo " 자신의 자금이나 군량을 다른 장수에게 증여합니다.
장수를 선택하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_44($turn, $command) { $db = DB::db(); $connect=$db->get(); starter("헌납"); echo " 자신의 자금이나 군량을 국가 재산으로 헌납합니다.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_46($turn, $command) { $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $connect=$db->get(); starter("건국"); $maxnation = $gameStor->maxnation; $colorUsed = []; foreach(GetNationColors() as $color){ $colorUsed[$color] = 0; } $nationCount = count(getAllNationStaticInfo()); foreach(getAllNationStaticInfo() as $nation){ if($nation['level'] <= 0){ continue; } if(!isset($nationcolor[$nation['color']])){ $nationcolor[$nation['color']] = 1; } else{ $nationcolor[$nation['color']]++; } } $colorUsedCnt = 0; foreach($colorUsed as $color=>$used){ if($used){ continue; } $colorUsedCnt += 1; } //색깔이 다 쓰였으면 그냥 모두 허용 if($colorUsedCnt === count($colorUsed)){ foreach(array_keys($colorUsed) as $color){ $colorUsed[$color] = 0; } } if($nationCount < $maxnation) { ?> 현재 도시에서 나라를 세웁니다. 중, 소도시에서만 가능합니다.
- 법 가 : 금수입↑ 치안↑ 인구↓ 민심↓
- 유 가 : 내정↑ 민심↑ 쌀수입↓
- 병 가 : 기술↑ 수성↑ 인구↓ 민심↓
- 덕 가 : 치안↑인구↑ 민심↑ 쌀수입↓ 수성↓
- 묵 가 : 수성↑ 기술↓
- 도 가 : 인구↑ 기술↓ 치안↓
- 태 평 도 : 인구↑ 민심↑ 기술↓ 수성↓
- 오 두 미 도 : 쌀수입↑ 인구↑ 기술↓ 수성↓ 내정↓
- 도 적 : 계략↑ 금수입↓ 치안↓ 민심↓
- 불 가 : 민심↑ 수성↑ 금수입↓
- 종 횡 가 : 전략↑ 수성↑ 금수입↓ 내정↓
- 음 양 가 : 내정↑ 인구↑ 기술↓ 전략↓
- 명 가 : 기술↑ 인구↑ 쌀수입↓ 수성↓
국명 : 색깔 : 성향 : > "; } echo "
"; } else { echo "더 이상 건국은 불가능합니다.
"; } ender(); } function command_48($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("장비 매매"); $query = "select no,city,gold from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("command_48 ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); $city = getCity($me['city'], "secu"); $color = []; for($i=1; $i <= 6; $i++) { if($city['secu'] >= $i*1000) { $color[$i] = "white"; } else { $color[$i] = "red"; } } echo " 장비를 구입하거나 매각합니다.
현재 구입 불가능한 것은 붉은색으로 표시됩니다.
현재 도시 치안 : {$city['secu']}    현재 자금 : {$me['gold']}
장비 : "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_49($turn, $command) { $db = DB::db(); $connect=$db->get(); starter("군량매매"); echo " 자신의 군량을 사거나 팝니다.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_51($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("항복 권고", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); $query = "select nation,power from nation where nation='{$me['nation']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $myNation = MYDB_fetch_array($result); echo " 타국에게 항복을 권고합니다.
서신은 개인 메세지로 전달됩니다.
권고할 국가를 목록에서 선택하세요.
합병이 불가능한 국가는 붉은 배경으로 표시됩니다.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
제한 조건
- 인접 국가
- 양국 모두 외교제한 기간 없음
- 제의한 국가가 항복하는 국가보다 국력 3배 초과
"; ender(1); } function command_52($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("원조", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); $mynation = getNationStaticInfo($me['nation']); echo " 타국에게 원조합니다.
작위별로 금액 제한이 있습니다.
 호족: 1만
 군벌: 2만
주자사: 3만
 주목: 4만
  공: 5만
  왕: 6만
 황제: 7만
원조할 국가를 목록에서 선택하세요.
대상 국가 국고 병량 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_53($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("통합제의", 1); $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("command_53 ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); $query = "select avg(power) as power,avg(gennum) as gennum from nation where level>=1"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $avgNation = MYDB_fetch_array($result); $query = "select std(power) as power,std(gennum) as gennum from nation where level>=1"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $stdNation = MYDB_fetch_array($result); $query = "select nation,power,gennum from nation where nation='{$me['nation']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $myNation = MYDB_fetch_array($result); echo " 세력이 비슷한 국가에 통합 제의를 합니다. 제의한 국가 위주로 통합됩니다.
서신은 개인 메세지로 전달됩니다.
제의할 국가를 목록에서 선택하세요.
통합이 불가능한 국가는 붉은 배경으로 표시됩니다.
대상국 : 통합국명 : "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
제한 조건
- 인접 국가
- 양국 모두 외교제한 없음
- 두 국가의 국력 평균이 상위 60%(현재 {$cond1}) 이하.
- 두 국가의 장수수 평균이 상위 75%(현재 {$cond2} 이하.
"; ender(1); } function command_54($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("선양"); $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select no,name,level from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $gencount = MYDB_num_rows($result); echo " 군주의 자리를 다른 장수에게 물려줍니다.
장수를 선택하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_61($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("불가침", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 타국에게 불가침을 제의합니다.
제의할 국가를 목록에서 선택하세요.
배경색은 현재 제의가 불가능한 국가는 붉은색, 현재 불가침중인 국가는 푸른색으로 표시됩니다.
비고는 불가침시 세부 조건등을 지정하는 곳입니다.(최대 45자) ※유저 편의를 위한 것일뿐 시스템적으로 보장하지는 않습니다.
대상 국가 기간
비고 : "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_62($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("선전포고", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 타국에게 선전 포고합니다.
선전 포고할 국가를 목록에서 선택하세요.
고립되지 않은 아국 도시에서 인접한 국가에 선포 가능합니다.
초반제한 해제 2년전부터 선포가 가능합니다. (체섭기준 181년 1월부터 가능)
배경색은 현재 선포가 불가능한 국가는 붉은색, 현재 불가침중(역시 불가)인 국가는 푸른색으로 표시됩니다.
대상 국가 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_63($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("종전", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 전쟁중인 국가에 종전을 제의합니다.
제의할 국가를 목록에서 선택하세요.
배경색은 현재 제의가 불가능한 국가는 붉은색으로 표시됩니다.
대상 국가 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_64($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("파기", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 불가침중인 국가에 조약 파기를 제의합니다.
제의할 국가를 목록에서 선택하세요.
배경색은 현재 제의가 불가능한 국가는 붉은색, 현재 불가침중(제의 가능)인 국가는 푸른색으로 표시됩니다.
대상 국가 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_65($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("초토화", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시를 초토화 시킵니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_66($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("천도", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시로 천도합니다.
현재 수도에서 인접한 도시만 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_67($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("증축", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시를 증축합니다.
현재 수도만 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_68($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("감축", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시를 감축합니다.
현재 수도만 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_72($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("백성동원", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 백성동원을 발동합니다.
아국 도시만 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_73($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("수몰", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 수몰을 발동합니다.
전쟁중인 상대국 도시만 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_74($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("허보", 1); $query = "select city from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); $query = "select name,path from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $currentcity = MYDB_fetch_array($result); echo getMapHtml(); echo "
선택된 도시에 허보를 발동합니다.
선포, 전쟁중인 상대국 도시만 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
"; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(); } function command_75($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("피장파장", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 선택된 국가에 피장파장을 발동합니다.
선포, 전쟁중인 상대국에만 가능합니다.
상대 국가를 목록에서 선택하세요.
배경색은 현재 피장파장 불가능 국가는 붉은색으로 표시됩니다.
대상 국가 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_77($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("이호경식", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 선택된 국가에 이호경식을 발동합니다.
선포, 전쟁중인 상대국에만 가능합니다.
상대 국가를 목록에서 선택하세요.
배경색은 현재 이호경식 불가능 국가는 붉은색으로 표시됩니다.
대상 국가 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_78($turn, $command) { $db = DB::db(); $connect=$db->get(); $userID = Session::getUserID(); starter("급습", 1); $query = "select nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); echo " 선택된 국가에 급습을 발동합니다.
선포, 전쟁중인 상대국에만 가능합니다.
상대 국가를 목록에서 선택하세요.
배경색은 현재 급습 불가능 국가는 붉은색으로 표시됩니다.
대상 국가 "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); } function command_81($turn, $command) { $db = DB::db(); $connect=$db->get(); starter("국기변경", 1); $colorUsed = []; foreach(GetNationColors() as $color){ $colorUsed[$color] = 0; } foreach(getAllNationStaticInfo() as $nation){ if($nation['level'] <= 0){ continue; } $colorUsed[$nation['color']]+=1; } $colorUsedCnt = 0; foreach($colorUsed as $color=>$used){ if($used){ continue; } $colorUsedCnt += 1; } //색깔이 다 쓰였으면 그냥 모두 허용 if($colorUsedCnt === count($colorUsed)){ foreach(array_keys($colorUsed) as $color){ $colorUsed[$color] = 0; } } echo " 국기를 변경합니다. 단 1회 가능합니다.
색깔 : "; for($i=0; $i < count($turn); $i++) { echo " "; } echo "
"; ender(1); }