后端Lua
后端Lua
后端Lua
local npc = {} EquipPos = {[0] = "衣服",[1] = "武器",[2] = "勋章",[3] = "头盔",[4] = "项链",[5] = "手镯(右)" , [6] = "手镯(左)",[7] = "戒指(右)",[8] = "戒指(左)",[10] = "腰带",[11] = "靴子"} npc.Attribute = { attName = { [1] = "血量", [3] = "攻击下限", [4] = "
后端Lua
local shuffled = Shuffle(attrPool) local result = "" for i = 1, maxCount do if i > 1 then result = result.."|" end local randomValue = math.random(1, 300) -- 1-300随机值 result = result.."3#"..shuffled[i].."#"..randomVa
后端Lua
setitemaddvalue
后端Lua
function ds_suijishu() local weights = { [1] = 500, [2] = 300, [3] = 100, [4] = 10, [5] = 5, [6] = 1 } -- 计算总权重 local totalWeight = 0 for _, w in pairs(weights) do totalWeig
后端Lua
我怎么能通过鉴定的颜色来给装备附等级名称
后端Lua
local colorList = {250, 154, 253, 151, 243, 249} local attrPool = {201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219} function GenerateRandomAttributes(maxCount) local function Shuffle(tbl) for i = #tbl, 2, -1 do
后端Lua
local colorList = {250, 154, 253, 151, 243, 249} local attrPool = {201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219}
后端Lua
attrPool
后端Lua
local colorList = {250, 154, 253, 151, 243, 249} local attrPool = {201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219} function GenerateRandomAttributes(maxCount) local function Shuffle(tbl) for i = #tbl, 2, -1 do
后端Lua
function ds_sqjd(actor,wyid) local wpobj = getitembymakeindex(actor,wyid) local wpbdzt = getitemaddvalue(actor,wpobj,3,1,1) if wpbdzt < 1 then local wpname = getiteminfo(actor,wpobj,7) setitemaddvalue(actor,wpobj,3,1,5)
后端Lua
-- 玩家攻击怪物时 function attack(actor, Target, Hiter, MagicId) if ismon(Target) then local monsterID = getbaseinfo(Target, 2) -- 获取怪物ID sendrefluamsg(actor, 9998, monsterID, 0, 0, actor) -- 发送给前端 end end 怎么用txt调用他
后端Lua
local npc = {} EquipPos = {[0] = "衣服",[1] = "武器",[2] = "勋章",[3] = "头盔",[4] = "项链",[5] = "手镯(右)" , [6] = "手镯(左)",[7] = "戒指(右)",[8] = "戒指(左)",[10] = "腰带",[11] = "靴子"} npc.Attribute = { attName = { [1] = "血量", [3] = "攻击下限", [4] = "
后端Lua
local npc = {} EquipPos = {[0] = "衣服",[1] = "武器",[2] = "勋章",[3] = "头盔",[4] = "项链",[5] = "手镯(右)" , [6] = "手镯(左)",[7] = "戒指(右)",[8] = "戒指(左)",[10] = "腰带",[11] = "靴子"} npc.Attribute = { attName = { [1] = "血量", [3] = "攻击下限", [4] = "
后端Lua