-
Notifications
You must be signed in to change notification settings - Fork 7
/
fightenemy.php
96 lines (78 loc) · 3.29 KB
/
fightenemy.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
session_name("icsession");
session_start();
include('db.php');
include('varset.php');
$getchar = mysql_query("SELECT * FROM characters WHERE id='".$_SESSION['userid']."'") or die(mysql_error());
$char = mysql_fetch_assoc($getchar);
if($_POST['auto'] == "Yes")
{
$randomCAPTCHA = rand(1,45);
if($randomCAPTCHA == 1 && $char['auto'] == 0 && $char['username']=="Ajezior"){
$amount_of_time = 600+ time();
$setupCaptcha = mysql_query("UPDATE characters SET auto='0', captcha='Active', captcha_time_limit='".$amount_of_time."' WHERE username='".$char['username']."'");
$data = "<strong>You have <u>10 minutes</u> to complete CAPTCHA security, from the time it was given, before your account gets suspended.</strong><br /><div id=\"recaptcha_div\"></div><br />";
$data .= "<input type=\"button\" value=\"Check answer\" onClick=\"verifyCaptcha();\">";
print("fillDiv('displayArea','".$data."');");
print("showRecaptcha('recaptcha_div');");
die();
}else{
if($char['auto'] > "0"){
print("alert('Auto Attack is already running cheater!');");
die();
}else{
$charauto = "".$char['automax']."";
$query = mysql_query("UPDATE characters SET auto='".$char['automax']."', lastfight='0' WHERE id='".$_SESSION['userid']."'");
}
}
}elseif($char['auto'] == "0"){
$randomCAPTCHA = rand(1,1500);
if($randomCAPTCHA == 1 && $char['username']=="Ajezior"){
$amount_of_time = 600 + time();
$setupCaptcha = mysql_query("UPDATE characters SET auto='0', captcha='Active', captcha_time_limit='".$amount_of_time."' WHERE username='".$char['username']."'");
$data = "<strong>You have <u>10 minutes</u> to complete CAPTCHA security, from the time it was given, before your account gets suspended.</strong><br /><div id=\"recaptcha_div\"></div><br />";
$data .= "<input type=\"button\" value=\"Check answer\" onClick=\"verifyCaptcha();\">";
print("fillDiv('displayArea','".$data."');");
print("showRecaptcha('recaptcha_div');");
die();
}
}
$getenemy = mysql_query("SELECT * FROM enemies WHERE id='".$_POST['enemyid']."'");
$enemy = mysql_fetch_assoc($getenemy);
$enemyid = $enemy['id'];
$enemyname = $enemy['name'];
$enemylvl = $enemy['level'];
if($char['enemylife'] > "0"){
$enemylife = $char['enemylife'];
}else{
$enemylife = "1" + $enemylvl * "23";
}
if($enemylife < "1"){
$enemylife = "1" + $enemylvl * "23";
}
$date = time();
$updatechar = mysql_query("UPDATE characters SET enemyid='".$enemyid."', enemylife='".$enemylife."', lastactive='".$date."' WHERE id='".$_SESSION['userid']."'");
$data = $data."<center><select id=\'enemylist\'>";
$getenemies = mysql_query("SELECT * FROM enemies ORDER BY level");
while($enemies = mysql_fetch_array($getenemies))
{
if($enemyid == $enemies['id'])
{
$data = $data."<option value=\'".$enemies['id']."\' selected=\'selected\'>".$enemies['name']." (".$enemies['level'].")</option>";
}
else
{
$data = $data."<option value=\'".$enemies['id']."\'>".$enemies['name']." (".$enemies['level'].")</option>";
}
}
$data .= "</select>";
$data .= "<br />You engage battle with the ".$enemyname."<br />Your HP: ".$char['life']." - Your MP: ".$char['mana']." (".$enemyname." HP left: ".$enemylife.")<br /></center>";
if($char['auto'] == "0" && $char['security'] != "1")
{
$randomNumber = rand(10,10);
$random = $randomNumber / 10;
sleep($random);
}else{
}
include('attackenemy.php');
?>