필요없어진 gennum2 삭제. gennum 재연산
This commit is contained in:
@@ -23,6 +23,7 @@ $connect=$db->get();
|
|||||||
|
|
||||||
switch($btn) {
|
switch($btn) {
|
||||||
case "국가변경":
|
case "국가변경":
|
||||||
|
$oldNation = $db->queryFirstField('SELECT nation FROM general WHERE owner=%i', $userID);
|
||||||
if($nation == 0) {
|
if($nation == 0) {
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'nation'=>0,
|
'nation'=>0,
|
||||||
@@ -33,6 +34,14 @@ switch($btn) {
|
|||||||
'nation'=>$nation,
|
'nation'=>$nation,
|
||||||
'level'=>1,
|
'level'=>1,
|
||||||
], 'owner=%i', $userID);
|
], 'owner=%i', $userID);
|
||||||
|
$db->update('nation', [
|
||||||
|
'gennum'=>$db->sqleval('gennum + 1')
|
||||||
|
], 'nation=%i', $oldNation);
|
||||||
|
}
|
||||||
|
if($oldNation != 0){
|
||||||
|
$db->update('nation', [
|
||||||
|
'gennum'=>$db->sqleval('gennum - 1')
|
||||||
|
], 'nation=%i', $oldNation);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ function postUpdateMonthly() {
|
|||||||
// 명성,공헌
|
// 명성,공헌
|
||||||
$nations = $db->query('SELECT
|
$nations = $db->query('SELECT
|
||||||
A.nation,
|
A.nation,
|
||||||
A.gennum, A.gennum2, A.aux,
|
A.gennum, A.aux,
|
||||||
round((
|
round((
|
||||||
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
|
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
|
||||||
+A.tech
|
+A.tech
|
||||||
@@ -536,7 +536,6 @@ function postUpdateMonthly() {
|
|||||||
|
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'power'=>$nation['power'],
|
'power'=>$nation['power'],
|
||||||
'gennum2'=>$nation['gennum'],
|
|
||||||
'aux'=>Json::encode($aux)
|
'aux'=>Json::encode($aux)
|
||||||
], 'nation=%i', $nation['nation']);
|
], 'nation=%i', $nation['nation']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1976,10 +1976,8 @@ function process_76(&$general) {
|
|||||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<M>의병모집</>을 발동");
|
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<M>의병모집</>을 발동");
|
||||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>의병모집</>을 발동");
|
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>의병모집</>을 발동");
|
||||||
|
|
||||||
$query = "select avg(gennum) as gennum from nation";
|
$avgGenNum = $db->queryFirstField('SELECT avg(gennum) FROM nation');
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$addGenCount = 5 + Util::round($avgGenNum / 10);
|
||||||
$avgNation = MYDB_fetch_array($result);
|
|
||||||
$gencount = 5 + Util::round($avgNation['gennum'] / 10);
|
|
||||||
|
|
||||||
$query = "select avg(age) as age, max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0) as dex0, avg(dex10) as dex10, avg(dex20) as dex20, avg(dex30) as dex30, avg(dex40) as dex40 from general where nation='{$general['nation']}'";
|
$query = "select avg(age) as age, max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0) as dex0, avg(dex10) as dex10, avg(dex20) as dex20, avg(dex30) as dex30, avg(dex40) as dex40 from general where nation='{$general['nation']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -1988,7 +1986,7 @@ function process_76(&$general) {
|
|||||||
//의병추가
|
//의병추가
|
||||||
$npc = 4;
|
$npc = 4;
|
||||||
$npcid = $admin['npccount'];
|
$npcid = $admin['npccount'];
|
||||||
for($i=0; $i < $gencount; $i++) {
|
for($i=0; $i < $addGenCount; $i++) {
|
||||||
// 무장 40%, 지장 40%, 무지장 20%
|
// 무장 40%, 지장 40%, 무지장 20%
|
||||||
$type = rand() % 10;
|
$type = rand() % 10;
|
||||||
switch($type) {
|
switch($type) {
|
||||||
@@ -2089,13 +2087,6 @@ function process_76(&$general) {
|
|||||||
//npccount
|
//npccount
|
||||||
$gameStor->npccount=$npcid;
|
$gameStor->npccount=$npcid;
|
||||||
|
|
||||||
//국가 기술력 그대로
|
|
||||||
$query = "select no from general where nation='{$general['nation']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gencount = MYDB_num_rows($result);
|
|
||||||
$gennum = $gencount;
|
|
||||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
|
||||||
|
|
||||||
// 국가보정
|
// 국가보정
|
||||||
if($nation['type'] == 11) { $term3 = Util::round($term3 / 2); }
|
if($nation['type'] == 11) { $term3 = Util::round($term3 / 2); }
|
||||||
if($nation['type'] == 12) { $term3 = $term3 * 2; }
|
if($nation['type'] == 12) { $term3 = $term3 * 2; }
|
||||||
@@ -2103,7 +2094,7 @@ function process_76(&$general) {
|
|||||||
//전략기한
|
//전략기한
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'sabotagelimit'=>$term3,
|
'sabotagelimit'=>$term3,
|
||||||
'gennum'=>$gennum
|
'gennum'=>$db->sqleval('gennum + %i', $addGenCount),
|
||||||
], 'nation=%i', $general['nation']);
|
], 'nation=%i', $general['nation']);
|
||||||
|
|
||||||
//경험치, 공헌치
|
//경험치, 공헌치
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ CREATE TABLE `nation` (
|
|||||||
`capital` INT(1) NULL DEFAULT '0',
|
`capital` INT(1) NULL DEFAULT '0',
|
||||||
`capset` INT(1) NULL DEFAULT '0',
|
`capset` INT(1) NULL DEFAULT '0',
|
||||||
`gennum` INT(3) NULL DEFAULT '1',
|
`gennum` INT(3) NULL DEFAULT '1',
|
||||||
`gennum2` INT(3) NULL DEFAULT '1',
|
|
||||||
`gold` INT(8) NULL DEFAULT '0',
|
`gold` INT(8) NULL DEFAULT '0',
|
||||||
`rice` INT(8) NULL DEFAULT '0',
|
`rice` INT(8) NULL DEFAULT '0',
|
||||||
`bill` INT(3) NULL DEFAULT '0',
|
`bill` INT(3) NULL DEFAULT '0',
|
||||||
|
|||||||
Reference in New Issue
Block a user