- Joined
- Jun 28, 2006
- Messages
- 299
- Reaction score
- 193
Enjoy. I only made this because of the other thread. This is for OdinMS.
PHP:
<?php
//Script by Diabllo (Leo Renard/Leo The Fox, etc.). Untested. Please report any errors.
include "config.php";
$reqlvl = 200; //Required level, etc.
$to = array(
"ap" => 9,
"level" => 1,
"job" => 0,
"str" => 4,
"dex" => 4,
"luk" => 4,
"int" => 4,
"hp" => 50,
"mp" => 50,
"sp" => 0,
"map" => 0); //Self-explanitory
echo "Reborn script, etc.<p>";
if($_POST){
$submit = array(
"user" => mysql_real_escape_string($_POST["accid"]),
"char" => mysql_real_escape_string($_POST["charid"]),
"pass" => mysql_real_escape_string($_POST["pass"]));
$initialsql = mysql_query("SELECT * FROM accounts WHERE name='".$submit["user"]."'") or die(mysql_error());
$initialsqlly = mysql_fetch_array($initialsql);
$truepassword = hash("SHA512", $submit["pass"] . $initialsqlly["salt"]); //Possibly incorrect? I'm going by memory here.
if($truepassword == $initialsqlly["password"]){
//Accepted password
if(!$initialsqlly["loggedin"]){
//Not logged. Good.
$sql = mysql_query("SELECT * FROM characters WHERE name='".$submit["char"]."' AND accountid='".$initialsqlly["id"]."'") or die(mysql_error());
if(mysql_num_rows($sql) > 0){
//Accepted character.
while($sqlly = mysql_fetch_array($sql)){
if($sqlly["level"] == $reqlvl){
mysql_query("UPDATE characters SET `level`='".$to["level"]."',`ap`='".$to["ap"]."',`job`='".$to["job"]."',`str`='".$to["str"]."',`dex`='".$to["dex"]."',`luk`='".$to["luk"]."',`int`='".$to["int"]."',`hp`='".$to["hp"]."',`maxhp`='".$to["hp"]."',`mp`='".$to["mp"]."',`maxmp`='".$to["mp"]."',`sp`='".$to["sp"]."' ,`map`='".$to["map"]."' WHERE name='".$submit["char"]."'") or die(mysql_error() . ", AKA U GOT RAPED");
echo "The character has been successfully reborn!";
} else {
echo "Sorry, but this character does not meet the level requirements.";
}
}
} else {
echo "Either the character does not exist, you typo'd the ID, or the character just doesn't belong to you. Go back and fix your mistake.";
}
} else {
echo "This account is currently logged in-game. LOG OUT YOU TOOL.";
}
} else {
echo "Invalid password.";
}
} else {
echo "To reborn, you must be at least Level $reqlvl, and your stats will be set to the following:<br>
<li>".$to["ap"]." AP</li>
<li>Level ".$to["level"]."</li>
<li>".$to["job"]." Job</li>
<li>".$to["str"]." Str</li>
<li>".$to["dex"]." Dex</li>
<li>".$to["luk"]." Luk</li>
<li>".$to["int"]." Int</li>
<li>".$to["hp"]." HP</li>
<li>".$to["mp"]." MP</li>
<li>".$to["sp"]." SP</li>
<br>
If you agree, please enter your Account ID, Character ID, and Password below. All information must match the database:<br>
<form method=post>
Account ID: <input name=accid type=text maxlength=20><br>
Character ID: <input name=charid type=text maxlength=20><br>
Password: <input name=pass type=password maxlength=20<br>
<input type=submit value='Submit'></form>";
}
?>

