From ea935b36ff30f187ae7d62c6773c9e1034f9a23b Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 3 May 2019 01:02:26 +0900 Subject: [PATCH] =?UTF-8?q?NPC=EB=8A=94=20=ED=95=AD=EC=83=81=20=EC=A0=95?= =?UTF-8?q?=EB=9E=80=20=EC=A7=95=EB=B3=91,=20=EB=AC=B4=EC=9E=A5,=20?= =?UTF-8?q?=EC=A7=80=EC=9E=A5=EC=9D=80=20'=EC=A0=95=EC=B0=A9=EC=9E=A5?= =?UTF-8?q?=EB=A0=A4'=EB=A5=BC=20=EC=9A=B0=EC=84=A0=EC=8B=9C=ED=95=A8.=20?= =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EA=B3=A0=20=EA=B8=B0=EC=88=A0=20=EC=97=B0?= =?UTF-8?q?=EA=B5=AC=20=EC=A4=91=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_npc.php | 110 +++++++++++++++++------------------------------ 1 file changed, 40 insertions(+), 70 deletions(-) diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 7abe8c36..4df8a10b 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -22,6 +22,22 @@ function SetDevelop($genType, $no, $city, $tech) { $command = EncodeCommand(0, 0, 0, 9); //조달 switch($genType) { case 0: //무장 + if($prob < 30) { + if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 + elseif($city['de'] < 99) { $command = EncodeCommand(0, 0, 0, 5); } //수비 + else { $command = EncodeCommand(0, 0, 0, 9); } //조달 + } elseif($prob < 60) { + if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 + elseif($city['wa'] < 99) { $command = EncodeCommand(0, 0, 0, 6); } //성벽 + else { $command = EncodeCommand(0, 0, 0, 9); } //조달 + } elseif($prob < 90) { + if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 + elseif($city['se'] < 99) { $command = EncodeCommand(0, 0, 0, 8); } //치안 + else { $command = EncodeCommand(0, 0, 0, 9); } //조달 + } else { + $command = EncodeCommand(0, 0, 0, 29); + } + break; case 2: //무내정장 if($prob < 30) { if($city['de'] < 99) { $command = EncodeCommand(0, 0, 0, 5); } //수비 @@ -40,15 +56,34 @@ function SetDevelop($genType, $no, $city, $tech) { } break; case 1: //지장 + if($prob < 40) { + if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 + elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + elseif($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업 + else { $command = EncodeCommand(0, 0, 0, 9); } //조달 + } elseif($prob < 80) { + if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 + elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + elseif($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업 + else { $command = EncodeCommand(0, 0, 0, 9); } //조달 + } elseif($prob < 90) { + if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 + elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + else { $command = EncodeCommand(0, 0, 0, 9); } //조달 + } else { + if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달 + else { $command = EncodeCommand(0, 0, 0, 29); } + } + break; case 3: //지내정장 if($prob < 40) { - if($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업 - elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + elseif($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 else { $command = EncodeCommand(0, 0, 0, 9); } //조달 } elseif($prob < 80) { - if($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업 - elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + elseif($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 else { $command = EncodeCommand(0, 0, 0, 9); } //조달 } elseif($prob < 90) { @@ -96,72 +131,7 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de [$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']); $relYear = Util::valueFit($year-$startyear, 0); - $type = 0; - switch($genType) { - case 0: //무장 - case 2: //무내정장 - $dex0 = $dex0 + rand()%1000; - $dex10 = $dex10 + rand()%1000; - $dex20 = $dex20 + rand()%1000; - $sel = 0; - // 보궁기 선택 - if($dex0 > $dex10) { - if($dex0 > $dex20) { - $sel = 0; - } else { - $sel = 2; - } - } else { - if($dex10 > $dex20) { - $sel = 1; - } else { - $sel = 2; - } - } - - - - $types = []; - switch($sel) { - case 0: - foreach(GameUnitConst::byType(GameUnitConst::T_FOOTMAN) as $crewtype){ - if($crewtype->isValid($cities, $regions, $relYear, $tech)){ - $types[] = $crewtype->id; - } - } - break; - case 1: - foreach(GameUnitConst::byType(GameUnitConst::T_ARCHER) as $crewtype){ - if($crewtype->isValid($cities, $regions, $relYear, $tech)){ - $types[] = $crewtype->id; - } - } - break; - case 2: - foreach(GameUnitConst::byType(GameUnitConst::T_CAVALRY) as $crewtype){ - if($crewtype->isValid($cities, $regions, $relYear, $tech)){ - $types[] = $crewtype->id; - } - } - break; - } - break; - case 1: //지장 - case 3: //지내정장 - foreach(GameUnitConst::byType(GameUnitConst::T_WIZARD) as $crewtype){ - if($crewtype->isValid($cities, $regions, $relYear, $tech)){ - $types[] = $crewtype->id; - } - } - break; - } - - if($types){ - $type = Util::choiceRandom($types); - } - else{ - $type = GameUnitConst::DEFAULT_CREWTYPE; - } + $type = GameUnitConst::DEFAULT_CREWTYPE;