挺久以前写的装备升级数据生成语句,可以直接拿去修改下
- /*一些属性倍率*/
- set @lv1 = 1.320;
- set @lv2 = 1.680;
- set @lv3 = 2.080;
- /*武器伤害倍率*/
- set @lv1_dmg = 1.320;
- set @lv2_dmg = 1.680;
- set @lv3_dmg = 2.080;
-
- /*预先清理数据*/
- DROP TABLE IF EXISTS item_up;
- DELETE FROM item_template_custom WHERE entry>=100000 and entry <= 1000000;
- DELETE FROM item_template WHERE entry>=100000 and entry <= 1000000;
-
- DELETE FROM disenchant_loot_template WHERE entry>=100000 and entry <= 1000000;
-
- DROP TABLE IF EXISTS item_template_copy;
- DROP TABLE IF EXISTS item_1;
- DROP TABLE IF EXISTS item_2;
- DROP TABLE IF EXISTS item_3;
- DROP TABLE IF EXISTS up1;
- DROP TABLE IF EXISTS up2;
- DROP TABLE IF EXISTS up3;
-
- CREATE TABLE `item_up` (
- `oldItemEntry` int(20) NOT NULL DEFAULT '0',
- `oldItemCount` int(20) DEFAULT '1',
- `newItemEntry` int(20) DEFAULT '0',
- `chance` tinyint(3) DEFAULT '100',
- `clEntry1` int(20) DEFAULT '0',
- `clCount1` int(20) DEFAULT '0',
- `clEntry2` int(20) DEFAULT '0',
- `clCount2` int(20) DEFAULT '0',
- `clEntry3` int(20) DEFAULT '0',
- `clCount3` int(20) DEFAULT '0',
- `clEntry4` int(20) DEFAULT '0',
- `clCount4` int(20) DEFAULT '0',
- `clEntry5` int(20) DEFAULT '0',
- `clCount5` int(20) DEFAULT '0',
- PRIMARY KEY (`oldItemEntry`)
- ) ENGINE=MyISAM DEFAULT CHARSET=gbk;
-
- CREATE TEMPORARY TABLE item_template_copy (select * from item_template);
- ALTER TABLE `item_template_copy` ADD PRIMARY KEY (`entry`);
- REPLACE into item_template_copy select * from item_template_custom;
-
- /*选择物品等级和品质大于等于1的装备生成升级数据*/
- CREATE TEMPORARY TABLE item_1 (select * from item_template_copy where entry<100000 and (class = 4 or class = 2) and ItemLevel >= 1 and Quality >= 1);
- CREATE TEMPORARY TABLE item_2 (select * from item_1);
- CREATE TEMPORARY TABLE item_3 (select * from item_1);
-
- CREATE TEMPORARY TABLE up1 select * from item_up;
- CREATE TEMPORARY TABLE up2 select * from item_up;
- CREATE TEMPORARY TABLE up3 select * from item_up;
-
- /*移除多余数据,使物品数据缺失导致某些物品不能升级
- 目的
- 普通->lv1 所有可升级
- lv1(青铜)->lv2(白银) 因为移除白银装等少于200的物品 所以导致部分装等小于200的青铜不能再次升级为白银
- lv2(白银)->lv3(黄金) 同理使得装等小于251的装备不能升级到黄金*/
- delete from item_2 where itemlevel < 200;/*移除装等少于200的白银装备*/
- delete from item_3 where itemlevel < 251;/*移除装等少于251的黄金装备*/
-
- INSERT INTO up1 (oldItemEntry) (select entry from item_1);
- INSERT INTO up2 (oldItemEntry) (select entry from item_2);
- INSERT INTO up3 (oldItemEntry) (select entry from item_3);
-
- update item_1 set name=concat(name,'◇英勇青铜');
- update item_1 set entry = entry + 100000;
- UPDATE item_1 SET stat_value1 = stat_value1*@lv1;
- UPDATE item_1 SET stat_value2 = stat_value2*@lv1;
- UPDATE item_1 SET stat_value3 = stat_value3*@lv1;
- UPDATE item_1 SET stat_value4 = stat_value4*@lv1;
- UPDATE item_1 SET stat_value5 = stat_value5*@lv1;
- UPDATE item_1 SET stat_value6 = stat_value6*@lv1;
- UPDATE item_1 SET stat_value7 = stat_value7*@lv1;
- UPDATE item_1 SET stat_value8 = stat_value8*@lv1;
- UPDATE item_1 SET stat_value9 = stat_value9*@lv1;
- UPDATE item_1 SET stat_value10 = stat_value10*@lv1;
- UPDATE item_1 SET armor = armor*@lv1;
- UPDATE item_1 SET holy_res = holy_res*@lv1;
- UPDATE item_1 SET fire_res = fire_res*@lv1;
- UPDATE item_1 SET nature_res = nature_res*@lv1;
- UPDATE item_1 SET frost_res = frost_res*@lv1;
- UPDATE item_1 SET shadow_res = shadow_res*@lv1;
- UPDATE item_1 SET arcane_res = arcane_res*@lv1;
- UPDATE item_1 SET dmg_min1 = dmg_min1*@lv1_dmg;
- UPDATE item_1 SET dmg_max1 = dmg_max1*@lv1_dmg;
- UPDATE item_1 SET SellPrice = SellPrice*1;
- update item_1 set maxcount = 3 where maxcount <= 1;
- update item_1 set DisenchantID = entry,RequiredDisenchantSkill = 0;
-
- update item_2 set name=concat(name,'◇不屈白银');
- update item_2 set entry = entry + 200000;
- UPDATE item_2 SET stat_value1 = stat_value1*@lv2;
- UPDATE item_2 SET stat_value2 = stat_value2*@lv2;
- UPDATE item_2 SET stat_value3 = stat_value3*@lv2;
- UPDATE item_2 SET stat_value4 = stat_value4*@lv2;
- UPDATE item_2 SET stat_value5 = stat_value5*@lv2;
- UPDATE item_2 SET stat_value6 = stat_value6*@lv2;
- UPDATE item_2 SET stat_value7 = stat_value7*@lv2;
- UPDATE item_2 SET stat_value8 = stat_value8*@lv2;
- UPDATE item_2 SET stat_value9 = stat_value9*@lv2;
- UPDATE item_2 SET stat_value10 = stat_value10*@lv2;
- UPDATE item_2 SET armor = armor*@lv2;
- UPDATE item_2 SET holy_res = holy_res*@lv2;
- UPDATE item_2 SET fire_res = fire_res*@lv2;
- UPDATE item_2 SET nature_res = nature_res*@lv2;
- UPDATE item_2 SET frost_res = frost_res*@lv2;
- UPDATE item_2 SET shadow_res = shadow_res*@lv2;
- UPDATE item_2 SET arcane_res = arcane_res*@lv2;
- UPDATE item_2 SET dmg_min1 = dmg_min1*@lv2_dmg;
- UPDATE item_2 SET dmg_max1 = dmg_max1*@lv2_dmg;
- UPDATE item_2 SET SellPrice = SellPrice*1;
- update item_2 set maxcount = 3 where maxcount <= 1;
- update item_2 set DisenchantID = entry,RequiredDisenchantSkill = 0;
-
- update item_3 set name=concat(name,'◇荣耀黄金');
- update item_3 set entry = entry + 300000;
- UPDATE item_3 SET stat_value1 = stat_value1*@lv3;
- UPDATE item_3 SET stat_value2 = stat_value2*@lv3;
- UPDATE item_3 SET stat_value3 = stat_value3*@lv3;
- UPDATE item_3 SET stat_value4 = stat_value4*@lv3;
- UPDATE item_3 SET stat_value5 = stat_value5*@lv3;
- UPDATE item_3 SET stat_value6 = stat_value6*@lv3;
- UPDATE item_3 SET stat_value7 = stat_value7*@lv3;
- UPDATE item_3 SET stat_value8 = stat_value8*@lv3;
- UPDATE item_3 SET stat_value9 = stat_value9*@lv3;
- UPDATE item_3 SET stat_value10 = stat_value10*@lv3;
- UPDATE item_3 SET armor = armor*@lv3;
- UPDATE item_3 SET holy_res = holy_res*@lv3;
- UPDATE item_3 SET fire_res = fire_res*@lv3;
- UPDATE item_3 SET nature_res = nature_res*@lv3;
- UPDATE item_3 SET frost_res = frost_res*@lv3;
- UPDATE item_3 SET shadow_res = shadow_res*@lv3;
- UPDATE item_3 SET arcane_res = arcane_res*@lv3;
- UPDATE item_3 SET dmg_min1 = dmg_min1*@lv3_dmg;
- UPDATE item_3 SET dmg_max1 = dmg_max1*@lv3_dmg;
- UPDATE item_3 SET SellPrice = SellPrice*1;
- update item_3 set maxcount = 3 where maxcount <= 1;
- update item_3 set DisenchantID = entry,RequiredDisenchantSkill = 0;
-
- insert into item_template_copy select * from item_1;
- insert into item_template_copy select * from item_2;
- insert into item_template_copy select * from item_3;
-
- insert into item_template_custom select * from item_1;
- insert into item_template_custom select * from item_2;
- insert into item_template_custom select * from item_3;
-
- /*升级表配置,我都按照装等设置数量*/
- update up1 a,item_template_copy b set a.oldItemCount = 1,a.newItemEntry = a.oldItemEntry + 100000,
- a.chance = 100 - (b.itemlevel) * 0.09,
-
- /*霜纹布 公式:装等*品质*0.05
- 例子:
- 装等10 绿装 10*2*0.05=1
- 装等200紫装 200*4*0.05=40
- 装等277紫装 277*4*0.05=55.4 */
- clEntry1 = 0, clCount1 = (b.itemlevel)* b.Quality * 2500,
- clEntry2 = 33470, clCount2 = (b.itemlevel)* b.Quality * 0.05,
- clEntry3 = 33568, clCount3 = (b.itemlevel)* b.Quality * 0.03,
- clEntry4 = 36912, clCount4 = (b.itemlevel) * b.Quality* 0.033
- where a.oldItemEntry = b.entry;
-
- update up2 a,item_template_copy b set a.oldItemCount = 2,a.oldItemEntry = a.oldItemEntry + 100000,a.newItemEntry = a.oldItemEntry + 200000,
- a.chance = (90 - (b.itemlevel) * 0.12),
- clEntry1 = 0, clCount1 = (b.itemlevel)* b.Quality * 6250,
- clEntry2 = 41510, clCount2 = (b.itemlevel) * b.Quality* 0.02,
- clEntry3 = 38425, clCount3 = (b.itemlevel) * b.Quality* 0.01,
- clEntry4 = 36913, clCount4 = (b.itemlevel) * b.Quality* 0.029
- where a.oldItemEntry = b.entry;
-
- update up3 a,item_template_copy b set a.oldItemCount = 3,a.oldItemEntry = a.oldItemEntry + 200000,a.newItemEntry = a.oldItemEntry + 300000,
- a.chance = 80 - (b.itemlevel) * 0.15,
- clEntry1 = 0, clCount1 = (b.itemlevel)* b.Quality * 25000,
- clEntry2 = 41511, clCount2 = (b.itemlevel)* b.Quality * 0.038,
- clEntry3 = 44128, clCount3 = (b.itemlevel)* b.Quality * 0.0065,
- clEntry4 = 37663, clCount4 = (b.itemlevel) * b.Quality* 0.0065
- where a.oldItemEntry = b.entry;
-
- insert into item_up select * from up1;
- insert into item_up select * from up2;
- insert into item_up select * from up3;
-
- INSERT INTO disenchant_loot_template select newItemEntry,oldItemEntry,100,1,0,oldItemCount,oldItemCount from item_up;
- INSERT INTO disenchant_loot_template select newItemEntry,clEntry1,100,1,1,1,clCount1 * 0.6 from item_up where clEntry1 <> 0 and clCount1 <> 0;
- INSERT INTO disenchant_loot_template select newItemEntry,clEntry2,100,1,2,1,clCount2 * 0.6 from item_up where clEntry2 <> 0 and clCount2 <> 0;
- INSERT INTO disenchant_loot_template select newItemEntry,clEntry3,100,1,3,1,clCount3 * 0.6 from item_up where clEntry3 <> 0 and clCount3 <> 0;
- INSERT INTO disenchant_loot_template select newItemEntry,clEntry4,100,1,4,1,clCount4 * 0.6 from item_up where clEntry4 <> 0 and clCount4 <> 0;
- INSERT INTO disenchant_loot_template select newItemEntry,clEntry5,100,1,5,1,clCount5 * 0.6 from item_up where clEntry5 <> 0 and clCount5 <> 0;
复制代码
|