Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 Server Modifications ONLY! (https://postpacific.mmorpg-game.online/forumdisplay.php?f=28)
-   -   l2joff npcpos converter again :) (https://postpacific.mmorpg-game.online/showthread.php?t=7672)

hel 29.05.2007 11:25

l2joff npcpos converter again :)
 
that's l2joff converting tool.

0.1a - first release.
0.1b - respawn time fixed.
0.2a - a bit optimized code, integrated castle guards converter (if there is a bug - post bugreport, i'll fix it), name="" mistake fixed.
0.2b - castle guards pos generating fix, $row["reuse_delay"] mistake fixed
0.2b2 - castle guards now isn't _ex_ npcs, but regular npcs is _ex_.
0.5a - now all territories looks like a square (8 points); warriors, raid bosses,mimic,treasures have pos=anywhere, but citizen's, guards, traders, etc have static coordinates; script from now will get npcnames from npclist (which has c4 npcs and some of c5), if some id not found in npclist, then script will take it from l2jdb and give them static coordinates and display a warning in browser;some optimizes (converting now take less than 5 seconds).
0.5a2 - minor bug fixed (with territory and npcmaker names on regular npcs).

i think that latest l2j database is here:
http://www.l2jdp.com/svn/

i've rewrite my old one from null, and it looks more better. :P
i was written this script to up exp in php, but i don't have time to check script or result for errors and mistakes.
this script not for sell, but you can freely modify and share it.
hints, reports and help will help me fix scripts and better understand php.
small piece of generated npcpos :) :
Quote:

territory_begin [gludio_t16_21_003] {{-103742;103344;-3555;-3535};{-101914;103344;-3555;-3535};{-101914;105251;-3555;-3535};{-103742;105251;-3555;-3535}} territory_end
npcmaker_ex_begin [gludio_t16_21_003] name="gludio_t16_21_003" ai=[default_maker] maximum_npc=5
npc_ex_begin [whispering_wind] pos={-101924;104293;-3545;-3220} total=1 respawn=35 npc_ex_end
npc_ex_begin [whispering_wind] pos={-102596;105241;-3545;-3220} total=1 respawn=35 npc_ex_end
npc_ex_begin [ol_mahum_legionnaire] pos={-103236;103354;-3545;-3220} total=1 respawn=35 npc_ex_end
npc_ex_begin [selu_lizardman_warrior] pos={-102946;103785;-3545;-3220} total=1 respawn=35 npc_ex_end
npc_ex_begin [selu_lizardman_scout] pos={-103732;103488;-3545;-3220} total=1 respawn=35 npc_ex_end
npcmaker_ex_end
Вложения из исходного сообщения (сами файлы в копии отсутствуют):
l2joff_npcpos_rebirth_0.5a2.rar — 40454 байт

madar 29.05.2007 11:55

nice

btw. you dont have to write sec/min/hour after respawn= ?

hel 29.05.2007 14:00

fixed....... maybe (not tested well). :)

madar 29.05.2007 17:46

ill try to redo the castle thing like you did with the npcpos if you will not be faster than me

madar 29.05.2007 22:01

Code:

npcmaker_ex_begin        [schuttgart_broadcast_2213_001]        name="schuttgart_broadcast"        ai=[default_maker]        maximum_npc=1

the name should/must be in [ ]

m4rk 29.05.2007 22:21

line 114 from npcpos_class.php

Incorrect one:
Code:

$res[0]."]\tname=\"".$res[0]."\"\tai=[default_maker]\tmaximum_npc=".$maximum_npc[0]."\r\n");
Fixed one:
Code:

res[0]."]\tname=[".$res[0]."]\tai=[default_maker]\tmaximum_npc=".$maximum_npc[0]."\r\n");

hel 30.05.2007 11:34

check 1st post, new version posted. :)

balapro 30.05.2007 11:38

wow hel nice, i tested very thx ^^


Big post

GmZenBrasil 30.05.2007 14:29

very good work man, thanks ^^

HF 30.05.2007 15:23

Good idea. It's my old wish :)

But, two questions:
- where can get l2j pos file?
- why need use 'npcmaker_ex_begin' but not simple 'npcmaker_begin' ?

mcrabben7 31.05.2007 00:50

