400 lines
9.4 KiB
PHP
400 lines
9.4 KiB
PHP
|
<?php
|
|||
|
|
|||
|
class BotPriemLogic
|
|||
|
{
|
|||
|
|
|||
|
private static $p = [];
|
|||
|
|
|||
|
public static function start($i, $id)
|
|||
|
{
|
|||
|
|
|||
|
self::$p = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $id . '" LIMIT 1'));
|
|||
|
|
|||
|
$test = self::testpriem(self::$p);
|
|||
|
|
|||
|
if (isset(self::$p['id']) && $test == 0) {
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> $id
|
|||
|
if ($id == 1) {
|
|||
|
self::priem1($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1|2|3|4|5|6|7|8|9|10|11|13|14|45|47|48|49|188|204|211|217|220|223|232|235|240|0|0|0|0|0|0|0|0|0|0|0|0|0|0
|
|||
|
elseif ($id == 2) {
|
|||
|
self::priem2($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 3) {
|
|||
|
self::priem3($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 4) {
|
|||
|
self::priem4($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 5) {
|
|||
|
self::priem5($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
elseif ($id == 6) {
|
|||
|
self::priem6($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 7) {
|
|||
|
self::priem7($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 8) {
|
|||
|
self::priem8($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 9) {
|
|||
|
self::priem9($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 10) {
|
|||
|
self::priem10($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 11) {
|
|||
|
self::priem11($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 13) {
|
|||
|
self::priem13($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 14) {
|
|||
|
self::priem14($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 45) {
|
|||
|
self::priem45($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 47) {
|
|||
|
self::priem47($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 48) {
|
|||
|
self::priem48($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 49) {
|
|||
|
self::priem49($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 188) {
|
|||
|
self::priem188($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 204) {
|
|||
|
self::priem204($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 211) {
|
|||
|
self::priem211($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 217) {
|
|||
|
self::priem217($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 220) {
|
|||
|
self::priem220($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 223) {
|
|||
|
self::priem223($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 232) {
|
|||
|
self::priem232($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 235) {
|
|||
|
self::priem235($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
elseif ($id == 240) {
|
|||
|
self::priem240($i);
|
|||
|
} //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
elseif ($id >= 175 && $id <= 179) {
|
|||
|
self::priem175($i);
|
|||
|
}
|
|||
|
//*********************************
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
private static function usePriem($id, $on = null)
|
|||
|
{
|
|||
|
$go_txt = '&usepriem=' . $id;
|
|||
|
if ($on != '') {
|
|||
|
$on = str_replace(' ', '%20', $on);
|
|||
|
$go_txt .= '&useon=' . $on;
|
|||
|
}
|
|||
|
BotLogic::inuser_go_btl(BotLogic::$bot, $go_txt);
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem220($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem217($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem204($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem232($i)
|
|||
|
{
|
|||
|
if (self::hp() <= 30 && rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem188($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
private static function priem235($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem240($i)
|
|||
|
{
|
|||
|
if (self::hp() <= 70) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
private static function priem175($i)
|
|||
|
{
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem1($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem2($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
private static function priem3($i)
|
|||
|
{
|
|||
|
if (self::hp() <= 70 && rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem6($i)
|
|||
|
{
|
|||
|
if (self::hp() <= 40 && rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem8($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem48($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 70) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem9($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem47($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem10($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem49($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 80 && self::hp() <= 60) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem223($i)
|
|||
|
{
|
|||
|
if (self::hp() <= 50 && rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
private static function priem11($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem13($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem14($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
private static function priem4($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 60) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
private static function priem5($i)
|
|||
|
{
|
|||
|
if (self::hp() <= 95) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem211($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 80) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem45($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 50) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function priem7($i)
|
|||
|
{
|
|||
|
if (rand(0, 100) < 30) {
|
|||
|
self::usePriem($i);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
private static function hp()
|
|||
|
{
|
|||
|
return round((BotLogic::$st['hpNow'] / BotLogic::$st['hpAll'] * 100), 2);
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static function testpriem($pl)
|
|||
|
{
|
|||
|
global $u;
|
|||
|
$notr = 0;
|
|||
|
|
|||
|
$tr = $u->lookStats($pl['tr']);
|
|||
|
$d2 = $u->lookStats($pl['date2']);
|
|||
|
|
|||
|
$x = 1;
|
|||
|
while ($x <= 7) {
|
|||
|
if (BotLogic::$bot['tactic' . $x] < $pl['tt' . $x] && $x != 7 && $pl['tt' . $x] > 0) {
|
|||
|
$notr++;
|
|||
|
} elseif ($x == 7) {
|
|||
|
if ($pl['tt' . $x] > 0 && BotLogic::$bot['tactic' . $x] <= 0) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
}
|
|||
|
$x++;
|
|||
|
}
|
|||
|
|
|||
|
if ($pl['xuse'] > 0) {
|
|||
|
$xu = $u->testAction('`vars` = "use_priem_' . BotLogic::$bot['battle'] . '_' . BotLogic::$bot['id'] . '" AND `vals` = "' . $pl['id'] . '" LIMIT ' . $pl['xuse'] . '', 2);
|
|||
|
if ($xu[0] >= $pl['xuse']) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
$x = 0;
|
|||
|
$t = $u->items['tr'];
|
|||
|
while ($x < count($t)) {
|
|||
|
$n = $t[$x];
|
|||
|
if (isset($tr['tr_' . $n])) {
|
|||
|
if ($n == 'lvl') {
|
|||
|
if ($tr['tr_' . $n] > BotLogic::$bot['level']) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
} elseif ($tr['tr_' . $n] > BotLogic::$st[$n]) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
}
|
|||
|
$x++;
|
|||
|
}
|
|||
|
|
|||
|
if (isset($tr['tr_mpNow']) && BotLogic::$st['mpNow'] < $tr['tr_mpNow']) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
|
|||
|
if ($pl['trUser'] == 1) {
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|||
|
$ga = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "' . BotLogic::$bot['battle'] . '" AND `uid1` = "' . BotLogic::$bot['id'] . '" AND `uid2` = "' . BotLogic::$bot['enemy'] . '" LIMIT 1'));
|
|||
|
if (isset($ga['id'])) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (BotLogic::$st['prsu'][$pl['id']] > 0) {
|
|||
|
$notr++;
|
|||
|
}
|
|||
|
|
|||
|
return $notr;
|
|||
|
}
|
|||
|
}
|