[GP] PicCall.lua--地图呼出

[复制链接]
发表于 5 天前 | 显示全部楼层 |阅读模式
local PicCall_NPCxq = {100905,"地图呼出",6,7777,25,25} --NPC详情

local PicCallWord = "/m" --呼出地图快捷键
local PicList = {} --图片列表
PicList[100] = {480028,480026,480027,480029} --PicList[x] = {a,b,c,...} x为地图编号 a,b,c为图片编号多个图片编号则自动翻页
PicList[4300] = {480002}
PicList[33200] = {480003,480004,480005,480006}
PicList[59520] = {480007,480008}
PicList[59521] = {480009,480010,480011}
PicList[59697] = {480012}
PicList[59698] = {480012}
PicList[20501] = {480013,480014,480015}
PicList[20502] = {480013,480014,480015}
PicList[20503] = {480013,480014,480015}
PicList[20504] = {480013,480014,480015}
PicList[20505] = {480013,480014,480015}
PicList[20506] = {480013,480014,480015}
PicList[20507] = {480013,480014,480015}
PicList[20508] = {480013,480014,480015}
PicList[20509] = {480013,480014,480015}
PicList[20510] = {480013,480014,480015}
PicList[20511] = {480013,480014,480015}
PicList[20512] = {480013,480014,480015}
PicList[20513] = {480013,480014,480015}
PicList[20514] = {480013,480014,480015}
PicList[20515] = {480013,480014,480015}
PicList[20516] = {480013,480014,480015}
PicList[20517] = {480013,480014,480015}
PicList[20518] = {480013,480014,480015}
PicList[20519] = {480013,480014,480015}
PicList[20520] = {480013,480014,480015}
PicList[20521] = {480013,480014,480015}
PicList[20522] = {480013,480014,480015}
PicList[20524] = {480013,480014,480015}
PicList[20525] = {480013,480014,480015}
PicList[20526] = {480013,480014,480015}
PicList[20527] = {480013,480014,480015}
PicList[20530] = {480013,480014,480015}
PicList[15400] = {480013,480014,480015}
PicList[20414] = {480013,480014,480015}
PicList[32067] = {480016}
PicList[46018] = {480017}
PicList[46019] = {480018}
PicList[46020] = {480019}
PicList[30001] = {480020,480021,480022}
PicList[4200] = {480023}
PicList[302] = {480024,480025}
PicList[301] = {480024,480025}
PicList[20301] = {480024,480025}
PicList[20302] = {480024,480025}
PicList[20303] = {480024,480025}
PicList[20304] = {480024,480025}
PicList[20305] = {480024,480025}
PicList[20306] = {480024,480025}
PicList[20307] = {480024,480025}
PicList[20308] = {480024,480025}
PicList[20309] = {480024,480025}
PicList[20310] = {480024,480025}
PicList[20002] = {480024,480025}
PicList[59500] = {480030,480031,480032}
PicList[43100] = {480033,480034}
PicList[59505] = {480035,480036}
PicList[59506] = {480037,480038}
PicList[46010] = {480039}
PicList[3100] = {480040}
PicList[32276] = {480041}
PicList[14019] = {480042}
PicList[14020] = {480042}
PicList[14021] = {480043}
PicList[14022] = {480044}
PicList[59679] = {480045,480046}
PicList[59680] = {480045,480046}
PicList[59681] = {480045,480046}
PicList[59682] = {480045,480046}
PicList[59683] = {480045,480046}
PicList[59684] = {480045,480046}
PicList[59685] = {480045,480046}
PicList[3300] = {480045}
PicList[48000] = {480048,480049,480095,480096}
PicList[44000] = {480048,480049,480095,480096}
PicList[48001] = {480048,480049,480095,480096}
PicList[48002] = {480048,480049,480095,480096}
PicList[48003] = {480048,480049,480095,480096}
PicList[48004] = {480048,480049,480095,480096}
PicList[48005] = {480048,480049,480095,480096}
PicList[48006] = {480048,480049,480095,480096}
PicList[48007] = {480048,480049,480095,480096}
PicList[48008] = {480048,480049,480095,480096}
PicList[48011] = {480048,480049}
PicList[48012] = {480048,480049}
PicList[48013] = {480048,480049}
PicList[48014] = {480048,480049}
PicList[48015] = {480048,480049}
PicList[48016] = {480048,480049}
PicList[48017] = {480048,480049}
PicList[48018] = {480048,480049}
PicList[48019] = {480048,480049}
PicList[48020] = {480048,480049}
PicList[48021] = {480048,480049}
PicList[48022] = {480048,480049}
PicList[48024] = {480048,480049}
PicList[3000] = {480050}
PicList[30002] = {480051}
PicList[4000] = {480052}
PicList[59602] = {480053}
PicList[59603] = {480053}
PicList[59628] = {480053}
PicList[59629] = {480053}
PicList[59644] = {480053}
PicList[59645] = {480053}
PicList[33500] = {480054,480055}
PicList[30012] = {480056}
PicList[43000] = {480057,480058}
PicList[46053] = {480059}
PicList[46056] = {480060}
PicList[46057] = {480060}
PicList[33118] = {480061}
PicList[35007] = {480062}
PicList[33117] = {480063}
PicList[43700] = {480064,480065}
PicList[30014] = {480066}
PicList[59522] = {480067}
PicList[43600] = {480068}
PicList[47025] = {480069}
PicList[59502] = {480070,480071,480072}
PicList[33000] = {480073}
PicList[43500] = {480074}
PicList[30013] = {480075}
PicList[4400] = {480076}
PicList[34000] = {480077}
PicList[34001] = {480077}
PicList[34002] = {480077}
PicList[34003] = {480077}
PicList[30011] = {480078}
PicList[13500] = {480079,480080,480081}
PicList[13501] = {480079,480080,480081}
PicList[13502] = {480079,480080,480081}
PicList[13503] = {480079,480080,480081}
PicList[13504] = {480079,480080,480081}
PicList[13505] = {480079,480080,480081}
PicList[13506] = {480079,480080,480081}
PicList[13507] = {480079,480080,480081}
PicList[13508] = {480079,480080,480081}
PicList[13509] = {480079,480080,480081}
PicList[13510] = {480079,480080,480081}
PicList[13511] = {480079,480080,480081}
PicList[13512] = {480079,480080,480081}
PicList[13513] = {480079,480080,480081}
PicList[13514] = {480079,480080,480081}
PicList[13515] = {480079,480080,480081}
PicList[3200] = {480082}
PicList[1522] = {480083}
PicList[60040] = {480085}
PicList[60041] = {480084}
PicList[4403] = {480086}
PicList[4404] = {480086}
PicList[4405] = {480086}
PicList[4406] = {480086}
PicList[4407] = {480086}
PicList[4408] = {480086}
PicList[4409] = {480086}
PicList[59524] = {480087}
PicList[21014] = {480088}
PicList[21015] = {480088}
PicList[21016] = {480088}
PicList[21017] = {480088}
PicList[21018] = {480088}
PicList[21019] = {480088}
PicList[21020] = {480088}
PicList[21021] = {480088}
PicList[21022] = {480088}
PicList[21023] = {480088}
PicList[21024] = {480088}
PicList[21025] = {480088}
PicList[400] = {480089}
PicList[402] = {480089}
PicList[2300] = {480090}
PicList[51002] = {480091}
PicList[51003] = {480092}
PicList[43820] = {480098,480099}
PicList[43821] = {480098,480099}
PicList[43822] = {480098,480099}
PicList[43823] = {480098,480099}
PicList[43824] = {480098,480099}
PicList[43825] = {480098,480099}
PicList[43826] = {480098,480099}
PicList[43830] = {480098,480099}
PicList[51005] = {480093}
PicList[51007] = {480094}
PicList[51008] = {480094}
PicList[51007] = {480094}
PicList[51009] = {480094}
PicList[51010] = {480094}
PicList[51011] = {480094}
PicList[51012] = {480094}
PicList[51013] = {480094}
PicList[51014] = {480094}
PicList[51015] = {480094}
PicList[51016] = {480094}
PicList[51017] = {480094}
PicList[51018] = {480094}
PicList[51100] = {480094}
PicList[300] = {480100,480101,480102}
PicList[11033] = {480103,480104}
PicList[11034] = {480103,480104}
PicList[11035] = {480103,480104}
PicList[11036] = {480103,480104}
PicList[11037] = {480103,480104}
PicList[2100] = {480105}
PicList[11000] = {480106}
PicList[11001] = {480106}
PicList[11002] = {480106}
PicList[59501] = {480107,480108,480109,480110}
PicList[6300] = {480111}
PicList[2200] = {480111}
PicList[47009] = {480112}
PicList[47010] = {480112}
PicList[47011] = {480112}
PicList[47012] = {480112}
PicList[47013] = {480112}
PicList[47014] = {480112}
PicList[47030] = {480112}
PicList[47031] = {480112}
PicList[47032] = {480112}
PicList[47033] = {480112}
PicList[59526] = {480113,480114}
PicList[2400] = {480115}
PicList[30010] = {480116,480117}
PicList[6100] = {480118}
PicList[46013] = {480119}
PicList[46014] = {480119}
PicList[46015] = {480119}
PicList[24008] = {480120}
PicList[24009] = {480120}
PicList[24010] = {480120}
PicList[24011] = {480120}
PicList[24012] = {480120}
PicList[24013] = {480120}
PicList[24014] = {480120}
PicList[24015] = {480120}
PicList[24016] = {480120}
PicList[24017] = {480120}
PicList[24018] = {480120}
PicList[24019] = {480121}
PicList[24020] = {480121}
PicList[24021] = {480121}
PicList[24022] = {480121}
PicList[24023] = {480121}
PicList[24024] = {480121}
PicList[24025] = {480121}
PicList[24026] = {480121}
PicList[24027] = {480121}
PicList[24028] = {480121}
PicList[24029] = {480125}
PicList[24030] = {480125}
PicList[24031] = {480125}
PicList[24032] = {480125}
PicList[24033] = {480125}
PicList[24034] = {480125}
PicList[24035] = {480125}
PicList[24036] = {480125}
PicList[24037] = {480125}
PicList[24038] = {480122}
PicList[24039] = {480123}
PicList[24040] = {480123}
PicList[24041] = {480123}
PicList[24042] = {480123}
PicList[24043] = {480123}
PicList[24044] = {480123}
PicList[24045] = {480123}
PicList[24046] = {480123}
PicList[24047] = {480123}
PicList[24048] = {480123}
PicList[24049] = {480124}
PicList[24050] = {480124}
PicList[24051] = {480124}
PicList[24052] = {480124}
PicList[24053] = {480124}
PicList[24054] = {480124}
PicList[24055] = {480124}
PicList[24056] = {480124}
PicList[24057] = {480124}
PicList[24058] = {480124}
PicList[24059] = {480124}
PicList[1000] = {480126,480127,480128,480129}
PicList[60005] = {480138}
PicList[60001] = {480131}
PicList[60002] = {480132}
PicList[60003] = {480133}
PicList[60004] = {480130}
PicList[1500] = {480135}
PicList[1531] = {480134}
PicList[11015] = {480136}
PicList[60100] = {480137}
PicList[60039] = {480139}
PicList[60083] = {480140}