Good job hel :) It's a very nice base to work on NPC positions.

madar 31.05.2007 06:06

row 62
change:
Code:

."\t".$row["heading"]."\t".$this->respawn_time($row["respawn_delay"]);
to:
Code:

."\t".$row["heading"]."\t".$this->respawn_time($row["respawnDelay"]);

after some test i found out your castle guard spawn converter's output is a bit wrong.

it must look like this:
Code:

territory_begin        [gludio_siege01]        {{-18511;113052;-2791;62945};{-18170;113055;-2791;62945};{-18176;113273;-2791;62945};{-18511;113273;-2791;62945}}        territory_end                               
npcmaker_begin        [gludio_siege01]        initial_spawn=all        spawn_time=siege_warfare_start(1)        maximum_npc=30                       
npc_begin        [gludio_bow_guard_s_e]        pos={-18460;113107;-2759;15608}        total=1        respawn=3hour        dbname=[gludio_siege_001]        dbsaving={death_time;parameters;pos}        npc_end
npc_begin        [gludio_bow_guard_s_e]        pos={-18432;113107;-2759;15608}        total=1        respawn=3hour        dbname=[gludio_siege_002]        dbsaving={death_time;parameters;pos}        npc_end
npcmaker_end


madar 31.05.2007 06:12

a snippet from Phantom2005's code that i modified:

Code:

$castle_list=array(1=>"gludio",2=>"dion",3=>"giran",4=>"oren",5=>"aden",6=>"innadril",7=>"goddard",8=>"rune",9=>"schuttgart");
        fputs($npcpos,"territory_begin        [{$castle_list[$row["castleId"]]}_siege".$row["id"]."]        {"
              .$points."}        territory_end        \r\nnpcmaker_begin        [".$row2["name"]."_siege"
              .$row["id"]."]        initial_spawn=all        spawn_time=siege_warfare_start(".$row["castleId"].")        maximum_npc=1        \r\nnpc_begin        ["
              .$name_of_npc."]        pos={".$row["x"].";".$row["y"].";"
              .$row["z"].";".$loczmax."}        total=1        respawn=".$row["respawnDelay"]."sec        dbname=[{$castle_list[$row["castleId"]]}_siege_".$row["id"]."]        dbsaving={death_time;parameters;pos}        npc_end\r\nnpcmaker_end                                \r\n");}


hel 31.05.2007 08:48

Quote:

Originally Posted by HF
Good idea. It's my old wish

But, two questions:
- where can get l2j pos file?
- why need use 'npcmaker_ex_begin' but not simple 'npcmaker_begin' ?

1. all spawnlist converts from database (mysql), not from file.
http://www.l2jdp.com/svn/ - i think new versions of databases is here. :)
2. don't know, how to see difference in npcmaker_ and npcmaker_ex_ in l2j database, so i use _ex_ one. :/

Quote:

Originally Posted by madar
a snippet from Phantom2005's code that i modified:

thanks, now i see, where i do a mistake and know what need to modify. :)

Quote:

Originally Posted by madar
row 62
change:

i see... will fix all reported problems soon.

madar 31.05.2007 09:53

as i see you have to use npcmaker_ex for all "regular npc / mob" and normal npc_maker for castle / agit siege stuff

hel 31.05.2007 11:15

check first post, new version posted. :)

hel 01.06.2007 05:48

if i don't recieve bugreports or ideas about npcpos converter this day, i'll end project and 0.2b2 will be "full unbuggy" and "full functional" end release. (in version 0.2b2 i was fixed all reported problems)
it will be more good, if i get txt file with only "npc_name;id" from npcdata (c5), then i will do getting right npcnames (for c4 (c5) off npcdata, npcpos) by id.

tpuNIsher 01.06.2007 07:51

Ok, time to post here my 2 cents.

This is indeed a great base to work from. However, the thing i've understood from weeks of analyzing c4 retail npcpos, then now comparing them to your npcpos is that:

1. Your npcpos tells every mob to spawn pos based. As in each mob will spawn on pos={x,y,z,direction} based.
That's processor intensive, l2npc works more imo, and players when playing will be knowing exactly where the mob is spawning.
That's the problem with l2j i do not like as well ;)

