Browse Source

新手引导增加创角奖励,2.增加需要完成问卷调查逻辑后才能进行下一步

gitxsm 3 tháng trước cách đây
mục cha
commit
1a7643985b

+ 3 - 0
script/common/ProtoID.lua

@@ -1785,6 +1785,9 @@ _ENV[1824]="CG_LEVELGIFT_QUERY"
 _ENV[1825]="GC_LEVELGIFT_QUERY"
 _ENV[1826]="CG_LEVELGIFT_GETREWARD"
 
+_ENV[1827]="GC_GUIDE_CTRATE_AWARD"
+_ENV[1828]="CG_GUIDE_CTRATE_AWARD_GET"
+
 
 _ENV[1896]="CG_ZHUANPAN_SUBSCRIBE_REWARD_QUERY"
 _ENV[1897]="GC_ZHUANPAN_SUBSCRIBE_REWARD_QUERY"

+ 77 - 4
script/module/guide/GuideLogic.lua

@@ -142,6 +142,19 @@ local function sendjumpinfo(human)
     Msg.send(tMsgData, human.fd)
 end
 
+
+local createRoleAwardArr = { {1203,1}, {118,10}, {101,5000000}, {112,1000} }
+local function sendCreateRoleAWard(human)
+    local tMsgData = Msg.gc.GC_GUIDE_CTRATE_AWARD
+    tMsgData.awardArr[0] = #createRoleAwardArr
+
+    for i, itemInfo in ipairs(createRoleAwardArr) do
+        Grid.makeItem(tMsgData.awardArr[i], itemInfo[1], itemInfo[2])
+    end
+
+    Msg.send(tMsgData, human.fd)
+end
+
 ------------------------------ data --------------------------------------
 
 -- 设置指引
@@ -743,18 +756,61 @@ function stepFinish(human, sid, noSend)
         end
     end
 
-    if sid == GUIDEID_SPECIALSID then
-        sendjumpinfo(human)
+    if sid == GUIDEID_SPECIALSID and (not human.db.getCreateRoleAward or not human.db.bGetJumpPrize ) then
+        if not human.db.getCreateRoleAward then
+            sendCreateRoleAWard(human)
+        else
+            sendjumpinfo(human)
+        end
     else
         refreshGuide(human)
         sendStep(human)
     end
 end
 
+local function isShowCreateAward(human)
+    local id = getGuideID(human)
+    local state = getGuideState(human)
+    local isIn103Step = false
+    if id and state == STATE_DOING then
+        local cf = GuideExcel.main_guide[id]
+        if cf and cf.guideList then
+            local currentStep = getGuideStep(human)
+            local currentSid = cf.guideList[currentStep + 1]
+            if id == 100 and (not human.db.getCreateRoleAward or not human.db.bGetJumpPrize) then
+                isIn103Step = true
+            end
+
+            -- if currentSid == GUIDEID_SPECIALSID then
+            --     isIn103Step = true
+            --     if not human.db.getCreateRoleAward then
+            --         sendCreateRoleAWard(human)
+            --     else
+            --         sendjumpinfo(human)
+            --     end
+            -- end
+        end
+    end
+    return isIn103Step
+end
+
 -- 登录回调
 function onLogin(human)
-    skipGuide(human)
-    refreshGuide(human, true)
+    local isIn103Step = isShowCreateAward(human)
+
+    -- 过了领取创角奖励和问卷调查这两个步骤后才执行跳过逻辑
+    if not isIn103Step then
+        skipGuide(human)
+        refreshGuide(human, true)
+    else
+        if not human.db.getCreateRoleAward then
+            return sendCreateRoleAWard(human)
+        else
+            if not human.db.bGetJumpPrize then
+                return sendjumpinfo(human)
+            end
+        end
+    end
     if getGuideState(human) == STATE_DOING then
         setLoginStep(human, getGuideID(human))
         sendStep(human)
@@ -948,4 +1004,21 @@ function stepwenjuanchose(human, szChoseID)
         refreshGuide(human)
         sendStep(human)
     end
+end
+
+
+-- 领取创角奖励
+function GetCreateRoleAward(human)
+    if not human.db.getCreateRoleAward then
+        local itemArr = {}
+        for i, itemInfo in ipairs(createRoleAwardArr) do
+            itemArr[i] = {itemInfo[1], itemInfo[2]}
+        end
+
+        BagLogic.addItemList(human, itemArr, "guide")
+
+        human.db.getCreateRoleAward = true
+    end
+
+    sendjumpinfo(human)
 end

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

@@ -14,4 +14,8 @@ end
 
 function CG_GUIDE_WENJUAN_CHOSE(human, msg)
 	GuideLogic.stepwenjuanchose(human, msg.szChoseID)
+end
+
+function CG_GUIDE_CTRATE_AWARD_GET(human, msg)
+	GuideLogic.GetCreateRoleAward(human)
 end

+ 10 - 1
script/module/guide/Proto.lua

@@ -49,4 +49,13 @@ CG_GUIDE_WENJUAN_CHOSE = {
     {"szChoseID",   1,      "string"}
 }
 
-GC_GUIDE_WENJUAN_JUMPOK = {}
+GC_GUIDE_WENJUAN_JUMPOK = {}
+
+
+
+-- 推送创角奖励
+GC_GUIDE_CTRATE_AWARD = {
+    {"awardArr",      4,      ItemData}
+}
+-- 领取创角奖励
+CG_GUIDE_CTRATE_AWARD_GET = {}