Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Dekaron > Dekaron Private Server
You last visited: Today at 16:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP]Looking for a genious

Discussion on [HELP]Looking for a genious within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
en[DEV]er's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 203
Received Thanks: 56
Question [HELP]Looking for a genious

I am adapting Korean Client to use it on a new client and I encounter the sad situation: only 19,000 (rounded) of 65000 index of item_shape are being used, and I had an idea: it would be nice if someone could put all index's in sequence on the client and then I remember to epvpers:''There is a lot of guys in epvpers smart, I will ask for their help! " And so here I am! Someone can help me ?
en[DEV]er is offline  
Old 09/07/2011, 16:03   #2
 
Zombe's Avatar
 
elite*gold: 20
Join Date: Dec 2007
Posts: 1,450
Received Thanks: 833
So what do you want, just to get a list of items from all item files sorted by their IDs? Give me a few min...

Done, put the files at the same folder as the script, edit add or delete file names as you like. Results will be saved as output.csv
PHP Code:
<?php
$files 
= array(
'itemarmor.csv',
'itemcash.csv',
'itemetc.csv',
'itemweapon.csv'
);
foreach(
$files as $filename)
{
    
$file file($filename);
    
$flag false;
    foreach(
$file as $row)
    {
        if(!
$flag)
        {
            
$flag true;
            continue;
        }
        
$expl explode(',',$row);
        if(
$expl[0] == '')
            continue;
        
$ids[] = $expl[0];
        
$rows[$expl[0]] = $row;
    }
}
sort($ids);
foreach(
$ids as $id)
{
    
$newrows[$id] = $rows[$id];
}
file_put_contents('output.csv',$newrows);
?>
Zombe is offline  
Thanks
4 Users
Old 09/07/2011, 23:20   #3
 
en[DEV]er's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 203
Received Thanks: 56
Thks dude ! awesome job !

Quote:
Originally Posted by Zombe View Post
So what do you want, just to get a list of items from all item files sorted by their IDs? Give me a few min...

Done, put the files at the same folder as the script, edit add or delete file names as you like. Results will be saved as output.csv
PHP Code:
<?php
$files 
= array(
'itemarmor.csv',
'itemcash.csv',
'itemetc.csv',
'itemweapon.csv'
);
foreach(
$files as $filename)
{
    
$file file($filename);
    
$flag false;
    foreach(
$file as $row)
    {
        if(!
$flag)
        {
            
$flag true;
            continue;
        }
        
$expl explode(',',$row);
        if(
$expl[0] == '')
            continue;
        
$ids[] = $expl[0];
        
$rows[$expl[0]] = $row;
    }
}
sort($ids);
foreach(
$ids as $id)
{
    
$newrows[$id] = $rows[$id];
}
file_put_contents('output.csv',$newrows);
?>

this code put the ids in sequence? like that,my problems its this: i shoud can put with a script like that reindex the files in sequence with the item_shape.csv ...

ex.:
(itemarmor)
101, argan armor,...
(item_shape)
101,....

the script put automaticly
(itemarmor)
1, argan armor,...
(item_shape)
1,....
en[DEV]er is offline  
Old 09/10/2011, 06:47   #4
 
en[DEV]er's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 203
Received Thanks: 56
nobody's can help me? very sad =/
en[DEV]er is offline  
Old 09/10/2011, 10:43   #5
 
Zombe's Avatar
 
elite*gold: 20
Join Date: Dec 2007
Posts: 1,450
Received Thanks: 833
Well I can, I just know it will take probably 2-3 hours, and I can't force myself to do it... :|

Cause you know, to change all IDs you'd need to change them not only in item_shape.csv and itemwhatever.csv, but you'd also need to change the upgrading pointers, if you can call it that, also edit all drops, and lastly generate and run one big-*** query made up of ~20k smaller queries, one for each ID...

I'm not sure if I want to spend so much time doing it all... :|
Zombe is offline  
Old 09/10/2011, 22:20   #6
 
en[DEV]er's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 203
Received Thanks: 56
Quote:
Originally Posted by Zombe View Post
Well I can, I just know it will take probably 2-3 hours, and I can't force myself to do it... :|

Cause you know, to change all IDs you'd need to change them not only in item_shape.csv and itemwhatever.csv, but you'd also need to change the upgrading pointers, if you can call it that, also edit all drops, and lastly generate and run one big-*** query made up of ~20k smaller queries, one for each ID...

I'm not sure if I want to spend so much time doing it all... :|
Yeah...work a lot =/
en[DEV]er is offline  
Reply




All times are GMT +1. The time now is 16:37.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.