2. Retail npcpos for most npcmaker_ex poses, they uses pos = anywhere.
So within the terriotory defined for that npcmaker_ex the mobs asked to spawn ( maximum npc ) and the mobs specified will spawn ALWAYS randomly, meaning player doesn't know at what spot the mob might spawn next.
It might be exactly where the mob spawned a bit ago or it might be a place far from it's previous spawn point. Which is how L2OFF poses are.

3. About territory:
This problem exists in ALL npcpos makers i've seen, none are perfect. Analyzing retail npcpos i understood that territories are built by a pentagon / rectangle / square and so on base.
Every npcpos maker ive seen uses rectangle / square based system for territories.
( HF, this is a idea for you too! maybe you can make option to choose how to make npcpos in ur tool, pentagon based / square based / etc based ..to know what i mean by pentagon and etc.. read down)

If you don't understand what that means.. let me give u an example..from l2wh pospic.

http://img523.imageshack.us/img523/1...ato1ry2.th.png

ok u see that's a pic from simple stakato nest pos from l2wh. its a 5 sided thing pentagon or w/e. How that works? look at this code below:

Code:

territory_begin        [rune08_2215_58]        {{95339;-87076;-2894;-2394};{95800;-86680;-2894;-2394};{95849;-85825;-2894;-2394};{95570;-85670;-2894;-2394};{95138;-85662;-2894;-2394};{94783;-86082;-2894;-2394};{95061;-87010;-2894;-2394}}        territory_end                                                                                                                       
npcmaker_ex_begin        [rune08_2215_58]        name=[rune08_2215_58m1]        ai=[default_maker]        maximum_npc=9                                                                                                               
npc_ex_begin        [brilliant_crown]        pos=anywhere        total=1        respawn=48sec        respawn_rand=15sec        npc_ex_end                                                                                               
npc_ex_begin        [brilliant_fang]        pos=anywhere        total=1        respawn=48sec        respawn_rand=15sec        npc_ex_end                                                                                               
npc_ex_begin        [brilliant_anguish]        pos=anywhere        total=1        respawn=48sec        respawn_rand=15sec        npc_ex_end                                                                                               
npcmaker_ex_end

u see my analysis is right! they are pos = anywhere which means random!

AND! look at {{95339;-87076;-2894;-2394};{95800;-86680;-2894;-2394};{95849;-85825;-2894;-2394};{95570;-85670;-2894;-2394};{95138;-85662;-2894;-2394};{94783;-86082;-2894;-2394};{95061;-87010;-2894;-2394}}

7 SIDES!! so, what we have to do to achieve more 'retail like' pos is to get a base from ur files, and do them all as retail by going to the places and making squares / pentagons / rectangles as necessary seen from l2wh and put pos = anywhere!

Do you understand what i mean by this pos? im not criticizing ur work hel, but im sayign to all that, we DONOT need pos = {x,y,z;direction} for ALL npcs in L2.. what we need is the castles / towns / other citizen pos = {x,y,z;direction} only! so We should concentrate on fixing that only and put max npc = some number and pos = anywhere for all rest territories for npcpos. Saves time & more retail like & less load on l2npc server imo. Only there will be a few exceptions.. like raidbosses maybe or some special mobs..

I hope my post was helpfull to u, ur this work is truely nice ^^ And ignore my typos =p

tpuNIsher 01.06.2007 08:18

Another thing, a bug report.
Code:

territory_begin        [giran04_npc2421_0358427]        {{154745;121047;-3807;-3707};{154745;121147;-3807;-3707};{154645;121147;-3807;-3707};{154645;121047;-3807;-3707}}        territory_end       
npcmaker_ex_begin        [giran04_npc2421_0358427]        name=[giran04_npc2421_035842701]        ai=[default_maker]        maximum_npc=1       
npc_ex_begin        [heart_of_warding]        pos={154695;121097;-3757;-3717}        total=1        respawn=60sec        npc_ex_end
npcmaker_ex_end

Format for pos is pos={x,y,z,direction}

The format there is {x,y,z,z2} ? :p

hel 01.06.2007 08:41

