동시에 관직이 여러번 뛸때에도 관직 보상 많이 줌

This commit is contained in:
2019-08-14 01:33:50 +09:00
parent e1b8dde60a
commit 6d85c609fd
+26 -20
View File
@@ -1005,8 +1005,10 @@ function updateNationState() {
} }
if($nationlevel > $nation['level']) { if($nationlevel > $nation['level']) {
$levelDiff = $nationlevel - $nation['level'];
$oldLevel = $nation['level']; $oldLevel = $nation['level'];
$nation['level'] = $nationlevel; $nation['level'] = $nationlevel;
switch($nationlevel) { switch($nationlevel) {
case 7: case 7:
@@ -1030,29 +1032,33 @@ function updateNationState() {
break; break;
} }
//유니크 아이템 하나 돌리자
$targetKillTurn = $admin['killturn']; foreach(range(1, $levelDiff) as $idx){
$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); $targetKillTurn = $admin['killturn'];
$uniqueLotteryWeightList = []; $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){ foreach($nationGenList as $nationGen){
if($nationGen['horse'] > 6 || $nationGen['weap'] > 6 || $nationGen['book'] > 6 || $nationGen['item'] > 6){ if($nationGen['horse'] > 6 || $nationGen['weap'] > 6 || $nationGen['book'] > 6 || $nationGen['item'] > 6){
continue; 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 guaranteedUniqueItemLottery($uniqueLotteryWeightList, '작위보상');
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, '작위보상');
$lastAssemblerID = $gameStor->assembler_id??0; $lastAssemblerID = $gameStor->assembler_id??0;