![]() |
|
|
#1 |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
The name basicaly says what is it... It generates a npcdata taking values from l2j tables. It won't generate a perfect npcdata, each mob will need some fixes (like npc_ai) but its better than start from nothing.
v0.1 - First Release v0.1b - Added "@set_time_limit(0);", fixed the "bigblunts", round collision_radius and collision_height to have 1 decimal value, change the "a" flag for the "w" to overwrite old file in second generation. v0.2 - Script has been optimised a bit (Thanks to hel). Drop/Spoil lists now use l2off itemnames, you will have to install a new table which was added in this version (itemname.sql). v0.3 - Script optimised much more (Thanks to hel again). You wont need the itemname table anymore. v0.3b - Fixed a problem with slot_rhand and slot_lhand which apeared in previous version. P.S. Sorry if there was another tool for that, I searched but didn't find anything. Вложения из исходного сообщения (сами файлы в копии отсутствуют): L2j_NPC_Converter_v0.3b.rar — 56489 байт |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Mar 2006
Posts: 685
|
Any samples?
And where in l2j do u get collision_height/radius & gound_high/low? |
|
|
|
|
#3 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
Quote:
Code:
npc_begin warrior 23206 [forgotten_victim] level=80 acquire_exp_rate=8.532656 acquire_sp=2600 unsowing=0 clan={@tomb_clan} ignore_clan_list={} clan_help_range=500 slot_chest=[] slot_rhand=[monster_only_(zombie_laborer_sword)] slot_lhand=[] shield_defense_rate=0 shield_defense=0 skill_list={@s_race_undead} npc_ai={[forgotten_victim];{[MoveAroundSocial]=0};{[MoveAroundSocial1]=0};{[MoveAroundSocial2]=0}} category={} race=fairy sex=male undying=0 can_be_attacked=1 corpse_time=7 no_sleep_mode=0 agro_range=1000 ground_high={164;0;0} ground_low={55;0;0} exp=1788937098 org_hp=115xx.xx0317 org_hp_regen=xx.xx org_mp=21xx.xx7297 org_mp_regen=3.09 collision_radius={xx.xx;xx.xx} collision_height={xx.xx;xx.xx} str=40 int=21 dex=25 wit=20 con=43 men=10 base_attack_type=sword base_attack_range=80 base_damage_range={0;0;80;120} base_rand_dam=30 base_physical_attack=9xx.xx5873 base_critical=4 physical_hit_modify=4.75 base_attack_speed=273 base_reuse_delay=0 base_magic_attack=6xx.xx5091 base_defend=6xx.xx381 base_magic_defend=4xx.xx5418 physical_avoid_modify=0 soulshot_count=0 spiritshot_count=0 hit_time_factor=0.45 item_make_list={} corpse_make_list={{[rp_spiritshot_s];1;1;0.15};{[sealed_majestic_robe_fabric];1;1;2.5};{[stone_of_purity];1;2;5};{[scroll_enchant_armor_(grade_a)];1;1;0.15};{[sealed_leather_armor_of_nightmare_fabric];1;1;2.5}} additional_make_list={} additional_make_multi_list={{{{[adena];4566;9322;100}};70};{{{[varnish];1;3;100}};xx.xx66};{{{[coal];1;3;100}};xx.xx11};{{{[cokes];1;1;100}};7.6011};{{{[mithril_arrow];100;300;100}};0.8823};{{{[stone_of_purity];1;1;100}};2.9411};{{{[mold_lubricant];1;1;100}};0.9174};{{{[sealed_shield_of_nightmare_fragment];1;1;100}};0.7352};{{{[sealed_majestic_circlet_design];1;1;100}};0.7246};{{{[sealed_helm_of_nightmare_design];1;1;100}};0.7011};{{{[rp_shining_arrow_(100%)];1;1;100}};0.046};{{{[sealed_helm_of_nightmare];1;1;100}};0.0088};{{{[sealed_shield_of_nightmare];1;1;100}};0.0088};{{{[sealed_majestic_circlet];1;1;100}};0.0088}} hp_increase=0 mp_increase=0 safe_height=100 npc_end
npc_begin warrior 23207 [triol's_layperson] level=81 acquire_exp_rate=xx.xx6351 acquire_sp=3292 unsowing=0 clan={@tomb_clan} ignore_clan_list={} clan_help_range=500 slot_chest=[] slot_rhand=[monster_only_(heretic_private_axe)] slot_lhand=[monster_only_(heretic_private_axe)] shield_defense_rate=0 shield_defense=0 skill_list={} npc_ai={[triol's_layperson];{[MoveAroundSocial]=0};{[MoveAroundSocial1]=0};{[MoveAroundSocial2]=0}} category={} race=fairy sex=male undying=0 can_be_attacked=1 corpse_time=7 no_sleep_mode=0 agro_range=1000 ground_high={164;0;0} ground_low={55;0;0} exp=2099375834 org_hp=146xx.xx619 org_hp_regen=xx.xx org_mp=32xx.xx2613 org_mp_regen=3.09 collision_radius={xx.xx;xx.xx} collision_height={xx.xx;xx.xx} str=40 int=21 dex=30 wit=20 con=43 men=10 base_attack_type=blunt base_attack_range=80 base_damage_range={0;0;80;120} base_rand_dam=50 base_physical_attack=8xx.xx5661 base_critical=1 physical_hit_modify=9 base_attack_speed=273 base_reuse_delay=0 base_magic_attack=6xx.xx5655 base_defend=4xx.xx0769 base_magic_defend=4xx.xx0416 physical_avoid_modify=-6 soulshot_count=0 spiritshot_count=0 hit_time_factor=0.45 item_make_list={} corpse_make_list={{[metal_hardener];1;2;5};{[sealed_shield_of_nightmare_fragment];1;1;2.5};{[rp_blessed_spiritshot_s];1;1;0.15}} additional_make_list={} additional_make_multi_list={{{{[chapel_key];1;1;100}};99};{{{[adena];4584;9387;100}};70};{{{[charcoal];1;3;100}};25};{{{[suede];1;3;100}};10};{{{[high_grade_suede];1;3;100}};4};{{{[dark_crystal];1;1;100}};3.3333};{{{[metal_hardener];1;1;100}};1.988};{{{[sealed_shield_of_nightmare_fragment];1;1;100}};0.8547};{{{[sealed_majestic_circlet_design];1;1;100}};0.8322};{{{[mold_hardener];1;1;100}};0.4237};{{{[sealed_shield_of_nightmare];1;1;100}};0.0088};{{{[sealed_majestic_circlet];1;1;100}};0.0088};{{{[sealed_helm_of_nightmare];1;1;100}};0.0088};{{{[scroll_enchant_weapon_(grade_s)];1;1;100}};0.018}} hp_increase=0 mp_increase=0 safe_height=100 npc_end
npc_begin warrior 23208 [triol's_believer] level=82 acquire_exp_rate=8.323171 acquire_sp=2665 unsowing=0 clan={@tomb_clan} ignore_clan_list={} clan_help_range=500 slot_chest=[] slot_rhand=[monster_only_(heretic_private_staff)] slot_lhand=[] shield_defense_rate=0 shield_defense=0 skill_list={} npc_ai={[triol's_believer];{[MoveAroundSocial]=0};{[MoveAroundSocial1]=0};{[MoveAroundSocial2]=0}} category={} race=fairy sex=male undying=0 can_be_attacked=1 corpse_time=7 no_sleep_mode=0 agro_range=1000 ground_high={164;0;0} ground_low={55;0;0} exp=2099425834 org_hp=118xx.xx4444 org_hp_regen=xx.xx org_mp=21xx.xx7297 org_mp_regen=3.09 collision_radius={xx.xx;xx.xx} collision_height={xx.xx;xx.xx} str=40 int=21 dex=30 wit=20 con=43 men=10 base_attack_type=bigblunt base_attack_range=80 base_damage_range={0;0;80;120} base_rand_dam=30 base_physical_attack=8xx.xx3922 base_critical=4 physical_hit_modify=4.75 base_attack_speed=273 base_reuse_delay=0 base_magic_attack=6xx.xx9626 base_defend=4xx.xx0588 base_magic_defend=4xx.xx4531 physical_avoid_modify=0 soulshot_count=0 spiritshot_count=0 hit_time_factor=0.45 item_make_list={} corpse_make_list={{[sealed_boots_of_nightmare_lining];1;1;2.5};{[rp_soulshot_(s)_compressed_package_(100%)];1;1;0.15};{[sealed_majestic_boots_lining];1;1;2.5}} additional_make_list={} additional_make_multi_list={{{{[chapel_key];1;1;100}};99};{{{[adena];5331;10920;100}};70};{{{[iron_ore];1;3;100}};20};{{{[stem];4;12;100}};xx.xx57};{{{[steel];1;1;100}};5.5555};{{{[blessing_of_darkness];1;1;100}};2.255};{{{[asofe];1;1;100}};1.8181};{{{[sealed_majestic_boots_lining];1;1;100}};0.8333};{{{[sealed_gloves_of_nightmare_design];1;1;100}};0.8333};{{{[sealed_majestic_gloves_design];1;1;100}};0.7599};{{{[sealed_boots_of_nightmare_lining];1;1;100}};0.7575};{{{[durable_metal_plate];1;1;100}};0.6993};{{{[scroll_enchant_armor_(grade_s)];1;1;100}};0.0227};{{{[sealed_gloves_of_nightmare];1;1;100}};0.0088};{{{[sealed_boots_of_nightmare];1;1;100}};0.0088};{{{[sealed_majestic_gloves];1;1;100}};0.0088};{{{[sealed_majestic_boots];1;1;100}};0.0088}} hp_increase=0 mp_increase=0 safe_height=100 npc_end
|
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Dec 2006
Posts: 252
|
Just be careful, ground high/low are fucked up in L2J, some mobs are half under the gound or flying (check dorfs :P )
nice share |
|
|
|
|
#5 | ||
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Quote:
2) monster_only_(zombie_laborer_sword) - this name standart is supported in c4off engine? approved? 3) Quote:
![]() 4) very interested formulas inside script. Need check it... |
||
|
|
|
|
#6 |
|
Архивный участник
Join Date: Dec 2005
Posts: 156
|
collision_radius={xx.xx;xx.xx} collision_height={xx.xx;xx.xx}
you have to strip ".00" or you will get parsing errors |
|
|
|
|
#7 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
Quote:
2.- Those weapons doesnt exist for l2off even with another name so you will have to change it anyway. But sometime mobs just use normal weapons like sword_of_damascus and u won't need to change anything. 3.- :P @madar: Are you sure about that? l2off sometimes use float values i.e. goblin: collision_height={16.5;16.5}. Maybe I'll just have to round it to 1 decimal value. |
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Apr 2006
Posts: 729
|
Guaresnay:
good share. i was thinking about making it. some technical help for you, if you need it. ![]() 1. add "@set_time_limit(0);" in npcdata.php for unlimited execution time. 2. you can make output npcdata in unicode automaticaly, this is an basic example, which a bit slow, but working well: functions.php: Code:
function LineAnsiUni($str){
return preg_replace_callback("/./",create_function('$match','return ($match[0]."\x00");'),$str);
}
Code:
...
$file=fopen("npcdata_new.txt", "a"); // i dont think, thats 'a' flag is good there. :) use "w". or for second generation it will not overwrite previously generated file.
fwrite($file,"\xFF\xFE"); // writing unicode header
...
while($row=mysql_fetch_array($link)){
...
if($Active){if(fwrite($file, LineAnsiUni("npc_begin ... npc_end\r\n"))){$done=2;}} // writing lines with extra-bytes for each symbol (it is required).
...
}
Code:
$query="SELECT weaponType FROM weapon WHERE item_id = '".$weapon_id."'"; $link=mysql_query($query); $row=mysql_fetch_array($link); $type=$row['weaponType']; Code:
$query="SELECT weaponType FROM weapon WHERE item_id = '".$weapon_id."'"; $link=mysql_query($query); $type=mysql_result($result,0,'weaponType'); // 0 - first row from result, 'weaponType' is a name of a field Code:
function get_all_armors_weapons($sql){
$query="SELECT * FROM weapon";
$link=mysql_query($query,$sql);
while($row_items=mysql_fetch_array($link)){
$weapons_array[($row["item_id"])]=array("name" => $row["name"],"type" => "weapon");
}
$query="SELECT * FROM armor";
$link=mysql_query($query,$sql);
while($row_items=mysql_fetch_array($link)){
$armors_array[($row["item_id"])]=array("name" => $row["name"],"type" => "armor");
}
return $armors_array+$weapons_array;
}
$id=1;
$wa_items=get_all_armors_weapons($conn);
echo ($wa_items[$id]["name"]." is ".$wa_items[$id]["type"]); // prints "short sword is a weapon".
sorry if you don't like that i "teach" you how to programming, i just want to help you make your script better, because i'm interested in it, if you want more programming hints - pm me.
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
Thank you for your suggestions hel, I knew some of them but just didnt do it that way b.c. I'm a lil lazy and I chose the easiest way :P
BTW I'll consider all of them. |
|
|
|
|
#10 |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
First post updated.
|
|
|
|
|
#11 |
|
Архивный участник
Join Date: Mar 2006
Posts: 685
|
Well might sound like a noob, but l2j is really not my thing, anyways, i still can't find any table in l2jdb where they has npc collisions, well actually found some but those were mainly summons.. What table in l2j db has them?
And ok, if we use c4 npc collisions from retail, all is cool. What about new ones? Your tool can find correct collision for c5 / interlude npcs? Thanks. |
|
|
|
|
#12 |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
you can find collision_radius and collision_height in 'npc' table with the same names. I took the l2j db from here .. http://www.l2jdp.com/svn/C5_Datapack/
The problems is that both values for each case will be always the same i mean {X;Y} X=Y always.. |
|
|
|
|
#13 |
|
Архивный участник
Join Date: Mar 2006
Posts: 685
|
Yes, and which is wrong. Half of them will fly or be under ground :|
I've been researching about this for quite a while now, there's a way to get collision info from meshes as i know, though have not done it myself yet. Anyways, nice share. Nice base to work from. |
|
|
|
|
#14 |
|
Архивный участник
Join Date: Dec 2006
Posts: 252
|
Yeah, also always check the attack speed, i mean when it's 278, it means 253 in l2off, it seems most of the stats are different between l2j and l2off ( logical since l2j is still using C1 basis ). So *if* you could add to your script: 0.91*L2J's atkspd = 1*l2off's atk spd this'd be better than nothing.
The attack range sometimes is also really fucked up so you gotta check it out by hands :P |
|
|
|
|
#15 |
|
Архивный участник
Join Date: May 2006
Posts: 209
|
Code:
Notice: Undefined variable: ok_again in c:\program files\easyphp1-8\www\config.php on line 15 Notice: Undefined variable: ok_again in c:\program files\easyphp1-8\www\config.php on line 15 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\functions.php on line 436 Notice: Undefined variable: ok_again in c:\program files\easyphp1-8\www\config.php on line 15 Notice: Undefined variable: x in c:\program files\easyphp1-8\www\npcdata.php on line 22 Notice: Undefined variable: string in c:\program files\easyphp1-8\www\functions.php on line 23 Notice: Undefined variable: string1 in c:\program files\easyphp1-8\www\functions.php on line 124 Notice: Undefined variable: string2 in c:\program files\easyphp1-8\www\functions.php on line 125 Notice: Undefined variable: is_drop in c:\program files\easyphp1-8\www\functions.php on line 136 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\npcdata.php on line 91 Notice: Undefined variable: x in c:\program files\easyphp1-8\www\npcdata.php on line 22 Notice: Undefined variable: string in c:\program files\easyphp1-8\www\functions.php on line 23 Notice: Undefined variable: string1 in c:\program files\easyphp1-8\www\functions.php on line 124 Notice: Undefined variable: string2 in c:\program files\easyphp1-8\www\functions.php on line 125 Notice: Undefined variable: is_drop in c:\program files\easyphp1-8\www\functions.php on line 136 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\npcdata.php on line 91 Notice: Undefined variable: x in c:\program files\easyphp1-8\www\npcdata.php on line 22 Notice: Undefined variable: string in c:\program files\easyphp1-8\www\functions.php on line 23 Notice: Undefined variable: string1 in c:\program files\easyphp1-8\www\functions.php on line 124 Notice: Undefined variable: string2 in c:\program files\easyphp1-8\www\functions.php on line 125 Notice: Undefined variable: is_drop in c:\program files\easyphp1-8\www\functions.php on line 136 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\npcdata.php on line 91 Notice: Undefined variable: x in c:\program files\easyphp1-8\www\npcdata.php on line 22 Notice: Undefined variable: string in c:\program files\easyphp1-8\www\functions.php on line 23 Notice: Undefined variable: string1 in c:\program files\easyphp1-8\www\functions.php on line 124 Notice: Undefined variable: string2 in c:\program files\easyphp1-8\www\functions.php on line 125 Notice: Undefined variable: is_drop in c:\program files\easyphp1-8\www\functions.php on line 136 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\npcdata.php on line 91 Notice: Undefined variable: x in c:\program files\easyphp1-8\www\npcdata.php on line 22 Notice: Undefined variable: string in c:\program files\easyphp1-8\www\functions.php on line 23 Notice: Undefined variable: string1 in c:\program files\easyphp1-8\www\functions.php on line 124 Notice: Undefined variable: string2 in c:\program files\easyphp1-8\www\functions.php on line 125 Notice: Undefined variable: is_drop in c:\program files\easyphp1-8\www\functions.php on line 136 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\npcdata.php on line 91 Notice: Undefined variable: x in c:\program files\easyphp1-8\www\npcdata.php on line 22 Notice: Undefined variable: string in c:\program files\easyphp1-8\www\functions.php on line 23 Notice: Undefined variable: string1 in c:\program files\easyphp1-8\www\functions.php on line 124 Notice: Undefined variable: string2 in c:\program files\easyphp1-8\www\functions.php on line 125 Notice: Undefined variable: is_drop in c:\program files\easyphp1-8\www\functions.php on line 136 Notice: Undefined variable: Active in c:\program files\easyphp1-8\www\npcdata.php on line 91 |
|
|
|
|
#16 |
|
Архивный участник
Join Date: Dec 2006
Posts: 252
|
Check your php/mysql version, easyphp uses outdated versions
|
|
|
|
|
#17 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
Quote:
|
|
|
|
|
|
#18 |
|
Архивный участник
Join Date: May 2006
Posts: 209
|
mmmm using latest php and mysql version I have error.
Code:
There was a problem writting the new npcdata |
|
|
|
|
#19 |
|
Архивный участник
Join Date: Dec 2005
Posts: 156
|
got busted by the antil33cher protect?
|
|
|
|
|
#20 |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
|
|
|
|
|
#21 |
|
Архивный участник
Join Date: May 2006
Posts: 209
|
Lol sorry need sleep (Zzz). Good anti-leecher protection! :P
Edit: Sorry I forgot, add this to functions.php Code:
case 'L2SiegeNpc':
$type='citizen';
break;
case 'L2WyvernManager':
$type='citizen';
break;
case 'L2MercManager':
$type='citizen';
break;
case 'L2Artefact':
$type='citizen';
break;
case 'L2CastleChamberlain':
$type='citizen';
break;
case 'L2CastleTeleporter':
$type='citizen';
break;
case 'L2Fisherman':
$type='citizen';
break;
case 'L2SymbolMaker':
$type='citizen';
break;
case 'L2SignsPriest':
$type='citizen';
break;
case 'L2CabaleBuffer':
$type='citizen';
break;
case 'L2Observation':
$type='citizen';
break;
|
|
|
|
|
#22 |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
ok thanks, I knew there were some missing classes
|
|
|
|
|
#23 |
|
Архивный участник
Join Date: Apr 2006
Posts: 100
|
There was a problem writting the new npcdata (what problem?)
|
|
|
|
|
#24 |
|
Архивный участник
Join Date: Apr 2006
Posts: 729
|
Guaresnay:
1. why you're getting itemnames through sql and not simply parse item_pch? ![]() Code:
foreach(file("item_pch.txt") as $iitem){
str_replace(array("\xFF\xFE","\x00"),"",trim($iitem));
$iitem=str_replace(array(" ","\t"),"",$iitem);
$eitem=explode("=",$iitem);
$itemids[($eitem[1])]=str_replace(array("[","]"),"",$eitem[0]);
}
// after that you may use for example $itemids[1], it returns short_sword.
Code:
function get_type($type){
switch($type){
...
default:
$type="citizen";break; //every case need to break, or switch will continue from begining, you forgot about it.
}
return $type;
}
|
|
|
|
|
#25 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 113
|
Quote:
2.- Yeh I'll change the default to 'citizen', my bad. Are you sure the default case also need the "break;"? I though switch wasn't iterative, so it doesnt continue from begining... |
|
|
|
|
|