Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY!
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 14.07.2006, 18:39   #1
hel
Архивный участник
 
Join Date: Apr 2006
Posts: 729
Default [Share] Converter for c4 retail npcdata to c1

Here a script, which I made by 5 hours... Hard to search right places...
But, here it is. ( Plz someone give me retail C4 exe's :P )

[php:1:9134d280a2]<?
function PARSE_LINE($line_get){
$line_explode=explode("\t",$line_get);
$coll_h=str_replace(array(";","}"),"",strstr($line _explode[34],";"));
$coll_r=str_replace(array(";","}"),"",strstr($line _explode[33],";"));
$coll_height="collision_radius=".$coll_h;
$coll_radius="collision_height=".$coll_r;
$line_finished=$line_explode[0]."\t".$line_explode[1]."\t".
$line_explode[2]."\t".$line_explode[3]."\t".$line_explode[4]."\t".
$line_explode[28]."\t".$line_explode[5]."\t".$line_explode[21]."\t".
$line_explode[22]."\t".$line_explode[6]."\t".$line_explode[19]."\t".
$line_explode[20]."\ttemper=100\t".$line_explode[63]."\torg_jump=15\t".
$line_explode[16]."\tmagic_list={}\tmax_item=50\t".$line_explode[57]."\t".
$line_explode[58]."\t".$line_explode[59]."\t".$line_explode[60]."\t".
$line_explode[11]."\t".$line_explode[12]."\t".$line_explode[13]."\t".
$line_explode[41]."\tbase_can_penetrate=0\t".$line_explode[42]."\t".
$line_explode[43]."\t".$line_explode[44]."\t".
$line_explode[35]."\t".$line_explode[36]."\t".$line_explode[37]."\t".
$line_explode[38]."\t".$line_explode[39]."\t".$line_explode[40]."\t".
$line_explode[61]."\t".$line_explode[62]."\t".$line_explode[30]."\t".
$line_explode[32]."\tground_low={20;0;10}\tground_high={50;-30;30}\t".
"underwater_low={50;0;10}\tunderwater_high={0;0;30 }\tfly_low={0;0;10}\t".
"fly_high={0;-30;30}\tfloat_low={0;0;10}\tfloat_high={0;-30;30}\t".
"org_earshot=100\tsight={0;0;2500;120;5}\t".
$line_explode[25]."\t".$line_explode[29]."\t".$line_explode[31]."\t".
$line_explode[51]."\t".$line_explode[50]."\t".$line_explode[52]."\t".
$line_explode[45]."\t".$line_explode[47]."\t".$line_explode[53]."\t".
$line_explode[48]."\t".$line_explode[49]."\t".
"magic_use_speed_modify=0\tstatus={normal}\tal ign=-1\t".
$coll_radius."\t".$coll_height."\t".$line_explode[18]."\t".
$line_explode[8]."\t".$line_explode[10]."\tguild={}\tpledge={}\t".
"pledge_leader=0\talliance={}\talliance_leader=0\t ruler=0\t".
"ruling_domain={}\t".$line_explode[17]."\t".
$line_explode[23]."\t".$line_explode[24]."\t".$line_explode[64];
return $line_finished;}
echo("Starting parsing and replacing, wait please...\r\n
Don't forget to put npcdata.txt C4Retail, in ANSI, near npcdata.php.\r\n");
$file1="npcdata-ansi.txt";
$filearray=file($file1);$count=0;
while($filearray[$count]!=""):
$line[$count]=PARSE_LINE($filearray[$count]);
$count++;
endwhile;
$count2=$count;
$count=0;
$file2="npcdata-parsed.txt";
$file2_result=fopen($file2,'w');
while($count!=$count2):
fputs($file2_result,$line[$count]);
$count++;
endwhile;
fclose($file2_result);
$fs=filesize($file2);
echo("Completed!\r\nFile (".$fs." bytes, ".$count.
" lines) npcdata-parsed.txt stored succesfuly!\r\n");
?>[/php:1:9134d280a2]
hel is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:18.