-
Notifications
You must be signed in to change notification settings - Fork 7
/
fight.php
50 lines (28 loc) · 1.45 KB
/
fight.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
session_name("icsession");
session_start();
include('db.php');
$getchar = mysql_query("SELECT * FROM characters WHERE id='".$_SESSION['userid']."'") or die(mysql_error());
$char = mysql_fetch_assoc($getchar);
$display .= "<center><select id=\'enemylist\'>";
$getenemies = mysql_query("SELECT * FROM enemies ORDER BY level");
while($enemies = mysql_fetch_array($getenemies))
{
if($char['enemyid'] == $enemies['id'])
{
$display .= "<option value=\'".$enemies['id']."\' selected=\'selected\'>".$enemies['name']." (".$enemies['level'].")</option>";
}
else
{
$display .= "<option value=\'".$enemies['id']."\'>".$enemies['name']." (".$enemies['level'].")</option>";
}
}
if($char['security'] == "1"){
$top = mt_rand(1,400);
$left = mt_rand(1,400);
$display .= "</select> Run away button!!! Go catch it! <input type=\'button\' value=\'Fight\' onclick=\'this.disabled=true;this.value=\"Submitting...\";fightEnemy();\' style=\'position:absolute;top:".$top."px;left:".$left."px;\' /></center><br /><br />";
}else{
$display .= "</select> <input type=\'button\' value=\'Fight\' onclick=\'this.disabled=true;this.value=\"Submitting...\";fightEnemy();\' /></center><br /><br />";
}
print("fillDiv('displayArea','".$display."');");
?>