魔力宝贝

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

[GA] fb1.lua--宠物丢地删除

[复制链接]
发表于 前天 02:03 | 显示全部楼层 |阅读模式
--tbl_gl = tbl_gl or {};
--tbl_gl["哥布林"] = 1;
--tbl_gl["红帽哥布林"] = 1;
--tbl_gl["新手宠"] = 1;

Delegate.RegInit("fb1_Init");
function fb1_Init()
        Protocol.OnRecv("lua/Module/fb1.lua", "DropPet_Recv", %RECV_DP%);
end

function DropPet_Recv(fd,head,packet)
        local player = Protocol.GetCharByFd(fd);
        if Char.GetData(player,%对象_地图%) ~= 10 or Char.GetData(player,%对象_地图%) ~= 1000 then
                local SplitArray = Split(packet,":");
                local PetSlot = tonumber(SplitArray[3]);
                local _Pet = Char.GetPet(player,PetSlot);
                local bh = Char.GetData(_Pet,%对象_原名%);


                if tbl_gl[bh] ~= nil then
                        Char.DelSlotPet(player,PetSlot)
                        NLG.SystemMessage(player,"这类宠物丢地直接消失了。");
                        return 1;
                end
        end
end


回复

使用道具 举报

Archiver|魔力研究社

GMT+8, 2025-5-12 18:13 , Processed in 0.114028 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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