re-added the cancel feature of the quests (now with a delay of 30 min)

main
hecht 9 years ago
parent 0fc78020df
commit a73a66ac91

@ -143,8 +143,9 @@ $zeit_in_sek = getEventStatusBlocked($char_id);
#######################Schatz Suche Kampf #######################Schatz Suche Kampf
if($ab == "Schatz Suche") { if($ab == "Schatz Suche") {
$kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$char_id)); $kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer, Timestampdiff(Second,now(),cancel) as cancel from quests where charid = '.$char_id));
$zeit_in_sek = $kampf_a['dauer']; $zeit_in_sek = $kampf_a['dauer'];
$cancel_zeit_in_sek = $kampf_a['cancel'];
echo "<SCRIPT language='JavaScript'>"; echo "<SCRIPT language='JavaScript'>";
?> ?>
@ -162,8 +163,60 @@ echo "<p align=center id='content'><b> Schatz Suche </b><br>&nbsp; <br>";
if($zeit_in_sek <= 0){ if($zeit_in_sek <= 0){
echo '<a href="javascript:showfight()" id="content">anzeigen</a>'; echo '<a href="javascript:showfight()" id="content">anzeigen</a>';
} else{ } else{
$jsfunction = "function t() {
n=new Date();
s=$zeit_in_sek-Math.round((n.getTime()-v.getTime())/1000.);
m=0;
h=0;
c=$cancel_zeit_in_sek-Math.round((n.getTime()-v.getTime())/1000.);
if ( s < 0 ) {
ht.innerHTML=\"<a href='javascript:showfight()' id='content'>anzeigen</a>\";
} else {
if ( s > 59 ) {
m=Math.floor(s/60);
s=s-m*60;
}
if ( m > 59 ) {
h=Math.floor(m/60);
m=m-h*60;
}
if ( s < 10 ) {
s='0'+s;
}
if ( m < 10 ) {
m='0'+m;
}
ht.innerHTML='Wartezeit zum Abholen: '+h+':'+m+':'+s+'<br /><br />';
if( c < 0 ) {
ht.innerHTML+='<a href=\"./schatz3.php?$abholstring&abort=cancel\">abbrechen</a>';
} else {
m=0;
h=0;
s=c;
if ( s > 59 ) {
m=Math.floor(s/60);
s=s-m*60;
}
if ( m > 59 ) {
h=Math.floor(m/60);
m=m-h*60;
}
if ( s < 10 ) {
s='0'+s;
}
if ( m < 10 ) {
m='0'+m;
}
ht.innerHTML+='Wartezeit zum Abbrechen: '+h+':'+m+':'+s+'<br /><br />';
}
}
window.setTimeout('t();',950);
}
";
?> ?>
<script type='text/javascript'>v=new Date();var ht=document.getElementById('timer');function t(){n=new Date();s=<?php echo $zeit_in_sek; ?>-Math.round((n.getTime()-v.getTime())/1000.);m=0;h=0;if(s<0){ht.innerHTML="<?php echo "<a href='javascript:showfight()' id='content'>Abholen</a>"; ?>"}else{if(s>59){m=Math.floor(s/60);s=s-m*60}if(m>59){h=Math.floor(m/60);m=m-h*60}if(s<10){s='0'+s}if(m<10){m='0'+m}ht.innerHTML=h+':'+m+':'+s+'<br /><a href="./schatz3.php?<?php echo $abholstring; ?>&abort=cancel">abbrechen</a>'}window.setTimeout('t();',950);}window.onload=t;</script> <script type='text/javascript'>v=new Date();var ht=document.getElementById('timer');<?php echo $jsfunction; ?>window.onload=t;</script>
<?php <?php
} }
?> ?>

@ -110,9 +110,10 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$k_hp1[1] = $in_hp_max; // Fuer Heal wichtig!! $k_hp1[1] = $in_hp_max; // Fuer Heal wichtig!!
$k_mp1[1] = $in_mp_max; // Fuer Heal wichtig!! $k_mp1[1] = $in_mp_max; // Fuer Heal wichtig!!
// Hinzufuegen Quest // Hinzufuegen Quest
$sql = 'Insert into quests(charid, dauer, std, ortid, st, sp, ver, gl, aus, hp, mp)' . $sql = 'Insert into quests(charid, dauer, cancel, std, ortid, st, sp, ver, gl, aus, hp, mp)' .
' values('.$chara_1['id'].', ' . ' values('.$chara_1['id'].', ' .
'TIMESTAMPADD(HOUR, '.$std.', now()), ' . 'TIMESTAMPADD(HOUR, '.$std.', now()), ' .
'TIMESTAMPADD(MINUTE, 30, now()), ' .
$std.', '. $std.', '.
$ort.', '. $ort.', '.
$in_starke.', '. $in_starke.', '.

@ -55,16 +55,21 @@ if(!checkAbholcode($char_id, $code)){
} }
if($abort == 'cancel'){ if($abort == 'cancel'){
echo '<p>Schatz Suche abbrechen ist derzeit nicht moeglich! Wir versuchen es so schnell wie moeglich wieder zu aktivieren.</p>'; $kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer, Timestampdiff(Second,now(),cancel) as cancel from quests where charid = '.$char_id));
displayErrorMessage(NULL,'Bitte um Verstaendnis!', displayIndexBackLink()); $zeit_in_sek = $kampf_a['dauer'];
$cancel_zeit_in_sek = $kampf_a['cancel'];
# if ($true == 1) { if ($cancel_zeit_in_sek <= 0) {
# interruptSchatzSuche($char_id); if ($true == 1) {
# displayErrorMessage(NULL,'Die Schatzsuche wurde abgebrochen!', displayIndexBackLink()); interruptSchatzSuche($char_id);
# } else { displayErrorMessage(NULL,'Die Schatzsuche wurde abgebrochen!', displayIndexBackLink());
# echo '<p>Schatz Suche wirklich abbrechen?</p>'; } else {
# echo '<p><a href="./schatz3.php?char_id='.$char_id.'&code='.$code.'&abort=cancel&true=1">Ja</a> | <a href="./index.php?as=abholen&ab=Schatz Suche&char_id='.$char_id.'">Nein</a></p>'; echo '<p>Schatz Suche wirklich abbrechen?</p>';
# } echo '<p><a href="./schatz3.php?char_id='.$char_id.'&code='.$code.'&abort=cancel&true=1">Ja</a> | <a href="./index.php?as=abholen&ab=Schatz Suche&char_id='.$char_id.'">Nein</a></p>';
}
} else {
displayErrorMessage(NULL,'Die Schatzsuche kann noch nicht abgebrochen werden!', displayIndexBackLink());
}
} else{ } else{
if(($text = displaySchatzSuche($char)) !== null){ if(($text = displaySchatzSuche($char)) !== null){
displayErrorMessage(NULL,$text, displayHistoryBackLink()); displayErrorMessage(NULL,$text, displayHistoryBackLink());

Loading…
Cancel
Save