황제가 있을 경우 황제. 없으면 이전 천통 군주의 명으로 토너먼트 개최

This commit is contained in:
2019-03-06 01:44:24 +09:00
parent f9f59bd7c2
commit b733b70ad8
2 changed files with 22 additions and 5 deletions
+18 -4
View File
@@ -235,6 +235,8 @@ function startTournament($auto, $type) {
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$prevWinner = $gameStor->prev_winner;
eraseTnmtFightLogAll();
switch($auto) {
@@ -263,12 +265,24 @@ function startTournament($auto, $type) {
$query = "truncate tournament";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opener = $db->queryFirstField('SELECT `general`.`name` FROM `general` JOIN `nation` ON `general`.`nation` = `nation`.`nation` WHERE `general`.`level` = 12 AND `nation`.`level` = 7 ORDER BY rand() LIMIT 1');
if(!$opener){
$opener = $gameStor->prev_winner;
}
if($opener){
$openerText = "황제 <Y>{$opener}</>의 명으로 ";
}
else{
$openerText = '';
}
$history = [];
switch($type) {
case 0: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>전력전</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>영웅</span>들을 모집하고 있습니다!"; break;
case 1: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>통솔전</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>명사</span>들을 모집하고 있습니다!"; break;
case 2: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>일기토</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>용사</span>들을 모집하고 있습니다!"; break;
case 3: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>설전</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>책사</span>들을 모집하고 있습니다!"; break;
case 0: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: $openerText<C>전력전</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>영웅</span>들을 모집하고 있습니다!"; break;
case 1: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: $openerText<C>통솔전</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>명사</span>들을 모집하고 있습니다!"; break;
case 2: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: $openerText<C>일기토</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>용사</span>들을 모집하고 있습니다!"; break;
case 3: $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월: $openerText<C>설전</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>책사</span>들을 모집하고 있습니다!"; break;
}
pushWorldHistory($history, $admin['year'], $admin['month']);
}
+4 -1
View File
@@ -164,6 +164,8 @@ class ResetHelper{
'plock'=>1
]);
$prevWinner = $db->queryFirstField('SELECT l12name FROM emperior ORDER BY `no` DESC LIMIT 1');
CityConst::build();
$cityPositions = [];
foreach(CityConst::all() as $city){
@@ -235,7 +237,8 @@ class ResetHelper{
'npcmode'=>$npcmode,
'extended_general'=>$extend,
'fiction'=>$fiction,
'tnmt_trig'=>$tournament_trig
'tnmt_trig'=>$tournament_trig,
'prev_winner'=>$prevWinner
];
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){