后端Lua
后端Lua
后端Lua
给称号
后端Lua
元素要去表里写好在添加吗
后端Lua
-- 魔神原力系统后端处理 local moshenyuanli={} function moshenyuanli.link(actor, msgid, arg1, arg2, arg3, sMsg) if not cfg_moshenyuanli or not next(cfg_moshenyuanli) then return end if arg2==0 then local levels = {} levels[
后端Lua
Print:魔神原力系统收到消息:0,内容:{"Script":"NPC\/moshenyuanli","SkillType":1,"TargetLevel":11}
后端Lua
-- 魔神原力系统后端处理 local moshenyuanli={} function moshenyuanli.link(actor, msgid, arg1, arg2, arg3, sMsg) if not cfg_moshenyuanli or not next(cfg_moshenyuanli) then return end -- 解析前端发送的JSON消息 local msgData = json2tbl(sMsg)
后端Lua
local moshenyuanli = {} local config = { [1] = {name = "暴击原力Lv1", level = 1, count = 2, type1 = "物品", name1 = "魔神修炼石", value1 = 10, type2 = "货币", name2 = "金币", value2 = 10000, cur_attr_1 = 1, cur_attr_2 = 1, cur_attr_3 = 1, cur_attr_4 = 30},
后端Lua
local moshenyuanli = {} function moshenyuanli.link(actor, msgid, arg1, arg2, arg3, sMsg) p("xxxxxxxxxxxxxxxxxxxxxxx") if not cfg_moshenyuanli or not next(cfg_moshenyuanli) then return end -- 强化技能 if arg2 == 0 then
后端Lua
local car = {} local function newcar(color,drive) local car = { color = color or '蓝色', drive = drive or '正在行驶' } function car:setcolor(color) self.color = car.color return '红色' end function car:setdrive(
后端Lua
local car = {} local function newcar(color,drive) local car = { color = color or '蓝色', drive = drive or '正在行驶' } function car:color(color) car.color = color return self end function car:drive(drive)
后端Lua
给Car类添加方法SetColor(color)设置颜色并返回self,添加方法Drive()打印"XXX颜色的车正在行驶"。实现链式调用:myCar:SetColor("红色"):Drive()
后端Lua
local moshenyuanli = {} -- 处理魔神原力系统请求 function moshenyuanli.link(actor, msgid, arg1, arg2, arg3, sMsg) if not cfg_moshenyuanli or not next(cfg_moshenyuanli) then return end local data = nil if sMsg and sMsg ~= "" then
后端Lua
local che = { {brand = '大众',price = 300000}, {brand = '奔驰',price = 400000}, } local car = {} setmetatable(car,{__index = che[2]}) local function newcar(color,drive) local car = { color = color or '蓝色', drive = drive } function c
后端Lua
local che = { {brand = '大众',price = 300000}, {brand = '奔驰',price = 400000}, } local car = {} setmetatable(car,{__index = che[2]}) local function newcar(brand,price,color,drive) local car = { brand = brand, price = price, color = colo
后端Lua