antiblock
Elveron
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
.Cadito

[MySQL] Converter queries mob_proto 2006 para 2010

4 posts in this topic

Olá Pessoal da Cyber-Gamers :)
Venho disponibilizar um tutorial feito pelo IvanSantos a demonstrar como converter as queries do mob_proto de 2006 para 2010

Introdução

Da passagem do sistema metin2 de 2006 para 2010, foram adicionadas 6 novas colunas ao mob_proto.
Neste tutorial, vais adicionar uma tabela nova mob_proto_2006. É nesta tabela que vão adicionar os mobs.
Depois, para converter, vão criar uma tabela chamada mob_proto_2010, que É uma tabela intermediária entre o mob_proto_2006 e o mob_proto normal. De seguida adicionam colunas ao mob_proto_2010 e depois copiam os valores para o mob_proto normal.

PASSO 1

Criar a tabela mob_proto 2006

Para a criação da tabela teremos de fazer uma simples querie que irei colocar em baixo

CREATE TABLE player.mob_proto_2006 (

`vnum` int(11) NOT NULL DEFAULT '0',

`name` varchar(24) NOT NULL DEFAULT 'Noname',

`locale_name` varbinary(24) NOT NULL DEFAULT 'Noname',

`rank` tinyint(2) NOT NULL DEFAULT '0',

`type` tinyint(2) NOT NULL DEFAULT '0',

`battle_type` tinyint(1) NOT NULL DEFAULT '0',

`level` smallint(3) NOT NULL DEFAULT '1',

`size` enum('SMALL','MEDIUM','BIG') NOT NULL DEFAULT 'SMALL',

`ai_flag` set('AGGR','NOMOVE','COWARD','NOATTSHINSU','NOATTCHUNJO','NOATTJINNO','ATTMOB','BERSERK','STONESKIN','GODSPEED','DEATHBLOW','REVIVE') DEFAULT NULL,

`mount_capacity` tinyint(2) NOT NULL DEFAULT '0',

`setRaceFlag` set('ANIMAL','UNDEAD','DEVIL','HUMAN','ORC','MILGYO','INSECT','FIRE','ICE','DESERT') NOT NULL DEFAULT '',

`setImmuneFlag` set('STUN','SLOW','FALL','CURSE','POISON','TERROR') NOT NULL DEFAULT '',

`empire` tinyint(4) NOT NULL DEFAULT '0',

`folder` varchar(100) NOT NULL DEFAULT '',

`on_click` tinyint(4) NOT NULL DEFAULT '0',

`st` smallint(5) unsigned NOT NULL DEFAULT '0',

`dx` smallint(5) unsigned NOT NULL DEFAULT '0',

`ht` smallint(5) unsigned NOT NULL DEFAULT '0',

`iq` smallint(5) unsigned NOT NULL DEFAULT '0',

`damage_min` smallint(5) unsigned NOT NULL DEFAULT '0',

`damage_max` smallint(5) unsigned NOT NULL DEFAULT '0',

`max_hp` int(10) unsigned NOT NULL DEFAULT '0',

`regen_cycle` tinyint(3) unsigned NOT NULL DEFAULT '0',

`regen_percent` tinyint(3) unsigned NOT NULL DEFAULT '0',

`gold_min` int(11) NOT NULL DEFAULT '0',

`gold_max` int(11) NOT NULL DEFAULT '0',

`exp` int(10) NOT NULL DEFAULT '0',

`def` smallint(5) unsigned NOT NULL DEFAULT '0',

`attack_speed` smallint(6) unsigned NOT NULL DEFAULT '100',

`move_speed` smallint(6) unsigned NOT NULL DEFAULT '100',

`aggressive_hp_pct` tinyint(3) unsigned NOT NULL DEFAULT '0',

`aggressive_sight` smallint(10) unsigned NOT NULL DEFAULT '0',

`attack_range` smallint(5) unsigned NOT NULL DEFAULT '0',

`drop_item` int(10) unsigned NOT NULL DEFAULT '0',

`resurrection_vnum` int(10) unsigned NOT NULL DEFAULT '0',

`enchant_curse` tinyint(4) unsigned NOT NULL DEFAULT '0',

`enchant_slow` tinyint(4) unsigned NOT NULL DEFAULT '0',

`enchant_poison` tinyint(4) unsigned NOT NULL DEFAULT '0',

`enchant_stun` tinyint(3) unsigned NOT NULL DEFAULT '0',

`enchant_critical` tinyint(3) unsigned NOT NULL DEFAULT '0',

`enchant_penetrate` tinyint(3) unsigned NOT NULL DEFAULT '0',

`resist_sword` tinyint(4) NOT NULL DEFAULT '0',

`resist_twohand` tinyint(4) NOT NULL DEFAULT '0',

`resist_dagger` tinyint(4) NOT NULL DEFAULT '0',

`resist_bell` tinyint(4) NOT NULL DEFAULT '0',

`resist_fan` tinyint(4) NOT NULL DEFAULT '0',

`resist_bow` tinyint(4) NOT NULL DEFAULT '0',

`resist_fire` tinyint(4) NOT NULL DEFAULT '0',

`resist_elect` tinyint(4) NOT NULL DEFAULT '0',

`resist_magic` tinyint(4) NOT NULL DEFAULT '0',

`resist_wind` tinyint(4) NOT NULL DEFAULT '0',

`resist_poison` tinyint(4) NOT NULL DEFAULT '0',

`dam_multiply` float DEFAULT NULL,

`summon` int(11) DEFAULT NULL,

`drain_sp` int(11) DEFAULT NULL,

`mob_color` int(10) unsigned DEFAULT NULL,

`polymorph_item` int(10) unsigned NOT NULL DEFAULT '0',

`skill_level0` tinyint(3) unsigned DEFAULT NULL,

`skill_vnum0` int(10) unsigned DEFAULT NULL,

`skill_level1` tinyint(3) unsigned DEFAULT NULL,

`skill_vnum1` int(10) unsigned DEFAULT NULL,

`sp_berserk` tinyint(4) NOT NULL DEFAULT '0',

`sp_stoneskin` tinyint(4) NOT NULL DEFAULT '0',

`sp_godspeed` tinyint(4) NOT NULL DEFAULT '0',

`sp_deathblow` tinyint(4) NOT NULL DEFAULT '0',

`sp_revive` tinyint(4) NOT NULL DEFAULT '0',

PRIMARY KEY (`vnum`)

) ENGINE=MyISAM DEFAULT CHARSET=big5;

