Преглед изворни кода

更新星降融合等级限制

zhanwencai пре 1 година
родитељ
комит
506280a4dc

+ 2 - 1
script/common/Lang.lua

@@ -723,4 +723,5 @@ AD_DRAW_REWARD_SUCCESS = [[观看广告领取奖励成功!!]]
 AD_HATCH_REWARD_LIMIT_ERROR = [[超过观看广告上限次数!!]]
 QUICK_HATCH_SUCCESS = [[加速孵化成功!!]]
 QUICK_HATCH_TIME_OUT = [[加速时间大于孵化时间!!]]
-MERGE_SUCCESS = [[融合成功!!]]
+MERGE_SUCCESS = [[融合成功!!]]
+MERGE_LV_NOT_ENOUGHT_FAIL = [[融合失败!!父母双方英雄等级必须大于100!!]]

+ 1 - 1
script/excel/ssecy/item.lua

@@ -96,7 +96,7 @@
 [176]={mainType=1,subType=1,isShow=0,name=[[复活药水]],icon=557,effects=0,order=0,rare=5,desc1=[[道具]],desc2=[[恢复生命复活英雄的神秘药剂,只能在失落神庙使用]],price={},getway={2002},panelID=2901,cond={},get={},fullCnt=0,cmd={"lostRevice"},material={},dot={},effect=0},
 [177]={mainType=1,subType=1,isShow=0,name=[[战意碎片]],icon=542,effects=0,order=9,rare=5,desc1=[[材料]],desc2=[[蕴含着微弱的战意之力,可用于升级战意技能等级]],price={},getway={},panelID=0,cond={},get={},fullCnt=0,cmd={},material={},dot={},effect=0},
 [178]={mainType=1,subType=1,isShow=0,name=[[生命雨露]],icon=178,effects=0,order=0,rare=5,desc1=[[材料]],desc2=[[蕴含生命起源的力量,英雄融合必需的道具]],price={},getway={},panelID=1022,cond={},get={},fullCnt=0,cmd={"mergeHero",1},material={},dot={},effect=0},
-[179]={mainType=1,subType=1,isShow=0,name=[[加速卡]],icon=179,effects=0,order=0,rare=5,desc1=[[道具]],desc2=[[在各种加速设置中可抵消5分钟的时间消耗]],price={},getway={},panelID=0,cond={},get={},fullCnt=0,cmd={},material={"hatchMerge",1},dot={},effect=0},
+[179]={mainType=1,subType=1,isShow=0,name=[[加速卡]],icon=179,effects=0,order=0,rare=5,desc1=[[道具]],desc2=[[在各种加速设置中可抵消5分钟的时间消耗]],price={},getway={},panelID=0,cond={},get={},fullCnt=0,cmd={"hatchMerge",1},material={},dot={},effect=0},
 [301]={mainType=1,subType=1,isShow=0,name=[[狂暴战意]],icon=301,effects=0,order=1,rare=5,desc1=[[道具]],desc2=[[用于激活或升级(狂暴)战意技能。狂暴:暴击率提高5%;英雄将在6星时开启战意领悟]],price={177,1000},getway={},panelID=1101,cond={},get={},fullCnt=0,cmd={},material={},dot={},effect=0},
 [302]={mainType=1,subType=1,isShow=0,name=[[战意战意]],icon=302,effects=0,order=1,rare=5,desc1=[[道具]],desc2=[[用于激活或升级(战意)战意技能。战意:生命值每降低1%,伤害提高0.1%;英雄将在6星时开启战意领悟]],price={177,1000},getway={},panelID=1101,cond={},get={},fullCnt=0,cmd={},material={},dot={},effect=0},
 [303]={mainType=1,subType=1,isShow=0,name=[[回音战意]],icon=303,effects=0,order=1,rare=5,desc1=[[道具]],desc2=[[用于激活或升级(遁走)战意技能。遁走:复活后闪避率提高5%,持续2回合;英雄将在6星时开启战意领悟]],price={177,1000},getway={},panelID=1101,cond={},get={},fullCnt=0,cmd={},material={},dot={},effect=0},

