From dd2f45c5bda47e128030097fe08a2eb70144eda0 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 27 Jan 2018 06:34:13 +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.=20NPC=EC=9D=98=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EC=95=84=EC=A7=81=20=EB=82=A8=EA=B2=A8?= =?UTF-8?q?=EB=91=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/func.php | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/twe/func.php b/twe/func.php index e00ae639..1e6b4fee 100644 --- a/twe/func.php +++ b/twe/func.php @@ -9,6 +9,11 @@ include "func_auction.php"; include "func_string.php"; include "func_history.php"; require_once("func_message.php"); + +/// 0.0~1.0 사이의 랜덤 float +function randF(){ + return mt_rand() / mt_getrandmax(); +} // 37.5 ~ 75 function abilityRand() { $total = 150; @@ -465,34 +470,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; }