--装备强化
--2019-12-1 10:19:25 逍遥子重写
x809262_g_ScriptId = 809262
x809262_g_QianghualuId = 30900045 --天罡强化露
x809262_g_QiangHuaJinHua = {38000571,38000572}
x809262_g_QianghualuTime = 11
x809262_g_qianghuaLevelT = {
[0]= {0,100},
[1]= {0,100},
[2]= {0,50},
[3]= {0,20},
[4]= {0,10},
[5]= {0,5},
[6]= {0,5},
[7]= {0,5},
[8]= {0,1},
[9]= {42,1},
[10]= {50,100},
[11]= {58,66.66},
[12]= {66,50},
[13]= {74,40},
[14]= {82,33.33},
[15]= {90,28.57},
[16]= {98,25},
[17]= {106,22.22},
[18]= {114,20},
[19]= {122,18.18},
[20]= {130,16.66},
[21]= {140,15.55},
[22]= {150,14.44},
[23]= {160,13.33},
[24]= {170,12.22},
[25]= {180,11.11},
[26]= {190,9.99},
[27]= {200,8.88},
[28]= {210,7.77},
[29]= {220,7.14},
[30]= {230,7.01},
[31]= {242,6.88},
[32]= {254,6.75},
[33]= {266,6.62},
[34]= {278,6.49},
[35]= {290,6.36},
[36]= {302,6.23},
[37]= {314,6.11},
[38]= {326,5.99},
[39]= {338,5.87},
[40]= {350,5.75},
[41]= {365,5.63},
[42]= {380,5.51},
[43]= {395,5.39},
[44]= {410,5.28},
[45]= {425,5.17},
[46]= {440,5.06},
[47]= {455,4.95},
[48]= {470,4.84},
[49]= {485,4.73},
[50]= {500,4.62},
[51]= {518,4.52},
[52]= {536,4.41},
[53]= {554,4.3},
[54]= {572,4.2},
[55]= {590,4.1},
[56]= {608,4},
[57]= {626,3.9},
[58]= {644,3.8},
[59]= {662,3.7},
[60]= {680,3.6},
[61]= {700,3.5},
[62]= {720,3.4},
[63]= {740,3.31},
[64]= {760,3.22},
[65]= {780,3.13},
[66]= {800,3.04},
[67]= {820,2.95},
[68]= {840,2.86},
[69]= {860,2.77},
[70]= {880,2.68},
[71]= {902,2.6},
[72]= {924,2.52},
[73]= {946,2.44},
[74]= {968,2.36},
[75]= {990,2.28},
[76]= {1012,2.2},
[77]= {1034,1.12},
[78]= {1056,2.05},
[79]= {1078,1.98},
[80]= {1100,1.91},
[81]= {1125,1.84},
[82]= {1150,1.77},
[83]= {1175,1.7},
[84]= {1200,1.64},
[85]= {1225,1.58},
[86]= {1250,1.52},
[87]= {1275,1.46},
[88]= {1300,1.4},
[89]= {1325,1.35},
[90]= {1350,1.3},
[91]= {1380,1.25},
[92]= {1410,1.2},
[93]= {1440,1.16},
[94]= {1470,1.12},
[95]= {1500,1.08},
[96]= {1530,1.05},
[97]= {1560,1.02},
[98]= {1590,1},
[99]= {1620,0.99},
[100]= {0,0},
}
x809262_g_EquipName = {
[0] ={name = "武器",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[1] ={name = "帽子",sanhai = "穿刺减免",qianhua = {20,30,42,60,88,140,186,270,390}},
[2] ={name = "衣服",sanhai = "穿刺减免",qianhua = {10,15,21,30,44,70,93,135,195}},
[3] ={name = "手套",sanhai = "穿刺减免",qianhua = {20,30,42,60,88,140,186,270,390}},
[4] ={name = "鞋" ,sanhai = "穿刺减免",qianhua = {20,30,42,60,88,140,186,270,390}},
[5] ={name = "腰带",sanhai = "穿刺减免",qianhua = {20,30,42,60,88,140,186,270,390}},
[6] ={name = "戒指",sanhai = "穿刺伤害",qianhua = {20,30,42,60,88,140,186,270,390}},
[7] ={name = "项链",sanhai = "穿刺伤害",qianhua = {20,30,42,60,88,140,186,270,390}},
[8] ={name = "骑乘",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[9] ={name = "行囊",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[10] ={name = "箱格",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[11] ={name = "戒指",sanhai = "穿刺伤害",qianhua = {20,30,42,60,88,140,186,270,390}},
[12] ={name = "护符",sanhai = "穿刺伤害",qianhua = {20,30,42,60,88,140,186,270,390}},
[13] ={name = "护符",sanhai = "穿刺伤害",qianhua = {20,30,42,60,88,140,186,270,390}},
[14] ={name = "护腕",sanhai = "穿刺伤害",qianhua = {20,30,42,60,88,140,186,270,390}},
[15] ={name = "护肩",sanhai = "穿刺减免",qianhua = {20,30,42,60,88,140,186,270,390}},
[16] ={name = "时装",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[17] ={name = "暗器",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[18] ={name = "武魂",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
[19] ={name = "龙纹",sanhai = "穿刺伤害",qianhua = {10,15,21,30,44,70,93,135,195}},
}
--强化卷轴
x809262_g_itm={}
x809262_g_itm[38001094]=20
x809262_g_itm[38001095]=30
x809262_g_itm[38001096]=40
x809262_g_itm[38001097]=50
x809262_g_itm[38001098]=60
x809262_g_itm[38001099]=70
x809262_g_itm[38001100]=80
x809262_g_itm[38001101]=90
x809262_g_itm[38001102]=99
--小强化卷轴
x809262_g_itm[38000548]=5
x809262_g_itm[38000549]=7
x809262_g_itm[38000550]=8
x809262_g_itm[38000551]=9
x809262_g_itm[38000552]=5
x809262_g_itm[38000553]=7
x809262_g_itm[38000554]=8
x809262_g_itm[38000555]=9
--**********************************
--列举事件
--**********************************
function x809262_OnEnumerate( sceneId, selfId, targetId )
end
--**********************************
--强化卷轴
--**********************************
function x809262_FinishQuickEnhance( sceneId, selfId ,equipitm, equipitmo)
local Item_Equip = LuaFnGetItemTableIndexByIndex( sceneId, selfId, equipitm ) --装备
local Item_ID = LuaFnGetItemTableIndexByIndex( sceneId, selfId, equipitmo) --强化卷轴
if not Item_Equip or Item_Equip == nil or not Item_ID or Item_ID == nil then
return
end
if x809262_g_itm[Item_ID] == nil then
x809262_TipBox( sceneId, selfId, "#{ZBQHJ_130508_17}" )
return
end
local equipType1 = GetItemEquipPoint(Item_Equip)
if not equipType1 or equipType1 == -1 or equipType1 ==8 or equipType1==10 or equipType1 == 2 or equipType1 > 17 then
x809262_TipBox( sceneId, selfId, "#{ZBQHJ_130508_15}" )
return
end
-- local nEquipPoint = GetItemEquipPoint( Item_Equip )
-- if nEquipPoint == 2 or nEquipPoint == 10 then
-- x809262_TipBox( sceneId, selfId, "该装备暂不支持强化。" )
-- return
-- end
local EnhanceLevel = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,equipitm)
if EnhanceLevel >= 99 then
x809262_TipBox( sceneId, selfId, "#{ZBQHJ_130508_26}" )
return
end
if EnhanceLevel >= x809262_g_itm[Item_ID] then
x809262_TipBox( sceneId, selfId, "#{ZBQHJ_140310_1}" )
return
end
local HumanMoney = LuaFnGetMoney( sceneId, selfId )
local HumanMoneyJZ = GetMoneyJZ( sceneId, selfId );
if HumanMoney + HumanMoneyJZ < 500000 then
x809262_TipBox( sceneId, selfId, "金钱不足,操作无法继续进行!" )
return
end
local bagindex = GetBagItemTransfer( sceneId, selfId, equipitmo )
if LuaFnDelAvailableItem(sceneId,selfId,Item_ID, 1) ~= 1 then
x809262_TipBox( sceneId, selfId, "物品扣取失败,请查看放入的强化卷轴是否锁定" )
return
end
local nDelJZ, nDelMoney = LuaFnCostMoneyWithPriority(sceneId, selfId, 500000);
if nDelJZ ~= -1 then
LuaFnXYZSetEquipEnhanceLevel(sceneId,selfId,equipitm,x809262_g_itm[Item_ID])
LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, 49, 0);
LuaFnItemBind( sceneId, selfId, equipitm ) --强制绑定
x809262_TipBox( sceneId, selfId,"#H成功将#{_ITEM"..Item_Equip.."}强化至"..x809262_g_itm[Item_ID].."级。")
local str = format("#{_INFOUSR%s}#H拿出珍藏许久的#{_INFOMSG%s}#H,心中默念异域咒语,突然强化卷轴竟开始燃烧,火光逐渐淡去后,只见%s#H直接被强化到了#G%s#H。",
GetName(sceneId,selfId),
bagindex,
GetItemName(sceneId,Item_Equip),
x809262_g_itm[Item_ID])
BroadMsgByChatPipe( sceneId, selfId,str, 4 )
else
x809262_TipBox( sceneId, selfId, "金钱不足50金,强化失败" )
return
end
end
--**********************************
--装备强化检查提交
--**********************************
function x809262_FinishEnhance( sceneId, selfId, itemidx1, itemidx2 ) --itemidx1装备ID itemidx2强化道具ID
if not itemidx1 or itemidx1 == nil or not itemidx2 or itemidx2 == nil then --如果ID为nil空,不执行程序
return
end
local ret = LuaFnIsItemLocked( sceneId, selfId, itemidx1 ) --检查装备是否锁定
if ret ~= 0 then
x809262_TipBox( sceneId, selfId, "该装备不可用。" )
return
end
ret = LuaFnIsItemAvailable( sceneId, selfId, itemidx2 ) --检查道具是否存在
if ret ~= 1 then
x809262_TipBox( sceneId, selfId,"该强化精华、强化露或至尊强化精华不可用。");
return
end
local nItemId = GetItemTableIndexByIndex(sceneId, selfId, itemidx1)--取当前位置的物品种类
--添加15级神器的排除
if 10300422 == nItemId or 10302448 == nItemId or
10304426 == nItemId or 10305444 == nItemId or
10306042 == nItemId or 10307042 == nItemId then
x809262_TipBox( sceneId, selfId,"#{XSQSJ_160812_30}")
return
end
local nEquipPoint = GetItemEquipPoint( nItemId ) --获得道具装备点
if nEquipPoint == 10 then
x809262_TipBox( sceneId, selfId,"#{ZBQH_130521_11}") --#H武魂无法强化,不能进行强化转移。
return
end
if nEquipPoint == 2 then
x809262_TipBox( sceneId, selfId,"此装备无法强化。")
return
end
local EnhanceLevel = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,itemidx1)
local equip_level = GetBagItemLevel( sceneId, selfId, itemidx1 )
local gem_index = LuaFnGetItemTableIndexByIndex( sceneId, selfId, itemidx2 ) --取当前位置的物品种类 --gem_index 精华的ID
if EnhanceLevel >= 99 then
x809262_TipBox( sceneId, selfId, "#{ZBQH_130521_32}") --#H此装备的强化等级已达上限,无法继续进行强化。
return
end
if equip_level < 40 and EnhanceLevel < 9 then
if gem_index ~= 30900005 then
--低级强化精华
x809262_TipBox( sceneId, selfId,format( "该装备强化需要%s。", GetItemName( sceneId, 30900005 ) ))
return
end
else
if EnhanceLevel < 9 then
if gem_index ~= 30900006 and gem_index ~= x809262_g_QianghualuId then
--高级强化精华
x809262_TipBox( sceneId, selfId,format( "该装备强化需要%s或%s。", GetItemName( sceneId, 30900006 ), GetItemName( sceneId, x809262_g_QianghualuId ) ))
return
end
else
if gem_index ~= x809262_g_QiangHuaJinHua[1] and gem_index ~= x809262_g_QiangHuaJinHua[2] then
x809262_TipBox( sceneId, selfId,"该装备强化需要"..GetItemName( sceneId, x809262_g_QiangHuaJinHua[1] ));
return
end
local nMoneySelf = GetMoneyJZ(sceneId,selfId) + GetMoney(sceneId,selfId)
if nMoneySelf < 300 then
x809262_TipBox( sceneId, selfId,"金钱不足#{_EXCHG300}")
return
end
end
end
--重楼绑定精华检测
local equip_index = LuaFnGetItemTableIndexByIndex( sceneId, selfId, itemidx1);
if (equip_index ==10553100) or (equip_index == 10553101) or (equip_index == 10553102) or (equip_index == 10553103) or (equip_index == 10553104) or (equip_index == 10553105) or (equip_index == 10553106) or (equip_index == 10553107) or (equip_index == 10553108) or (equip_index == 10553109) or (equip_index == 10553111) or (equip_index == 10159135) or (equip_index == 10159134) or (equip_index == 10159133) then --重楼玉,重楼戒
if tonumber(gem_index) == 30900006 then --强化精华
local bindStatus = LuaFnGetItemBindStatus(sceneId, selfId, itemidx2);
if bindStatus == 1 then --绑定
x809262_TipBox( sceneId, selfId,"该装备不能用已绑定的天罡强化精华强化!}")
return
end
end
end
--装备可用度
local nIsAvailable = LuaFnIsItemAvailable( sceneId, selfId, itemidx2 )
if nIsAvailable ~= 1 then
x809262_TipBox( sceneId, selfId,"装备不可用。");
return
end
--最高强化等级检查
local nEnchanceLevel = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,itemidx1);
if nEnchanceLevel >= 99 then
x809262_TipBox( sceneId, selfId,"#{ZBQH_130521_32}")
return
end
--金币数量检测
local nMoneyCheck, arg0 = LuaFnEquipEnhanceCheck( sceneId, selfId, itemidx1, itemidx2 )
if nMoneyCheck == -5 then
x809262_TipBox( sceneId, selfId,format("强化该装备需要#{_EXCHG%d},您身上的现金不足。",arg0))
return
end
--检查完毕
x809262_DoFinishEnhance( sceneId, selfId, itemidx1*1000+itemidx2)
end
--**********************************
--装备强化
--**********************************
function x809262_DoFinishEnhance( sceneId, selfId, index )
local itemidx1 = floor(index / 1000)
local itemidx2 = mod(index , 1000)
local text="装备强化成功!"
local nEnchanceLevel = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,itemidx1)
if x809262_g_qianghuaLevelT[nEnchanceLevel] == nil then
x809262_TipBox( sceneId, selfId, "装备强化等级错误" )
return
end
--开始强化、要看几率
local ret,arg0 = -6,nEnchanceLevel
local nRandomData = x809262_g_qianghuaLevelT[nEnchanceLevel][2]
local nRandm = random(1,100)
if nRandm <= floor(nRandomData) then
local nEquipEnhanceLevel = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,itemidx1)
if nEquipEnhanceLevel >= 9 then
x809262_TipBox( sceneId, selfId, "#{ZBQH_130521_32}" )
return
end
LuaFnXYZSetEquipEnhanceLevel( sceneId, selfId, itemidx1, nEquipEnhanceLevel + 1 )
ret = 0
end
if ret == 0 then
if arg0 >= 2 then
local szTranItm1 = GetBagItemTransfer( sceneId, selfId, itemidx1 )
local szTranItm2 = GetBagItemTransfer( sceneId, selfId, itemidx2 )
local szMsg = format( "#W#{_INFOUSR%s}#{EQ_1}#{_INFOMSG%s}#{EQ_2}%d#{EQ_3}#{_INFOMSG%s}#{EQ_4}",
LuaFnGetName( sceneId, selfId ), szTranItm2, tonumber(arg0)+1, szTranItm1 )
--公告精简,小于5级的强化,不发公告
if (arg0 >= 5) then
AddGlobalCountNews( sceneId, szMsg )
end
end
gem_index = LuaFnGetItemTableIndexByIndex( sceneId, selfId, itemidx2 )--取当前位置的物品种类 。强化物品ID
if x809262_g_QianghualuId == gem_index then --确定是强化露ID
local a = LuaFnGetAvailableItemCount(sceneId, selfId, x809262_g_QianghualuId)
local b = LuaFnGetAvailableItemCount(sceneId, selfId, x809262_g_QianghualuId)
a=a*11
local b=b*11
--local r, t = LuaFnEraseItemTimes( sceneId, selfId, itemidx2, x809262_g_QianghualuTime )--有11次机会
local r, t = LuaFnEraseItemTimes( sceneId, selfId, itemidx2, a )--有11次机会
--PrintNum(r);
--PrintNum(t) --强化等级
BeginEvent(sceneId)
--local str = "天罡强化露剩余使用次数%d"
--local szMsg = format( "天罡强化露剩余使用次数%d/%d",tonumber(t), tonumber(x809262_g_QianghualuTime) );
local szMsg = format( "天罡强化露剩余使用次数%d/%d",tonumber(t), tonumber(b) );
AddText(sceneId,szMsg);
EndEvent(sceneId)
DispatchMissionTips(sceneId,selfId)
elseif gem_index == x809262_g_QiangHuaJinHua[1] or gem_index == x809262_g_QiangHuaJinHua[2] then--扣除强化精华
local nRet = LuaFnMtl_CostMaterial(sceneId,selfId,1,x809262_g_QiangHuaJinHua[1],x809262_g_QiangHuaJinHua[2])
if nRet ~= 1 then
BeginEvent( sceneId )
AddText( sceneId, StringTable_GetData(347) )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
return
end
else
--LuaFnEraseItem( sceneId, selfId, itemidx2 ) ----这个会删一格
local myQHF_1 = LuaFnGetItemTableIndexByIndex(sceneId,selfId,itemidx2) ----方法2也是删一格物品
--LuaFnDelAvailableItem(sceneId,selfId,myQHF_1,1)----方法2也是删一格物品
LuaFnDelAvailableItem(sceneId,selfId,gem_index,1)----方法2也是删一格物品
--x809262_TipBox( sceneId, selfId, myQHF_2 )
--DelItem(sceneId, selfId, itemidx2, 1)
end
LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, 49, 0);
end
if ret == -6 then
text="好可惜啊您的装备强化失败了,别灰心!!!"
if x809262_g_QianghualuId == gem_index then
local a = LuaFnGetAvailableItemCount(sceneId, selfId, x809262_g_QianghualuId)
local b = LuaFnGetAvailableItemCount(sceneId, selfId, x809262_g_QianghualuId)
a=a*11
local b=b*11
-- local r, t = LuaFnEraseItemTimes( sceneId, selfId, itemidx2, x809262_g_QianghualuTime ) --删除项目时间
local r, t = LuaFnEraseItemTimes( sceneId, selfId, itemidx2, a ) --删除项目时间
BeginEvent(sceneId)
--local szMsg = format( "天罡强化露剩余使用次数%d/%d",tonumber(t), tonumber(x809262_g_QianghualuTime) );
local szMsg = format( "天罡强化露剩余使用次数%d/%d",tonumber(t), tonumber(b) );
AddText(sceneId,szMsg);
EndEvent(sceneId)
DispatchMissionTips(sceneId,selfId)
elseif gem_index == x809262_g_QiangHuaJinHua[1] or gem_index == x809262_g_QiangHuaJinHua[2] then
local nRet = LuaFnMtl_CostMaterial(sceneId,selfId,1,x809262_g_QiangHuaJinHua[1],x809262_g_QiangHuaJinHua[2])
if nRet ~= 1 then
BeginEvent( sceneId )
AddText( sceneId, StringTable_GetData(347) )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
return
end
LuaFnCostMoneyWithPriority( sceneId, selfId, 300 );
else
--LuaFnEraseItem( sceneId, selfId, itemidx2 )
local myQHF_2 = LuaFnGetItemTableIndexByIndex(sceneId,selfId,itemidx2) --取当前位置的物品种类
--x809262_TipBox( sceneId, selfId, myQHF_2 )
--LuaFnDelAvailableItem(sceneId,selfId,myQHF_2,1)
LuaFnDelAvailableItem(sceneId,selfId,gem_index,1)----方法2也是删一格物品
-- DelItem(sceneId, selfId, itemidx2, 1)
end
end
if ret >= 0 then
nEnchanceLevel = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,itemidx1)
if nEnchanceLevel > 9 then
LuaFnCostMoneyWithPriority( sceneId, selfId, 300 );
local gem_index1 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, itemidx1 )
local equipType = GetItemEquipPoint(gem_index1 )
if equipType ~= -1 then
text = text.."此装备的"..x809262_g_EquipName[equipType].sanhai.."增加至"..x809262_g_qianghuaLevelT[arg0][1].."#H点。"
end
end
end
--************************重置界面UI。
BeginUICommand(sceneId)
UICommand_AddInt(sceneId,itemidx1);
EndUICommand(sceneId )
DispatchUICommand(sceneId,selfId, 20200533 )
BeginEvent(sceneId)
AddText(sceneId,text);
EndEvent(sceneId)
DispatchMissionTips(sceneId,selfId)
end
--**********************************
--装备强化转移
--**********************************
function x809262_FinishMoveEnhance( sceneId, selfId,Item1,Item2,nType)
if nType == nil or (nType ~= 0 and nType ~= 1) then
return
end
if nType == 1 then --vip特权
if LuaFnGetAccoutVipLevel(sceneId,selfId) < 7 then
return
end
end
if not Item1 or Item1 == nil or not Item2 or Item2 == nil then
return
end
if Item2 == Item1 then
return
end
if Item1 < 0 or Item1 > 59 or Item2 < 0 or Item2 > 59 then
return
end
local ret = LuaFnIsItemLocked( sceneId, selfId, Item1 )
if ret ~= 0 then
x809262_TipBox( sceneId, selfId, "#{ZBQH_130521_13}" )
return
end
ret = LuaFnIsItemAvailable( sceneId, selfId, Item2 )
if ret ~= 1 then
x809262_TipBox( sceneId, selfId, "#{ZBQH_130521_20}" )
return
end
local gem_index1 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, Item1 )
local gem_index2 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, Item2 )
local equipType1 = GetItemEquipPoint(gem_index1 )
local equipType2 = GetItemEquipPoint(gem_index2 )
local curlevel1 = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,Item1)
local curlevel2 = LuaFnXYZGetEquipEnhanceLevel(sceneId,selfId,Item2)
local Equip_Level1 = GetBagItemLevel( sceneId, selfId, Item1 )
local Equip_Level2 = GetBagItemLevel( sceneId, selfId, Item2 )
local leftItemName = GetItemName(sceneId, gem_index1)
local systemstringid =""
if equipType1 == -1 or equipType2 == -1 then
return
end
if equipType1 ~= equipType2 then
if Equip_Level1 < 40 then
systemstringid = format("#H仅可将%s#H的强化等级转移至装备等级不足40级的%s#H之上。",leftItemName, x809262_g_EquipName[Equip_Level1].name)
end
if Equip_Level1 >= 40 then
systemstringid = format("#H仅可将%s#H的强化等级转移至装备等级达到40级及以上等级的%s#H之上。",leftItemName, x809262_g_EquipName[Equip_Level1].name)
end
x809262_TipBox( sceneId, selfId, systemstringid)
return
end
if Equip_Level1 < 40 and Equip_Level2 >= 40 then
systemstringid = format("#H仅可将%s#H的强化等级转移至装备等级不足40级的%s#H之上。",leftItemName, x809262_g_EquipName[Equip_Level1].name)
x809262_TipBox( sceneId, selfId, systemstringid)
return
end
if Equip_Level1 >= 40 and Equip_Level2 < 40 then
systemstringid = format("#H仅可将%s#H的强化等级转移至装备等级达到40级及以上等级的%s#H之上。",leftItemName, x809262_g_EquipName[Equip_Level1].name)
x809262_TipBox( sceneId, selfId, systemstringid)
return
end
if curlevel1 <= curlevel2 then
systemstringid = format("#H该装备的强化等级已达到或超过源装备的强化等级:%s#H级,无法接受转移。",curlevel1)
x809262_TipBox( sceneId, selfId, systemstringid)
return
end
local NeedMoney = curlevel1*5
if NeedMoney > 100 then
NeedMoney = 100
end
local nMoneyJZ = GetMoneyJZ(sceneId,selfId)
local nMoneyJB = GetMoney(sceneId,selfId)
local nMoneySelf = nMoneyJZ + nMoneyJB
if nMoneySelf < NeedMoney*10000 then
x809262_TipBox( sceneId, selfId, "转移强化需要#{_EXCHG%d},您的金钱不足",NeedMoney*10000)
return
end
--原装备数据清空
LuaFnXYZSetEquipEnhanceLevel(sceneId,selfId,Item1,0)
LuaFnCostMoneyWithPriority( sceneId, selfId, NeedMoney*10000 );
--目标装备数据存储
LuaFnXYZSetEquipEnhanceLevel( sceneId, selfId,Item2,curlevel1)
LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, 49, 0);
x809262_TipBox( sceneId, selfId, "恭喜您,强化转移成功!!")
local szTranItm1 = GetBagItemTransfer( sceneId, selfId, Item1 )
local szTranItm2 = GetBagItemTransfer( sceneId, selfId, Item2 )
local szMsg = format( "#W#{_INFOUSR%s}#G花费了#{_EXCHG%d}成功把#Y"..leftItemName.."#G上的强化转移到#{_INFOMSG"..szTranItm2.."}上",LuaFnGetName( sceneId, selfId ), NeedMoney*10000)
--AddGlobalCountNews( sceneId, szMsg)
end
--**********************************
--屏幕中心醒目提醒
--**********************************
function x809262_TipBox( sceneId, selfId, msg )
BeginEvent(sceneId)
AddText(sceneId,msg);
EndEvent(sceneId)
DispatchMissionTips(sceneId,selfId)
end