allright... :)
now i think about how to see, where use static, and where use random spawns... (i don't have c5 npcdata :\)
square 6 or 8 points territory will be enough?


nope, zmax and zmin diff is maximum 20
that's heading

madar 01.06.2007 09:07

the npc has to be spawn on a "static" pos and mobs can get the "anywhere" in pos imo

tpuNIsher 01.06.2007 09:11

Oh ic, but in npcpos, i haven't seen any zmin / zmax in pos=. i think the 4th param is direction in npcpos
so it's like pos={x;y;z;direction}

like: pos={147984;8486;-212;16389} direction is east/west/north/south.
Code:

npc_begin        [aden_bow_guard_s_e]        pos={147984;8486;-212;16389}        total=1        respawn=3hour        dbname=[aden_siege_067]        dbsaving={death_time;parameters;pos}        npc_end
And ah.. i think highest i have seen is 7/8 sided territory :p and thats for hugely big territorries. yah i think 7/8 will be enough.
And yes, i agree, all mobs should be like dynamic as in anywhere pos and citizens / town npcs should be "static".
We can always fix the ones needed to be fixed by hand later if needed.

P.S. I saw u don't have a c5 npcname list done yet, if you want i can do one for you npcname;id quickly like in few hrs.
I have almost all npcs done with ai class / npcdata ..(almost) ..just remaining all bosses and some dwarf schuttgart and dungeons mobs.
Only thing remaining was proper pos / droplist.. ^^
( i have been working on C5 npcs for 2 and a half monthes :P )

hel 01.06.2007 09:46

tpuNIsher:
yeah, thats fine :)
write me text file which contains, id;npc;random for example:
1;gremlin;0 //0 means pos=anywhere,1 means pos={static_coords}

thats will be enough. :)

madar:
i'll wait tpuNIsher for c5 npclist and correct that bug. :)

tpuNIsher 01.06.2007 09:50

K will be done in few hrs hopefully. btw see pm :P

tpuNIsher 01.06.2007 11:18

hum doing all citizen gonna take a long ass time :p
I can do them too maybe in few days :p

Code:

