/**************批量开始**************/
if $num!=0 then
WHILE $i<=$num DO
/*重新编号*/
/*set $newentry=concat($entry,'',$i); 这个是加在后面...*/
set $newentry=concat($i,'',$entry);
/*物品改名*/
set $newName=concat(concat($name,'','Lv'),'',$i);
set $description=concat($description,'','★');
If $Mod=1 then
/*****************************属性设置*************************/
if $stat_type1 !=0 then
set $stat_value1 =$stat_value1+$sxjc;
end if;
if $stat_type2 !=0 then
set $stat_value2 =$stat_value2+$sxjc;
end if;
if $stat_type3 !=0 then
set $stat_value3 =$stat_value3+$sxjc;
end if;
if $stat_type4 !=0 then
set $stat_value4 =$stat_value4+$sxjc;
end if;
if $stat_type5 !=0 then
set $stat_value5 =$stat_value5+$sxjc;
end if;
if $stat_type6 !=0 then
set $stat_value6 =$stat_value6+$sxjc;
end if;
if $stat_type7 !=0 then
set $stat_value7 =$stat_value7+$sxjc;
end if;
if $stat_type8 !=0 then
set $stat_value8 =$stat_value8+$sxjc;
end if;
if $stat_type9 !=0 then
set $stat_value9 =$stat_value9+$sxjc;
end if;
if $stat_type10 !=0 then
set $stat_value10 =$stat_value10+$sxjc;
end if;
/**************************伤害/防护***********************/
set $dmg_min1 =$dmg_min1+$shjc;
set $dmg_max1 =$dmg_max1+$shjc;
if $dmg_min2 !=0 then
set $dmg_min2 =$dmg_min2+$shjc;
end if;
if $dmg_max2 !=0 then
set $dmg_max2 =$dmg_max2+$shjc;
end if;
set $holy_res =$holy_res+$kxjc;
set $fire_res =$fire_res+$kxjc;
set $nature_res =$nature_res+$kxjc;
set $frost_res =$frost_res+$kxjc;
set $shadow_res =$shadow_res+$kxjc;
set $arcane_res =$arcane_res+$kxjc;
set $armor =$armor+$hjjc;
set $block =$block+$gdjc;
Else
/*****************************属性设置*************************/
set $stat_value1 =$stat_value1*$sxjc;
set $stat_value2 =$stat_value2*$sxjc;
set $stat_value3 =$stat_value3*$sxjc;
set $stat_value4 =$stat_value4*$sxjc;
set $stat_value5 =$stat_value5*$sxjc;
set $stat_value6 =$stat_value6*$sxjc;
set $stat_value7 =$stat_value7*$sxjc;
set $stat_value8 =$stat_value8*$sxjc;
set $stat_value9 =$stat_value9*$sxjc;
set $stat_value10 =$stat_value10*$sxjc;
/**************************伤害/防护***********************/
set $dmg_min1 =$dmg_min1*$shjc;
set $dmg_max1 =$dmg_max1*$shjc;
set $dmg_min2 =$dmg_min2*$shjc;
set $dmg_max2 =$dmg_max2*$shjc;
set $holy_res =$holy_res*$kxjc;
set $fire_res =$fire_res*$kxjc;
set $nature_res =$nature_res*$kxjc;
set $frost_res =$frost_res*$kxjc;
set $shadow_res =$shadow_res*$kxjc;
set $arcane_res =$arcane_res*$kxjc;
set $armor =$armor*$hjjc;
set $block =$block*$gdjc;
end If;
/******************执行插入*************************/
INSERT INTO item_template()
VALUES
($newentry,$class,$subclass,$unk0,$newName,$displayid,$Quality,$Flags,$Faction,$BuyCount,$BuyPrice,$SellPrice,$InventoryType,$AllowableClass,$AllowableRace,$ItemLevel,$RequiredLevel,$RequiredSkill,$RequiredSkillRank,$requiredspell,$requiredhonorrank,$RequiredCityRank,$RequiredReputationFaction,$RequiredReputationRank,$maxcount,$stackable,$ContainerSlots,$StatsCount,$stat_type1,$stat_value1,$stat_type2,$stat_value2,$stat_type3,$stat_value3,$stat_type4,$stat_value4,$stat_type5,$stat_value5,$stat_type6,$stat_value6,$stat_type7,$stat_value7,$stat_type8,$stat_value8,$stat_type9,$stat_value9,$stat_type10,$stat_value10,$ScalingStatDistribution,$ScalingStatValue,$dmg_min1,$dmg_max1,$dmg_type1,$dmg_min2,$dmg_max2,$dmg_type2,$armor,$holy_res,$fire_res,$nature_res,$frost_res,$shadow_res,$arcane_res,$delay,$ammo_type,$RangedModRange,$spellid_1,$spelltrigger_1,$spellcharges_1,$spellppmRate_1,$spellcooldown_1,$spellcategory_1,$spellcategorycooldown_1,$spellid_2,$spelltrigger_2,$spellcharges_2,$spellppmRate_2,$spellcooldown_2,$spellcategory_2,$spellcategorycooldown_2,$spellid_3,$spelltrigger_3,$spellcharges_3,$spellppmRate_3,$spellcooldown_3,$spellcategory_3,$spellcategorycooldown_3,$spellid_4,$spelltrigger_4,$spellcharges_4,$spellppmRate_4,$spellcooldown_4,$spellcategory_4,$spellcategorycooldown_4,$spellid_5,$spelltrigger_5,$spellcharges_5,$spellppmRate_5,$spellcooldown_5,$spellcategory_5,$spellcategorycooldown_5,$bonding,$description,$PageText,$LanguageID,$PageMaterial,$startquest,$lockid,$Material,$sheath,$RandomProperty,$RandomSuffix,$block,$itemset,$MaxDurability,$area,$Map,$BagFamily,$TotemCategory,$socketColor_1,$socketContent_1,$socketColor_2,$socketContent_2,$socketColor_3,$socketContent_3,$socketBonus,$GemProperties,$RequiredDisenchantSkill,$ArmorDamageModifier,$Duration,$ItemLimitCategory,$HolidayId,$ScriptName,$DisenchantID,$FoodType,$minMoneyLoot,$maxMoneyLoot,$WDBVerified);
set $i=$i+1;
END WHILE;
/************************插入升级公式*****************/
set $i=1;
/*set $newentry=concat($entry,'',$i); 这个是加在后面...*/
set $newentry=concat($i,'',$entry);
INSERT INTO custom_item_levelup
(`item_entry`, `item_num`, `energy_entry`, `energy_num`, `guard_entry`, `guard_num`, `newitem_entry`, `rp`, `rank`, `level`, `type`, `points`, `price`)
VALUES
($entry, 1, $sjbs, $sjsl, $shbs, $shsl, $newentry, $cgl, 0, 0, 0, 0, 0);
if $num>1 then
set $i=1;
WHILE $i<$num DO
set $x=$i+1;
/*改变消耗数量 和 成功几率*/
set $sjsl =$sjsl+$sjzz;
set $shsl =$shsl+$shzz;
set $cgl =$cgl-$cgxj;
if $cgl <=0 then
set $cgl = 1;
end if;
INSERT INTO custom_item_levelup
(`item_entry`, `item_num`, `energy_entry`, `energy_num`, `guard_entry`, `guard_num`, `newitem_entry`, `rp`, `rank`, `level`, `type`, `points`, `price`)
VALUES
(concat($i,'',$entry), 1, $sjbs, $sjsl, $shbs, $shsl, concat($x,'',$entry), $cgl, 0, 0, 0, 0, 0);
/*(concat($entry,'',$i), 1, $sjbs, $sjsl, $shbs, $shsl, concat($entry,'',$x), $cgl, 0, 0, 0, 0, 0); 这个是加在后面...*/
set $i=$i+1;
END WHILE;
end if;
end if;
end