From 6d85c609fd329a85dae0d869dd557c01a11a31cb Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 14 Aug 2019 01:33:50 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=99=EC=8B=9C=EC=97=90=20=EA=B4=80?= =?UTF-8?q?=EC=A7=81=EC=9D=B4=20=EC=97=AC=EB=9F=AC=EB=B2=88=20=EB=9B=B8?= =?UTF-8?q?=EB=95=8C=EC=97=90=EB=8F=84=20=EA=B4=80=EC=A7=81=20=EB=B3=B4?= =?UTF-8?q?=EC=83=81=20=EB=A7=8E=EC=9D=B4=20=EC=A4=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_gamerule.php | 46 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 1d0b66ca..f825ada5 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -1005,8 +1005,10 @@ function updateNationState() { } if($nationlevel > $nation['level']) { + $levelDiff = $nationlevel - $nation['level']; $oldLevel = $nation['level']; $nation['level'] = $nationlevel; + switch($nationlevel) { case 7: @@ -1030,29 +1032,33 @@ function updateNationState() { break; } - //유니크 아이템 하나 돌리자 - $targetKillTurn = $admin['killturn']; - $targetKillTurn -= 24 * 60 / $admin['turnterm']; - $nationGenList = $db->query('SELECT no, level, belong, horse, weap, book, item FROM general WHERE nation = %i AND killturn >= %i AND npc < 2', $nation['nation'], $targetKillTurn); - $uniqueLotteryWeightList = []; + + foreach(range(1, $levelDiff) as $idx){ + //유니크 아이템 하나 돌리자 + $targetKillTurn = $admin['killturn']; + $targetKillTurn -= 24 * 60 / $admin['turnterm']; + $nationGenList = $db->query('SELECT no, level, belong, horse, weap, book, item FROM general WHERE nation = %i AND killturn >= %i AND npc < 2', $nation['nation'], $targetKillTurn); + $uniqueLotteryWeightList = []; - foreach($nationGenList as $nationGen){ - if($nationGen['horse'] > 6 || $nationGen['weap'] > 6 || $nationGen['book'] > 6 || $nationGen['item'] > 6){ - continue; + foreach($nationGenList as $nationGen){ + if($nationGen['horse'] > 6 || $nationGen['weap'] > 6 || $nationGen['book'] > 6 || $nationGen['item'] > 6){ + continue; + } + $score = $nationGen['belong'] + 5; //임관 년도 + 5 + if($nationGen['level'] == 12){ + $score += 200; //NOTE: 꼬우면 군주하세요. + } + else if($nationGen['level'] == 11){ + $score += 100; + } + else if($nationGen['level'] > 4){ + $score += 50; + } + $uniqueLotteryWeightList[$nationGen['no']] = $score; } - $score = $nationGen['belong'] + 5; //임관 년도 + 5 - if($nationGen['level'] == 12){ - $score += 200; //NOTE: 꼬우면 군주하세요. - } - else if($nationGen['level'] == 11){ - $score += 100; - } - else if($nationGen['level'] > 4){ - $score += 50; - } - $uniqueLotteryWeightList[$nationGen['no']] = $score; + guaranteedUniqueItemLottery($uniqueLotteryWeightList, '작위보상'); } - guaranteedUniqueItemLottery($uniqueLotteryWeightList, '작위보상'); + $lastAssemblerID = $gameStor->assembler_id??0;