From a44ea2c7916f02d3a7612eabd512f217e0269a1d Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 18 Sep 2018 01:18:03 +0900 Subject: [PATCH] =?UTF-8?q?NPC=20=EB=B6=80=EB=8C=80=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_gamerule.php | 9 +++++---- hwe/func_npc.php | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 5757b00e..39f62517 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -960,7 +960,7 @@ function updateNationState() { $connect=$db->get(); $history = array(); - $admin = $gameStor->getValues(['year', 'month']); + $admin = $gameStor->getValues(['year', 'month', 'fiction', 'startyear', 'show_img_level', 'turnterm']); $query = "select nation,name,level from nation"; $nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -996,6 +996,7 @@ function updateNationState() { } if($nationlevel > $nation['level']) { + $oldLevel = $nation['level']; $nation['level'] = $nationlevel; switch($nationlevel) { @@ -1022,7 +1023,7 @@ function updateNationState() { $lastAssemblerID = $gameStor->assemblerID??0; - $jumpStep = $nationLevel - max(1, $nation['level']); + $jumpStep = $nationlevel - max(1, $oldLevel); if($jumpStep > 0){ foreach(range(1, $jumpStep) as $levelGen){ $lastAssemblerID += 1; @@ -1032,7 +1033,7 @@ function updateNationState() { 10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, 10, 75 ); $npcObj->npc = 5; - $npcObj->build(); + $npcObj->build($admin); $npcID = $npcObj->generalID; $db->insert('troop', [ @@ -1056,7 +1057,7 @@ function updateNationState() { } } - $gameStor->assemberlID = $lastAssemblerID; + $gameStor->assemblerlID = $lastAssemblerID; //작위 상승 $query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'"; diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 20f39648..e3e43759 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -1279,6 +1279,9 @@ function NPCStaffWork($general, $nation, $dipState){ if($generalCity['pop'] - 33000 > $nationGeneral['leader']){ continue; } + if($nationGeneral['npc'] == 5){ + continue; + } $score = 5; if($nationGeneral['npc']<2){