Beispiel #1
0
 public function caravan_dismis($config, $ca)
 {
     call("delete from caravan where ca_id = {$ca}");
     require_once 'functions/MsgMgr.php';
     $MsgMgr = new MsgMgr();
     $MsgMgr->raport($config, $town, 'karawana zakończyła podróż w  ' . $tname);
 }
Beispiel #2
0
 public function colectors_dismis($config, $town, $id)
 {
     $data = get_row("select * from colectors where co_id = {$id}");
     call("update game_objects set go_lvl = go_lvl + " . $data->co_counts . " where go_type = 3 and go_subtype = 8 and go_t_id =" . $town);
     require_once 'functions/TownMgr.php';
     $towns = new TownMgr();
     $towns->change_resources($config, $town, $data->co_wood, $data->co_stone, $data->co_iron, 0);
     require_once 'functions/MsgMgr.php';
     $MsgMgr = new MsgMgr();
     $user = get_one("select t_usr_id from towns where t_id = " . $town);
     $MsgMgr->raport($config, $user, 'Zbieracze powrócili do miasta i przynieśli ze sobą ' . $data->co_wood . ' drewna, ' . $data->co_stone . ' gliny i ' . $data->co_iron . ' żelaza');
 }
Beispiel #3
0
 public function spy_dismis($config, $town, $counts)
 {
     call("update game_objects set go_lvl = go_lvl + {$counts} where go_type = 3 and go_subtype = 7 and go_t_id =" . $town);
     require_once 'functions/MsgMgr.php';
     $MsgMgr = new MsgMgr();
     $user = get_one("select t_usr_id from towns where t_id = " . $town);
     $MsgMgr->raport($config, $user, 'Szpiegowie powrócili do miasta');
 }
Beispiel #4
0
 public function army_dismis($config, $town, $army_id)
 {
     $units = get_all("select * from army_units where au_a_id = {$army_id} and au_counts > 0");
     call("delete from army where a_id = {$army_id}");
     call("delete from army_units where au_a_id = {$army_id}");
     if (is_array($units)) {
         foreach ($units as $unit) {
             call("update game_objects set go_lvl = go_lvl + " . $unit->au_counts . " where go_type = 3 and go_subtype = " . $unit->au_gop_subtype . " and go_t_id =" . $town);
         }
     }
     require_once 'functions/MsgMgr.php';
     $MsgMgr = new MsgMgr();
     $user = get_one("select t_usr_id from towns where t_id = " . $town);
     $MsgMgr->raport($config, $user, 'Armia powróciłą do miasta ');
 }
Beispiel #5
0
 public function quest_end($config, $player)
 {
     $quest = (int) $quest;
     if ($player->in_quest != 0) {
         $quest = get_row("select * , unix_timestamp() as tnow from quests where q_id = " . $player->in_quest);
         if ($quest->tnow >= $player->in_quest_time) {
             $text = '';
             if ($quest->q_exp > 0) {
                 $exp = floor($quest->q_exp * ($player->lvl + 1) * 1.77);
                 call("update users set in_quest = 0,in_quest_time = 0, exp = exp + " . $exp . " where usr_id = " . $player->usr_id);
                 call("update users set skills = skills + 1, exp = exp - exp_lvl, exp_lvl = exp_lvl * 1.45, lvl = lvl + 1 where exp >= exp_lvl and usr_id = " . $player->usr_id);
                 $text .= 'Twój heros zdobył ' . $exp . ' doświadczenia<br/>';
             }
             if ($quest->q_res > 0) {
                 $res = floor($quest->q_res * ($player->lvl + 1) * 1.77);
                 call("update users set in_quest = 0,in_quest_time = 0 where usr_id = " . $player->usr_id);
                 require_once 'functions/TownMgr.php';
                 $TownMgr = new TownMgr();
                 $TownMgr->change_resources($config, $player->actual_town, $res, $res, $res, 0);
                 $text .= 'Twój heros zdobył ' . $res . ' każdego z surowców<br/>';
             }
             require_once 'functions/MsgMgr.php';
             $MsgMgr = new MsgMgr();
             $MsgMgr->raport($config, $player->usr_id, $text);
         }
     }
 }