コード例 #1
0
ファイル: VipMgr.php プロジェクト: WlasnaGra/Utopia
 public function use_coins($config, $player, $type)
 {
     $type = intV($type);
     if ($type == 1 && $player->coins >= 20) {
         call("update users set coins = coins - 20 where usr_id = " . $player->usr_id);
         call("update towns set t_wood = t_wood + 1000, t_stone = t_stone + 1000, t_iron = t_iron + 1000 where t_id = " . $player->actual_town);
         $msg = 'dodano po 1000 surowców';
     } elseif ($type == 2 && $player->coins >= 50) {
         call("update users set coins = coins - 50 where usr_id = " . $player->usr_id);
         call("update towns set t_wood = t_wood + 3000, t_stone = t_stone + 3000, t_iron = t_iron + 3000 where t_id = " . $player->actual_town);
         $msg = 'dodano po 3000 surowców';
     } else {
         $msg = 'brakuje monet / nie ma takiej funkcji';
     }
     return $msg;
 }
コード例 #2
0
ファイル: market.php プロジェクト: WlasnaGra/Arena
require_once 'ustawienia/ustawienia.php';
require_once 'funkcje/podstawowe.php';
isUser($config);
$player = getUser($config);
if (empty($_GET['type'])) {
    $_GET['type'] = 0;
}
if (empty($_GET['subtype'])) {
    $_GET['subtype'] = 0;
}
if (empty($_GET['mid'])) {
    $_GET['mid'] = 0;
}
$_GET['mid'] = intV($_GET['mid']);
$_GET['type'] = intV($_GET['type']);
$_GET['subtype'] = intV($_GET['subtype']);
$object = get_one("select m_id from arena_map inner join arena_monsters on mo_id = m_subtype  where m_type = 5 and m_subtype =  " . $_GET['subtype'] . " and m_id = " . $_GET['mid'] . " limit 1");
if (!empty($object)) {
    switch ($_GET['subtype']) {
        case 1:
            $items = get_all("select * from arena_items_param ");
            echo "\n\t\t\t\t\t\t\t<div class='highslide-header'><b>Meglash</b> [esc - wyjście]\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li class='highslide-move'>\n\t\t\t\t\t\t\t\t\t\t<a style='color:#000000'  href='#' title='przesuń' onclick='return false'>\n\t\t\t\t\t\t\t\t\t\t\t<span>&lt;&gt;</span>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li class='highslide-close'>\n\t\t\t\t\t\t\t\t\t\t<a style='color:#000000'  href='#' title='zamknij' onclick='hs.height = 120; hs.width = 220; return hs.close(this)'>\n\t\t\t\t\t\t\t\t\t\t\t<span>zamknij</span>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t";
            $echo = '';
            if (is_array($items)) {
                foreach ($items as $item) {
                    $options = '';
                    if ($item->ip_gold <= $player->gold) {
                        $options .= "<a style='color:#000000'  href='?action=map&item_buy=" . $item->ip_id . "' >[ kup ]</a>";
                    }
                    $item->ip_text .= "<br/>";
                    if ($item->ip_attack > 0) {
コード例 #3
0
ファイル: map.php プロジェクト: WlasnaGra/Arena
    $msg = $HeroMgr->heal_all($config, $player);
    reload($config, 'map', '');
} elseif (isset($_GET['regenerate'])) {
    $msg = $HeroMgr->regenerateE($config, $player);
    reload($config, 'map', '');
} elseif (isset($_GET['regenerate_all'])) {
    $msg = $HeroMgr->regenerateE_all($config, $player);
    reload($config, 'map', '');
} elseif (!empty($_GET['item_buy'])) {
    $msg = $HeroMgr->item_buy($config, $player, $_GET['item_buy']);
    $player = getUser($config);
} elseif (!empty($_GET['item_sell'])) {
    $msg = $HeroMgr->item_sell($config, $player, $_GET['item_sell']);
    $player = getUser($config);
} elseif (!empty($_GET['where'])) {
    $_GET['where'] = intV($_GET['where']);
    hero_go($player->usr_id, $_GET['where']);
    reload($config, 'map', '');
}
if (!empty($msg)) {
    echo "<script type='text/javascript'> alert('" . $msg . "')</script>";
}
?>


<div  style='position: relative;'>
<center>
	<div id='map' style=' width:420px; height:420px; display:block;'>
		<?php 
require_once 'ajax_map.php';
?>
コード例 #4
0
ファイル: heal.php プロジェクト: WlasnaGra/Arena
<?php

ob_start();
require_once 'ustawienia/ustawienia.php';
require_once 'funkcje/podstawowe.php';
isUser($config);
$player = getUser($config);
$_GET['mid'] = intV($_GET['mid']);
$object = get_one("select m_id from arena_map inner join arena_monsters on mo_id = m_subtype  where m_type = 5 and m_subtype =  1 and m_id = " . $_GET['mid'] . " limit 1");
if (!empty($object)) {
    echo "\n<div class='highslide-header'><b>Meglash</b> [esc - wyjście]\n\t<ul>\n\t\t<li class='highslide-move'>\n\t\t\t<a style='color:#000000'  href='#' title='przesuń' onclick='return false'>\n\t\t\t\t<span>&lt;&gt;</span>\n\t\t\t</a>\n\t\t</li>\n\t\t<li class='highslide-close'>\n\t\t\t<a style='color:#000000'  href='#' title='zamknij' onclick='hs.height = 120; hs.width = 220; return hs.close(this)'>\n\t\t\t\t<span>zamknij</span>\n\t\t\t</a>\n\t\t</li>\n\t</ul>\n</div>\n";
    $echo = '';
    $options .= "\n\tKoszt leczenia to 1 życia = 1 złota<hr/>\n\t<a  href='?action=map&heal' > wylecz 10 życia</a> <br/>\n\t<a   href='?action=map&heal_all' > wylecz całkowicie</a> <br/>\n\t";
    $echo .= "\n\n\t\t\t<h2 style='background-color:#5D5D5D; color:#ffffff'>Leczenie</h2>\n\t\t\t<div class='messageWrapper' style='overflow:hidden;'>\n\t\t\t\t\n\t\t\t\t<div class='box message'>\n\n\t\t\t\t\t<p style='text-align:left'></p>\n\n\t\t\t\t\t<p class='options' style='text-align:left' >\n\t\t\t\t\t  " . $options . "\n\t\t\t\t   </p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t";
} else {
    $echo = 'nie mam nic do zaoferowania [esc - wyjście]';
}
echo $echo;
?>

					
コード例 #5
0
ファイル: HeroMgr.php プロジェクト: WlasnaGra/Arena
 public function add_exp($config, $player, $exp)
 {
     $exp = intV($exp);
     if ($exp > 0) {
         call("update arena_users set exp = exp + {$exp} where usr_id =" . $player->usr_id);
     }
     call("update arena_users set exp = exp  - exp_lvl, exp_lvl = exp_lvl * 1.45, lvl = lvl + 1, skills = skills + 3, chars = chars + 5, actions_max = actions_max + 10 where usr_id =" . $player->usr_id . " and exp >= exp_lvl");
 }