Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY!

Notices

 
 
Thread Tools Search this Thread Display Modes
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  
Old 14.07.2006, 18:56   #2
drzoom
Архивный участник
 
Join Date: Aug 2005
Posts: 428
Default

Respect hel!
Perfect as always!
Good work - keep it up!
drzoom is offline  
Old 14.07.2006, 19:43   #3
horyfilipe
Архивный участник
 
Join Date: Jul 2005
Posts: 242
Default

lexer erros =/
horyfilipe is offline  
Old 14.07.2006, 19:50   #4
hel
Архивный участник
 
Join Date: Apr 2006
Posts: 729
Default

Do you converted npcdata back to unicode?
hel is offline  
Old 14.07.2006, 20:04   #5
Xari0n
Архивный участник
 
Join Date: Jul 2006
Posts: 119
Default

thnx hel we complete itemdata converter now i share it for all
Xari0n is offline  
Old 14.07.2006, 20:36   #6
Koner
Архивный участник
 
Join Date: Sep 2005
Posts: 212
Default

rename npcdata to npcdata-ansi.txt and save in ansi
Koner is offline  
Old 14.07.2006, 20:36   #7
Koner
Архивный участник
 
Join Date: Sep 2005
Posts: 212
Default

Hel good work!
Koner is offline  
Old 15.07.2006, 12:45   #8
Papa_Wader
Архивный участник
 
Join Date: Nov 2005
Posts: 23
Default

What does this scripd do, exactly? =) sorry for noob question
Papa_Wader is offline  
Old 15.07.2006, 16:01   #9
horyfilipe
Архивный участник
 
Join Date: Jul 2005
Posts: 242
Default

By any change a great script for skilldata too?
horyfilipe is offline  
Old 15.07.2006, 16:56   #10
Met45
Архивный участник
 
Join Date: Jan 2006
Posts: 281
Default

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...
Met45 is offline  
Old 16.07.2006, 01:40   #11
nowak2006
Архивный участник
 
Join Date: May 2006
Posts: 53
Default 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]
nowak2006 is offline  
Old 16.07.2006, 01:46   #12
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

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.
FidoW is offline  
Old 16.07.2006, 01:50   #13
nowak2006
Архивный участник
 
Join Date: May 2006
Posts: 53
Default

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.
nowak2006 is offline  
Old 16.07.2006, 09:32   #14
empathon
Архивный участник
 
Join Date: Feb 2006
Posts: 136
Default

hehe thanks i just doing this and u made it faster :P
empathon is offline  
Old 16.07.2006, 15:28   #15
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

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 is offline  
Old 16.07.2006, 15:36   #16
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

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").
2Rain is offline  
Old 16.07.2006, 17:11   #17
Phantom2005
Архивный участник
 
Join Date: Aug 2005
Posts: 394
Default

align = -level*level
but max. -4900

(karik for example: -70x70 = -4900)
Phantom2005 is offline  
Old 17.07.2006, 03:43   #18
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

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..
rodier is offline  
Old 17.07.2006, 05:39   #19
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

Phantom2005

Thank you very much!
2Rain is offline  
Old 17.07.2006, 06:16   #20
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

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..
rodier is offline  
Old 18.07.2006, 01:08   #21
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

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?
2Rain is offline  
Old 18.07.2006, 01:19   #22
kgptzac
Архивный участник
 
Join Date: Jan 2006
Posts: 363
Default

possible chance for making a exe with GUI? ;P
kgptzac is offline  
Old 18.07.2006, 18:04   #23
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

2rain > you can in wordpad use function find & replace ;-DD ctrl+h
rodier is offline  
Old 18.07.2006, 18:43   #24
melkij
Архивный участник
 
Join Date: Feb 2005
Posts: 55
Default

share plz converted npcdata
melkij is offline  
Old 21.07.2006, 02:56   #25
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

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?
2Rain is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 23:44.