----------
Global_Reg.RegInit("PicCall_zhuce");--全局注册
Global_Reg.RegTalkEvent("PicCallTalkEvent")

function PicCall_zhuce() --NPC注册
        PicCall_NPC()
        return 0
        end
       
function PicCallTalkEvent(player,msg,color,range,size)
        if NLG.Get_Char_Date(player,145) > 0 then
                if msg=="P|查看flag详情" then
                        local ItemIndex = Char.GetItemIndex(player,8);
                        if ItemIndex>=0 then
                                local name = Item.GetData(ItemIndex,%道具_已鉴定名%)
                                local val30=Item.GetData(ItemIndex,30) or 0
                                local val51=Item.GetData(ItemIndex,51) or 0
                                local val2008=Item.GetData(ItemIndex,2008) or 0
                                local val2009=Item.GetData(ItemIndex,2009) or 0
                                local val2010=Item.GetData(ItemIndex,2010) or 0
                                local val2011=Item.GetData(ItemIndex,2011) or 0
                                NLG.SystemMessage(player,name)
                                NLG.SystemMessage(player,"30是:"..val30.."他的类型是"..type(val30))
                                NLG.SystemMessage(player,"51是:"..val51.."他的类型是"..type(val51))
                                NLG.SystemMessage(player,"2008是:"..val2008.."他的类型是"..type(val2008))
                                NLG.SystemMessage(player,"2009是:"..val2009.."他的类型是"..type(val2009))
                                NLG.SystemMessage(player,"2010是:"..val2010.."他的类型是"..type(val2010))
                                NLG.SystemMessage(player,"2011是:"..val2011.."他的类型是"..type(val2011))
                        end
                elseif msg=="P|设置flag" then
                        local ItemIndex = Char.GetItemIndex(player,8);
                        if ItemIndex>=0 then
                                local a=Item.SetData(ItemIndex,%道具_未鉴定名%,834)
                                local a=Item.SetData(ItemIndex,%道具_攻击%,208)
                                local b=Item.SetData(ItemIndex,%道具_必杀%,5)
                                local c=Item.SetData(ItemIndex,%道具_命中%,15)
                                local val30=Item.SetData(ItemIndex,30,1185)
                                local val51=Item.SetData(ItemIndex,51,1149)
                                local val2008=Item.SetData(ItemIndex,2008,50002)
                                local val2009=Item.SetData(ItemIndex,2009,3006)--PVE
                                Item.UpItem(player,8);
                                --local val2010=Item.GetData(ItemIndex,2010) or 0--金色PVE词条未开放
                        end
                elseif msg=="P|内存" then
                        local a=collectgarbage("count")
                        NLG.SystemMessage(player,a.."KB")
                end
        end
        if (string.sub(msg,1,4) =="P|"..PicCallWord) then
                local maptype = Char.GetData(player,3)
                local mapid = Char.GetData(player,4)
