PHP skilldata enc [Skill level edit]

04/18/2013 23:26 ocsi94#1
with my script you can edit the skills lvl.
you need to put the files in that folder where is the skildata_*enc.txt
and you need to change .txt coding and change the $lvl variable what now 100
Good Luck

PHP Code:
<?php

error_reporting
(0);
//file names -> after decode
// you need change coding to UTF-8
// after you runed this. you need chage the new files coding to Unicode
$files=array("Decoded_skilldata_5000enc.txt","Decoded_skilldata_10000enc.txt","Decoded_skilldata_15000enc.txt","Decoded_skilldata_20000enc.txt","Decoded_skilldata_25000enc.txt","Decoded_skilldata_30000enc.txt","Decoded_skilldata_35000enc.txt","Decoded_skilldata_40000enc.txt","Decoded_skilldata_45000enc.txt");
//the lvl what you need
$lvl=100

$t=0;

Print(
"\nChanging Skill level to ".$lvl."\n\n\n");

foreach(
$files as $filename){                       // while there are filenames in $files array
print("\nLoading\n");

    
$fp=fopen($filename,"r+");                    // open the $files[x]
print($filename." try to read.");
    
$weapon= array();                             // declare and inicialize $weapon array
    
$i=0;
    
$fid=false;
    while(
$sor=fgets($fp,10240)){                   // while there are more lines in the file 
    
chop($sor);                                    // delelete enters on the end of the line (delete \n)
    
$weapon[$i]=explode("\t",$sor);             // split the line by the tabulators (\t)
    
$i=$i+1;
    
$fid=true;
    }
    if(
$fid){                                    // if fid = true -> there are file what name in $files array
        
$fs fopen("new_".$filename"w+");         // generate and open new_$files[x] file
        
print("\n".$filename." has opened.\n");
        print(
"new_".$filename." has created");        
        }else{
            print(
"\n".$filename." could not opened.");            
            }
   
while(
$i>0){
    
$i--;
    
$exploded=explode("_",$weapon[$i][3]);                    // split the skill name by _
    
if($exploded[0]=="SKILL" && $weapon[$i][36]>$lvl){        // weapont[$i][36] the level of the skill
    
$weapon[$i][0]=0;                                        // rewrite the skill "Service"  0=off and 1=on
    
}
    else{
        
$weapon[$i][0]=1;                                    // rewrite the skill "Service"  0=off and 1=on
        
}
}

$ks=false;

foreach(
$weapon as $wep){                                    //while there are record in the $weapon array rename the line to $wep
    
$c 1;                                                    //
    
foreach($wep as $dep){                                    //while there are record in the $wep array rename the line to $wep
        
        
if($c == count($wep)){                                // if $c == count($wep) we in the last clumn
        
fwrite($fs,$dep);                                    // write to new_$files[x] the weapon[]
        
}else{
            
fwrite($fs,$dep."\t");    
            
$ks=true;
            }
        ++
$c;      
        }
    }
   if(
$ks==true){
        print(
"\nnew_$filename successed\n\n");
        
$t++;
    }
else{
    print(
"\n".$filename." not valid\n\n");
    }
}
print(
"\n".$t." File successed");
?>

[Only registered and activated users can see links. Click Here To Register...]
08/21/2013 08:13 gunz5#2
Working Well Thanks
09/10/2013 10:49 AhmedAli0#3
will this change the level of the skills? or just delete the skills above the level?
cause if it is changing it's level
the server will not be balanced
and one more stupid question
where is the skilldata files?
09/13/2013 00:47 @$$#4
Thanks working fine ;-)
keep Sharing
11/12/2013 18:38 Skullsoil#5
thanks that helps alot!
07/20/2015 22:16 skip999#6
hello friend can tell me in detail how it works that code ..