魔力宝贝

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

[GP] sjly_lv1item.lua--狮鹫乐园lv1道具

[复制链接]
发表于 前天 03:23 | 显示全部楼层 |阅读模式
local tj_tab = {}
tj_tab[79801] = {299,{782221}}--tj_tab[道具id] = {图鉴id,{1级怪物enemyid}}
tj_tab[79802] = {300,{782222}}
tj_tab[79803] = {301,{782223}}
tj_tab[79804] = {302,{782224}}
tj_tab[79805] = {112,{602}}
tj_tab[79806] = {114,{604}}
tj_tab[79807] = {170,{21104}}
tj_tab[79808] = {168,{21102}}
tj_tab[79809] = {162,{21004}}
tj_tab[79810] = {159,{21001}}
tj_tab[79811] = {174,{21114}}
tj_tab[79812] = {177,{21203}}
tj_tab[79813] = {172,{21112}}
tj_tab[79814] = {136,{714}}
tj_tab[79815] = {135,{713}}
tj_tab[79816] = {147,{812}}
tj_tab[79817] = {202,{21614}}
tj_tab[79818] = {191,{21501}}
tj_tab[79819] = {104,{523}}
tj_tab[79820] = {163,{21011}}
tj_tab[79821] = {166,{21014}}
tj_tab[79822] = {195,{21601}}
tj_tab[79823] = {74,{334}}
tj_tab[79824] = {63,{313}}
tj_tab[79825] = {19,{32}}
tj_tab[79826] = {181,{21213}}
tj_tab[79827] = {182,{21214}}
tj_tab[79828] = {8,{12}}
tj_tab[79829] = {171,{21111}}

----------
Global_Reg.RegItemUseEvent ("sjly_lv1item");--创建一个所有玩家双击道具栏物品就会触发的Lua函数。

function sjly_lv1item(player, Itemindex)
        local itemid = Item.GetData(Itemindex, %道具_ID%);--召唤书lv1道具id
--        NLG.SystemMessage(player,"itemid="..itemid..",类型="..type(itemid)..",")
        if itemid >= 79801 and itemid <= 79999 then
                local skillpos = Char.HaveSkill(player, 69)
                local tj = Char.AlbumFlg(player, tj_tab[itemid][1])
                local itemname = Item.GetData(Itemindex, %道具_已鉴定名%)
                local enemyname = string.sub(itemname,1,-7)
--                NLG.SystemMessage(player,"skillpos="..skillpos..",tj="..tj..",")
--                NLG.SystemMessage(player,"itemname="..itemname..",enemyname="..enemyname..",")
                if skillpos >= 0 and tj >= 1 then
                        NLG.DelItem(player,itemid,1) --扣除道具
                        NLG.CreateBattle(player,Itemindex,nil,tj_tab[itemid][2],nil,nil)
                elseif tj < 1 then
                        NLG.SystemMessage(player,"你没有"..enemyname.."的图鉴。")
                elseif skillpos < 0 then
                        NLG.SystemMessage(player,"你没有精灵的盟约技能,捕捉不了怪物。")
                end
                return 1
        end
        return 0--通过
end


回复

使用道具 举报

Archiver|魔力研究社

GMT+8, 2025-5-12 14:47 , Processed in 0.123461 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表