NPCDATA Import / Export - mySQL/PHP

Теги:
 

Forb

новичок
Сабж. На ПП сделали тулзу, которой можно импортировать, экспортировать данные с офф сервера ;)


Greetings,

I shared part of this on RZ in the past; but thought I would share our entire system for managing npc data herehttp://l2.hopzone.net/vote.php?site=2633 on PP.

The following PHP and SQL scripts will allow you to manage your NPC data through mySQL. If you use this and then use something like PHPmyAdmin, you can edit npcdata alot faster, perform complex searches and etc. Its much better than editing in a text editor or Excel. It will also help you to maintain a master npc database having multiple people contribute to the editing.

Also, the SQL has many of the pre-defined npc options already defined. So when it comes to adding new npcs and etc, you can make use of drop down menus and etc making the job much easier.

These scrips make use of the iconv library for PHP to convert the npcdata.txt from UTF-16 into ASCII automatically and viceversa. There is no need for you to save it as ASCII before trying to import it as the script will auto convert it. Same with the export, as it will save as Unicode 16 LE.

You will need to change some values in the php script such as your mysql username, password and possibly path to your npcdata.txt.

There are 3 files included with this release.

isogames_npc.sql - Contains the sql for mySQL
npc_import.php - Imports UTF-16 npcdata.txt into an empty database
npc_export.php - Exports UTF-16 npcdata.txt from the contents of the database

Hope some of you find this useful. This is used by isoGames in our day to day management of npc data. It is mostly bug free. If you have problems with the import, it is more than likeley due to improperly formatted npcdata.txt. If you make sure there are no spaces in the file, then you should be fine.

http://www.postpacific.com/forum/viewtopic.php?t=2704
 

Forb

новичок
Вот кусок полученного sql кода

