From c333d397ee91a25156c1fa1aef4f535edfaefaa9 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 31 Jan 2018 20:38:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=EC=A0=80=EC=9E=A5=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EA=B1=B0=EC=83=81=20=EC=82=AD=EC=A0=9C.=20[NPC=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=EC=9D=80=20=EB=B3=84=EB=8F=84]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/func.php | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/che_close/func.php b/che_close/func.php index 60e74f2..62f8015 100644 --- a/che_close/func.php +++ b/che_close/func.php @@ -7,6 +7,11 @@ include "func_auction.php"; include "func_string.php"; include "func_history.php"; +/// 0.0~1.0 사이의 랜덤 float +function randF(){ + return mt_rand() / mt_getrandmax(); +} + // 37.5 ~ 75 function abilityRand() { $total = 150; @@ -442,34 +447,34 @@ function SpecCall($call) { function getSpecial($connect, $leader, $power, $intel) { //통장 if($leader*0.9 > $power && $leader*0.9 > $intel) { - $type = array(20, 30, 31); - $special = $type[rand()%3]; - // 거상, 귀모는 33% * 6% = 2% - if(($special == 30 || $special == 31) && rand()%100 > 6) { + $type = array(20, 31); + $special = array_rand($type); + // 귀모는 50% * 5% = 2.5% + if($special == 31 && randF() < 0.05) { $type = array(20, 20); - $special = $type[rand()%2]; + $special = array_rand($type); } //무장 } elseif($power >= $intel) { - $type = array(10, 11, 12, 30, 31); - $special = $type[rand()%5]; - // 거상, 귀모는 그중에 20% * 10% = 2% - if(($special == 30 || $special == 31) && rand()%100 > 10) { + $type = array(10, 11, 12, 31); + $special = array_rand($type); + // 귀모는 그중에 25% * 10% = 2.5% + if(($special == 30 || $special == 31) && randF() < 0.05) { $type = array(10, 11, 12); - $special = $type[rand()%3]; + $special = array_rand($type); } //지장 } elseif($intel > $power) { - $type = array(1, 2, 3, 30, 31); - $special = $type[rand()%5]; - // 거상, 귀모는 그중에 20% * 10% = 2% - if(($special == 30 || $special == 31) && rand()%100 > 10) { + $type = array(1, 2, 3, 31); + $special = array_rand($type); + // 거상, 귀모는 그중에 25% * 10% = 2.5% + if($special == 31 && randF() < 0.05) { $type = array(1, 2, 3); - $special = $type[rand()%3]; + $special = array_rand($type); } } else { - $type = array(30, 31); - $special = $type[rand()%2]; + //귀모. 다만 이쪽으로 빠지지 않음. + $type = 31; } return $special; }