diff --git a/Mirserver/Mir200/Envir/Data/cfg_npclist.xls b/Mirserver/Mir200/Envir/Data/cfg_npclist.xls index 9198d728..2317351d 100644 Binary files a/Mirserver/Mir200/Envir/Data/cfg_npclist.xls and b/Mirserver/Mir200/Envir/Data/cfg_npclist.xls differ diff --git a/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/神甲融合.lua b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/神甲融合.lua new file mode 100644 index 00000000..2df5826c --- /dev/null +++ b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/神甲融合.lua @@ -0,0 +1,62 @@ +ShenJiaRongHeOBJ = Up_BaseClass:new() + + +ShenJiaRongHeOBJ._name = "ShenJiaRongHeOBJ" +-- NPCID + +ShenJiaRongHeOBJ.id = { 192 } + +for i, v in ipairs(ShenJiaRongHeOBJ.id or {}) do + Npc.clicknpcCfg[v] = ShenJiaRongHeOBJ +end + +-- ļ +ShenJiaRongHeOBJ.cfg = Func.require("cfg_ں") + + + +---* ͬ +Player.sycCfg[ShenJiaRongHeOBJ._name] = ShenJiaRongHeOBJ.cfg + + +ShenJiaRongHeOBJ.CaChe = {} + +---* ǰ˵õĺ +ShenJiaRongHeOBJ.allowFunc = { "up" } + + +function ShenJiaRongHeOBJ:up(actor, p1, p2, p3, data) + LOGDump(data) + local id = data[1] + + if not id then + return + end + + local cfg = table.Copy(self.cfg[id]) + LOGDump(cfg) + + local _xh = {} + + for i, v in ipairs(cfg.cost or {}) do + table.insert(_xh, {v.itemname, v.itemnum, v.itembind}) + end + + if Func.batchcheckitem(actor, _xh, true, true) then + if Func.random(cfg.success or 20) then + + local _gives = {} + for i, v in ipairs(cfg.reward or {}) do + table.insert(_gives, string.format("%s#%d#%d", v.givename, v.givenum, v.bind)) + end + gives(actor, table.concat(_gives, "&")) + Func.sendmsg9(actor, "[ʾ]:#70|ںϳɹ") + else + Func.sendmsg9(actor, "[ʾ]:#70|ںʧܣ³ԣ") + end + end +end + + + +return ShenJiaRongHeOBJ \ No newline at end of file diff --git a/client/dev/GUIExport/game/B/ShenJiaRongHeUI.lua b/client/dev/GUIExport/game/B/ShenJiaRongHeUI.lua new file mode 100644 index 00000000..07e771d2 --- /dev/null +++ b/client/dev/GUIExport/game/B/ShenJiaRongHeUI.lua @@ -0,0 +1,100 @@ +local ui = {} +local _V = function(...) return SL:GetMetaValue(...) end +local FUNCQUEUE = {} +local TAGOBJ = {} + +function ui.init(parent, __data__, __update__) + if __update__ then return ui.update(__data__) end + -- Create Layer + local Layer = GUI:Node_Create(parent, "Layer", 0, 0) + GUI:setTag(Layer, -1) + + -- Create bg_close + local bg_close = GUI:Layout_Create(Layer, "bg_close", 0, 0, 1136, 640, false) + GUI:Layout_setBackGroundColorType(bg_close, 1) + GUI:Layout_setBackGroundColor(bg_close, "#000000") + GUI:Layout_setBackGroundColorOpacity(bg_close, 0) + GUI:setAnchorPoint(bg_close, 0.00, 0.00) + GUI:setTouchEnabled(bg_close, true) + GUI:setTag(bg_close, -1) + + -- Create nd_root + local nd_root = GUI:Node_Create(Layer, "nd_root", 568, 320) + GUI:setTag(nd_root, 670) + TAGOBJ["670"] = nd_root + + -- Create img_bg + local img_bg = GUI:Image_Create(nd_root, "img_bg", 0, 0, "res/custom/41/bg.png") + GUI:setChineseName(img_bg, "背景图片") + GUI:setAnchorPoint(img_bg, 0.50, 0.50) + GUI:setTouchEnabled(img_bg, true) + GUI:setTag(img_bg, -1) + + -- Create btn_close + local btn_close = GUI:Button_Create(img_bg, "btn_close", 758, 429, "res/public/1900000510.png") + GUI:Button_loadTexturePressed(btn_close, "res/public/1900000511.png") + GUI:setContentSize(btn_close, 26, 42) + GUI:setIgnoreContentAdaptWithSize(btn_close, false) + GUI:Button_setTitleText(btn_close, [[]]) + GUI:Button_setTitleColor(btn_close, "#ffffff") + GUI:Button_setTitleFontSize(btn_close, 14) + GUI:Button_titleDisableOutLine(btn_close) + GUI:setAnchorPoint(btn_close, 0.00, 0.00) + GUI:setTouchEnabled(btn_close, true) + GUI:setTag(btn_close, -1) + + -- Create btn_ListView + local btn_ListView = GUI:ListView_Create(img_bg, "btn_ListView", 61, 32, 141, 398, 1) + GUI:setAnchorPoint(btn_ListView, 0.00, 0.00) + GUI:setTouchEnabled(btn_ListView, true) + GUI:setTag(btn_ListView, 0) + + -- Create Button_1 + local Button_1 = GUI:Button_Create(btn_ListView, "Button_1", 0, 350, "res/custom/41/btn/1.png") + GUI:Button_setTitleText(Button_1, [[按钮]]) + GUI:Button_setTitleColor(Button_1, "#ffffff") + GUI:Button_setTitleFontSize(Button_1, 16) + GUI:Button_titleEnableOutline(Button_1, "#000000", 1) + GUI:setAnchorPoint(Button_1, 0.00, 0.00) + GUI:setTouchEnabled(Button_1, true) + GUI:setTag(Button_1, 0) + + -- Create ItemShow + local ItemShow = GUI:ItemShow_Create(img_bg, "ItemShow", 470, 290, {index = 1, count = 1, look = true, bgVisible = false, color = 255}) + GUI:setAnchorPoint(ItemShow, 0.50, 0.50) + GUI:setTag(ItemShow, 0) + + -- Create cost_Layout + local cost_Layout = GUI:Layout_Create(img_bg, "cost_Layout", 317, 132, 304, 81, false) + GUI:setAnchorPoint(cost_Layout, 0.00, 0.00) + GUI:setTouchEnabled(cost_Layout, false) + GUI:setTag(cost_Layout, 0) + + -- Create Text_success + local Text_success = GUI:Text_Create(img_bg, "Text_success", 472, 106, 16, "#00ff00", [[成功率:20%]]) + GUI:Text_enableOutline(Text_success, "#000000", 1) + GUI:setAnchorPoint(Text_success, 0.50, 0.50) + GUI:setTouchEnabled(Text_success, false) + GUI:setTag(Text_success, 0) + + -- Create up_btn + local up_btn = GUI:Button_Create(img_bg, "up_btn", 406, 41, "res/custom/41/2.png") + GUI:Button_setTitleText(up_btn, [[]]) + GUI:Button_setTitleColor(up_btn, "#ffffff") + GUI:Button_setTitleFontSize(up_btn, 16) + GUI:Button_titleEnableOutline(up_btn, "#000000", 1) + GUI:setAnchorPoint(up_btn, 0.00, 0.00) + GUI:setTouchEnabled(up_btn, true) + GUI:setTag(up_btn, 0) + + ui.update(__data__) + return Layer +end + +function ui.update(data) + for _, func in pairs(FUNCQUEUE) do + if func then func(data) end + end +end + +return ui diff --git a/client/dev/GUILayout/game/B/ShenJiaRongHeOBJ.lua b/client/dev/GUILayout/game/B/ShenJiaRongHeOBJ.lua new file mode 100644 index 00000000..309628a1 --- /dev/null +++ b/client/dev/GUILayout/game/B/ShenJiaRongHeOBJ.lua @@ -0,0 +1,115 @@ +ShenJiaRongHeOBJ = Up_BaseClassOBJ:new() + +ShenJiaRongHeOBJ.__cname = "ShenJiaRongHeOBJ" + +-- 配置文件 +ShenJiaRongHeOBJ.cfg = {} + +ShenJiaRongHeOBJ.UIfile = "game/B/ShenJiaRongHeUI" + +ShenJiaRongHeOBJ.leftNum = 8 +ShenJiaRongHeOBJ.id = 1 --当前选中按钮 id + +function ShenJiaRongHeOBJ:updata() + self.id = self.id or 1 + local listview = self.ui.btn_ListView + local imgDir = "res/custom/41/btn/" + GUI:ListView_removeAllItems(listview) + for i = 1, self.leftNum do + local btnKey = string.format("list_btn_%d", i) + local isSelected = (self.id == i) + self.ui[btnKey] = GUI:Button_Create(listview, btnKey, 0, 0, + string.format("%s%s.png", imgDir, isSelected and tostring(i) or (i .. "a"))) + GUI:addOnClickEvent(self.ui[btnKey], function() + if self.id == i then return end --重复点击不刷新 + local oldId = self.id + self.id = i + --旧按钮换为非选中态 + GUI:Button_loadTextures(self.ui[string.format("list_btn_%d", oldId)], + string.format("%s%s.png", imgDir, oldId .. "a"), "", "", 0) + --新按钮换为选中态 + GUI:Button_loadTextures(self.ui[btnKey], + string.format("%s%s.png", imgDir, tostring(i)), "", "", 0) + self:init() + end) + end + self:init() +end + +function ShenJiaRongHeOBJ:init() + local cfg = self.cfg[self.id] + if not cfg then + return + end + + if GUI:Win_IsNotNull(self.ui.ItemShow) then + GUI:removeFromParent(self.ui.ItemShow) + end + + self.ui.ItemShow = GUI:ItemShow_Create(self.ui.img_bg, "ItemShow", 470, 290, + { index = SL:GetMetaValue("ITEM_INDEX_BY_NAME", cfg.name), count = 1, look = true, bgVisible = false, color = 255 }) + GUI:setAnchorPoint(self.ui.ItemShow, 0.50, 0.50) + + GUI:removeAllChildren(self.ui.cost_Layout) + for i, v in ipairs(cfg.cost or {}) do + local costItemBg = string.format("costItemBg_%d", i) + self.ui[costItemBg] = GUI:Image_Create(self.ui.cost_Layout, costItemBg, 0, 0, "res/public/1900000651_1.png") + GUI:Win_SetParam(self.ui[costItemBg], i) + + local bg_size = GUI:getContentSize(self.ui[costItemBg]) + + local costItem = string.format("costItem_%d", i) + self.ui[costItem] = GUI:ItemShow_Create(self.ui[costItemBg], costItem, bg_size.width / 2, bg_size.height / 2, + { index = SL:GetMetaValue("ITEM_INDEX_BY_NAME", v.itemname), count = v.itemnum, look = true, bgVisible = false, color = 255 }) + GUI:setAnchorPoint(self.ui[costItem], 0.50, 0.50) + end + + GUI:UserUILayout(self.ui.cost_Layout, { + dir = 2, + addDir = 2, + interval = 1, + gap = { x = 30 }, + sortfunc = function(lists) + table.sort(lists, function(a, b) + return (GUI:Win_GetParam(a) or 0) > (GUI:Win_GetParam(b) or 0) + end) + end + }) + + GUI:Text_setString(self.ui.Text_success, string.format("成功率:%d%%", cfg.success)) + + GUI:addOnClickEvent(self.ui.up_btn, function() + ssrMessage:SubLink(string.format("%s_%s", self.__cname, "up"), self.id) + end) +end + +---* 注册事件 +function ShenJiaRongHeOBJ:EventBind() + local function ShenJiaRongHeOBJ_EQUIP_CHANGE(data) + if GUI:Win_IsNotNull(self._parent) then + if data.Where == 16 then + self:updata() + end + end + end + SL:RegisterLUAEvent(LUA_EVENT_PLAYER_EQUIP_CHANGE, self.__cname, ShenJiaRongHeOBJ_EQUIP_CHANGE) + + --关闭窗口 + SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname, function(widgetName) + self:OnClose(widgetName) + end) +end + +--关闭窗口 +function ShenJiaRongHeOBJ:OnClose(widgetName) + if widgetName == self.__cname then + self:UnRegisterEvent() + end +end + +function ShenJiaRongHeOBJ:UnRegisterEvent() + SL:UnRegisterLUAEvent(LUA_EVENT_PLAYER_EQUIP_CHANGE, self.__cname) + SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname) +end + +return ShenJiaRongHeOBJ diff --git a/client/dev/res/custom/41/2.png b/client/dev/res/custom/41/2.png new file mode 100644 index 00000000..929b76bb Binary files /dev/null and b/client/dev/res/custom/41/2.png differ diff --git a/client/dev/res/custom/41/btn/1.png b/client/dev/res/custom/41/btn/1.png new file mode 100644 index 00000000..3efe9462 Binary files /dev/null and b/client/dev/res/custom/41/btn/1.png differ diff --git a/client/dev/res/custom/41/btn/1a.png b/client/dev/res/custom/41/btn/1a.png new file mode 100644 index 00000000..340d8990 Binary files /dev/null and b/client/dev/res/custom/41/btn/1a.png differ diff --git a/client/dev/res/custom/41/btn/2.png b/client/dev/res/custom/41/btn/2.png new file mode 100644 index 00000000..ddb05d50 Binary files /dev/null and b/client/dev/res/custom/41/btn/2.png differ diff --git a/client/dev/res/custom/41/btn/2a.png b/client/dev/res/custom/41/btn/2a.png new file mode 100644 index 00000000..ba2ae8ce Binary files /dev/null and b/client/dev/res/custom/41/btn/2a.png differ diff --git a/client/dev/res/custom/41/btn/3.png b/client/dev/res/custom/41/btn/3.png new file mode 100644 index 00000000..dd3ce051 Binary files /dev/null and b/client/dev/res/custom/41/btn/3.png differ diff --git a/client/dev/res/custom/41/btn/3a.png b/client/dev/res/custom/41/btn/3a.png new file mode 100644 index 00000000..e5a3e5ba Binary files /dev/null and b/client/dev/res/custom/41/btn/3a.png differ diff --git a/client/dev/res/custom/41/btn/4.png b/client/dev/res/custom/41/btn/4.png new file mode 100644 index 00000000..76a61757 Binary files /dev/null and b/client/dev/res/custom/41/btn/4.png differ diff --git a/client/dev/res/custom/41/btn/4a.png b/client/dev/res/custom/41/btn/4a.png new file mode 100644 index 00000000..faeda634 Binary files /dev/null and b/client/dev/res/custom/41/btn/4a.png differ diff --git a/client/dev/res/custom/41/btn/5.png b/client/dev/res/custom/41/btn/5.png new file mode 100644 index 00000000..124edc67 Binary files /dev/null and b/client/dev/res/custom/41/btn/5.png differ diff --git a/client/dev/res/custom/41/btn/5a.png b/client/dev/res/custom/41/btn/5a.png new file mode 100644 index 00000000..805051b1 Binary files /dev/null and b/client/dev/res/custom/41/btn/5a.png differ diff --git a/client/dev/res/custom/41/btn/6.png b/client/dev/res/custom/41/btn/6.png new file mode 100644 index 00000000..3fbba7f4 Binary files /dev/null and b/client/dev/res/custom/41/btn/6.png differ diff --git a/client/dev/res/custom/41/btn/6a.png b/client/dev/res/custom/41/btn/6a.png new file mode 100644 index 00000000..86641710 Binary files /dev/null and b/client/dev/res/custom/41/btn/6a.png differ diff --git a/client/dev/res/custom/41/btn/7.png b/client/dev/res/custom/41/btn/7.png new file mode 100644 index 00000000..2a919c23 Binary files /dev/null and b/client/dev/res/custom/41/btn/7.png differ diff --git a/client/dev/res/custom/41/btn/7a.png b/client/dev/res/custom/41/btn/7a.png new file mode 100644 index 00000000..1d6147c5 Binary files /dev/null and b/client/dev/res/custom/41/btn/7a.png differ diff --git a/client/dev/res/custom/41/btn/8.png b/client/dev/res/custom/41/btn/8.png new file mode 100644 index 00000000..352146d4 Binary files /dev/null and b/client/dev/res/custom/41/btn/8.png differ diff --git a/client/dev/res/custom/41/btn/8a.png b/client/dev/res/custom/41/btn/8a.png new file mode 100644 index 00000000..68cdbf21 Binary files /dev/null and b/client/dev/res/custom/41/btn/8a.png differ