CREATE TABLE `npcdata` (
`id` int(12) NOT NULL auto_increment,
`class` enum('warrior','merchant','warehouse_keeper','teleporter','citizen','guild_coach','guild_master','guard','package_keeper','summon','object','temptrainer','holything','castle_gate','house_master','blacksmith','boss','pet','chamberlain') NOT NULL default 'warrior',
`title` varchar(75) NOT NULL default '',
`level` int(2) NOT NULL default '1',
`exp` decimal(12,3) NOT NULL default '1.000',
`acquire_exp_rate` varchar(50) NOT NULL default '1,1',
`undying` enum('0','1') NOT NULL default '0',
`can_be_attacked` enum('0','1') NOT NULL default '1',
`acquire_sp` int(12) NOT NULL default '1',
`race` enum('divine','fairy','animal','humanoid','plant','elemental','undead','construct','bug','beast','demonic','monster','dragon','giant','human','dwarf','elf','darkelf','orc','mercenary','castle_guard') NOT NULL default 'fairy',
`sex` enum('male','female') NOT NULL default 'male',
`temper` int(3) NOT NULL default '100',
`safe_height` int(4) NOT NULL default '100',
`org_jump` int(2) NOT NULL default '0',
`skill_list` text,
`magic_list` text,
`max_item` int(3) NOT NULL default '0',
`item_make_list` text,
`corpse_make_list` text,
`additional_make_list` text,
`additional_make_multi_list` text,
`slot_chest` varchar(50) default NULL,
`slot_rhand` varchar(50) default NULL,
`slot_lhand` varchar(50) default NULL,
`base_attack_type` enum('fist','blunt','bow','sword','dagger','pole','none') NOT NULL default 'none',
`base_can_penetrate` enum('0','1') NOT NULL default '0',
`base_attack_range` int(4) NOT NULL default '0',
`base_damage_range` varchar(20) NOT NULL default '{0;0;0;0}',
`base_rand_dam` int(4) NOT NULL default '0',
`str` int(3) NOT NULL default '0',
`int` int(3) NOT NULL default '0',
`dex` int(3) NOT NULL default '0',
`wit` int(3) NOT NULL default '0',
`con` int(3) NOT NULL default '0',
`men` int(3) NOT NULL default '0',
`hp_increase` int(3) NOT NULL default '0',
`mp_increase` int(2) NOT NULL default '0',
`org_hp_regen` decimal(4,1) NOT NULL default '0.0',
`org_mp_regen` decimal(4,1) NOT NULL default '0.0',
`ground_low` varchar(15) NOT NULL default '{0;0;0}',
`ground_high` varchar(15) NOT NULL default '{0;0;0}',
`underwater_low` varchar(15) NOT NULL default '{0;0;0}',
`underwater_high` varchar(15) NOT NULL default '{0;0;0}',
`fly_low` varchar(15) NOT NULL default '{0;0;0}',
`fly_high` varchar(15) NOT NULL default '{0;0;0}',
`float_low` varchar(15) NOT NULL default '{0;0;0}',
`float_high` varchar(15) NOT NULL default '{0;0;0}',
`org_earshot` int(3) NOT NULL default '0',
`sight` varchar(20) NOT NULL default '{0;0;0;0;0}',
`agro_range` int(4) NOT NULL default '0',
`org_hp` decimal(22,13) NOT NULL default '0.0000000000000',
`org_mp` decimal(12,3) NOT NULL default '0.000',
`base_defend` decimal(24,13) NOT NULL default '0.0000000000000',
`base_magic_attack` decimal(24,13) NOT NULL default '0.0000000000000',
`base_magic_defend` decimal(24,13) NOT NULL default '0.0000000000000',
`base_physical_attack` decimal(24,13) NOT NULL default '0.0000000000000',
`physical_hit_modify` decimal(4,2) NOT NULL default '0.00',
`physical_avoid_modify` enum('0','1','-18') NOT NULL default '0',
`base_attack_speed` int(3) NOT NULL default '253',
`base_reuse_delay` int(4) NOT NULL default '0',
`base_critical` enum('1','4','8') NOT NULL default '1',
`magic_use_speed_modify` int(1) NOT NULL default '0',
`status` varchar(10) NOT NULL default '{normal}',
`align` int(4) NOT NULL default '0',
`collision_radius` decimal(4,1) NOT NULL default '0.0',
`collision_height` decimal(4,1) NOT NULL default '0.0',
`category` varchar(10) NOT NULL default '{}',
`clan` enum('{}','{@goblin_clan}','{@demonic_clan}','{@orc_clan}','{-1}','{@lizardman_clan}','{@werewolf_clan}','{@elemental1_clan}','{@skeleton_clan}','{@elemental2_clan}','{@wererat_clan}','{@ol_mahum_clan}','{@bugbear_clan}','{@scropio_clan}','{@ant_clan}','{@elemental3_clan}','{@elemental4_clan}','{@all_elemental_clan}','{@all_elemental2_clan}','{@undead_clan}','{@dragon_clan}','{@mandragora_clan}','{@stakato_clan}','{@neer_crawler_clan}','{@oel_mahum_clan}','{@serpent_clan}','{@silenos_clan}','{@tyrant_clan}','{@wolf_clan}','{@porta_clan}','{@torfe_clan}','{@giant_leech_clan}','{@cave_servant_clan}','{@succubus_clan}','{@ghost_clan}','{@monster_eye_clan}','{@elemental_clan}','{@kobold_clan}','{@malruk_clan}','{@mirrorforest_clan}','{@giant_clan}','{@hatar_clan}','{@partisan_clan}','{@q403_clan}','{@abyss_jewel_clan}','{@grave_guard_clan}','{@grave_keeper_clan}','{@door_clan;@gludio_siege_clan}','{@orfen_clan}','{@door_clan;@oren_siege_clan}','{@door_clan;@aden_siege_clan}','{@door_clan;@mercenary_siege_clan}','{@queen_ant_clan}','{@curma_core_clan}','{@door_clan;@dion_siege_clan}','{@door_clan;@giran_siege_clan}') NOT NULL default '{}',
`clan_help_range` int(4) NOT NULL default '0',
`guild` varchar(10) NOT NULL default '{}',
`pledge` varchar(10) NOT NULL default '{}',
`pledge_leader` int(1) NOT NULL default '0',
`alliance` varchar(10) NOT NULL default '{}',
`alliance_leader` int(1) NOT NULL default '0',
`ignore_clan_list` text,
`ruler` int(1) NOT NULL default '0',
`ruling_domain` varchar(10) NOT NULL default '{}',
`npc_ai` text,
`corpse_time` int(3) NOT NULL default '0',
`no_sleep_mode` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=ascii AUTO_INCREMENT=12372 ;

--
-- Дамп данных таблицы `npcdata`
--

INSERT INTO `npcdata` VALUES (1, 'warrior', '[gremlin]', 1, '1.000', '29.39', '0', '1', 2, 'fairy', 'male', 100, 100, 15, '{}', '{}', 50, '{}', '{{[magic_ring];1;1;12.0603};{[stem];1;1;3.9799}}', '{}', '{{{{[adena];7;10;100}};70};{{{[apprentice''s_shoes];1;1;63.7931};{[cloth_shoes];1;1;12.069};{[leather_sandals];1;1;12.069};{[short_gloves];1;1;12.0689}};10.9692};{{{[stem];1;1;75};{[suede];1;1;25}};1.3062}}', '[]', '[]', '[]', 'fist', '0', 40, '{0;0;80;120}', 30, 40, 21, 30, 20, 43, 10, 10, 3, '2.0', '0.9', '{20;0;10}', '{50;-30;30}', '{50;0;10}', '{0;0;30}', '{0;0;10}', '{0;-30;30}', '{0;0;10}', '{0;-30;30}', 100, '{0;0;2500;120;5}', 1000, '41.0281717042200', '40.000', '45.8791162425050', '5.7870370370370', '32.5225155877150', '4.1291204618255', '4.75', '0', 253, 0, '4', 0, '{normal}', -1, '10.0', '15.0', '{}', '{}', 300, '{}', '{}', 0, '{}', 0, '{}', 0, '{}', '{[gremlin]}', 7, '0');
INSERT INTO `npcdata` VALUES (2, 'warrior', '[rabbit]', 1, '1.000', '29.39', '0', '1', 2, 'animal', 'male', 100, 100, 18, '{@s_animal_weakness}', '{}', 50, '{}', '{}', '{}', '{}', '[]', '[]', '[]', 'fist', '0', 40, '{0;0;0;0}', 30, 40, 21, 30, 20, 43, 10, 10, 3, '2.0', '0.9', '{50;0;10}', '{80;-30;30}', '{50;0;10}', '{0;0;30}', '{0;0;10}', '{0;-30;30}', '{0;0;10}', '{0;-30;30}', 100, '{0;0;2500;120;5}', 1000, '41.0281717042200', '40.000', '45.8791162425050', '5.7870370370370', '32.5225155877150', '4.1291204618255', '4.75', '0', 253, 0, '4', 0, '{normal}', -1, '5.0', '3.8', '{}', '{}', 300, '{}', '{}', 0, '{}', 0, '{}', 0, '{}', '{[rabbit]}', 7, '0');
INSERT INTO `npcdata` VALUES (3, 'warrior', '[goblin]', 5, '2885.100', '5.88', '0', '1', 4, 'humanoid', 'male', 100, 100, 15, '{}', '{}', 50, '{}', '{{[charcoal];1;1;7.007};{[magic_ring];1;1;42.4667}}', '{}', '{{{{[adena];25;35;100}};70};{{{[apprentice''s_earing];1;1;30.9859};{[magic_ring];1;1;46.0094};{[necklace_of_magic];1;1;23.0047}};15.1467};{{{[varnish];1;1;11.3636};{[coal];1;1;11.3636};{[charcoal];1;1;11.3636};{[rp_bow];1;1;9.0909};{[wooden_arrow];20;39;56.8183}};6.0713}}', '[]', '[club]', '[]', 'blunt', '0', 40, '{0;0;80;120}', 50, 40, 21, 30, 20, 43, 10, 10, 3, '2.0', '0.9', '{40;0;10}', '{110;-30;30}', '{50;0;10}', '{0;0;30}', '{0;0;10}', '{0;-30;30}', '{0;0;10}', '{0;-30;30}', 100, '{0;0;2500;120;5}', 1000, '82.7611867683000', '69.600', '53.2713596112040', '8.4266626354167', '37.7626851872310', '12.7384005158720', '9.00', '0', 253, 0, '1', 0, '{normal}', -25, '10.0', '15.0', '{}', '{@goblin_clan}', 300, '{}', '{}', 0, '{}', 0, '{}', 0, '{}', '{[goblin]}', 7, '0');
INSERT INTO `npcdata` VALUES (4, 'warrior', '[imp]', 6, '6038.800', '4.9', '0', '1', 5, 'fairy', 'male', 100, 100, 15, '{@s_floating_target}', '{}', 50, '{}', '{{[suede];1;1;6.4142};{[willow_staff_head];1;1;0.6872}}', '{}', '{{{{[adena];34;48;100}};70};{{{[short_leather_gloves];1;1;33.3333};{[cotton_shoes];1;1;33.3333};{[crude_leather_shoes];1;1;33.3334}};2.4971};{{{[stem];1;1;75};{[suede];1;1;25}};2.5262}}', '[]', '[]', '[]', 'fist', '0', 40, '{0;0;80;120}', 30, 40, 21, 30, 20, 43, 10, 10, 3, '2.0', '0.9', '{60;0;10}', '{80;-30;30}', '{50;0;10}', '{0;0;30}', '{0;0;10}', '{0;-30;30}', '{0;0;10}', '{0;-30;30}', 100, '{0;0;2500;120;5}', 1000, '96.5611083151970', '77.200', '55.2618019067400', '9.2356222484167', '39.1736581066060', '13.9612869653960', '4.75', '0', 253, 0, '4', 0, '{normal}', -36, '10.0', '24.0', '{}', '{@demonic_clan}', 300, '{}', '{}', 0, '{}', 0, '{}', 0, '{}', '{[imp]}', 7, '0');
INSERT INTO `npcdata` VALUES (5, 'warrior', '[imp_ribe]', 7, '11287.550', '4.2', '0', '1', 7, 'fairy', 'male', 100, 100, 15, '{@s_floating_target}', '{}', 50, '{}', '{{[lesser_healing_potion];1;1;26.7647};{[suede];1;1;8.0294}}', '{}', '{{{{[adena];42;59;100}};70};{{{[small_shield];1;1;58.8121};{[leather_cap];1;1;41.1879}};2.5284};{{{[stem];1;1;75};{[suede];1;1;25}};3.1624}}', '[]', '[]', '[]', 'fist', '0', 40, '{0;0;80;120}', 30, 40, 21, 30, 20, 43, 10, 10, 3, '2.0', '0.9', '{60;0;10}', '{80;-30;30}', '{50;0;10}', '{0;0;30}', '{0;0;10}', '{0;-30;30}', '{0;0;10}', '{0;-30;30}', 100, '{0;0;2500;120;5}', 1000, '108.4225405935500', '84.880', '55.5189360613720', '10.1130063620160', '40.6263479280590', '16.2905105872210', '4.75', '0', 253, 0, '4', 0, '{normal}', -49, '10.0', '24.0', '{}', '{@demonic_clan}', 300, '{}', '{}', 0, '{}', 0, '{}',0, '{}', '{[imp_ribe]}', 7, '0');
INSERT INTO `npcdata` VALUES (6, 'warrior', '[orc_archer]', 8, '19423.550', '3.67', '0', '1', 8, 'humanoid', 'male', 100, 100, 15, '{}', '{}', 50, '{}', '{{[lesser_healing_potion];1;1;34.2744};{[mage_earing];1;1;3.8036}}', '{}', '{{{{[adena];55;75;100}};70};{{{[bow];1;1;18.3007};{[bow_shaft];1;1;81.6993}};0.5311};{{{[stem];1;1;22.4101};{[suede];1;1;7.47};{[rp_leather_tunic];1;1;14.0944};{[wooden_arrow];20;39;56.0255}};6.7765}}', '[]', '[bow]', '[]', 'bow', '0', 500, '{0;0;10;0}', 10, 40, 21, 30, 20, 43, 10, 10, 3, '2.0', '0.9', '{45;0;10}', '{110;-30;30}', '{50;0;10}', '{0;0;30}', '{0;0;10}', '{0;-30;30}', '{0;0;10}', '{0;-30;30}', 100, '{0;0;2500;120;5}', 1000, '128.9609811015200', '92.640', '59.4201419766180', '11.0636289600460', '42.1213975318120', '37.1621600666830', '0.00', '0', 227, 1500, '8', 0, '{normal}', -64, '14.0', '25.0', '{}', '{@orc_clan}', 300, '{}', '{}', 0, '{}', 0, '{}', 0, '{}', '{[orc_archer]}', 7, '0');
Отсюда видим офф дроплист, и офф статы :D
 
AD Реклама Google — средство выживания форумов :)

Murkt

Pythoneer

"офф" дроплист и статы, не забывай об этом. У них мобы - не особо лучше, чем у нас. А где и лучше - так точно не в выкладываемых сборках :)

Например, в той сборке с ПП skilldata вся идиотская. Как можно с увеличением уровня дебаффа увеличивать у него lv_bonus_rate? Один идиот написал, остальные скопировали... И я не думаю, что там лучше с мобами. С геодатой там точно не лучше, она-то там есть на новые зоны... Но в ТоИ людям приходится гейткиперов расставлять возле каждой лестницы :D а то вниз проваливаются.
[team Їжачки - сумні падлюки]  

в начало страницы | новое
 
Поиск
Настройки
Твиттер сайта
Статистика
Рейтинг@Mail.ru