From 14966a88c2ae36f2f463dbdaeb15d351d9af7202 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 18 Sep 2018 01:27:30 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=80=EB=8C=80=20=ED=83=84=20=EC=82=AC?= =?UTF-8?q?=EB=9E=8C=EC=9D=80=20=EB=B0=9C=EB=A0=B9=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=B5=9C=EB=8C=80=ED=95=9C=20=EB=B0=B0?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_npc.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hwe/func_npc.php b/hwe/func_npc.php index e3e43759..77070732 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -192,7 +192,7 @@ function processAI($no) { $isStart = 0; } - $query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,train,atmos,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'"; + $query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,train,atmos,troop,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'"; $result = MYDB_query($query, $connect) or Error("processAI01 ".MYDB_error($connect),""); $general = MYDB_fetch_array($result); @@ -937,7 +937,7 @@ function NPCStaffWork($general, $nation, $dipState){ $commandList = []; - foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level` FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) { + foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level`, troop FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) { $cityID = $nationGeneral['city']; $generalID = $nationGeneral['no']; @@ -1195,13 +1195,18 @@ function NPCStaffWork($general, $nation, $dipState){ if($maxDevCity['dev'] >= 95 && $targetCity['city'] != $maxDevCity['city'] && $targetCity['dev'] <= 70){ $targetGeneral = $nationGenerals[Util::choiceRandom($maxDevCity['generals'])]; - $commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 2; + if($targetGeneral['troop'] != 0){ + $commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 2; + } } if(count($targetCity['generals']) < count($maxCity['generals']) - 2){ //세명 이상 차이나야 함 $targetGeneral = $nationGenerals[Util::choiceRandom($maxCity['generals'])]; - if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95){ + if($targetGeneral['npc']==5){ + + } + else if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95 && $targetGeneral['troop'] == 0){ //유저장은 의도가 있을 것이므로 삽나지 않는 이상 발령 안함! $commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 5; }