Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $event = mysql_fetch_object(mysql_query($q="select e_usr_id from events where e_usr_id = ".$player->p_usr_id.""));
- if(empty($event->e_usr_id)){
- $p_q = $player->p_quest + 1;
- $data = mysql_fetch_object(mysql_query($q="select * from `quests_param` WHERE q_id = ".$p_q." and q_need_lvl <= ".$player->p_lvl.""));
- if(!empty($data)){
- echo ''.$data->q_name.' <br/> '.$data->q_content .' <br/> <a href="mw.php?action=quest&quest=1">Przyjmij zadanie</a>';
- }
- else {
- echo 'Nie ma aktualnie żadnych misji!';
- }
- if($_GET['quest'] == 1){
- $data = mysql_fetch_object(mysql_query("select * from `quests_param` WHERE q_id = ".$p_q." and q_need_lvl <= ".$player->p_lvl.""));
- if(!empty($data)){
- $time = time() + $data->q_time;
- mysql_query($q="call add_event(".$player->p_usr_id.", 2, ".$data->q_id.", ".$time.")");
- echo 'Przyjołe¶ zadanie!';
- }
- }
- }
- else {
- $times = mysql_fetch_object(mysql_query("select * from events WHERE e_usr_id = ".$player->p_usr_id.""));
- $time = $times->e_end - time();
- $m = floor($time/60);
- $s = $time % 60;
- echo 'Aktualnie co¶ robisz, wrócisz za '; ?>
- <span id="timer">a </span>
- <script type="text/javascript">
- function liczCzas2(span_id,ile) {
- godzin = Math.floor(ile / 3600);
- minut = Math.floor((ile - godzin * 3600) / 60);
- sekund = ile - minut * 60 - godzin * 3600;
- if (godzin < 10){godzin = "0"+ godzin; }
- if (minut < 10){minut = "0" + minut; }
- if (sekund < 10){sekund = "0" + sekund; }
- ile--;
- if (ile > 0) {
- document.getElementById(span_id).innerHTML = godzin + ':' + minut + ':' + sekund;
- setTimeout("liczCzas2('"+span_id+"',"+ile+" )", 1000);
- } else {
- document.getElementById(span_id).innerHTML = '00:00:00';
- }
- }
- liczCzas2('timer',<?php echo $time ?>);
- </script>
- <?php
- }
- $event = mysql_fetch_object(mysql_query($q="select * from events where e_usr_id = ".$player->p_usr_id.""));
- if($event->e_type == 2 && $event->e_end <= time()){
- $data = mysql_fetch_object(mysql_query("select * from quests_param where q_id = $event->e_subtype"));
- switch($data->q_type){
- case '1':
- $win = rand(1, $data->q_difficulty);
- if($win == 1){
- echo ''.$data->q_final_content.'';
- mysql_query("update players set gold = gold + $data->q_gold, exp = exp + $data->q_exp where p_usr_id = ".$player->p_usr_id."");
- $i_data = mysql_fetch_object(mysql_query("select * from items_param where i_id = ".$data->q_item.""));
- mysql_query("delete from events where e_usr_id = ".$player->p_usr_id."");
- if($data->q_item != 0){
- mysql_query("INSERT INTO `items_player` (`ip_usr_id` ,`ip_name` ,`ip_cost` ,`ip_lvl` ,`ip_attack_min` , `ip_attack_max` ,`ip_defense` ,`ip_injuries_ice` ,`ip_injuries_fire` ,`ip_injuries_poision` ,`ip_info` ,`ip_image` ,`ip_type`) VALUES (".$player->p_usr_id.", ".$i_data->i_name.", ".$i_data->i_cost.", ".$i_data->i_lvl.",".$i_data->i_attack_min.", ".$i_data->i_attack_max.", ".$i_data->i_defense.", ".$i_data->i_injuries_ice.", ".$i_data->i_injuries_fire.", ".$i_data->i_poision.", ".$i_data->i_info.", ".$i_data->i_image.", ".$i_data->i_type.")");
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement