SCFC 9 месяцев назад
Родитель
Сommit
a25b59533f

+ 3 - 0
script/common/ProtoID.lua

@@ -1545,3 +1545,6 @@ _ENV[1574]="GC_SHOP_ALL_ITEM_QUERY"
 -- _ENV[1591]="CG_NEW_BUSONEACT_BUY_GET"
 -- _ENV[1592]="GC_NEW_BUSONEACT_YUANZHENG_QUERY"
 
+_ENV[1593]="GC_GUIDE_WENJUAN"
+_ENV[1594]="CG_GUIDE_WENJUAN_CHOSE"
+_ENV[1595]="GC_GUIDE_WENJUAN_JUMPOK"

+ 76 - 2
script/module/guide/GuideLogic.lua

@@ -36,10 +36,12 @@ local CommonDB = require("common.CommonDB")
 local OpenServerGiftLogic = require("present.OpenServerGiftLogic")
 local MaiDianDefine = require("MaiDian.MaiDianDefine")
 local MainDianLogic = require("MaiDian.MaiDianLogic")
+local GuideJumpExcel = require("excel.guideJump")
 
 local WeiLen = 30
 local GUIDECMD_LIST = {"battle"}
 local GUIDEID_FIRST = 0
+local GUIDEID_SPECIALSID = 103
 
 -- 指引中断处理方式
 SKIPTYPE_RESET = 0              -- 该指引重新从第一步开始
@@ -121,6 +123,25 @@ function initAfterHot()
     GUIDE_COMBAT_INFO.defFormation, GUIDE_COMBAT_INFO.defender)
 end
 
+local function sendjumpinfo(human)
+    local tMsgData = Msg.gc.GC_GUIDE_WENJUAN
+    tMsgData.tList[0] = #GuideJumpExcel.Jump
+
+    for nID, v in ipairs(GuideJumpExcel.Jump) do
+        local tData = tMsgData.tList[nID]
+        tData.nID = nID
+        tData.szName = v.szName
+    end
+
+    tMsgData.tPrize[0] = #GuideJumpExcel.Prize[1].tPrize
+
+    for index, v in ipairs(GuideJumpExcel.Prize[1].tPrize) do
+        Grid.makeItem(tMsgData.tPrize[index], v[1], v[2])
+    end
+
+    Msg.send(tMsgData, human.fd)
+end
+
 ------------------------------ data --------------------------------------
 
 -- 设置指引
@@ -722,8 +743,12 @@ function stepFinish(human, sid, noSend)
         end
     end
 
-    refreshGuide(human)
-    sendStep(human)
+    if sid == GUIDEID_SPECIALSID then
+        sendjumpinfo(human)
+    else
+        refreshGuide(human)
+        sendStep(human)
+    end
 end
 
 -- 登录回调
@@ -735,6 +760,19 @@ function onLogin(human)
         sendStep(human)
     end
     sendLvGuide(human)
+
+    if human.db.lv and human.db.lv <= 4 then
+        local nID = getGuideID(human)
+        local nMaxID = 0
+        for i, v in pairs(GuideExcel.main_guide) do
+            nMaxID = math.max(nMaxID, i)
+        end
+
+        if nMaxID ==  nID then
+            local tMsgData = Msg.gc.GC_GUIDE_WENJUAN_JUMPOK
+            Msg.send(tMsgData, human.fd)    
+        end
+    end
 end
 
 
@@ -870,4 +908,40 @@ function checkAllFinish(human)
   --  local isFinish = isFinishGuideID(human, 1200)
 
     return isFinishGuideID(human, 1200) and 1 or 0
+end
+
+function stepwenjuanchose(human, szChoseID)
+    local tChoseID = Util.split(szChoseID, "|")
+    local bJump = false
+    if tChoseID and nil ~= _G.next(tChoseID) then
+        for _, key in ipairs(tChoseID) do
+            local nID = tonumber(key)
+            if GuideJumpExcel.Jump[nID] and GuideJumpExcel.Jump[nID].bJump 
+                and GuideJumpExcel.Jump[nID].bJump == 1 then
+                    bJump = true
+                    break
+            end
+        end
+    end
+
+    local tPrize = GuideJumpExcel.Prize[1].tPrize
+    BagLogic.addItemList(human, tPrize, "guide")
+
+    if true == bJump then
+        local nMaxID = 0
+        for nID, v in pairs(GuideExcel.main_guide) do
+            nMaxID = math.max(nMaxID, nID)
+        end
+
+        print("[stepwenjuanchose] 设置完成主线 nMaxID = "..nMaxID)
+        setGuide(human, nMaxID, STATE_FINISH)
+
+        local tMsgData = Msg.gc.GC_GUIDE_WENJUAN_JUMPOK
+        Msg.send(tMsgData, human.fd)
+
+        ObjHuman.save(human)
+    else
+        refreshGuide(human)
+        sendStep(human)
+    end
 end

+ 3 - 0
script/module/guide/Handler.lua

@@ -12,3 +12,6 @@ function CG_GUIDE_QUEST_LV_INFO(human, msg)
 	GuideLogic.stepLvInfo(human, msg.id, msg.guideId)
 end
 
+function CG_GUIDE_WENJUAN_CHOSE(human, msg)
+	GuideLogic.stepwenjuanchose(human, msg.szChoseID)
+end

