|
@@ -16,6 +16,7 @@ local ItemExcel = require("excel.item").item
|
|
|
local FuwenLogic = require("fuwen.FuwenLogic")
|
|
local FuwenLogic = require("fuwen.FuwenLogic")
|
|
|
local EquipLogic = require("equip.EquipLogic")
|
|
local EquipLogic = require("equip.EquipLogic")
|
|
|
local HeroGem = require("hero.HeroGem")
|
|
local HeroGem = require("hero.HeroGem")
|
|
|
|
|
+local EquipLogicGrid = require("equip.EquipLogicGrid")
|
|
|
|
|
|
|
|
function query(human, heroID, heroIndex)
|
|
function query(human, heroID, heroIndex)
|
|
|
local heroGrid = HeroLogic.getHeroGrid(human, heroID, heroIndex)
|
|
local heroGrid = HeroLogic.getHeroGrid(human, heroID, heroIndex)
|
|
@@ -36,9 +37,9 @@ function query(human, heroID, heroIndex)
|
|
|
if equipGrid then
|
|
if equipGrid then
|
|
|
cnt = cnt + 1
|
|
cnt = cnt + 1
|
|
|
if i == ItemDefine.EQUIP_SUBTYPE_SHUIJIN then -- 水晶比较特殊
|
|
if i == ItemDefine.EQUIP_SUBTYPE_SHUIJIN then -- 水晶比较特殊
|
|
|
- Grid.makeItem(msgRet.equips[cnt], equipGrid.id, 1, heroGrid.shuijingAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equips[cnt], equipGrid.id, 1, heroGrid.shuijingAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
else
|
|
else
|
|
|
- Grid.makeItem(msgRet.equips[cnt], equipGrid.id, 1, nil, equipGrid, -1, Grid.getOpflagAtBag(heroGrid.equip[i].id),nil,suitBonusTbl)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equips[cnt], equipGrid.id, 1, nil, equipGrid, -1, Grid.getOpflagAtBag(heroGrid.equip[i].id), nil, suitBonusTbl, nil, human)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -58,7 +59,7 @@ function query(human, heroID, heroIndex)
|
|
|
heroGrid.fuwen[i].id ~= nil then
|
|
heroGrid.fuwen[i].id ~= nil then
|
|
|
cnt = cnt + 1
|
|
cnt = cnt + 1
|
|
|
msgRet.fuwens[cnt].pos = i
|
|
msgRet.fuwens[cnt].pos = i
|
|
|
- Grid.makeItem(msgRet.fuwens[cnt].fuwen, heroGrid.fuwen[i].id, 1,nil,heroGrid.fuwen[i],-1, Grid.getOpflagAtBag(heroGrid.fuwen[i].id))
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.fuwens[cnt].fuwen, heroGrid.fuwen[i].id, 1, nil, heroGrid.fuwen[i], -1, Grid.getOpflagAtBag(heroGrid.fuwen[i].id), nil, nil, nil, human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
msgRet.fuwenGrid[i] = 1
|
|
msgRet.fuwenGrid[i] = 1
|
|
@@ -104,7 +105,7 @@ function putOn(human, heroID, heroIndex, bagIndex, noCalc)
|
|
|
--获取宝石加成
|
|
--获取宝石加成
|
|
|
local suitBonusTbl = HeroGem.suitAttrBonus(heroGrid)
|
|
local suitBonusTbl = HeroGem.suitAttrBonus(heroGrid)
|
|
|
|
|
|
|
|
- Grid.makeItem(msgRet.equip, equipID, 1, nil, equipGrid, bagIndex, Grid.getOpflagAtBag(equipID), nil, suitBonusTbl)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, equipID, 1, nil, equipGrid, bagIndex, Grid.getOpflagAtBag(equipID), nil, suitBonusTbl, nil, human)
|
|
|
|
|
|
|
|
if heroGrid.equip == nil or
|
|
if heroGrid.equip == nil or
|
|
|
heroGrid.equip[pos] == nil then
|
|
heroGrid.equip[pos] == nil then
|
|
@@ -210,7 +211,7 @@ function putOnHero(human, heroID, heroIndex, putHeroID, putHeroIndex, putHeroPos
|
|
|
--获取宝石加成
|
|
--获取宝石加成
|
|
|
local suitBonusTbl = HeroGem.suitAttrBonus(heroGrid)
|
|
local suitBonusTbl = HeroGem.suitAttrBonus(heroGrid)
|
|
|
|
|
|
|
|
- Grid.makeItem(msgRet.equip, equipID, 1, nil, equipGrid, bagIndex, Grid.getOpflagAtBag(equipID), nil, suitBonusTbl)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, equipID, 1, nil, equipGrid, bagIndex, Grid.getOpflagAtBag(equipID), nil, suitBonusTbl, nil, human)
|
|
|
|
|
|
|
|
--Grid.makeItem(msgRet.equip, equipID, 1, nil, equipGrid, 0, Grid.getOpflagAtBag(equipID))
|
|
--Grid.makeItem(msgRet.equip, equipID, 1, nil, equipGrid, 0, Grid.getOpflagAtBag(equipID))
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
@@ -295,7 +296,7 @@ function putOffQuick(human, heroID, heroIndex, noSendDy)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-function doCalcHero(obj,attrs)
|
|
|
|
|
|
|
+function doCalcHero(human, obj, attrs)
|
|
|
local equip = obj.equip
|
|
local equip = obj.equip
|
|
|
if not equip then return end
|
|
if not equip then return end
|
|
|
|
|
|
|
@@ -386,6 +387,12 @@ function doCalcHero(obj,attrs)
|
|
|
if equipConfig.subType == ItemDefine.EQUIP_SUBTYPE_RING or equipConfig.subType == ItemDefine.EQUIP_SUBTYPE_AMULET then
|
|
if equipConfig.subType == ItemDefine.EQUIP_SUBTYPE_RING or equipConfig.subType == ItemDefine.EQUIP_SUBTYPE_AMULET then
|
|
|
equipSuitCntTable[equipConfig.suit].isSpEquip = 1
|
|
equipSuitCntTable[equipConfig.suit].isSpEquip = 1
|
|
|
end
|
|
end
|
|
|
|
|
+
|
|
|
|
|
+ --等级 >= 15级的装备
|
|
|
|
|
+ if equipConfig.jobSuitIm and next(equipConfig.jobSuitIm) then
|
|
|
|
|
+ local jobId = EquipLogicGrid.GetEquipOwnerJob(human, equipGrid)
|
|
|
|
|
+ equipSuitCntTable[equipConfig.suit].jobId = jobId
|
|
|
|
|
+ end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
@@ -397,9 +404,16 @@ function doCalcHero(obj,attrs)
|
|
|
if v.cnt > 1 then
|
|
if v.cnt > 1 then
|
|
|
local equipIDTemp = v.equipID
|
|
local equipIDTemp = v.equipID
|
|
|
local equipConfigTemp = EquipExcel.equip[equipIDTemp]
|
|
local equipConfigTemp = EquipExcel.equip[equipIDTemp]
|
|
|
- for i = 1, #equipConfigTemp.suitIm do
|
|
|
|
|
- local keyTemp = equipConfigTemp.suitIm[i][1]
|
|
|
|
|
- local valTemp = equipConfigTemp.suitIm[i][2]
|
|
|
|
|
|
|
+ local suitImCfg = equipConfigTemp.suitIm
|
|
|
|
|
+ if v.jobId then
|
|
|
|
|
+ suitImCfg = Util.copyTable(equipConfigTemp.suitIm)
|
|
|
|
|
+ local attrInfo = equipConfigTemp.jobSuitIm[v.jobId]
|
|
|
|
|
+ EquipLogicGrid.MergeEquipSuitIm(suitImCfg, attrInfo)
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ for i = 1, #suitImCfg do
|
|
|
|
|
+ local keyTemp = suitImCfg[i][1]
|
|
|
|
|
+ local valTemp = suitImCfg[i][2]
|
|
|
if v.cnt > i then
|
|
if v.cnt > i then
|
|
|
-- 普通套装
|
|
-- 普通套装
|
|
|
if v.isSpEquip ~= 1 and (suitBonusTbl and suitBonusTbl[i+1]) then
|
|
if v.isSpEquip ~= 1 and (suitBonusTbl and suitBonusTbl[i+1]) then
|
|
@@ -457,7 +471,7 @@ function jihuoShuijing(human, heroID, heroIndex)
|
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
|
msgRet.heroID = heroID
|
|
msgRet.heroID = heroID
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
- Grid.makeItem(msgRet.equip, equipID, 1, heroGrid.shuijingAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, equipID, 1, heroGrid.shuijingAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -533,7 +547,7 @@ function shuijingTransDo(human, heroID, heroIndex)
|
|
|
human.tempAttrID = equipConfig.shuijingAttrID[indexTemp]
|
|
human.tempAttrID = equipConfig.shuijingAttrID[indexTemp]
|
|
|
|
|
|
|
|
-- 通知客户端
|
|
-- 通知客户端
|
|
|
- Grid.makeItem(msgRet.equip, equipID, 1, human.tempAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, equipID, 1, human.tempAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -567,7 +581,7 @@ function shuijingTransSave(human, heroID, heroIndex)
|
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
|
msgRet.heroID = heroID
|
|
msgRet.heroID = heroID
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
- Grid.makeItem(msgRet.equip, equipID, 1, heroGrid.shuijingAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, equipID, 1, heroGrid.shuijingAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
|
|
|
|
|
local msgRet = Msg.gc.GC_SHUIJING_TRANS_SAVE
|
|
local msgRet = Msg.gc.GC_SHUIJING_TRANS_SAVE
|
|
@@ -611,7 +625,7 @@ function shuijingUpLvQuery(human, mainType, heroID, heroIndex)
|
|
|
msgRet.equip[0] = 1
|
|
msgRet.equip[0] = 1
|
|
|
local attrID = heroGrid.shuijingAttrID
|
|
local attrID = heroGrid.shuijingAttrID
|
|
|
local tempAttrID = EquipExcel.shuijingAttr[attrID].lockNextID
|
|
local tempAttrID = EquipExcel.shuijingAttr[attrID].lockNextID
|
|
|
- Grid.makeItem(msgRet.equip[1], nextID, 1, tempAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip[1], nextID, 1, tempAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -689,13 +703,13 @@ function shuijingUpLvDo(human, mainType, heroID, heroIndex)
|
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
|
msgRet.heroID = heroID
|
|
msgRet.heroID = heroID
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
- Grid.makeItem(msgRet.equip, nextID, 1, heroGrid.shuijingAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, nextID, 1, heroGrid.shuijingAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
|
|
|
|
|
local msgRet = Msg.gc.GC_SHUIJING_UPLV_DO
|
|
local msgRet = Msg.gc.GC_SHUIJING_UPLV_DO
|
|
|
msgRet.heroID = heroID
|
|
msgRet.heroID = heroID
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
- Grid.makeItem(msgRet.equip, nextID, 1, heroGrid.shuijingAttrID)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, nextID, 1, heroGrid.shuijingAttrID, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -724,7 +738,7 @@ function shenqiUpLvQuery(human, heroID, heroIndex)
|
|
|
msgRet.heroID = heroID
|
|
msgRet.heroID = heroID
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
msgRet.needExp = shenqiUpNeedConfig.needExp
|
|
msgRet.needExp = shenqiUpNeedConfig.needExp
|
|
|
- Grid.makeItem(msgRet.equip, nextID, 1)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, nextID, 1, nil, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -811,7 +825,7 @@ function shenqiUpLvDo(human, heroID, heroIndex, equipIDList, equipCntList)
|
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
local msgRet = Msg.gc.GC_HERO_EQUIP_PUTON
|
|
|
msgRet.heroID = heroID
|
|
msgRet.heroID = heroID
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
- Grid.makeItem(msgRet.equip, nextID, 1)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip, nextID, 1, nil, nil, nil, nil, nil, nil, nil, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
|
|
|
|
|
local msgRet = Msg.gc.GC_SHENQI_UPLV_DO
|
|
local msgRet = Msg.gc.GC_SHENQI_UPLV_DO
|
|
@@ -819,7 +833,7 @@ function shenqiUpLvDo(human, heroID, heroIndex, equipIDList, equipCntList)
|
|
|
msgRet.heroIndex = heroIndex
|
|
msgRet.heroIndex = heroIndex
|
|
|
if backCnt > 0 then
|
|
if backCnt > 0 then
|
|
|
msgRet.equip[0] = 1
|
|
msgRet.equip[0] = 1
|
|
|
- Grid.makeItem(msgRet.equip[1], HeroDefine.DEFAULT_SHENQI_UPLV_BACK,backCnt)
|
|
|
|
|
|
|
+ Grid.makeItem(msgRet.equip[1], HeroDefine.DEFAULT_SHENQI_UPLV_BACK, backCnt, nil, nil, nil, nil, nil, nil, nil, human)
|
|
|
else
|
|
else
|
|
|
msgRet.equip[0] = 0
|
|
msgRet.equip[0] = 0
|
|
|
end
|
|
end
|