Exp Fix

Website Scripts for your Helbreath Server.
Post Reply
Dyno
Regular
Posts: 68
Joined: Wed May 25, 2005 2:54 am

Post by Dyno »

Code: Select all

<?php

//-----------------------------------------------------------
$dir = '?';
//-----------------------------------------------------------

if(!$_POST)
{
        echo '<form action="'.$_SERVER['PHP_SELF'].'" method=post>
        Account: <input type="text" name=acc><br>
        Password: <input type="password" name=pass><br>
        Character: <input type="text" name=char><br>
        <input type="submit" value="Get Fixed!">
        </form>';
	echo "If your use this script on a character that is not lvl 310, 
	Dyno will put it on the very last of his to do list.";
}
else
{
        $acc = $_POST['acc'];
        $pass = $_POST['pass'];
        $char = $_POST['char'];
        if(!@$acc | !@$pass | !@$char)
        die('Please fill in all the fields');

        $a_ord = ord($acc);
        $c_ord = ord($char);
        $path = ($dir==''?'':$dir.'\\').'Account\\AscII'.$a_ord.'\\'.$acc.'.txt';
        $char_path = ($dir==''?'':$dir.'\\').'Character\\AscII'.$c_ord.'\\'.$char.'.txt';

        if(!file_exists($path))
        die('Account <b>'.$acc.'</b> does not exist');
        elseif(!file_exists($char_path))
        die('Character <b>'.$char.'<b> does not exist');

        $file = file($path);
        for($a=0; $a<count($file); $a++)
        {
                if(preg_match('/^account-password = '.$pass.'$/', trim($file[$a])))
                $pass_check = true;
                if(preg_match('/^account-character  = '.$char.'$/', trim($file[$a])))
                $char_check = true;
        }

        if(!@$pass_check)
        die('The password is not correct.');
        elseif(!@$char_check)
        die('The character doesnt exist in this account');

        $file = file($char_path);

        for($a=0; $a<count($file); $a++)
        {
                if(preg_match('/character-EXP/', trim($file[$a])))
                $line = $a;
        }

        $file[$line] = "character-EXP      = 1875370642\r\n";

        $file = join('', $file);

        $fopen = fopen($char_path, 'w');
        fputs($fopen, $file);
        fclose($fopen);

        echo 'Your level 310 character has been fixed.';
}


?>
How to add the script to read char file for /character-LEVEL = 310/ and if not 310, die('You have to be level 310 to use this script) i thought maybe elseif(preg_match('/character-LEVEL = 310/' but then what. Not the greatest at php :)
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

Hey if I change that set character exp part too the exp required for max lvl in my server do you think it would work?
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
Dyno
Regular
Posts: 68
Joined: Wed May 25, 2005 2:54 am

Post by Dyno »

Well as this script is now, If you use this on a level 1 (anything, 1 being the example) And go into game and kill 1 thing, can be any npc, You will automaticly level to that set exp, Thats why i'm trying to add a $read character-LEVEL= 310, So once i get a fix for it i'll try and rewrite it for you.
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

Dyno wrote: Well as this script is now, If you use this on a level 1 (anything, 1 being the example) And go into game and kill 1 thing, can be any npc, You will automaticly level to that set exp, Thats why i'm trying to add a $read character-LEVEL= 310, So once i get a fix for it i'll try and rewrite it for you.
You dont gotta mate I already asked someone too write me a script similar too this before you replyed. But thanks anyway :)
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
Dyno
Regular
Posts: 68
Joined: Wed May 25, 2005 2:54 am

Post by Dyno »

*Bump* Still have got it to work right by reading the character-LEVEL line yet, anyone? It's being a pain in my ass.
Dyno
Regular
Posts: 68
Joined: Wed May 25, 2005 2:54 am

Post by Dyno »

+1
Post Reply