From 405fed5123bce7df92a5ad44ae1d97db4f298ec7 Mon Sep 17 00:00:00 2001 From: Admin Date: Sun, 21 Jun 2026 21:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BB=BB=E5=8A=A1=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mir200/Envir/Extension/UtilServer/Npc.lua | 4 + .../Mir200/Envir/QuestDiary/config/VarCfg.lua | 3 + .../游戏功能/A0_通用类/MainLineTask.lua | 440 ++++++++++++++++++ .../GUIExport/game/Tongyong/TaskShowUI.lua | 32 +- client/dev/GUILayout/delay/TaskShowOBJ.lua | 123 +++++ .../game/tongyong/MainLineTaskOBJ.lua | 13 + .../GUILayout/game/tongyong/ShouChongOBJ.lua | 5 + .../dev/scripts/game_config/cfg_monster.lua | 4 +- 8 files changed, 621 insertions(+), 3 deletions(-) create mode 100644 Mirserver/Mir200/Envir/QuestDiary/游戏功能/A0_通用类/MainLineTask.lua create mode 100644 client/dev/GUILayout/game/tongyong/MainLineTaskOBJ.lua diff --git a/Mirserver/Mir200/Envir/Extension/UtilServer/Npc.lua b/Mirserver/Mir200/Envir/Extension/UtilServer/Npc.lua index 02dfa595..8fcdd9ff 100644 --- a/Mirserver/Mir200/Envir/Extension/UtilServer/Npc.lua +++ b/Mirserver/Mir200/Envir/Extension/UtilServer/Npc.lua @@ -7,6 +7,10 @@ Npc.clicknpcCfg = {} function clicknpc(actor, npcID, sScript) Func.sendmsg9(actor, "NPC:" .. npcID) + if MainLineTaskOBJ and MainLineTaskOBJ.onVisitNpc then + MainLineTaskOBJ:onVisitNpc(actor, npcID, sScript) + end + if sScript == "ؽӴԱ" then TianGuanOBJ:publicMian(actor, npcID) diff --git a/Mirserver/Mir200/Envir/QuestDiary/config/VarCfg.lua b/Mirserver/Mir200/Envir/QuestDiary/config/VarCfg.lua index 2b68b72e..b86dfe91 100644 --- a/Mirserver/Mir200/Envir/QuestDiary/config/VarCfg.lua +++ b/Mirserver/Mir200/Envir/QuestDiary/config/VarCfg.lua @@ -35,6 +35,9 @@ VarCfg.Player.int["ǧ VarCfg.Player.int["˲ι"] = "INT_˲ι" VarCfg.Player.int["ɽѩ"] = "INT_ɽѩ" VarCfg.Player.int["ʬ"] = "INT_ʬ" +VarCfg.Player.int["ID"] = "INT_ID" +VarCfg.Player.int["״̬"] = "INT_״̬" +VarCfg.Player.int[""] = "INT_" VarCfg.Player.int.cd = {} VarCfg.Player.int.cd[""] = "INT_CD" ---* cd diff --git a/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A0_通用类/MainLineTask.lua b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A0_通用类/MainLineTask.lua new file mode 100644 index 00000000..453e2c76 --- /dev/null +++ b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A0_通用类/MainLineTask.lua @@ -0,0 +1,440 @@ +MainLineTaskOBJ = {} + +MainLineTaskOBJ._name = "MainLineTaskOBJ" +MainLineTaskOBJ.STATUS_WAIT_VISIT = 0 +MainLineTaskOBJ.STATUS_DOING = 1 +MainLineTaskOBJ.STATUS_FINISH = 9 + +MainLineTaskOBJ.cfg = { + [1] = { + id = 1, + next = 2, + enabled = true, + title = "[]˽׳", + desc = "˽׳ǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "100򡢽5000", + visit = { type = "module", keys = { "ShouChongOBJ" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "money", "", 1000000 }, { "money", "", 5000 } }, + }, + [2] = { + id = 2, + next = 3, + enabled = true, + title = "[]ݷöɽ", + desc = "ݷöɽǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "100򡢽10000", + visit = { type = "npc", ids = { 6 }, scripts = { "ת" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "money", "", 1000000 }, { "money", "", 10000 } }, + }, + [3] = { + id = 3, + next = 4, + enabled = true, + title = "[]ݷ޴", + desc = "ݷ޴ǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "֮Ѫ*50֮*50", + visit = { type = "npc", ids = { 5 }, scripts = { "޴" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "item", "֮Ѫ", 50, 0 }, { "item", "֮", 50, 0 } }, + }, + [4] = { + id = 4, + next = 5, + enabled = true, + title = "[]ݷϽ", + desc = "ݷϽ˺ǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "100ǧʯ*5010000", + visit = { type = "npc", ids = { 189 }, scripts = { "Ͻ«" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "money", "", 1000000 }, { "item", "ǧʯ", 50, 0 }, { "money", "", 10000 } }, + }, + [5] = { + id = 5, + next = 6, + enabled = true, + title = "[]˽ѧNPC", + desc = "˽ѧNPCǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "ʯ*50ؼ*1", + visit = { type = "npc", ids = { 12 }, scripts = { "ѧ" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "item", "ʯ", 50, 0 }, { "item", "ؼ", 1, 0 } }, + }, + [6] = { + id = 6, + next = 7, + enabled = true, + title = "[]ݷ", + desc = "ݷӺǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "100򡢽10000", + visit = { type = "npc", ids = { 11 }, scripts = { "" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "money", "", 1000000 }, { "money", "", 10000 } }, + }, + [7] = { + id = 7, + next = 8, + enabled = true, + title = "[]ǰװ", + desc = "ǰװǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "100򡢽10000", + visit = { type = "npc", ids = { 10 }, scripts = { "װ" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "money", "", 1000000 }, { "money", "", 10000 } }, + }, + [8] = { + id = 8, + next = 9, + enabled = true, + title = "[]ǰ", + desc = "ǰǰͼɱ5ֻ", + doingDesc = "ǰͼɱ", + rewardText = "ʯ*410000", + visit = { type = "npc", ids = { 13 }, scripts = { "" } }, + target = { type = "kill_mon", count = 5, map = "*", mon = "*" }, + rewards = { { "item", "ʯ", 4, 0 }, { "money", "", 10000 } }, + }, + [9] = { + id = 9, + next = nil, + enabled = true, + title = "[]", + desc = "ɡ", + doingDesc = "ɡ", + rewardText = "", + visit = nil, + target = nil, + rewards = {}, + finish = true, + }, +} + +function MainLineTaskOBJ:getTask(id) + return self.cfg[tonumber(id or 1)] +end + +function MainLineTaskOBJ:setTask(id, cfg) + if not id or not cfg then + return false + end + cfg.id = tonumber(id) + self.cfg[tonumber(id)] = cfg + return true +end + +function MainLineTaskOBJ:deleteTask(id) + id = tonumber(id) + if not id then + return false + end + self.cfg[id] = nil + return true +end + +function MainLineTaskOBJ:getValidTask(id) + id = tonumber(id) + if not id then + return nil + end + local task = self:getTask(id) + local guard = 0 + while task and task.enabled == false and task.next and guard < 100 do + task = self:getTask(task.next) + guard = guard + 1 + end + return task +end + +function MainLineTaskOBJ:getTaskId(actor) + local id = Player.getint(actor, VarCfg.Player.int["ID"]) or 0 + if id <= 0 then + id = 1 + self:setState(actor, id, self.STATUS_WAIT_VISIT, 0) + end + local task = self:getValidTask(id) + if task and task.id ~= id then + id = task.id + local status = task.finish and self.STATUS_FINISH or self.STATUS_WAIT_VISIT + self:setState(actor, id, status, 0) + elseif not task then + id = 9 + self:setState(actor, id, self.STATUS_FINISH, 0) + end + return id +end + +function MainLineTaskOBJ:getStatus(actor) + return Player.getint(actor, VarCfg.Player.int["״̬"]) or self.STATUS_WAIT_VISIT +end + +function MainLineTaskOBJ:getProgress(actor) + return Player.getint(actor, VarCfg.Player.int[""]) or 0 +end + +function MainLineTaskOBJ:setState(actor, id, status, progress) + Player.setint(actor, VarCfg.Player.int["ID"], id) + Player.setint(actor, VarCfg.Player.int["״̬"], status) + Player.setint(actor, VarCfg.Player.int[""], progress or 0) +end + +function MainLineTaskOBJ:contains(list, value) + if not list then + return false + end + for _, v in ipairs(list) do + if tostring(v) == tostring(value) then + return true + end + end + return false +end + +function MainLineTaskOBJ:visitMatched(task, visitKey, npcID, sScript) + if not task or not task.visit then + return false + end + local visit = task.visit + if visit.type == "module" then + return self:contains(visit.keys, visitKey) + end + if visit.type == "npc" then + return self:contains(visit.ids, npcID) or self:contains(visit.scripts, sScript) + end + return false +end + +function MainLineTaskOBJ:getRewardView(task) + local itemRewards = {} + local moneyRewards = {} + for _, reward in ipairs((task and task.rewards) or {}) do + local rtype = reward[1] + local name = reward[2] + local num = tonumber(reward[3]) or 0 + local bind = tonumber(reward[4]) or 0 + if name and num > 0 then + if rtype == "item" then + table.insert(itemRewards, { name = name, count = num, bind = bind, type = rtype }) + elseif rtype == "money" then + table.insert(itemRewards, { name = name, count = num, bind = 0, type = rtype }) + table.insert(moneyRewards, { name = name, count = num }) + end + end + end + return itemRewards, moneyRewards +end +function MainLineTaskOBJ:getTaskView(actor) + local id = self:getTaskId(actor) + local task = self:getValidTask(id) + if not task then + task = self.cfg[9] + id = 9 + self:setState(actor, id, self.STATUS_FINISH, 0) + end + local status = self:getStatus(actor) + local progress = self:getProgress(actor) + local target = task and task.target or nil + local need = target and target.count or 0 + if task and task.finish then + status = self.STATUS_FINISH + progress = 0 + need = 0 + end + local statusText = "ݷ" + local desc = task and task.desc or "" + if status == self.STATUS_DOING then + statusText = "" + desc = task.doingDesc or desc + elseif status == self.STATUS_FINISH or (task and task.finish) then + statusText = "" + desc = task.desc or "ɡ" + end + local rewardItems, rewardMoneys = self:getRewardView(task) + return { + id = task and task.id or id, + title = task and task.title or "[]", + desc = desc, + status = status, + statusText = statusText, + progress = progress, + need = need, + rewardText = task and task.rewardText or "", + rewardItems = rewardItems, + rewardMoneys = rewardMoneys, + finish = task and task.finish and true or false, + } +end + +function MainLineTaskOBJ:sync(actor) + if not isnotnull(actor) then + return + end + if self:tryCompleteReady(actor) then + return + end + Message:SubLink(actor, self._name .. "_sync", self:getTaskView(actor)) +end + +function MainLineTaskOBJ:startTask(actor, task) + self:setState(actor, task.id, self.STATUS_DOING, 0) + Func.sendmsg9(actor, string.format("[]:#70|ѽȡ%s", task.title)) + self:sync(actor) +end + +function MainLineTaskOBJ:onVisit(actor, visitKey) + local id = self:getTaskId(actor) + local task = self:getValidTask(id) + if not task or task.finish or self:getStatus(actor) ~= self.STATUS_WAIT_VISIT then + self:sync(actor) + return + end + if self:visitMatched(task, visitKey, nil, nil) then + self:startTask(actor, task) + else + self:sync(actor) + end +end + +function MainLineTaskOBJ:onVisitNpc(actor, npcID, sScript) + local id = self:getTaskId(actor) + local task = self:getValidTask(id) + if not task or task.finish or self:getStatus(actor) ~= self.STATUS_WAIT_VISIT then + self:sync(actor) + return + end + if self:visitMatched(task, nil, npcID, sScript) then + self:startTask(actor, task) + else + self:sync(actor) + end +end + +function MainLineTaskOBJ:giveItemRewards(actor, items) + if #items <= 0 then + return + end + local itemStrs = {} + for _, item in ipairs(items) do + table.insert(itemStrs, string.format("%s#%s#%s", item[1], item[2], item[3] or 0)) + end + gives(actor, table.concat(itemStrs, "&"), "") +end + +function MainLineTaskOBJ:giveRewards(actor, rewards) + local items = {} + for _, reward in ipairs(rewards or {}) do + local rtype = reward[1] + local name = reward[2] + local num = tonumber(reward[3]) or 0 + local bind = tonumber(reward[4]) or 0 + if rtype == "money" then + local moneyId = ConstCfg.sysMoney[name] + if moneyId and num > 0 then + changemoney(actor, moneyId, "+", num, "", true) + end + elseif rtype == "item" and name and num > 0 then + table.insert(items, { name, num, bind }) + end + end + self:giveItemRewards(actor, items) +end + +function MainLineTaskOBJ:completeTask(actor, task) + self:giveRewards(actor, task.rewards) + Func.sendmsg9(actor, string.format("[]:#70|%sѷš", task.title)) + + local nextTask = self:getValidTask(task.next) + if nextTask then + if nextTask.finish then + self:setState(actor, nextTask.id, self.STATUS_FINISH, 0) + else + self:setState(actor, nextTask.id, self.STATUS_WAIT_VISIT, 0) + end + else + self:setState(actor, 9, self.STATUS_FINISH, 0) + end + self:sync(actor) +end + +function MainLineTaskOBJ:tryCompleteReady(actor) + if self:getStatus(actor) ~= self.STATUS_DOING then + return false + end + local id = self:getTaskId(actor) + local task = self:getValidTask(id) + if not task or not task.target or task.target.type ~= "kill_mon" then + return false + end + local need = tonumber(task.target.count) or 0 + if need > 0 and self:getProgress(actor) >= need then + Player.setint(actor, VarCfg.Player.int[""], need) + self:completeTask(actor, task) + return true + end + return false +end +function MainLineTaskOBJ:onKillMon(actor, mon, itype, kill, monName, mapID) + if self:getStatus(actor) ~= self.STATUS_DOING then + return + end + local id = self:getTaskId(actor) + local task = self:getValidTask(id) + if not task or not task.target or task.target.type ~= "kill_mon" then + return + end + local target = task.target + if target.map and target.map ~= "*" and tostring(target.map) ~= tostring(mapID) then + return + end + if target.mon and target.mon ~= "*" and tostring(target.mon) ~= tostring(monName) then + return + end + local need = tonumber(target.count) or 0 + local progress = self:getProgress(actor) + 1 + if progress >= need then + Player.setint(actor, VarCfg.Player.int[""], need) + self:completeTask(actor, task) + else + Player.setint(actor, VarCfg.Player.int[""], progress) + self:sync(actor) + end +end + +GameEvent.add(EventCfg.onLogin, function(actor) + MainLineTaskOBJ:sync(actor) +end, MainLineTaskOBJ) + +GameEvent.add(EventCfg.onqfloadend, function(actor) + MainLineTaskOBJ:sync(actor) +end, MainLineTaskOBJ) + +GameEvent.add(EventCfg.onKillMon, function(actor, mon, itype, kill, monName, mapID) + MainLineTaskOBJ:onKillMon(actor, mon, itype, kill, monName, mapID) +end, MainLineTaskOBJ) + +MainLineTaskOBJ.allowFunc = { "query", "visit" } + +function MainLineTaskOBJ:query(actor) + self:sync(actor) +end + +function MainLineTaskOBJ:visit(actor, p1, p2, p3, data) + local visitKey = p1 + if type(data) == "table" then + visitKey = data[1] or data.visitKey or visitKey + end + if visitKey then + self:onVisit(actor, visitKey) + else + self:sync(actor) + end +end + +return MainLineTaskOBJ \ No newline at end of file diff --git a/client/dev/GUIExport/game/Tongyong/TaskShowUI.lua b/client/dev/GUIExport/game/Tongyong/TaskShowUI.lua index ea78db58..7da0b2fc 100644 --- a/client/dev/GUIExport/game/Tongyong/TaskShowUI.lua +++ b/client/dev/GUIExport/game/Tongyong/TaskShowUI.lua @@ -10,11 +10,41 @@ function ui.init(parent, __data__, __update__) GUI:setTag(Layer, -1) -- Create TaskShow_Layout - local TaskShow_Layout = GUI:Layout_Create(Layer, "TaskShow_Layout", 0, 0, 200, 185, false) + local TaskShow_Layout = GUI:Layout_Create(Layer, "TaskShow_Layout", 0, 0, 202, 188, false) GUI:setAnchorPoint(TaskShow_Layout, 0.00, 0.00) GUI:setTouchEnabled(TaskShow_Layout, false) GUI:setTag(TaskShow_Layout, 0) + local Bg = GUI:Layout_Create(TaskShow_Layout, "Bg", 0, 0, 202, 188, false) + GUI:Layout_setBackGroundColorType(Bg, 1) + GUI:Layout_setBackGroundColor(Bg, "#000000") + GUI:Layout_setBackGroundColorOpacity(Bg, 120) + GUI:setTouchEnabled(Bg, false) + + local TaskTitle_Text = GUI:Text_Create(TaskShow_Layout, "TaskTitle_Text", 8, 166, 15, "#f6d27a", "[主线]任务") + GUI:setAnchorPoint(TaskTitle_Text, 0.00, 0.50) + GUI:Text_enableOutline(TaskTitle_Text, "#000000", 1) + + local TaskStatus_Text = GUI:Text_Create(TaskShow_Layout, "TaskStatus_Text", 154, 166, 13, "#28ef01", "") + GUI:setAnchorPoint(TaskStatus_Text, 0.00, 0.50) + GUI:Text_enableOutline(TaskStatus_Text, "#000000", 1) + + local TaskDesc_Text = GUI:Text_Create(TaskShow_Layout, "TaskDesc_Text", 8, 134, 13, "#ffffff", "") + GUI:setAnchorPoint(TaskDesc_Text, 0.00, 0.50) + GUI:Text_enableOutline(TaskDesc_Text, "#000000", 1) + + local TaskProgress_Text = GUI:Text_Create(TaskShow_Layout, "TaskProgress_Text", 8, 104, 14, "#28ef01", "进度:0/0") + GUI:setAnchorPoint(TaskProgress_Text, 0.00, 0.50) + GUI:Text_enableOutline(TaskProgress_Text, "#000000", 1) + + local TaskReward_Text = GUI:Text_Create(TaskShow_Layout, "TaskReward_Text", 8, 75, 12, "#ffd36a", "奖励:无") + GUI:setAnchorPoint(TaskReward_Text, 0.00, 0.50) + GUI:Text_enableOutline(TaskReward_Text, "#000000", 1) + + local RewardItems_Layout = GUI:Layout_Create(TaskShow_Layout, "RewardItems_Layout", 8, 6, 186, 58, false) + GUI:setAnchorPoint(RewardItems_Layout, 0.00, 0.00) + GUI:setTouchEnabled(RewardItems_Layout, false) + ui.update(__data__) return Layer end diff --git a/client/dev/GUILayout/delay/TaskShowOBJ.lua b/client/dev/GUILayout/delay/TaskShowOBJ.lua index 1598a27f..ae307cda 100644 --- a/client/dev/GUILayout/delay/TaskShowOBJ.lua +++ b/client/dev/GUILayout/delay/TaskShowOBJ.lua @@ -12,6 +12,52 @@ end TaskShowOBJ.UIfile = getUifile() +TaskShowOBJ.mainLineData = nil + +local function getShortDesc(data) + local status = tonumber(data.status or 0) or 0 + if data.finish then + return "主线任务已完成" + end + if status == 1 then + return "任意地图击杀怪物" + end + return "拜访目标后击杀5只怪" +end + +local function getRewardItems(data) + local items = {} + for _, item in ipairs(data.rewardItems or {}) do + table.insert(items, item) + end + if #items <= 0 then + for _, item in ipairs(data.rewardMoneys or {}) do + table.insert(items, item) + end + end + if #items <= 0 and data.rewardText and data.rewardText ~= "" and data.rewardText ~= "无" then + for part in string.gmatch(data.rewardText, "[^、,,%s]+") do + local name, count = string.match(part, "^(.+)%*(%d+)$") + if not name then + name, count = string.match(part, "^(.-)(%d+)万$") + if name and count then + count = tonumber(count) * 10000 + end + end + if not name then + name, count = string.match(part, "^(.-)(%d+)$") + end + if not name and string.find(part, "一本", 1, true) then + name = string.gsub(part, "一本", "") + count = 1 + end + if name and name ~= "" then + table.insert(items, { name = name, count = tonumber(count) or 1 }) + end + end + end + return items +end function TaskShowOBJ:main() @@ -23,6 +69,83 @@ function TaskShowOBJ:main() self._parent = parent self.ui = GUI:ui_delegate(parent) + + if self.UIfile == "game/Tongyong/TaskShowUI" then + self:renderMainLine(self.mainLineData or (MainLineTaskOBJ and MainLineTaskOBJ.data)) + ssrMessage:SubLink("MainLineTaskOBJ_query") + SL:ScheduleOnce(function() + ssrMessage:SubLink("MainLineTaskOBJ_query") + end, 0.35) + end + end +end + +function TaskShowOBJ:syncMainLine(data) + self.mainLineData = data + if self.UIfile ~= "game/Tongyong/TaskShowUI" then + return + end + if not self.ui or GUI:Win_IsNull(self._parent) then + self:main() + return + end + self:renderMainLine(data) +end + +function TaskShowOBJ:renderMainLine(data) + if not data or not self.ui then + return + end + if GUI:Win_IsNotNull(self.ui.TaskTitle_Text) then + GUI:Text_setString(self.ui.TaskTitle_Text, data.title or "[主线]任务") + end + if GUI:Win_IsNotNull(self.ui.TaskStatus_Text) then + GUI:Text_setString(self.ui.TaskStatus_Text, data.statusText or "") + end + if GUI:Win_IsNotNull(self.ui.TaskDesc_Text) then + GUI:Text_setString(self.ui.TaskDesc_Text, getShortDesc(data)) + end + if GUI:Win_IsNotNull(self.ui.TaskProgress_Text) then + local need = tonumber(data.need or 0) or 0 + local progress = tonumber(data.progress or 0) or 0 + local progressText = need > 0 and string.format("进度:%d/%d", progress, need) or "进度:已完成" + GUI:Text_setString(self.ui.TaskProgress_Text, progressText) + end + if GUI:Win_IsNotNull(self.ui.TaskReward_Text) then + GUI:Text_setString(self.ui.TaskReward_Text, "奖励:") + end + if GUI:Win_IsNotNull(self.ui.RewardItems_Layout) then + GUI:removeAllChildren(self.ui.RewardItems_Layout) + local items = getRewardItems(data) + if #items <= 0 then + local EmptyReward_Text = GUI:Text_Create(self.ui.RewardItems_Layout, "EmptyReward_Text", 0, 24, 12, "#ffd36a", "无") + GUI:setAnchorPoint(EmptyReward_Text, 0.00, 0.50) + GUI:Text_enableOutline(EmptyReward_Text, "#000000", 1) + return + end + for i, item in ipairs(items) do + if i > 4 then + break + end + local name = item.name or item[1] + local count = tonumber(item.count or item[2]) or 1 + local x = 22 + (i - 1) * 44 + local y = 29 + local index = SL:GetMetaValue("ITEM_INDEX_BY_NAME", name) + if index then + local itemShow = GUI:ItemShow_Create(self.ui.RewardItems_Layout, "RewardItem_" .. i, x, y, { + index = index, + count = count, + bgVisible = true, + look = true + }) + GUI:setScale(itemShow, 0.86) + else + local RewardText = GUI:Text_Create(self.ui.RewardItems_Layout, "RewardText_" .. i, x - 18, y, 11, "#ffd36a", tostring(name or "奖励")) + GUI:setAnchorPoint(RewardText, 0.00, 0.50) + GUI:Text_enableOutline(RewardText, "#000000", 1) + end + end end end diff --git a/client/dev/GUILayout/game/tongyong/MainLineTaskOBJ.lua b/client/dev/GUILayout/game/tongyong/MainLineTaskOBJ.lua new file mode 100644 index 00000000..7efa93e7 --- /dev/null +++ b/client/dev/GUILayout/game/tongyong/MainLineTaskOBJ.lua @@ -0,0 +1,13 @@ +MainLineTaskOBJ = {} + +MainLineTaskOBJ.__cname = "MainLineTaskOBJ" +MainLineTaskOBJ.data = nil + +function MainLineTaskOBJ:sync(arg1, arg2, arg3, data) + self.data = data + if TaskShowOBJ and TaskShowOBJ.syncMainLine then + TaskShowOBJ:syncMainLine(data) + end +end + +return MainLineTaskOBJ diff --git a/client/dev/GUILayout/game/tongyong/ShouChongOBJ.lua b/client/dev/GUILayout/game/tongyong/ShouChongOBJ.lua index 8e7880a3..2f81d13d 100644 --- a/client/dev/GUILayout/game/tongyong/ShouChongOBJ.lua +++ b/client/dev/GUILayout/game/tongyong/ShouChongOBJ.lua @@ -10,6 +10,11 @@ ShouChongOBJ.cfg = {} ShouChongOBJ.other = nil ShouChongOBJ.npcid = nil +function ShouChongOBJ:main(arg1, arg2, arg3, data) + Up_BaseClassOBJ.main(self, arg1, arg2, arg3, data) + ssrMessage:SubLink("MainLineTaskOBJ_visit", "ShouChongOBJ") +end + function ShouChongOBJ:updata() local cfg = self.cfg[1] diff --git a/client/dev/scripts/game_config/cfg_monster.lua b/client/dev/scripts/game_config/cfg_monster.lua index 585eb929..6fb57962 100644 --- a/client/dev/scripts/game_config/cfg_monster.lua +++ b/client/dev/scripts/game_config/cfg_monster.lua @@ -132,9 +132,9 @@ local config = { Name="沃玛统领" }, [34] = { - Hide="0#0", + Name="远古·沃玛魔祖", IDX=34, - Name="远古·沃玛魔祖" + Hide="0#0" }, [35] = { IDX=35,