22001;grim_wolf;0
22002;grim_grizzly;0
22003;grave_robber_scout;0
22004;grave_robber_lookout;0
22005;grave_robber_ranger;0
22006;grave_robber_guard;0
22007;ghost_of_soldier;0
22008;grave_robber_fighter;0
22009;ghost_of_loyal_vassal;0
22010;ghost_of_general;0
22011;ghost_of_batur_chief;0
22012;ghost_of_batur_chief_a;0
22013;ghost_of_morek_chief;0
22014;ghost_of_morek_chief_a;0
22015;ghost_of_turka_chief;0
22016;ghost_of_turka_chief_a;0
22017;bandit_sweeper;0
22018;bandit_hound;0
22019;bandit_watchman;0
22020;snow_lynx;0
22021;bandit_undertaker;0
22022;bandit_assassin;0
22023;bandit_warrior;0
22024;bandit_inspector;0
22025;frozen_wasteland_werewolf;0
22026;bandit_captain;0
22027;forgotten_crewman;0
22028;vagabond_of_the_ruins;0
22029;ragna_orc;0
22030;ragna_orc_shaman;0
22031;ragna_orc_archer;0
22032;ragna_orc_warrior;0
22033;ragna_orc_mage;0
22034;ragna_orc_mage_a;0
22035;ragna_orc_mage_b;0
22036;ragna_orc_mage_c;0
22037;ragna_orc_healer;0
22038;ragna_orc_hero;0
22039;ragna_orc_commander;0
22040;ragna_orc_sniper;0
22041;ragna_orc_sorcerer;0
22042;ragna_orc_sorcerer_a;0
22043;ragna_orc_sorcerer_b;0
22044;ragna_orc_sorcerer_c;0
22045;dark_corpse;0
22046;varangka_dre_vanul;0
22047;guardian_ghost_town;0
22048;dark_spider;0
22049;varangka_succubus;0
22050;probe_golem_prodigy;0
22051;spelunking_spider;0
22052;jackhammer_golem_a;0
22053;cannon_golem_a;0
22054;cannon_golem_b;0
22055;cruel_vice_golem;0
22056;probe_golem_champion;0
22057;spelunking_ant;0
22058;excavator_golem;0
22059;ginzu_golem_a;0
22060;cannon_golem_c;0
22061;cannon_golem_d;0
22062;jackhammer_golem_b;0
22063;ginzu_golem_prodigy;0
22064;ginzu_golem_b;0
22065;ginzu_golem_c;0
22066;cannon_golem_e;0
22067;cannon_golem_f;0
22068;cannon_golem_g;0
22069;cannon_golem_h;0
22070;cannon_golem_i;0
22071;cannon_golem_j;0
22072;cannon_golem_k;0
22073;cannon_golem_l;0
22074;epic_cannon_golem_a;0
22075;epic_cannon_golem_adjunct;0
22076;ginzu_golem_d;0
22077;ginzu_golem_e;0
22078;ginzu_golem_f;0
22079;lost_bandersnatch;0
22080;big_maze_bandersnatch;0
22081;lost_watcher;0
22082;elder_lost_watcher;0
22083;baby_panthera;0
22084;panthera;0
22085;lost_gargoyle;0
22086;lost_gargoyle_youngling;0
22087;pronghorn_spirit;0
22088;pronghorn;0
22089;ice_tarantula;0
22090;frost_tarantula;0
22091;lost_iron_golem;0
22092;frost_iron_golem;0
22093;lost_buffalo;0
22094;frost_buffalo;0
22095;ursus_cub;0
22096;ursus;0
22097;lost_yeti;0
22098;frost_yeti;0
22099;freya_buffalo;0
22100;freya_gardener;0
22101;freya_servant;0
22102;freya_servant;0
22103;freya_white_bear;0
22104;freya_dog;0
22108;female_spiked_stakato;0
22109;male_spiked_stakato;0
22110;male_spiked_stakato;0
22111;spiked_stakato_sorcerer;0
22112;cannibal_stakato_follower;0
22113;cannibal_stakato_leader;0
22114;cannibal_stakato_leader;0
22117;spiked_stakato_captain;0
22118;spiked_stakato_nurse;0
22119;spiked_stakato_nurse;0
22120;spiked_stakato_baby;0
22121;spiked_stakato_shaman;0
22122;monastic_pilgrim;0
22123;monastic_crusader;0
22124;solina_brother;0
22125;solina_lay_brother;0
22126;silent_seeker;0
22127;silent_brother;0
22128;monastery_guardian;0
22129;warrior_monk;0
22130;divine_advocate;0
22131;pilgrim_of_light;0
22132;judge_of_light;0
22133;guardian_of_grail;0
22134;guardian_of_holy_land;0
22135;beholder_of_light;0
22136;gatekeeper_zombie;0
22137;penance_guard;0
22138;chapel_guard;0
22139;old_aristocrat_soldier;0
22140;zombie_worker;0
22141;forgotten_victim;0
22142;triol_layperson;0
22143;triol_believer_a;0
22144;resurrected_temple_knight;0
22145;ritual_sacrifice_a;0
22146;triol_priest_a;0
22147;ritual_offering_a;0
22148;triol_believer_b;0
22149;ritual_offering_b;0
22150;triol_believer_c;0
22151;triol_priest_b;0
22152;temple_guard;0
22153;temple_guard_capt;0
22154;ritual_sacrifice_b;0
22155;triol_high_priest_a;0
22156;triol_priest_c;0
22157;triol_priest_d;0
22158;triol_believer_d;0
22159;triol_high_priest_b;0
22160;triol_priest_e;0
22161;ritual_sacrifice_c;0
22162;triol_believer_e;0
22163;triol_high_priest_c;0
22164;triol_believer_f;0
22165;triol_priest_f;0
22166;triol_believer_g;0
22167;triol_high_priest_d;0
22168;triol_priest_g;0
22169;ritual_sacrifice_d;0
22170;triol_believer_h;0
22171;triol_high_priest_e;0
22172;ritual_sacrifice_e;0
22173;triol_priest_h;0
22174;triol_priest_i;0
22175;andreas_royal_guard_capt;0
22176;andreas_royal_guards;0
22177;hall_keeper_captain;0
22178;hall_keeper_wizard;0
22179;hall_keeper_guard;0
22180;hall_keeper_patrol;0
22181;hall_keeper_suicidal_soldier;0
22182;dark_choir_captain;0
22183;dark_choir_prima_donna;0
22184;dark_choir_lancer;0
22185;dark_choir_archer;0
22186;dark_choir_witch_doctor;0
22187;dark_choir_player;0
22188;andreas_royal_guard_capt_b;0
22189;andreas_royal_guards_b;0
22190;ritual_sacrifice_f;0
22191;andreas_royal_guard_capt_c;0
22192;andreas_royal_guards_c;0
22193;andreas_royal_guards_d;0
22194;penance_guard;0