--                        NLG.SystemMessage(player,"mapid= "..mapid.." maptype="..maptype.."")
                if maptype == 0 then
                        if PicList[mapid] then
                                if #PicList[mapid] <= 1 then
                                        PicCall_gongneng(LuaNpcIndex["PicCall_npc"],player,0,32,0)
                                else
                                        PicCall_gongneng(LuaNpcIndex["PicCall_npc"],player,0,32,0)
                                end
                        else
                                NLG.SystemMessage(player,"您所在的地图不支持此功能。")
                        end
                else
                        NLG.SystemMessage(player,"不能在随机迷宫呼出地图。")
                end
        end
end

function PicCall_NPC(npc) --NPC设置
        if npc == nil  then
        npc = NL.CreateNpc(nil,"PicCall_NPCzhizuo")
        end       
        Char.SetData(npc,1,PicCall_NPCxq[1])
        Char.SetData(npc,2,PicCall_NPCxq[1])
        Char.SetData(npc,2000,PicCall_NPCxq[2])
        Char.SetData(npc,7,PicCall_NPCxq[3])
        Char.SetData(npc,4,PicCall_NPCxq[4])
        Char.SetData(npc,5,PicCall_NPCxq[5])
        Char.SetData(npc,6,PicCall_NPCxq[6])
        LuaNpcIndex["PicCall_npc"]=npc;--读取使用用 LuaNpcIndex.PicCall_npc 就可以读取对应NPC index
        InstallNpc("PicCall_npc",npc);
        NLG.UpChar(npc)
        Char.SetTalkedEvent(nil,"PicCall_chuangkou",npc)
        Char.SetWindowTalkedEvent(nil,"PicCall_gongneng",npc)
        return true