BIN
script/file3.tar.gz


+ 18 - 0
script/module/bag/ItemLogic.lua

@@ -336,11 +336,29 @@ function cmd.lostRevice(data, human, value)
 end
 
 function cmd.mergeHero(data, human, value)
+    if data.left < 1 then return end
     return true
  end
 
  function cmd.hatchMerge(data, human, value)
+    if data.left < 1 then return end
     return true
+    -- human.db.mergeInfo = human.db.mergeInfo or {}
+    -- human.db.mergeInfo.endTime =  human.db.mergeInfo.endTime or 0
+
+    -- if  human.db.mergeInfo.endTime > 0 then
+    --     local itemSpeedTime = (60 * 5 * data.cnt)
+    --     local hatchTime = human.db.mergeInfo.endTime - itemSpeedTime - os.time()
+    --     if hatchTime <= 0 then
+    --         human.db.mergeInfo.endTime = 0
+    --         return true 
+    --     else
+    --         human.db.mergeInfo.endTime = human.db.mergeInfo.endTime - itemSpeedTime
+    --         return true 
+    --     end
+    -- end
+
+    -- return false
  end
 -----------------------------------------------------------------------------
 

+ 9 - 7
script/module/fuwen/FuwenLogic.lua

@@ -240,7 +240,7 @@ function putOn(human, heroID, heroIndex, fuwenIndex,pos,noCalc)
 end
 
 -- 脱下符文
-function putOff(human, heroID, heroIndex, pos, noCalc)
+function putOff(human, heroID, heroIndex, pos, noCalc, noSend)
     local heroGrid = HeroLogic.getHeroGrid(human, heroID, heroIndex)
 	if heroGrid == nil then
 		return 
@@ -265,12 +265,14 @@ function putOff(human, heroID, heroIndex, pos, noCalc)
         HeroEquip.query(human, heroID, heroIndex)	
 	end
 
-    -- 通知客户端
-	local msgRet = Msg.gc.GC_FUWEN_PUTOFF
-	msgRet.heroID = heroID
-	msgRet.heroIndex = heroIndex
-    msgRet.pos = pos
-	Msg.send(msgRet, human.fd)
+    if not noSend  then
+        -- 通知客户端
+        local msgRet = Msg.gc.GC_FUWEN_PUTOFF
+        msgRet.heroID = heroID
+        msgRet.heroIndex = heroIndex
+        msgRet.pos = pos
+        Msg.send(msgRet, human.fd)
+    end
 end
 
 function putOffQuick(human, heroID, heroIndex, noSys)

+ 9 - 7
script/module/hero/HeroEquip.lua

