![]() |
[Share]L2j NPC Converter
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 байт |
Any samples?
And where in l2j do u get collision_height/radius & gound_high/low? |
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 |
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 |
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... |
collision_radius={xx.xx;xx.xx} collision_height={xx.xx;xx.xx}
you have to strip ".00" or you will get parsing errors |
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. |
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){Code:
...Code:
$query="SELECT weaponType FROM weapon WHERE item_id = '".$weapon_id."'";Code:
$query="SELECT weaponType FROM weapon WHERE item_id = '".$weapon_id."'";Code:
function get_all_armors_weapons($sql){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. :) |
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. |
First post updated.
|
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. |
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.. |
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. |
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 |
Code:
Notice: Undefined variable: ok_again in c:\program files\easyphp1-8\www\config.php on line 15 |
Check your php/mysql version, easyphp uses outdated versions ;)
|
Quote:
|
mmmm using latest php and mysql version I have error.
Code:
There was a problem writting the new npcdata |
got busted by the antil33cher protect?
|
Quote:
|
Lol sorry need sleep (Zzz). Good anti-leecher protection! :P
Edit: Sorry I forgot, add this to functions.php Code:
|
:) ok thanks, I knew there were some missing classes
|
There was a problem writting the new npcdata (what problem?)
|
Guaresnay:
1. why you're getting itemnames through sql and not simply parse item_pch? :) Code:
foreach(file("item_pch.txt") as $iitem){Code:
function get_type($type){ |
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... |
1. you completely wrong... test my script before. :)
2. yeah, my mistake, but ending all cases with break; is a programming standart... |
I just did it as u said and it works like a bomb, thanks :P dunno what i was doing wrong the last time i tryed it =/
First post updated. |
There was a problem writting the new npcdata (what problem?)
|
Quote:
|
Where exactly and that to actuate?
|
| All times are GMT. The time now is 23:06. |