hel 01.06.2007 14:35

you doing npclist by hands? O_O
give me npcdata (at least "warrior 1 [gremlin]" columns) and i'll make a script. :)

Guaresnay 01.06.2007 15:51

As I've been looking the script makes just one big area for each zone, so if you chage the pos to pos=anywhere then you will prolly have mobs behind the walls or smth like that.

mcrabben7 02.06.2007 05:28

Neo, lol, I could Ultraedit my entire C5 npcdata in like 2 minutes :P Why did you do it by hand xD?

Edit: list attached. All warriors + mimics + treasure chests have a 0 for random. Rest have 1.

P.S. If possible, I only care about C5 mobs which are from id 22001 to 22195. I have some mobs commented out that I haven't built yet, so those aren't in the list. They exist inbetween the ids 22001 and 22195.

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
hel_npc_list.rar — 37483 байт

tpuNIsher 02.06.2007 06:55

yah i didn't think of that xD

hel 02.06.2007 08:58

Quote:

Originally Posted by Guaresnay (Post 87406)
As I've been looking the script makes just one big area for each zone, so if you chage the pos to pos=anywhere then you will prolly have mobs behind the walls or smth like that.

yeah, but how to check real territory? :/ (it's not creating "one big area", it makes territory based on minimum and maximum coordinates from npcmaker list)
i've completed square-like 8-points territory generating, but think it's bad idea, than old...
it looks like this (points is square "corners", unbreakable lines is max and min x,y values, found in current npcmaker list):

---------.---------
---.____max____.---
---|-----------|---
. min--center--max .
---|-----------|---
---.____min____.---
---------.---------


Code:

{{-20000;110686;-2772;-2189};{-19950;113328;-2772;-2189};{-18249;113378;-2772;-2189};{-16548;113328;-2772;-2189};{-16498;110686;-2772;-2189};{-16548;108044;-2772;-2189};{-18249;107994;-2772;-2189};{-19950;108044;-2772;-2189}}
Quote:

Originally Posted by mcrabben7
Edit: list attached. All warriors + mimics + treasure chests have a 0 for random. Rest have 1.

:) thanks
now i'll download latest spawnlist, npc, castle siege guards from l2dp svn and will do next version.

hel 02.06.2007 14:33

mcrabben7:
your npclist has mistakes... for example all siege guards has 3rd value (rand) assigned to 0. (it's pos=anywhere, of course it's wrong)

btw, new version 0.5a uploaded, check 1st post.

mcrabben7 02.06.2007 22:28

Siege guards are warriors xD That's why.

hel 03.06.2007 06:23

mcrabben7:
for that reason i use static coords for all siege spawns.

what i need to do with territory? i don't think thats new territory generation is better than old... :(

Guaresnay 03.06.2007 06:40

No hel the new way is worst, b.c as i told u, it will spawn mobs behind walls or somewhere where ppl wont be able to see. For example pay a look at monastery of silence's positions, it's a big area for the whole geodata so u can't spawn mobs in random positions with this kind of areas

hel 03.06.2007 06:51

Guaresnay:
any ideas, how to generate good territory?
i have an idea, but it way hard to implement. :(

minor bug fixed, converter reuploaded.

Guaresnay 03.06.2007 15:50

I'm debuging one idea, i'll let u know if it works.

tpuNIsher 04.06.2007 11:32

idea is do it by hand lol :p

DevilsAssociate 08.06.2007 00:00

tpuNIsher LOL that would work too :P

great work with it hel.

was wondering if anyone else got this error or if it just me.

Code:

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:**/npcpos_class.php on line 12

hel 08.06.2007 08:01

there is no problems. script greatly works on my config, i'm using Apache/2.2.3, PHP 5.1.6.

DevilsAssociate 09.06.2007 00:05

I will update my version and i am sure that will fix it then. Thanks

Starting doing them by hand :P for the npcs I needed


All times are GMT. The time now is 23:01.