![]() |
[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] |
Respect hel!
Perfect as always! Good work - keep it up! |
lexer erros =/
|
Do you converted npcdata back to unicode? ;)
|
thnx hel :) we complete itemdata converter now i share it for all
|
rename npcdata to npcdata-ansi.txt and save in ansi
|
Hel good work! ;)
|
What does this scripd do, exactly? =) sorry for noob question
|
By any change a great script for skilldata too?
|
Quote:
|
Somes Fixes
Very good job hel!!
Just some fixes: [php:1:db43e7bd76] // Function by hel function PARSE_LINE($line_get) { // Fixes by Nowak: // - collision_height // - collision_radius // - ignore_clan_list // - base_critical // - ground_high // - ground_low $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_height=".$coll_h; $coll_radius="collision_radius=".$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]."\t".$line_explode[27] ."\t".$line_explode[26]."\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".$line_explode[46]."\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 " . $line_explode[9] ."\truler=0\t". "ruling_domain={}\t".$line_explode[17]."\t". $line_explode[23]."\t".$line_explode[24]."\t".$line_explode[64]; return $line_finished; } [/php:1:db43e7bd76] |
collision fields are in wrong order i think...
base_critical are missing ignore_clan_list are missing i convert 3 npcs ... test it in game.. and... 1. bad collision data... i see data and are inverted.. 2. npcs are too slow... the other data seens perfect. |
Look at the type of npc.. the second parameter..
In retail we have some new types: * mrkeeper * monrace * treasure * xmastree * zzoldagu We must change it also. |
hehe thanks i just doing this and u made it faster :P
|
Quote:
HAndmade is a cool! But Hel - great brain! I am glad what he my young friend. 8) In my variant no any missings, You right - words "collision_heignh" and "collision_radius" must changed in places. ground_low={...} - NPC speed. Hel add same data in script for all NPC. But in source C4 script this data for NPC are present. I think, Hell very soon will post new, fixed variant of this great scrpt. :wink: |
I have one question:
"align=-1" for all NPC - correct views ingame? Because I was manually correct this parameters from C1 scripts and not for all NPC this parameter true (for all new NPC I insert "align=-1"). |
align = -level*level
but max. -4900 (karik for example: -70x70 = -4900) |
what is this align for?
and does anyone have rate changer for npcdata? I tried few but noone works :-( one php programmmer of my team now tries to make parser..but he dont have too much skills with npcdata.. |
Phantom2005
Thank you very much! |
someone make this too
http://forum.ragezone.com/l2-file-re...c1-152480.html but its .exe but its little bugged ;] collision_radius={52 collision_height={86 :-) ..but its good because it remove the "movesocial" from AI bracket.. |
Now I am work over next:
Finding uncorrect strings (LowRangeDDMagic etc.) and autoreplace according C1 AI sintaksis. Full manyally, in wordpad :( Maybe anybody can help me to save the time? |
possible chance for making a exe with GUI? ;P
|
2rain > you can in wordpad use function find & replace ;-DD ctrl+h
|
share plz converted npcdata ;)
|
Quote:
PS.: You have IQ as a God or just try hit me? |
You can use find&replace with regular expressions. It works great.
|
| All times are GMT. The time now is 16:27. |