From 398f54cced4cd37f42840a319b997e950b95c8f9 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 29 May 2018 01:49:06 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B5=B0=EC=A3=BC=EA=B0=80=20=EC=A7=80?= =?UTF-8?q?=EC=A0=95=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8D=94=EB=9D=BC?= =?UTF-8?q?=EB=8F=84=20=EC=95=88=EC=A0=84=ED=95=98=EA=B2=8C=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Scenario/NPC.php | 2 +- hwe/sammo/Scenario/Nation.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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(){