PASSO 2

Abrem o Notepad++ e coloquem lá as queries que gostariam de colocar no vosso mob_proto

onde diz mob_proto alteram para mob_proto_2006

Aqui está uma imagem para vos ajudar

http://img826.imageshack.us/img826/9870/print1l.png

ps: sempre podem usar o substituir para vos facilitar a vida e não ser tão cansativo para substituir carreguem naquele icon que são uns binóculos

PASSO 3

Coloquem as queries no navicat

e façam run ( como É óbvio )

de seguida coloquem estas façam está querie

DROP TABLE IF EXISTS player.mob_proto_2010;
CREATE TABLE player.mob_proto_2010 LIKE player.mob_proto_2006;
INSERT player.mob_proto_2010 SELECT * FROM player.mob_proto_2006;
ALTER TABLE player.mob_proto_2010 ADD `skill_level2` tinyint(3) unsigned default NULL;
ALTER TABLE player.mob_proto_2010 ADD `skill_vnum2` int(10) unsigned default NULL;
ALTER TABLE player.mob_proto_2010 ADD `skill_level3` tinyint(3) unsigned default NULL;
ALTER TABLE player.mob_proto_2010 ADD `skill_vnum3` int(10) unsigned default NULL;
ALTER TABLE player.mob_proto_2010 ADD `skill_level4` tinyint(3) unsigned default NULL;
ALTER TABLE player.mob_proto_2010 ADD `skill_vnum4` int(10) unsigned default NULL;
INSERT player.mob_proto SELECT * FROM player.mob_proto_2010;








Pessoal sempre que quiserem adicionar novas queries repitam o PASSO 2 e o PASSO 3

CrÉditos: IvanSantos

Pessoal se gostaram do tutorial sempre podem carregar no botão "+"

pois talvez irei publicar mais tutoriais da minha autoria e outros não.

Share this post


Link to post
Share on other sites
antiblock
Elveron

Obrigado por partilhares com comunidade.Continua.CumprimentosP.s Creditos nao e so para o ivan para proxima coloca o site.

Share this post


Link to post
Share on other sites

Obrigado pela dica PowerOffPara a próxima com certeza irei colocar o site de onde retirei o tutorialCumprimentos

Share this post


Link to post
Share on other sites

Deveria colocar no ENGINE = InnoDB.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this