@@ -202,7 +202,7 @@ function putOnHero(human, heroID, heroIndex, putHeroID, putHeroIndex, putHeroPos
     Msg.send(msgRet, human.fd)
 end
 
-function putOff(human, heroID, heroIndex, pos, noCalc)
+function putOff(human, heroID, heroIndex, pos, noCalc, noSend)
 	local heroGrid = HeroLogic.getHeroGrid(human, heroID, heroIndex)
 	if heroGrid == nil then
 		return
@@ -231,12 +231,14 @@ function putOff(human, heroID, heroIndex, pos, noCalc)
 		HeroLogic.refreshDot(human, heroGrid.uuid)
 	end
 	
-	-- 通知客户端
-	local msgRet = Msg.gc.GC_HERO_EQUIP_PUTOFF
-	msgRet.heroID = heroID
-	msgRet.heroIndex = heroIndex
-	msgRet.pos = pos
-	Msg.send(msgRet, human.fd)
+    if not noSend  then
+        -- 通知客户端
+        local msgRet = Msg.gc.GC_HERO_EQUIP_PUTOFF
+        msgRet.heroID = heroID
+        msgRet.heroIndex = heroIndex
+        msgRet.pos = pos
+        Msg.send(msgRet, human.fd)
+    end
 end
 
 -- 一键穿装

+ 24 - 6
script/module/role/NewLogic.lua

@@ -23,6 +23,7 @@ local SkinLogic              = require("skin.SkinLogic")
 local XingYaoGongMing        = require("xingYaoMen.XingYaoGongMing")
 local SkillExcel             = require("excel.skill")
 local BufferExcel            = require("excel.buffer")
+local ItemDefine             = require("bag.ItemDefine")
 
 AD_DRAW_REWARD_TYPE          = 10 --观看广告领取召唤券
 QUERY_MERGE_INFO_TYPE        = 11 --获取融合信息
@@ -196,6 +197,11 @@ function NewProto(human, type, param)
             local mergeInfo = {}
             local attrs = RoleDefine.PANEL_ATTR_KEY
 
+            if fatherHeroGrid.lv < 100 or motherHeroGrid.lv < 100 then
+                Broadcast.sendErr(human, Lang.MERGE_LV_NOT_ENOUGHT_FAIL)
+                return
+            end
+
             local sonHeroID = mergeHero(fatherHeroGrid.id, motherHeroGrid.id)
             if sonHeroID <= 0 then
                 return
@@ -229,9 +235,17 @@ function NewProto(human, type, param)
             local delHeroList = { [1] = fatherHeroBagIndex, [2] = motherHeroBagIndex }
             for key, heroIndex in pairs(delHeroList) do
                 local heroID = HeroLogic.getHeroIdByIndex(human, heroIndex)
+                --脱装备
+                HeroEquip.putOff(human, heroID, heroIndex, ItemDefine.EQUIP_SUBTYPE_WEAPON, false, true)
+                HeroEquip.putOff(human, heroID, heroIndex, ItemDefine.EQUIP_SUBTYPE_CLOTH, false, true)
+                HeroEquip.putOff(human, heroID, heroIndex, ItemDefine.EQUIP_SUBTYPE_SHOES, false, true)
+                HeroEquip.putOff(human, heroID, heroIndex, ItemDefine.EQUIP_SUBTYPE_SHIPIN, false, true)
+                HeroEquip.putOff(human, heroID, heroIndex, ItemDefine.EQUIP_SUBTYPE_SHENQI, false, true)
+
+                --脱符文
+                FuwenLogic.putOff(human, heroID, heroIndex, 1, false, true)
+                FuwenLogic.putOff(human, heroID, heroIndex, 2, false, true)
 
-                HeroEquip.putOffQuick(human, heroID, heroIndex, true)
-                FuwenLogic.putOffQuick(human, heroID, heroIndex, true)
                 HeroLogic.delHeroByIndex(human, heroIndex, "hero_merge")
             end
 
@@ -422,7 +436,8 @@ function NewProto(human, type, param)
                 end
 
                 --使用道具
-                ItemLogic.use(human, 179, itemCnt)
+                ItemLogic.use(human, 179, cnt)
+                human.db.mergeInfo.endTime = human.db.mergeInfo.endTime - itemSpeedTime
             elseif quickType == 2 then
                 local zuanshiCnt = doCalcNeedZuanshi(hatchTime)
 
@@ -440,6 +455,8 @@ function NewProto(human, type, param)
                     human.db.isTip = human.db.isTip or 1
                     human.db.isTip = tonumber(tb[3])
                 end
+
+                human.db.mergeInfo.endTime = human.db.mergeInfo.endTime - itemSpeedTime
             elseif quickType == 3 then
                 human.db.adHatchRewardCnt = human.db.adHatchRewardCnt or 0
 
@@ -449,13 +466,14 @@ function NewProto(human, type, param)
                 end
 
                 --加速30分钟
-                itemSpeedTime             = 30 * 60
+                itemSpeedTime              = 30 * 60
 
                 --增加今日观看次数
-                human.db.adHatchRewardCnt = (human.db.adHatchRewardCnt or 0) + 1
+                human.db.adHatchRewardCnt  = (human.db.adHatchRewardCnt or 0) + 1
+
+                human.db.mergeInfo.endTime = human.db.mergeInfo.endTime - itemSpeedTime
             end
 
-            human.db.mergeInfo.endTime = human.db.mergeInfo.endTime - itemSpeedTime
             local hatchTime = human.db.mergeInfo.endTime - nowTime
 
             -- 孵化成功