搜索
LUA

LUA

本版块未设置版块简介!请后台版块编辑添加。
  •  帖子: 115
  •  讨论: 115
  •  关注: 0

KJDW.lua--忘了是什么了

GA 发表于 2025-5-10 02:13:00 | 显示全部楼层 |阅读模式
108 0
Delegate.RegInit("KJDW_Init");
NL.RegItemString(nil, "KJDW_ItemUse", "LUA_useKJDW");
local PlayerMapArr = {};

function new_PlayerMap(player)
        local PlayerMap =
        {
                MapType = Char.GetData(player,%对象_MAP%);  
                Map = Char.GetData(player,%对象_地图%);       
                XStr = Char.GetData(player,%对象_X%);
                YStr = Char.GetData(player,%对象_Y%);
        };
        return PlayerMap;
end

function KJDW_ItemUse(player,toPlayer,slot)
        local MapType = Char.GetData(player,%对象_MAP%);
        if MapType~=0 then
                NLG.SystemMessage(player,"当前地图不能使用!");
                return
        end
        if(Char.PartyNum(player) > 1)then
                NLG.SystemMessage(player,"请先离开队伍!");
                return;
        end

                local _itemindex = Char.GetItemIndex(player,slot);
                local duidie = Item.GetData(_itemindex,%道具_堆叠数%);
                if duidie == 1 then
                        Item.Kill(player, _itemindex, slot);
                        Item.UpItem(player, slot);
                else
                        Item.SetData(_itemindex,%道具_堆叠数%,duidie-1);
                        Item.UpItem(player, slot);
                end

        PlayerMapArr[Playerkey(player)] = new_PlayerMap(player);
        Char.Warp(player,0,23102,27,32);
        return;
end

function initKJDWNpc_Init(index)
        return 1;
end

function initKJDWNpc()
        if (KJDWNpc == nil) then
                KJDWNpc = NL.CreateNpc("lua/Module/KJDW.lua", "initKJDWNpc_Init");
                Char.SetData(KJDWNpc,%对象_形象%,103012);
                Char.SetData(KJDWNpc,%对象_原形%,103012);
                Char.SetData(KJDWNpc,%对象_X%,23);
                Char.SetData(KJDWNpc,%对象_Y%,25);
                Char.SetData(KJDWNpc,%对象_地图%,23102);
                Char.SetData(KJDWNpc,%对象_方向%,6);
                Char.SetData(KJDWNpc,%对象_原名%,"出口");
                NLG.UpChar(KJDWNpc);
                Char.SetTalkedEvent("lua/Module/KJDW.lua","KJDWMsg", KJDWNpc);
        end
end

function KJDWMsg(_me,_tome)
        if (NLG.CanTalk(_me,_tome) == true) then
                if (PlayerMapArr[Playerkey(_tome)] == nil) then
                        Char.Warp(_tome,0,278,27,22);
                        return;
                else
                        Char.DischargeParty(_tome);
                        Char.Warp(_tome,PlayerMapArr[Playerkey(_tome)].MapType,PlayerMapArr[Playerkey(_tome)].Map,PlayerMapArr[Playerkey(_tome)].XStr,PlayerMapArr[Playerkey(_tome)].YStr);
                        return;
                end
        end
end

function KJDW_Init()
        initKJDWNpc();
end

回复

使用道具 举报

全部评论

暂无评论,期待您打破宁静

TA的帖子
相关帖子
  • admin 2025-5-10

    #先到阿斯提亞鎮 打完UD找到NPC卡蓮 拿到給LBLS 的信 然後去打LBLS 再打完 LBLS以後 ...

  • admin 2025-5-10

    用本目录下文件"内容"覆盖服务器data目录下同名文件相应"内容" 请勿直接覆盖文件本身 ...

  • admin 2025-5-11

    ############## 城城的武器强化系统 ############## #剑1 block StrCmpChat == 700 W ...

  • admin 2025-5-11

    魔力宝贝手动架设中遇到的问题及解决方法魔力宝贝手动架设教程—魔力私服,魔力宝贝私 ...

  • admin 2025-5-12

    起始地点法兰城的竞技场的贝贝(34.36)头目战╳ 必要条件---必要等级Lv1 职业限定---建 ...

  • admin 2025-5-12

    1.与里谢里雅堡的H1N1防疫宣传员(28,77)说话,取得"防疫小口罩"。 图例物品名称等级种 ...

  • admin 2025-5-12

    魅惑的哈密瓜无取得宠物「哈密瓜公主」╳╳○ 起始地点魔法大学头目战╳ 必要条件--- ...

  • admin 2025-5-12

    起始地点法兰城的里谢里雅堡头目战○ 必要条件---必要等级--- 职业限定---建议等级--- ...

  • admin 2025-5-12

    起始地点法兰城的里谢里雅堡头目战○ 必要条件---必要等级--- 职业限定---建议等级--- ...

  • admin 2025-5-12

    起始地点法兰城的冒险者旅馆头目战○ 必要条件---必要等级--- 职业限定---建议等级LV8 ...

发布 联系QQ