|
|
@@ -5,7 +5,7 @@ local MonsterExcel = require("excel.monster")
|
|
|
local ThroneExcel = require("excel.throne")
|
|
|
local MailExcel = require("excel.mail")
|
|
|
local RoleExcel = require("excel.role")
|
|
|
-local Lang = require("common.Lang")
|
|
|
+-- local Lang = require("common.Lang")
|
|
|
local Util = require("common.Util")
|
|
|
local Lang = require("common.Lang")
|
|
|
local Msg = require("core.Msg")
|
|
|
@@ -26,16 +26,33 @@ local MailManager = require("mail.MailManager")
|
|
|
local TheStarsDBLogic = require("theStars.TheStarsDBLogic")
|
|
|
local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
|
|
|
local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
|
|
|
-local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
|
|
|
-local ChengjiuDefine = require("chengjiu.ChengjiuDefine")
|
|
|
+-- local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
|
|
|
+-- local ChengjiuDefine = require("chengjiu.ChengjiuDefine")
|
|
|
local JjcLogic = require("jjc.JjcLogic")
|
|
|
local ItemExcel = require("excel.item").item
|
|
|
local MailDefine = require("mail.MailIdDefine")
|
|
|
local ChatPaoMaLogic = require("chat.ChatPaoMaLogic")
|
|
|
local HeroGrowUp = require("absAct.HeroGrowUp")
|
|
|
+local HeroLogic = require("hero.HeroLogic")
|
|
|
+local HeroExcel = require("excel.hero")
|
|
|
|
|
|
local FAIL_COMBAT_CD = 1200 -- 失败后冷却CD 1200
|
|
|
|
|
|
+
|
|
|
+local function getTargetHuman(playerUuid)
|
|
|
+ local targetHuman = ObjHuman.onlineUuid[playerUuid]
|
|
|
+ if not targetHuman then
|
|
|
+ local db = RoleDBLogic.getDb(playerUuid)
|
|
|
+ if db then
|
|
|
+ targetHuman = {}
|
|
|
+ targetHuman.db = db
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ return targetHuman
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
function isOpen(human,sendErr)
|
|
|
if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_1303,sendErr) then
|
|
|
return
|
|
|
@@ -138,19 +155,40 @@ function theStarsThroneQuery(human, id, vestId)
|
|
|
|
|
|
msgRet.lv = throne.lv
|
|
|
msgRet.nowEvolveCnt = throne.evolve or 0
|
|
|
+ msgRet.monsterList[0] = 0
|
|
|
|
|
|
- local monsterOutID = getMonsterOutID(throne.id, throne.lv)
|
|
|
- local monsterOutConfig = MonsterExcel.monsterOut[monsterOutID]
|
|
|
- local count = #monsterOutConfig.member
|
|
|
- for i = 1,count do
|
|
|
- local monsterID = monsterOutConfig.member[i][1]
|
|
|
- local lv = monsterOutConfig.member[i][2]
|
|
|
- local mcf = MonsterExcel.monster[monsterID]
|
|
|
- msgRet.monsterList[i].body = mcf.body
|
|
|
- msgRet.monsterList[i].lv = throne.lv
|
|
|
- msgRet.monsterList[i].camp = mcf.camp
|
|
|
+ if throne.uuid then
|
|
|
+ local targetHuman = getTargetHuman(throne.uuid)
|
|
|
+ if targetHuman then
|
|
|
+ local len = 0
|
|
|
+ local heroList = CombatPosLogic.getCombatHeros(targetHuman, CombatDefine.COMBAT_TYPE5)
|
|
|
+ for _, heroUuid in pairs(heroList or {}) do
|
|
|
+ local heroGrid = HeroLogic.getHeroGridByUuid(targetHuman, heroUuid)
|
|
|
+ if heroGrid then
|
|
|
+ len = len + 1
|
|
|
+ msgRet.monsterList[0] = len
|
|
|
+
|
|
|
+ local heroCfg = HeroExcel.hero[heroGrid.id]
|
|
|
+ msgRet.monsterList[len].body = heroGrid.body or heroCfg.body
|
|
|
+ msgRet.monsterList[len].lv = heroGrid.lv or 0
|
|
|
+ msgRet.monsterList[len].camp = heroCfg.camp
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+ else
|
|
|
+ local monsterOutID = getMonsterOutID(throne.id, throne.lv)
|
|
|
+ local monsterOutConfig = MonsterExcel.monsterOut[monsterOutID]
|
|
|
+ local count = #monsterOutConfig.member
|
|
|
+ for i = 1,count do
|
|
|
+ local monsterID = monsterOutConfig.member[i][1]
|
|
|
+ local lv = monsterOutConfig.member[i][2]
|
|
|
+ local mcf = MonsterExcel.monster[monsterID]
|
|
|
+ msgRet.monsterList[i].body = mcf.body
|
|
|
+ msgRet.monsterList[i].lv = throne.lv
|
|
|
+ msgRet.monsterList[i].camp = mcf.camp
|
|
|
+ end
|
|
|
+ msgRet.monsterList[0] = count
|
|
|
end
|
|
|
- msgRet.monsterList[0] = count
|
|
|
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
|
@@ -166,7 +204,7 @@ end
|
|
|
|
|
|
local function getNewLvExp(id, lv, exp, evolveCnt)
|
|
|
local starsCf = ThroneExcel.theStars[lv]
|
|
|
- exp = evolveCnt * starsCf.evolveExp + exp
|
|
|
+ exp = evolveCnt * starsCf.evolveExp + exp
|
|
|
while exp >= starsCf.exp do
|
|
|
lv = lv + 1
|
|
|
exp = exp - starsCf.exp
|
|
|
@@ -185,7 +223,7 @@ function checkCombatPos(human, args)
|
|
|
local evolveCnt = tonumber(args[2] or 0)
|
|
|
local vestId = args[3]
|
|
|
|
|
|
- if evolveCnt < 1 then return end -- 升级次数小于1,怀疑有人作弊
|
|
|
+ -- if evolveCnt < 1 then return end -- 升级次数小于1,怀疑有人作弊
|
|
|
|
|
|
local cf = ThroneExcel.throne[id]
|
|
|
if not cf then return end
|
|
|
@@ -197,7 +235,7 @@ function checkCombatPos(human, args)
|
|
|
|
|
|
local leftTime = getFightCoolTime(human)
|
|
|
if leftTime > 0 then
|
|
|
- return Broadcast.sendErr(human, Util.format(Lang.THRONE_CHALLENGE_TIME_INIT, math.ceil(leftTime / 60)))
|
|
|
+ return Broadcast.sendErr(human, Util.format(Lang.THRONE_CHALLENGE_TIME_INIT, math.ceil(leftTime / 60)))
|
|
|
end
|
|
|
|
|
|
if human.db._id == throne.uuid then --不能挑战自己
|
|
|
@@ -230,6 +268,9 @@ function fight(human, args)
|
|
|
cbParam.vestId = throne._id
|
|
|
cbParam.id = throne.id
|
|
|
cbParam.evolveCnt = tonumber(args[2] or 0)
|
|
|
+
|
|
|
+
|
|
|
+ args[#args+1] = throne.uuid
|
|
|
|
|
|
CombatLogic.combatBegin(human, cf.mapID, args, CombatDefine.COMBAT_TYPE5, cbParam)
|
|
|
|
|
|
@@ -287,7 +328,7 @@ function onFightEnd(human, result, type, cbParam, combatInfo)
|
|
|
combatInfo.endParam = ItemExcel[config.chenghaoID].icon.."|"..key1Value.."|"..key2Value
|
|
|
|
|
|
-- 重新设置敌人名字
|
|
|
- combatInfo.defender.name = Util.format(Lang.THE_STARS_DEFINCER, cbParam.newLv)
|
|
|
+ -- combatInfo.defender.name = Util.format(Lang.THE_STARS_DEFINCER, cbParam.newLv)
|
|
|
CombatVideo.saveThroneVideo(throne.id, combatInfo,cbParam.evolveCnt)
|
|
|
else
|
|
|
human.db.throneTime = os.time() -- 失败刷新CD
|
|
|
@@ -351,10 +392,24 @@ function getCombatMonsterOutID(human, side, args)
|
|
|
return getMonsterOutID(throne.id, newLv)
|
|
|
end
|
|
|
|
|
|
-function getCombatObjList(human,side)
|
|
|
- if side ~= CombatDefine.ATTACK_SIDE then return end
|
|
|
+function getCombatObjList(human,side, args)
|
|
|
+ -- if side ~= CombatDefine.ATTACK_SIDE then return end
|
|
|
+
|
|
|
+ local h
|
|
|
+ if side == CombatDefine.ATTACK_SIDE then
|
|
|
+ h = human
|
|
|
+ else
|
|
|
+ local playerUuuid = args and args[#args]
|
|
|
+ h = getTargetHuman(playerUuuid)
|
|
|
+ end
|
|
|
+
|
|
|
+ if not h then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ -- return CombatLogic.getHumanObjList(human, CombatDefine.COMBAT_TYPE1)
|
|
|
|
|
|
- return CombatLogic.getHumanObjList(human, CombatDefine.COMBAT_TYPE1)
|
|
|
+ return CombatLogic.getHumanObjList(h, CombatDefine.COMBAT_TYPE1)
|
|
|
end
|
|
|
|
|
|
|