end

function PicCall_NPCzhizuo(index)
        return true;
end

function PicCall_chuangkou(npc,player) --窗口
        if NLG.CanTalk(npc,player) then
                NLG.ShowWindowTalked(player,0,0,222,"2\n\n测试\n测试1\n测试2",npc)
        end
end

function PicCall_gongneng(npc,player,_SqeNo,_select,_data) --功能
--        NLG.SystemMessage(player,"\n _SqeNo是:"..(_SqeNo or "空").."它的类型是"..type(_SqeNo).."\n  _select是:".. (_select or "空").."它的类型是"..type(_select).."\n  _data是:"..(_data or "空").."它的类型是"..type(_data))
        if _select ~= 2 then
                local maptype = Char.GetData(player,3)
                local mapid = Char.GetData(player,4)
                if maptype == 0 then
                        if PicList[mapid] then
                                local nextseq
                                local nextsel = 2
                                if _select == 32 then
                                        nextseq = _SqeNo + 1
                                        if #PicList[mapid] > nextseq then
                                                nextsel = nextsel + 32
                                        end
                                        if nextseq > 1 then
                                                nextsel = nextsel + 16
                                        end
                                        if nextseq > #PicList[mapid] then
                                                nextseq = #PicList[mapid]
                                        end
                                        if nextseq < 1 then
                                                nextseq = 1
                                        end
                                elseif _select == 16 then
                                        nextseq = _SqeNo - 1
                                        if #PicList[mapid] > nextseq then
                                                nextsel = nextsel + 32
                                        end
                                        if nextseq > 1 then
                                                nextsel = nextsel + 16
                                        end
                                        if nextseq > #PicList[mapid] then
                                                nextseq = #PicList[mapid]
                                        end
                                        if nextseq < 1 then
                                                nextseq = 1
                                        end
                                end
                                if PicList[mapid][nextseq] then
                                        local msg  = "\n@g,"..PicList[mapid][nextseq].."@"
                                        NLG.ShowWindowTalked(player,0,nextsel,nextseq,msg,LuaNpcIndex["PicCall_npc"])
                                end
                        else
                                NLG.SystemMessage(player,"您所在的地图不支持此功能。")
                        end
                else
                        NLG.SystemMessage(player,"不能在随机迷宫呼出地图。")
                end
        end
end


回复

使用道具 举报

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