gitxsm 1 rok pred
rodič
commit
d66c136d6e

+ 3 - 2
script/Main.lua

@@ -3,7 +3,7 @@
   jit.flush()
   print("jit close")
 end
- 
+
 real_os_time = real_os_time or os.time 
 local Timer   
 function os.time(tb) 
@@ -88,7 +88,6 @@ end
   
 ConfigLoadFile = ConfigLoadFile or nil
 function require(str, not_need_exist) 
-    
     if not ConfigLoadFile then
         ConfigLoadFile = {}
         ConfigLoadFile = require("Config") 
@@ -411,5 +410,7 @@ local function initAfterHot()
 end  
 initAfterStart()
 initAfterHot() 
+
+
 collectgarbage("collect")
 print("logic:"..collectgarbage("count"))--, jit.status()) 

+ 8 - 0
script/module/combat/CombatImpl.lua

@@ -876,7 +876,15 @@ end
 function setExtraHit(target,hpValue,cmd,attrs)
 	local frame = result.frames[#result.frames]
 	local skillFrame = frame.skillList[#frame.skillList]
+	--处理下没有使用技能的情况
+	if not skillFrame then
+		print("======================没有使用技能====================")
+		setSkillID({pos = 99}, 66666)
+		skillFrame = frame.skillList[#frame.skillList]
+	end
+
 	local pos = target.pos
+
 	if not skillFrame.extraList[pos] then
 		skillFrame.extraList[pos] = {}
 	end

+ 69 - 5
script/module/dailyTask/MainTask.lua

@@ -19,13 +19,35 @@ local BagLogic = require("bag.BagLogic")
 local Lang = require("common.Lang")
 local Broadcast = require("broadcast.Broadcast")
 local Config = require("excel.mainTask")
-local TriggerDefine = require("trigger.TriggerDefine")
 local TriggerLogic = require("trigger.TriggerLogic")
+local TriggerDefine = require("trigger.TriggerDefine")
 local ObjHuman = require("core.ObjHuman")
 
+--日志标识
+local MAINTASKLOGTAG = "mainTask"
+
 --获取某类任务在该活动之前就达成的进度
 local function getTaskOldProgress(human, taskType)
+    local progress = 0
+
+    if taskType == TriggerDefine.HUANJINGTOWER_LV then
+        local HuanJingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
+        progress = HuanJingTowerLogic.getTowerLevel(human)
+
+    elseif taskType == TriggerDefine.LIANYU_PASS then
+        local LianyuLogic = require("lianyu.LianyuLogic")
+        progress = LianyuLogic.getMaxLv(human)
+
+    elseif taskType == TriggerDefine.REALM_UPGRADE then
+        local RoleRealmLogic = require("roleSystem.RoleRealmLogic")
+        progress = RoleRealmLogic.GetNowRealmLv(human)
+
+    elseif taskType == TriggerDefine.BATTLE_NORMAL_MODE_PASS then
+        local BattleLogic = require("battle.BattleLogic")
+        progress = BattleLogic.GetLevelByType(human)
+    end
 
+    return progress
 end
 
 
@@ -105,17 +127,59 @@ function EventCBFunc(eventType, uuid, nValue1, nValue2)
 
     --推数据给客户端更新
     if isNowTask then
-        
+        TaskQuery(human)
     end
 end
 
 
-
+--查询
 function TaskQuery(human)
-    
+    local taskData = human.db.mainTaskData.taskData
+    local nowTaskId = human.db.mainTaskData.nowTaskId
+    local maxTaskId = #Config
+
+    local nowTaskCfg = Config[nowTaskId]
+    local msgRet = Msg.gc.GC_MAINTASK_QUERY
+    msgRet.nowTaskId = nowTaskId
+    msgRet.nowProgess = taskData[nowTaskId] and taskData[nowTaskId].progress or 0
+    msgRet.condProgess = nowTaskCfg.condProgress
+    msgRet.taskDesc = nowTaskCfg.taskDesc
+    msgRet.panelID = nowTaskCfg.panelID
+    Grid.makeItem(msgRet.taskAward, nowTaskCfg.reward[1], nowTaskCfg.reward[2])
+    msgRet.isNoTask = 0
+
+    if nowTaskId == maxTaskId and taskData[nowTaskId] and taskData[nowTaskId].isGetReward then
+        msgRet.isNoTask = 1
+    end
+
+    Msg.send(msgRet, human.fd)
 end
 
 
+--领奖
 function GetReward(human, taskId)
-    
+    local taskData = human.db.mainTaskData.taskData
+    local nowTaskId = human.db.mainTaskData.nowTaskId
+
+    local nowTaskCfg = Config[nowTaskId]
+    if not taskData[nowTaskId] or taskData[nowTaskId].progress < nowTaskCfg.condProgress then
+        return Broadcast.sendErr(human, Lang.UNION_TASK_NOT_COMPLETE)
+    end
+
+    if taskData[nowTaskId] and taskData[nowTaskId].isGetReward then
+        return Broadcast.sendErr(human, Lang.FRIEND_HEART_GET_HAD)
+    end
+
+    taskData[nowTaskId].isGetReward = true
+
+
+    local rewardCfg = Config[nowTaskId].reward
+    BagLogic.addItemList(human, { {rewardCfg[1], rewardCfg[2]}}, MAINTASKLOGTAG)
+
+
+    nowTaskId = nowTaskId + 1
+    if Config[nowTaskId] then
+        human.db.mainTaskData.nowTaskId = nowTaskId
+    end
+    TaskQuery(human)
 end

+ 7 - 0
script/module/roleSystem/RoleRealmLogic.lua

@@ -139,6 +139,13 @@ function getRealmName(human)
     return name
 end
 
+--获取当前境界
+function GetNowRealmLv(human)
+    local realmLv = human.db.realmLv or 0
+    return realmLv
+end
+
+
 --红点判断
 function isDot(human)
     local realmLv = human.db.realmLv or 0