diff --git a/hwe/sammo/Scenario/NPC.php b/hwe/sammo/Scenario/NPC.php index 449500da..db7755cb 100644 --- a/hwe/sammo/Scenario/NPC.php +++ b/hwe/sammo/Scenario/NPC.php @@ -173,7 +173,7 @@ class NPC{ $experience = $age * 100; $dedication = $age * 100; $level = $this->level; - if(!$level){ + if(!$level || $isNewGeneral){ $level = $nationID?1:0; } diff --git a/hwe/sammo/Scenario/Nation.php b/hwe/sammo/Scenario/Nation.php index 2613ca95..5c8c3b6e 100644 --- a/hwe/sammo/Scenario/Nation.php +++ b/hwe/sammo/Scenario/Nation.php @@ -137,6 +137,13 @@ class Nation{ 'gennum'=>$npc_cnt, 'totaltech'=>$this->tech*$npc_cnt ], 'nation=%i', $this->id); + + //군주가 없는지 확인 + $hasRuler = $db->queryFirstField('SELECT count(*) FROM general WHERE nation=%i AND level=12'); + if(!$hasRuler){ + $newRuler = $db->queryFirstField('SELECT `no` FROM general WHERE nation=1 ORDER BY leader+power+intel DESC LIMIT 1'); + $db->update('general',['level'=>12], 'no=%i', $newRuler); + } } public function getBrief(){