From 52d1a48c0b6c0e39c83b8b63601247ab7ff28dc1 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 13 Jun 2018 03:21:55 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B1=B0=EB=B3=91=20=ED=99=95=EB=A5=A0=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD.=20NPC=20=EC=9E=84=EA=B4=80=20=ED=99=95?= =?UTF-8?q?=EB=A5=A0=20=EC=B6=94=EA=B0=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_npc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 99c35a13..199f6128 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -330,7 +330,11 @@ function processAI($no) { if($admin['startyear']+2 > $admin['year']){ //초기 임관 기간에서는 국가가 적을수록 임관 시도가 적음 $nationCnt = $db->queryFirstField('SELECT count(nation) FROM nation'); - if(Util::randBool(1/$nationCnt)){ + $notFullNationCnt = $db->queryFirstField('SELECT count(nation) FROM nation WHERE gennum < %i', GameConst::$initialNationGenLimit); + if($nationCnt == 0 || $notFullNationCnt == 0){ + $available = false; + } + else if(Util::randBool(sqrt(1 / $nationCnt / $notFullNationCnt))){ //국가가 1개일 경우에는 '임관하지 않음' $available = false; } @@ -345,10 +349,10 @@ function processAI($no) { } break; case 1: //거병이나 견문 40% - // 초반이면서 능력이 좋은놈 위주로 1%확률로 거병 + // 초반이면서 능력이 좋은놈 위주로 1.25%확률로 거병 $prop = Util::randF() * (GameConst::$defaultStatNPCMax + GameConst::$chiefStatMin) / 2; $ratio = ($general['leader'] + $general['power'] + $general['intel']) / 3; - if($admin['startyear']+2 > $admin['year'] && $prop < $ratio && Util::randBool(0.01) && $general['makelimit'] == 0) { + if($admin['startyear']+2 > $admin['year'] && $prop < $ratio && Util::randBool(0.0125) && $general['makelimit'] == 0) { //거병 $command = EncodeCommand(0, 0, 0, 55); } else {