| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715 |
- -- 星曜之门-星耀共鸣
- local ObjHuman = require("core.ObjHuman")
- local Util = require("common.Util")
- local Msg = require("core.Msg")
- local Broadcast = require("broadcast.Broadcast")
- local Lang = require("common.Lang")
- local BagLogic = require("bag.BagLogic")
- local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
- local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
- local XingYaoMenExcel = require("excel.xingYaoMen")
- local HeroGrid = require("hero.HeroGrid")
- local Grid = require("bag.Grid")
- local HeroLogic = require("hero.HeroLogic")
- local HeroEquip = require("hero.HeroEquip")
- local FuwenLogic = require("fuwen.FuwenLogic")
- local ItemDefine = require("bag.ItemDefine")
- local Log = require("common.Log")
- local LogDefine = require("common.LogDefine")
- -- human.db.xingYaoGongMing = {
- -- defList = nil --守卫者
- -- gridList = nil --保存格子信息
- -- xingYaoHe = nil --星耀之核
- -- }
- -- gridList[index] = {
- -- heroIndex = nil
- -- cdTime = nil --冷却时间
- -- }
- -- defList[heroIndex] = heroIndex
- XINGYAO_GONGMING_DEFMAX = 5 -- 5个守护者
- XYHERO_LV = 1
- XYHERO_RESET = 2
- local function makeXyGmGridsByIndex(human,net,gridIndex,gridData)
- net.index = gridIndex
- net.oldLV = 0
- net.hero[0] = 0
- local heroIndex = gridData.heroIndex
- if heroIndex then
- local heroGrid = human.db.heroBag[heroIndex]
- if heroGrid then
- net.hero[0] = 1
- HeroGrid.makeHeroSimple(net.hero[1], heroGrid, heroIndex, human)
- net.oldLV = heroGrid.oldLV or 0
- end
- end
-
- net.leftTime = 0
- if gridData.cdTime then
- net.leftTime = math.max(gridData.cdTime - os.time(),0)
- end
- end
- local function makeXyGmGrids(human,net,conf)
- net[0] = 0
- if not human.db.xingYaoGongMing or not human.db.xingYaoGongMing.gridList then return end
- for index,data in pairs(human.db.xingYaoGongMing.gridList) do
- net[0] = net[0] + 1
- local index = net[0]
- makeXyGmGridsByIndex(human,net[index],index,data)
- end
- end
- local function gongMingGridHeroOff(human,heroGrid,heroIndex)
-
- local oldLv = heroGrid.oldLV or 0
- Log.write(Log.LOGID_TEST, "XingYaoGongMing gongMingGridHeroOff hero OldLv: "..oldLv.." Lv: "..heroGrid.lv.." humanUuid: ", human.db._id)
- makeLvQuality(heroGrid)
- HeroEquip.putOffQuick(human, heroGrid.id, heroIndex, true)
- FuwenLogic.putOffQuick(human, heroGrid.id, heroIndex, true)
- ObjHuman.doCalcHero(human, heroIndex)
- HeroLogic.sendHeroGridDynamic(human, heroGrid, heroIndex)
- end
- local function makeGongMingDef(human)
- local maxIndex = nil
- local maxLV = nil
- local maxZhanDouLi = nil
- for i = 1, human.db.heroBag[0] do
- local heroGrid = human.db.heroBag[i]
- local defList = human.db.xingYaoGongMing.defList
- if heroGrid then
- if not defList or not defList[i] then
- local lv = heroGrid.lv
- if heroGrid.oldLV then
- lv = heroGrid.oldLV
- end
- local set = nil
- if not maxLV and not maxZhanDouLi then
- set = true
- else
- if maxLV < lv then
- set = true
- elseif maxLV == lv and maxZhanDouLi < heroGrid.zhandouli then
- set = true
- end
- end
- --print("i,maxLV,lv,maxZhanDouLi,zhandouli,set",i,maxLV,lv,maxZhanDouLi,heroGrid.zhandouli,set)
- if set then
- maxLV = lv
- maxIndex = i
- maxZhanDouLi = heroGrid.zhandouli
- end
- end
- end
- end
- if not maxIndex then return end
- local gridIndex = isGongMing(human,maxIndex)
- if gridIndex then
- local gridList = human.db.xingYaoGongMing.gridList
- if gridList then
- gridList[gridIndex].heroIndex = nil
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- end
-
- local heroGrid = human.db.heroBag[maxIndex]
- gongMingGridHeroOff(human,heroGrid,maxIndex)
- end
- human.db.xingYaoGongMing.defList = human.db.xingYaoGongMing.defList or {}
- human.db.xingYaoGongMing.defList[maxIndex] = maxIndex
- end
- local function checkGongMingDB(human)
- --if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- --return
- --end
- if human.db.xingYaoGongMing then return end
- human.db.xingYaoGongMing = {}
- human.db.xingYaoGongMing.gridList = {}
- human.db.xingYaoGongMing.gridList[1] = {}
- for i=1,XINGYAO_GONGMING_DEFMAX do
- makeGongMingDef(human)
- end
-
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- end
- function CG_XINGYAOMEN_GONGMING_QUERY(human)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302,true) then
- return
- end
- checkGongMingDB(human)
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_QUERY
- local conf = XingYaoMenExcel.gongMing[1]
- makeXyGmGrids(human,msgRet.grid,conf)
- msgRet.maxGrid = conf.gridMax
-
- msgRet.defList[0] = 0
- local db = human.db.xingYaoGongMing
- if db and db.defList then
- for heroIndex in pairs(db.defList) do
- local heroGrid = human.db.heroBag[heroIndex]
- if heroGrid then
- msgRet.defList[0] = msgRet.defList[0] + 1
- local index = msgRet.defList[0]
- HeroGrid.makeHeroSimple(msgRet.defList[index], heroGrid, heroIndex, human)
- end
- end
- end
- Grid.makeItem(msgRet.cdClean,conf.cdClean[1],conf.cdClean[2])
- --Msg.trace(msgRet)
- Msg.send(msgRet,human.fd)
- GC_XINGYAOMEN_GONGMING_REDS(human)
- end
- local function gridCanOpen(human,gridIndex,send,checkItem)
- checkGongMingDB(human)
- local db = human.db.xingYaoGongMing
- if not db or not db.gridList then return end
- if gridIndex ~= 1 and not db.gridList[gridIndex - 1] then
- if send then
- Broadcast.sendErr(human,Lang.XINGYAOMEN_GONGMING_OPEN_ERR1)
- end
- return
- elseif db.gridList[gridIndex] then
- if send then
- Broadcast.sendErr(human,Lang.XINGYAOMEN_GONGMING_OPEN_ERR2)
- end
- return
- end
- if checkItem then
- local gongMingConf = XingYaoMenExcel.gongMing[1]
- local conf = XingYaoMenExcel.gongMingGrid
- local needItem = gongMingConf.openGridCostItem
- local needCnt = 0
- if gridIndex > #conf then
- needCnt = conf[#conf].openCost
- else
- needCnt = conf[gridIndex].openCost
- end
- local now = BagLogic.getItemCnt(human, ItemDefine.ITEM_XINGYAOGONGMING_ID)
- if now < needCnt then
- if send then
- Broadcast.sendErr(human,Lang.XINGYAOMEN_GONGMING_OPEN_ERR)
- end
- return
- end
- end
- return true
- end
- function CG_XINGYAOMEN_GONGMING_OPEN_QUERY(human,gridIndex)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302,true) then
- return
- end
- local gongMingConf = XingYaoMenExcel.gongMing[1]
- if gridIndex > gongMingConf.gridMax then
- return Broadcast.sendErr(human,Lang.XINGYAOMEN_GONGMING_OPEN_ERR3)
- end
- if not gridCanOpen(human,gridIndex,true) then return end
- local conf = XingYaoMenExcel.gongMingGrid
- local needItem = gongMingConf.openGridCostItem
- local needCnt = 0
- if gridIndex > #conf then
- needCnt = conf[#conf].openCost
- else
- needCnt = conf[gridIndex].openCost
- end
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_OPEN_QUERY
- Grid.makeItem(msgRet.cost, needItem, needCnt)
- msgRet.now = BagLogic.getItemCnt(human, ItemDefine.ITEM_XINGYAOGONGMING_ID)
- --Msg.trace(msgRet)
- Msg.send(msgRet,human.fd)
- end
- function CG_XINGYAOMEN_GONGMING_OPEN_DO(human,gridIndex)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302,true) then
- return
- end
- local gongMingConf = XingYaoMenExcel.gongMing[1]
- if gridIndex > gongMingConf.gridMax then return end
- if not gridCanOpen(human,gridIndex,true,true) then return end
- local conf = XingYaoMenExcel.gongMingGrid
- local needItem = gongMingConf.openGridCostItem
- local needCnt = 0
- if gridIndex > #conf then
- needCnt = conf[#conf].openCost
- else
- needCnt = conf[gridIndex].openCost
- end
- local now = BagLogic.getItemCnt(human, ItemDefine.ITEM_XINGYAOGONGMING_ID)
- if now < needCnt then
- return
- end
- BagLogic.delItem(human, ItemDefine.ITEM_XINGYAOGONGMING_ID, needCnt, "xingyao_gongming")
- human.db.xingYaoGongMing.gridList[gridIndex] = {}
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_OPEN_DO
- msgRet.gridIndex = gridIndex
- --Msg.trace(msgRet)
- Msg.send(msgRet,human.fd)
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- GC_XINGYAOMEN_GONGMING_REDS(human)
- end
- function CG_XINGYAOMEN_GONGMING_PUTON(human,heroIndex,gridIndex)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302,true) then
- return
- end
- checkGongMingDB(human)
- local db = human.db.xingYaoGongMing
- if not db then return end
- local conf = XingYaoMenExcel.gongMing[1]
- if gridIndex > conf.gridMax then return end
- local mingLV,mingIndex = getGongMingLV(human)
- if mingLV == 0 then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_DEF_ERR)
- end
- local heroGrid = human.db.heroBag[heroIndex]
- local mingGrid = human.db.heroBag[mingIndex]
- if not heroGrid or not mingGrid then return end
- if db.defList[heroIndex] then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_DEF_ERR)
- end
- if heroGrid.lv >= mingLV then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_ON_ERR5)
- end
- if not db.gridList or not db.gridList[gridIndex] then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_GRID_OPEN_ERR)
- end
- local gridData = db.gridList[gridIndex]
- if gridData then
- if gridData.heroIndex then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_ON_ERR2)
- elseif gridData.cdTime then
- local leftTime = math.max(gridData.cdTime - os.time(),0)
- if leftTime > 0 then
- return Broadcast.sendErr(human, Util.format(Lang.XINGYAOMEN_GONGMING_ON_ERR3,leftTime))
- end
- end
- end
- for _,data in pairs(db.gridList) do
- if data.heroIndex == heroIndex then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_ON_ERR1)
- end
- end
- human.db.xingYaoGongMing.gridList[gridIndex].heroIndex = heroIndex
- makeLvQuality(heroGrid,mingGrid)
- HeroLogic.sendHeroGridDynamic(human, heroGrid, heroIndex)
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_PUTON
- msgRet.heroIndex = heroIndex
- msgRet.gridIndex = gridIndex
- HeroGrid.makeHeroSimple(msgRet.hero,heroGrid,heroIndex,human)
- makeXyGmGridsByIndex(human,msgRet.grid,gridIndex,human.db.xingYaoGongMing.gridList[gridIndex])
- Msg.send(msgRet,human.fd)
- ObjHuman.doCalcHero(human, heroIndex)
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- end
- function CG_XINGYAOMEN_GONGMING_PUTOFF(human,gridIndex)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302,true) then
- return
- end
- checkGongMingDB(human)
- local db = human.db.xingYaoGongMing
- if not db then return end
- if not db.gridList or not db.gridList[gridIndex] then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_GRID_OPEN_ERR)
- end
- if not db.gridList[gridIndex].heroIndex then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_GRID_HERO_NO)
- end
- local heroIndex = db.gridList[gridIndex].heroIndex
- db.gridList[gridIndex].heroIndex = nil
- local heroGrid = human.db.heroBag[heroIndex]
- if not heroGrid then end
- local now = os.time()
- local conf = XingYaoMenExcel.gongMing[1]
- db.gridList[gridIndex].cdTime = now + conf.cdTime
-
- gongMingGridHeroOff(human,heroGrid,heroIndex)
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_PUTOFF
- msgRet.gridIndex = gridIndex
- msgRet.leftTime = math.max(db.gridList[gridIndex].cdTime - now,0)
- --Msg.trace(msgRet)
- Msg.send(msgRet,human.fd)
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- end
- function CG_XINGYAOMEN_GONGMING_CDCLEAN(human,gridIndex)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302,true) then
- return
- end
- local db = human.db.xingYaoGongMing
- if not db then return end
- if not db.gridList or not db.gridList[gridIndex] then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_GRID_OPEN_ERR)
- end
- if not db.gridList[gridIndex].cdTime then return end
- local leftTime = math.max(db.gridList[gridIndex].cdTime - os.time(),0)
- if leftTime <= 0 then
- return Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_CD_CLEAN)
- end
- local conf = XingYaoMenExcel.gongMing[1]
- if not BagLogic.checkItemCnt(human,conf.cdClean[1],conf.cdClean[2]) then
- return
- end
- BagLogic.delItem(human,conf.cdClean[1],conf.cdClean[2],"xingyao_gongming")
- db.gridList[gridIndex].cdTime = nil
- Broadcast.sendErr(human, Lang.XINGYAOMEN_GONGMING_CD_CLEAN_OK)
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_CDCLEAN
- msgRet.gridIndex = gridIndex
- --Msg.trace(msgRet)
- Msg.send(msgRet,human.fd)
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- end
- function getGongMingLV(human)
- local db = human.db.xingYaoGongMing
- if not db or not db.defList then return 0,0,0 end
- local mingLV = nil
- local mingIndex = nil
- local defCnt = 0
- for index in pairs(db.defList) do
- local heroGrid = human.db.heroBag[index]
- if heroGrid then
- defCnt = defCnt + 1
- if not mingLV or mingLV > heroGrid.lv then
- mingLV = heroGrid.lv
- mingIndex = index
- end
- end
- end
- if defCnt < XINGYAO_GONGMING_DEFMAX then
- return 0,0,0
- end
- return mingLV,mingIndex,defCnt
- end
- -- 是否正在共鸣 则不能做常规升级
- function isGongMing(human,heroIndex,sendType)
- if not human or not human.db.xingYaoGongMing or not human.db.xingYaoGongMing.gridList then return end
- for index,data in pairs(human.db.xingYaoGongMing.gridList) do
- if data.heroIndex and heroIndex == data.heroIndex then
- if sendType and sendType == XYHERO_LV then
- Broadcast.sendErr(human,Lang.XINGYAOMEN_GONGMING_LVUP_ERR)
- elseif sendType and sendType == XYHERO_RESET then
- Broadcast.sendErr(human,Lang.XINGYAOMEN_GONGMING_RESET_ERR)
- end
- return index
- end
- end
- end
- --刷新入驻英雄共鸣等级
- function refreshGongMing(human)
- if not human.db.xingYaoGongMing or not human.db.xingYaoGongMing.gridList then return end
- local mingLV,mingIndex = getGongMingLV(human)
- if mingLV == 0 then return end
- for i,data in pairs(human.db.xingYaoGongMing.gridList) do
- if data.heroIndex then
- local heroGrid = human.db.heroBag[data.heroIndex]
- local mingGrid = human.db.heroBag[mingIndex]
- if heroGrid and mingGrid then
- local send = nil
- if mingLV ~= heroGrid.lv then
- heroGrid.lv = mingLV
- send = true
- end
- if heroGrid.quality ~= mingGrid.quality then
- heroGrid.quality = mingGrid.quality
- send = true
- end
- if send then
- ObjHuman.doCalcHero(human, data.heroIndex)
- HeroLogic.sendHeroGridDynamic(human, heroGrid, data.heroIndex)
- end
- end
- end
- end
- end
- --增加新的英雄,是否影响到守卫和共鸣等级 heroIndex新增英雄背包index
- function onAddHero(human,heroGrid,heroIndex)
- --if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- --return
- --end
- --print("onAddHero lv heroIndex",heroGrid.lv,heroIndex)
- checkGongMingDB(human)
- local mingLV,minIndex,defCnt = getGongMingLV(human)
- human.db.xingYaoGongMing.defList = human.db.xingYaoGongMing.defList or {}
- local defList = human.db.xingYaoGongMing.defList
- if defList[heroIndex] then return end
- if defCnt >= XINGYAO_GONGMING_DEFMAX then
- if heroGrid.lv > mingLV then
- defList[minIndex] = nil
- defList[heroIndex] = heroIndex
- end
- refreshGongMing(human)
- else
- human.db.xingYaoGongMing.defList[heroIndex] = heroIndex
- end
- end
- --删除英雄,是否影响到守卫和共鸣等级 heroIndex原英雄背包index
- function onDelHero(human, heroGrid, heroIndex)
- --if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- --return
- --end
- checkGongMingDB(human)
- local defList = human.db.xingYaoGongMing.defList
- if not defList or not defList[heroIndex] then --删除的英雄不是守卫者,走卸下入驻逻辑
- putOff(human,heroGrid,heroIndex)
-
- return
- end
- defList[heroIndex] = nil
- makeGongMingDef(human)
- refreshGongMing(human)
- end
- --英雄升级,是否影响到守卫和共鸣等级 heroIndex原英雄背包index
- function onHeroLvUp(human,heroGrid,heroIndex)
- --if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- --return
- --end
- --print("onHeroLvUp lv heroIndex",heroGrid.lv,heroIndex)
- checkGongMingDB(human)
- local mingLV,minIndex,defCnt = getGongMingLV(human)
- local defList = human.db.xingYaoGongMing.defList
- if not defList then return end
- if defList[heroIndex] then
- refreshGongMing(human)
- else
- if heroGrid.lv > mingLV then
- human.db.xingYaoGongMing.defList[minIndex] = nil
- human.db.xingYaoGongMing.defList[heroIndex] = heroIndex
- refreshGongMing(human)
- end
- end
- end
- --英雄升阶
- function onHeroUpgrade(human,heroGrid,heroIndex)
- --if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- --return
- --end
- checkGongMingDB(human)
- local defList = human.db.xingYaoGongMing.defList
- if not defList then return end
- if not defList[heroIndex] then return end
- refreshGongMing(human)
- end
- --英雄分解重生觉醒等等操作,下阵入驻英雄
- function putOff(human,heroGrid,heroIndex)
- local gridIndex = isGongMing(human,heroIndex)
- if not gridIndex then return end
- local oldLv = heroGrid.oldLV or 0
- Log.write(Log.LOGID_TEST, "XingYaoGongMing putOff hero OldLv: "..oldLv.." Lv: "..heroGrid.lv.." humanUuid: ", human.db._id)
- makeLvQuality(heroGrid)
- human.db.xingYaoGongMing.gridList[gridIndex] = {}
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_302)
- end
- --征战扫荡掉落
- local function onSaoDang(human,items)
- local conf = XingYaoMenExcel.gongMing[1]
- local battleExtraItem = conf.battleExtraItem
- local battleExtraSaoDang = conf.battleExtraSaoDang
- local randomCnt = math.random(battleExtraSaoDang[1],battleExtraSaoDang[2])
- items[battleExtraItem] = (items[battleExtraItem] or 0) + randomCnt
- end
- --征战挂机收益
- function getItemOut(human,items,outCnt)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- return
- end
-
- checkGongMingDB(human)
- if not outCnt then
- onSaoDang(human,items)
- return
- end
- local conf = XingYaoMenExcel.gongMing[1]
- local battleExtraItem = conf.battleExtraItem
- local battleExtraCnt = conf.battleExtraCnt
- local cnt = math.ceil(math.random(battleExtraCnt[1] * outCnt,battleExtraCnt[2] * outCnt))
- if cnt > 0 then
- items[battleExtraItem] = (items[battleExtraItem] or 0) + cnt
- end
- end
- --扫荡奖励列表
- function getItemOutsShow(human,items)
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_302) then
- return
- end
- checkGongMingDB(human)
- local conf = XingYaoMenExcel.gongMing[1]
- local battleExtraItem = conf.battleExtraItem
- items[battleExtraItem] = 1
- end
- function getGongMingLVByIndex(human,heroIndex)
- if not human then return 0 end
- if not isGongMing(human,heroIndex) then return 0 end
- local mingLV = getGongMingLV(human)
- return mingLV or 0
- end
- function GC_XINGYAOMEN_GONGMING_REDS(human)
- local msgRet = Msg.gc.GC_XINGYAOMEN_GONGMING_REDS
- msgRet.nextGridRed = 0
-
- local db = human.db.xingYaoGongMing
- if not db or not db.gridList then return end
- local conf = XingYaoMenExcel.gongMing[1]
- local nextGrid = math.min(#db.gridList + 1,conf.gridMax)
- if not db.gridList[nextGrid] then
- if gridCanOpen(human,nextGrid,nil,true) then
- msgRet.nextGridRed = 1
- end
- end
-
- --Msg.trace(msgRet)
- Msg.send(msgRet,human.fd)
- end
- function makeLvQuality(heroGrid,targetGrid)
- if targetGrid then
- heroGrid.oldLV = heroGrid.lv
- heroGrid.lv = targetGrid.lv
- heroGrid.oldQuality = heroGrid.quality
- heroGrid.quality = targetGrid.quality
- else
- heroGrid.lv = heroGrid.oldLV
- heroGrid.oldLV = nil
- heroGrid.quality = heroGrid.oldQuality
- heroGrid.oldQuality = nil
- end
- end
- function isDot(human)
- if not human.db.xingYaoGongMing
- or not human.db.xingYaoGongMing.gridList
- then return true
- end
- local gridList = human.db.xingYaoGongMing.gridList
- local conf = XingYaoMenExcel.gongMing[1]
- local nextGrid = math.min(#gridList + 1,conf.gridMax)
- if not gridList[nextGrid] then
- if gridCanOpen(human,nextGrid,nil,true) then
- return true
- end
- end
-
- end
|