Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [Share] Converter for c4 retail npcdata to c1 (https://postpacific.loc-online.com/showthread.php?t=5144)

hel 14.07.2006 18:39

[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]

drzoom 14.07.2006 18:56

Respect hel!
Perfect as always!
Good work - keep it up!

horyfilipe 14.07.2006 19:43

lexer erros =/

hel 14.07.2006 19:50

Do you converted npcdata back to unicode? ;)

Xari0n 14.07.2006 20:04

thnx hel :) we complete itemdata converter now i share it for all

Koner 14.07.2006 20:36

rename npcdata to npcdata-ansi.txt and save in ansi

Koner 14.07.2006 20:36

Hel good work! ;)

Papa_Wader 15.07.2006 12:45

What does this scripd do, exactly? =) sorry for noob question

horyfilipe 15.07.2006 16:01

By any change a great script for skilldata too?

Met45 15.07.2006 16:56

Quote:

Originally Posted by Papa_Wader
What does this scripd do, exactly? =) sorry for noob question

remove every new entries which are newer then c1, otherwise the normal server wouldn't load...

nowak2006 16.07.2006 01:40

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]

FidoW 16.07.2006 01:46

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.

nowak2006 16.07.2006 01:50

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.

empathon 16.07.2006 09:32

hehe thanks i just doing this and u made it faster :P

2Rain 16.07.2006 15:28

Quote:

Originally Posted by FidoW
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.

I made all work manually in MS Excel, hehe. :wink:
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:

2Rain 16.07.2006 15:36

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").

Phantom2005 16.07.2006 17:11

align = -level*level
but max. -4900

(karik for example: -70x70 = -4900)

rodier 17.07.2006 03:43

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..

2Rain 17.07.2006 05:39

Phantom2005

Thank you very much!

rodier 17.07.2006 06:16

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..

2Rain 18.07.2006 01:08

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?

kgptzac 18.07.2006 01:19

possible chance for making a exe with GUI? ;P

rodier 18.07.2006 18:04

2rain > you can in wordpad use function find & replace ;-DD ctrl+h

melkij 18.07.2006 18:43

share plz converted npcdata ;)

2Rain 21.07.2006 02:56

Quote:

Originally Posted by rodier
2rain > you can in wordpad use function find & replace ;-DD ctrl+h

Not funny. I do same as you tell. But, I don't know ALL new strings. Fnd many same strings have different numeric parameters. It make unavailable autoreplace in most accusions. All, what may change with autoreplace, I was change.

PS.: You have IQ as a God or just try hit me?


All times are GMT. The time now is 16:20.