+ 52 - 35
script/module/guide/Proto.lua

@@ -1,35 +1,52 @@
-
-
-GuideStepNet = {
-    {"id",          1,      "int"},         -- 步骤id
-    {"conditions",  1,      "string"},      -- 条件列表 json
-    {"behavior",    1,      "string"},      -- 触发行为 json
-    {"sound",       1,      "int"},         -- 声音配置
-    {"dialog",      1,      "byte"},        -- 对话框显示方式 0没有对话 1左下 2左上 3右上 4右下
-    {"content",     1,      "string"},      -- 对话内容
-    {"handid",		1,		"int"},			-- 手指特效id
-    {"zhiyin",		1,		"byte"},			-- 手指特效id
-    {"heroLhID",	1,		"string"},			-- 英雄半身像
-    {"skip",        1,      "byte"},        -- 0 不跳过  1 跳过
-}
-
--- 指引步骤信息 登录或变化时推
-GC_GUIDE_STEP = {
-    {"step",        2,      GuideStepNet},  -- 数组长度0表示没有下一步指引了
-}
-
--- 指引步骤完成
-CG_GUIDE_STEP_FINISH = {
-    {"id",          1,      "int"},         -- 步骤id    
-}
-
-
--- 指引步骤完成
-CG_GUIDE_QUEST_LV_INFO = {
-    {"id",          1,      "int"},         -- 步骤id 
-    {"guideId",     1,      "int"},         -- 步骤id 
-}
-
-CG_GUIDE_LV_FINISH = {
-    {"id",          1,      "int"},         -- 步骤id    
-}
+local ItemData = require("bag.Proto").ItemData
+
+GuideStepNet = {
+    {"id",          1,      "int"},         -- 步骤id
+    {"conditions",  1,      "string"},      -- 条件列表 json
+    {"behavior",    1,      "string"},      -- 触发行为 json
+    {"sound",       1,      "int"},         -- 声音配置
+    {"dialog",      1,      "byte"},        -- 对话框显示方式 0没有对话 1左下 2左上 3右上 4右下
+    {"content",     1,      "string"},      -- 对话内容
+    {"handid",		1,		"int"},			-- 手指特效id
+    {"zhiyin",		1,		"byte"},			-- 手指特效id
+    {"heroLhID",	1,		"string"},			-- 英雄半身像
+    {"skip",        1,      "byte"},        -- 0 不跳过  1 跳过
+}
+
+-- 指引步骤信息 登录或变化时推
+GC_GUIDE_STEP = {
+    {"step",        2,      GuideStepNet},  -- 数组长度0表示没有下一步指引了
+}
+
+-- 指引步骤完成
+CG_GUIDE_STEP_FINISH = {
+    {"id",          1,      "int"},         -- 步骤id    
+}
+
+
+-- 指引步骤完成
+CG_GUIDE_QUEST_LV_INFO = {
+    {"id",          1,      "int"},         -- 步骤id 
+    {"guideId",     1,      "int"},         -- 步骤id 
+}
+
+CG_GUIDE_LV_FINISH = {
+    {"id",          1,      "int"},         -- 步骤id    
+}
+
+GuideWenJuan = {
+    {"nID",         1,      "int"},         -- id
+    {"szName",      1,      "string"}       -- 游戏名
+}
+
+-- 推问卷数据
+GC_GUIDE_WENJUAN = {
+    {"tList",       8,      GuideWenJuan},
+    {"tPrize",      5,      ItemData}
+}
+
+CG_GUIDE_WENJUAN_CHOSE = {
+    {"szChoseID",   1,      "string"}
+}
+
+GC_GUIDE_WENJUAN_JUMPOK = {}

+ 5 - 2
script/module/yunying/YunYingLogic.lua

@@ -678,6 +678,7 @@ end
 
 
 function sendBanner(human)
+    local nNowLv = human.db.lv
     local bannerList = { }
     local len = 0
     for k, _id in ipairs(BANNER_LIST_SERVER) do
@@ -691,7 +692,7 @@ function sendBanner(human)
                local funcConfig = getFuncConfig(moduleFn.funcID[config.funcID[i]])
                local active = nil
                if moduleFn.isActive and
-                   not moduleFn.isActive(human, YYInfo, funcConfig) then
+                   not moduleFn.isActive(human, YYInfo, funcConfig) and nNowLv >= funcConfig.openLv then
                    if dot ~= true then
                        dot = moduleFn.isRed and moduleFn.isRed(human, YYInfo, funcConfig)
                    end
@@ -709,7 +710,7 @@ function sendBanner(human)
             local funcConfig = getFuncConfig(moduleFn.funcID[config.funcID[1]])
             local active = nil
             if moduleFn.isActive and
-                not moduleFn.isActive(human, YYInfo, funcConfig) then
+                not moduleFn.isActive(human, YYInfo, funcConfig) and nNowLv >= funcConfig.openLv then
                 local leftTime, endTime, startTime = 0
                 local state = false
                 if isAbsfunc(moduleFn.funcID[config.funcID[1]]) then
@@ -873,6 +874,8 @@ function onLevelUp(human, oldLv, newLv)
             end
         end
     end
+
+    sendBanner(human)
 end