Exemple #1
0
function finalize300(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x += \skillbase\skill_getvalue(300, 'cnt', $pa);
    $x = min($x, (1 << 30) - 1);
    if ($ox < 32767 && $x >= 32767) {
        \cardbase\get_qiegao(200, $pa);
    }
    if ($ox < 142857 && $x >= 142857) {
        \cardbase\get_qiegao(300, $pa);
    }
    if ($ox < 999983 && $x >= 999983) {
        \cardbase\get_qiegao(500, $pa);
        \cardbase\get_card(86, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #2
0
function finalize323(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x = \skillbase\skill_getvalue(323, 'cnt', $pa);
    if ($x == 0) {
        $x = $ox;
    }
    if ($ox != 0) {
        $x = min($x, $ox);
    }
    eval(import_module('cardbase'));
    $arr = $cardindex['S'];
    $c = count($arr) - 1;
    $cr = $arr[rand(0, $c)];
    if ($x != 0 && $x <= 2700 && ($ox > 2700 || $ox == 0)) {
        \cardbase\get_qiegao(666, $pa);
        \cardbase\get_card($cr, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #3
0
function finalize313(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x = $pa['money'];
    $x = max($x, $ox);
    if ($ox < 30000 && $x >= 30000) {
        \cardbase\get_qiegao(300, $pa);
    }
    if ($ox < 60000 && $x >= 60000) {
        \cardbase\get_qiegao(800, $pa);
    }
    if ($ox < 100000 && $x >= 100000) {
        \cardbase\get_qiegao(2400, $pa);
        \cardbase\get_card(89, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #4
0
function finalize302(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x += \skillbase\skill_getvalue(302, 'cnt', $pa);
    $x = min($x, (1 << 30) - 1);
    if ($ox < 1 && $x >= 1) {
        \cardbase\get_qiegao(50, $pa);
    }
    if ($ox < 5 && $x >= 5) {
        \cardbase\get_qiegao(300, $pa);
    }
    if ($ox < 30 && $x >= 30) {
        \cardbase\get_qiegao(1000, $pa);
        \cardbase\get_card(66, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #5
0
function finalize310(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x += \skillbase\skill_getvalue(310, 'cnt', $pa);
    $x = min($x, (1 << 30) - 1);
    if ($ox < 100 && $x >= 100) {
        \cardbase\get_qiegao(100, $pa);
    }
    eval(import_module('cardbase'));
    $arr = $cardindex['A'];
    $c = count($arr) - 1;
    $cr = $arr[rand(0, $c)];
    if ($ox < 2500 && $x >= 2500) {
        \cardbase\get_qiegao(400, $pa);
        \cardbase\get_card($cr, $pa);
    }
    $cr = $arr[rand(0, $c)];
    if ($ox < 10000 && $x >= 10000) {
        \cardbase\get_qiegao(1500, $pa);
        \cardbase\get_card($cr, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #6
0
function kujidraw1(&$pa, $is_dryrun = false)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('cardbase', 'kuji1'));
    if ($pa['gold'] < 1000 && !$is_dryrun) {
        return -1;
    }
    $rr = array();
    $r = rand(1, $cw);
    if ($r <= $sw) {
        $arr = $cardindex['S'];
    } else {
        if ($r <= $aw) {
            $arr = $cardindex['A'];
        } else {
            $arr = $cardindex['B'];
        }
    }
    $c = count($arr) - 1;
    $r = $arr[rand(0, $c)];
    if (!$is_dryrun) {
        if (\cardbase\get_card($r, $pa) != 1) {
            \cardbase\get_qiegao(30, $pa);
            $pa['gold'] += 30;
        }
    }
    $rr[0] = $r;
    for ($i = 1; $i <= 10; $i++) {
        $r = rand(1, $cw);
        if ($r <= $sw) {
            $arr = $cardindex['S'];
        } else {
            if ($r <= $aw) {
                $arr = $cardindex['A'];
            } else {
                if ($r <= $bw) {
                    $arr = $cardindex['B'];
                } else {
                    $arr = $cardindex['C'];
                }
            }
        }
        $c = count($arr) - 1;
        $r = $arr[rand(0, $c)];
        if (!$is_dryrun) {
            if (\cardbase\get_card($r, $pa) == 1) {
                \cardbase\get_qiegao(-100, $pa);
                $pa['gold'] -= 100;
            } else {
                \cardbase\get_qiegao(-70, $pa);
                $pa['gold'] -= 70;
            }
        }
        $rr[$i] = $r;
    }
    return $rr;
}
Exemple #7
0
function finalize319(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x += \skillbase\skill_getvalue(319, 'cnt', $pa);
    $x = min($x, (1 << 30) - 1);
    if ($ox < 15 && $x >= 15) {
        \cardbase\get_qiegao(485, $pa);
        \cardbase\get_card(12, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #8
0
function finalize326(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $flag = 0;
    foreach (array(301, 305, 306, 307) as $sk) {
        if (\skillbase\skill_query($sk, $pa) && (int) \skillbase\skill_getvalue($sk, 'cnt', $pa) == 1) {
            $flag = 1;
        }
    }
    if (!$flag) {
        return $data;
    }
    $c = (int) $pa['card'];
    for ($i = 0; $i < strlen($data); $i += 3) {
        $x = base64_decode_number(substr($data, $i, 3));
        if ($x == $c) {
            return $data;
        }
    }
    $data .= base64_encode_number($c, 3);
    $o = ceil(strlen($data) / 3);
    if ($o == 10) {
        \cardbase\get_qiegao(888, $pa);
    }
    if ($o == 25) {
        \cardbase\get_card(81, $pa);
        \cardbase\get_qiegao(1200, $pa);
    }
    if ($o == 50) {
        \cardbase\get_qiegao(1600, $pa);
    }
    if ($o == 75) {
        \cardbase\get_qiegao(2000, $pa);
    }
    if ($o == 100) {
        \cardbase\get_qiegao(2500, $pa);
    }
    return $data;
}
Exemple #9
0
function finalize325(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $z = (int) \skillbase\skill_getvalue(325, 'cnt', $pa);
    $ox = $x;
    $x = $ox + $z;
    if ($ox < 1 && $x >= 1) {
        \cardbase\get_qiegao(233, $pa);
    }
    if ($ox < 100 && $x >= 100) {
        \cardbase\get_qiegao(2333, $pa);
        \cardbase\get_card(119, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #10
0
function kujidraw2(&$pa, $is_dryrun = false)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('cardbase', 'kuji2'));
    if ($pa['gold'] < 250 && !$is_dryrun) {
        return -1;
    }
    $r = rand(1, $cw);
    if ($r <= $sw) {
        $arr = $cardindex['S'];
    } else {
        if ($r <= $aw) {
            $arr = $cardindex['A'];
        } else {
            if ($r <= $bw) {
                $arr = $cardindex['B'];
            } else {
                $arr = $cardindex['C'];
            }
        }
    }
    $c = count($arr) - 1;
    $r = $arr[rand(0, $c)];
    if (!$is_dryrun) {
        if (\cardbase\get_card($r, $pa) == 1) {
            \cardbase\get_qiegao(-250, $pa);
            $pa['gold'] -= 250;
        } else {
            \cardbase\get_qiegao(-220, $pa);
            $pa['gold'] -= 220;
        }
    }
    return $r;
}
Exemple #11
0
function finalize322(&$pa, $data)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($data == '') {
        $x = 0;
    } else {
        $x = base64_decode_number($data);
    }
    $ox = $x;
    $x = \skillbase\skill_getvalue(322, 'cnt', $pa);
    if ($x == 0) {
        $x = $ox;
    }
    if ($ox != 0) {
        $x = min($x, $ox);
    }
    if ($x != 0 && $x <= 1800 && ($ox > 1800 || $ox == 0)) {
        \cardbase\get_qiegao(666, $pa);
        \cardbase\get_card(78, $pa);
    }
    return base64_encode_number($x, 5);
}
Exemple #12
0
function check_addarea_gameover($atime)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'map'));
    if ($gametype == 1) {
        if ($alivenum <= 0) {
            \sys\gameover($atime, 'end1');
            //理论不会这样,防BUG
            return;
        }
        if ($areanum >= $areaadd * 2) {
            //限时2禁
            $result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 ORDER BY pid DESC");
            $ml = -1;
            $winner = '';
            $wl = array();
            while ($pt = $db->fetch_array($result)) {
                $pa = \player\fetch_playerdata_by_pid($pt['pid']);
                $cl = (int) \skillbase\skill_getvalue(424, 'lvl', $pa);
                $wl[$pa['name']] = $cl;
                if ($cl > $ml) {
                    $ml = $cl;
                    $winner = $pa['name'];
                }
            }
            arsort($wl);
            $rk = 0;
            foreach ($wl as $kk => $v) {
                $rk++;
                $k = \player\fetch_playerdata($kk);
                if ($v >= 5) {
                    \cardbase\get_qiegao(150, $k);
                }
                if ($v >= 10) {
                    \cardbase\get_qiegao(300, $k);
                }
                if ($v >= 20) {
                    \cardbase\get_qiegao(600, $k);
                }
                if ($v >= 30) {
                    \cardbase\get_card(94, $k);
                    \cardbase\get_qiegao(500, $k);
                }
                if ($rk == 1) {
                    \cardbase\get_card(96, $k);
                    \cardbase\get_card(95, $k);
                }
                if ($rk <= 2) {
                    \cardbase\get_card(95, $k);
                }
                if ($rk <= 3) {
                    \cardbase\get_qiegao(500, $k);
                    addnews(0, 'g1announce', $rk, $kk, $v);
                }
            }
            \sys\gameover($atime, 'end8', $winner);
            return;
        }
        \sys\rs_game(16 + 32);
        return;
    }
    $chprocess($atime);
}
Exemple #13
0
function check_addarea_gameover($atime)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'map'));
    if ($gametype == 1) {
        if ($alivenum <= 0) {
            \sys\gameover($atime, 'end1');
            //理论不会这样,防BUG
            return;
        }
        if ($areanum >= $areaadd * 2) {
            //限时2禁
            $result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 ORDER BY pid DESC");
            $ml = -1;
            $winner = '';
            $wl = array();
            $wc = 0;
            while ($pt = $db->fetch_array($result)) {
                $pa = \player\fetch_playerdata_by_pid($pt['pid']);
                $cl = (int) \skillbase\skill_getvalue(424, 'lvl', $pa);
                //$wl[$pa['name']]=$cl;
                if ($cl > $ml) {
                    $ml = $cl;
                    $winner = $pa['name'];
                }
                $wc++;
                $wl[$wc]['n'] = $pa['name'];
                $wl[$wc]['p'] = $pa['pid'];
                $wl[$wc]['c'] = $cl;
            }
            //arsort($wl);
            for ($i = 1; $i < $wc; $i++) {
                for ($j = $i + 1; $j <= $wc; $j++) {
                    if ($wl[$i]['c'] < $wl[$j]['c'] || $wl[$i]['c'] == $wl[$j]['c'] && $wl[$i]['p'] < $wl[$j]['p']) {
                        $tt = $wl[$i];
                        $wl[$i] = $wl[$j];
                        $wl[$j] = $tt;
                    }
                }
            }
            $rk = 0;
            $max_announce_num = 3;
            //进行状况展示人数
            $bestlist = array();
            //进行状况中展示的前X名列表
            //foreach ($wl as $kk=>$v){
            for ($rk = 1; $rk <= $wc; $rk++) {
                //$rk++;
                $kk = $wl[$rk]['n'];
                $v = $wl[$rk]['c'];
                $k = \player\fetch_playerdata($kk);
                if ($v >= 5) {
                    \cardbase\get_qiegao(150, $k);
                }
                if ($v >= 10) {
                    \cardbase\get_qiegao(300, $k);
                }
                if ($v >= 20) {
                    \cardbase\get_qiegao(600, $k);
                }
                if ($v >= 30) {
                    \cardbase\get_card(94, $k);
                    \cardbase\get_qiegao(500, $k);
                }
                if ($rk == 1) {
                    \cardbase\get_card(96, $k);
                    \cardbase\get_card(95, $k);
                }
                if ($rk <= 2) {
                    \cardbase\get_card(95, $k);
                }
                if ($rk <= $max_announce_num) {
                    \cardbase\get_qiegao(500, $k);
                    $bestlist[$rk] = array(0 => $kk, 1 => $v);
                }
            }
            for ($i = $max_announce_num; $i >= 1; $i--) {
                if (isset($bestlist[$i])) {
                    addnews(0, 'g1announce', $i, $bestlist[$i][0], $bestlist[$i][1]);
                }
            }
            \sys\gameover($atime, 'end8', $winner);
            return;
        }
        \sys\rs_game(16 + 32);
        return;
    }
    $chprocess($atime);
}
Exemple #14
0
}
$c = count($arr) - 1;
$r = $arr[rand(0, $c)];
/*
$carr = explode('_',$cardlist);
$clist = Array();
foreach($carr as $key => $val){
	$clist[$key] = $val;
}
$cflag=false;
if (in_array($r,$clist)){
	$gold-=70;
}else{
	$gold-=100;
	$cflag=true;
	$cardlist.="_".$r;
}
$db->query("UPDATE {$gtablepre}users SET gold='$gold',cardlist='$cardlist' WHERE username='******'");*/
$cflag = false;
if (\cardbase\get_card($r, $udata) == 1) {
    \cardbase\get_qiegao(-100, $udata);
    $gold = $gold - 100;
    $cflag = true;
} else {
    \cardbase\get_qiegao(-70, $udata);
    $gold = $gold - 70;
}
//$db->query("UPDATE {$gtablepre}users SET gold='$gold' WHERE username='******'");
include template('kujiresult');
?>
 
Exemple #15
0
function wdecode()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'itemmain', 'logger', 'skill234', 'skillbase', 'map'));
    if (\skillbase\skill_query(234)) {
        $req1 = $goal234[\skillbase\skill_getvalue(234, 'cur1')];
        $req2 = $goal234[\skillbase\skill_getvalue(234, 'cur2')];
        $clv = \skillbase\skill_getvalue(234, 'lvl');
        $position = 0;
        foreach (array(1, 2, 3, 4, 5, 6) as $imn) {
            global ${'itm' . $imn}, ${'itmk' . $imn}, ${'itme' . $imn}, ${'itms' . $imn}, ${'itmsk' . $imn};
            if (${'itm' . $imn} == $req1 || ${'itm' . $imn} == $req2) {
                $position = $imn;
                break;
            }
        }
        if ($position) {
            $itm = ${'itm' . $position};
            $log .= "<span class=\"yellow\">破解成功。</span><br />";
            $log .= "<span class=\"red\">{$itm}</span>用光了。<br />";
            addnews(0, 'skill234', $name, $clv + 1);
            ${'itm' . $position} = ${'itmk' . $position} = ${'itmsk' . $position} = '';
            ${'itme' . $position} = ${'itms' . $position} = 0;
            if ($clv == 50) {
                $log .= "<span class=\"evergreen\">游戏系统已经完全破解。</span><br />";
                ${'itm' . $position} = '游戏解除钥匙';
                ${'itmk' . $position} = 'Y';
                ${'itmsk' . $position} = 'Z';
                ${'itme' . $position} = 1;
                ${'itms' . $position} = 1;
                \skillbase\skill_lost(234);
                if ($areanum / $areaadd < 4 && !in_array($gametype, $qiegao_ignore_mode)) {
                    if (\cardbase\get_card(63) == 1) {
                        $log .= "恭喜您获得了活动奖励卡<span class=\"orange\">lemon</span>!<br>";
                    } else {
                        $log .= "您已经拥有活动奖励卡了,系统奖励您<span class=\"yellow\">500</span>切糕!<br>";
                        \cardbase\get_qiegao(500);
                    }
                }
                $mode = 'command';
                return;
            }
            $gdice = rand(1, 4);
            if ($clv < 5) {
                if ($gdice == 1) {
                    $exp += 10;
                    $log .= "<span class=\"yellow\">获得了10点经验值。</span><br />";
                }
                if ($gdice == 2) {
                    $att += 10;
                    $log .= "<span class=\"yellow\">获得了10点基础攻击。</span><br />";
                }
                if ($gdice == 3) {
                    $def += 10;
                    $log .= "<span class=\"yellow\">获得了10点基础防御。</span><br />";
                }
                if ($gdice == 4) {
                    $wp += 10;
                    $wk += 10;
                    $wc += 10;
                    $wd += 10;
                    $wg += 10;
                    $wf += 10;
                    $log .= "<span class=\"yellow\">获得了10点全熟练。</span><br />";
                }
            } else {
                if ($clv < 20) {
                    if ($gdice == 1) {
                        $money += 200;
                        $log .= "<span class=\"yellow\">获得了180元。</span><br />";
                    }
                    if ($gdice == 2) {
                        $mhp += 7;
                        $log .= "<span class=\"yellow\">生命上限提高了7点。</span><br />";
                    }
                    if ($gdice == 3) {
                        $att += 10;
                        $def += 10;
                        $log .= "<span class=\"yellow\">基础攻防提高了10点。</span><br />";
                    }
                    if ($gdice == 4) {
                        $wp += 10;
                        $wk += 10;
                        $wc += 10;
                        $wd += 10;
                        $wg += 10;
                        $wf += 10;
                        $log .= "<span class=\"yellow\">获得了10点全熟练。</span><br />";
                    }
                } else {
                    if ($gdice == 1) {
                        $money += 320;
                        $log .= "<span class=\"yellow\">获得了320元。</span><br />";
                    }
                    if ($gdice == 2) {
                        $mhp += 12;
                        $log .= "<span class=\"yellow\">生命上限提高了12点。</span><br />";
                    }
                    if ($gdice == 3) {
                        $att += 15;
                        $def += 15;
                        $log .= "<span class=\"yellow\">基础攻防提高了15点。</span><br />";
                    }
                    if ($gdice == 4) {
                        $wp += 13;
                        $wk += 13;
                        $wc += 13;
                        $wd += 13;
                        $wg += 13;
                        $wf += 13;
                        $log .= "<span class=\"yellow\">获得了13点全熟练。</span><br />";
                    }
                }
            }
            $clv++;
            $t = count($goal234) - 1;
            if ($clv < 10) {
                $t = 19;
            }
            if ($clv < 5) {
                $t = 9;
            }
            $nx = rand(0, $t);
            $ed = $goal234[$nx];
            $log .= "下次破解需要物品<span class=\"yellow\">{$ed}</span>或";
            \skillbase\skill_setvalue(234, 'cur1', $nx);
            $nx1 = rand(0, $t);
            while ($nx1 == $nx) {
                $nx1 = rand(0, $t);
            }
            $ed = $goal234[$nx1];
            $log .= "<span class=\"yellow\">{$ed}</span>。<br />";
            \skillbase\skill_setvalue(234, 'cur2', $nx1);
            \skillbase\skill_setvalue(234, 'lvl', $clv);
            $mode = 'command';
            return;
        } else {
            $log .= "你没有进行破解所需的物品。<br />";
            $mode = 'command';
            return;
        }
    } else {
        $log .= '<span class="red">你没有这个技能!</span><br />';
        $mode = 'command';
        return;
    }
}