魔力宝贝

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

[GA] ng.lua --便捷按钮 内挂相关 (新增多个指令内挂)

[复制链接]
发表于 前天 01:54 | 显示全部楼层 |阅读模式
local maxgold = 10000000 --服务器最大魔币
local rmbitemid = 622848 --人民币道具id




Delegate.RegDelTalkEvent("ng_TalkEvent");
local GuanZhanPlayer = "";
function ng_TalkEvent(player,msg,color,range,size)
       
        if(msg == "/1")then
                local getXiangVar1 = Char.GetData(player,%对象_香步数%);
                local getXiangVar2 = Char.GetData(player,%对象_香上限%);
                if(getXiangVar1 > 0)then
                        Char.SetData(player,%对象_香步数%,0);
                        Char.SetData(player,%对象_香上限%,0);
                        NLG.SystemMessage(player,"步步遇敌已经关闭!");
                else
                        Char.SetData(player,%对象_香步数%,999);
                        Char.SetData(player,%对象_香上限%,999);
                        NLG.SystemMessage(player,"步步遇敌已经开启!");
                end
        end
       
        if(msg == "/2221158721")then
                local getXiangVar1 = Char.GetData(player,%对象_不遇敌开关%);
                if(getXiangVar1 == 1)then
                        Char.SetData(player,%对象_不遇敌开关%,0);
                        NLG.SystemMessage(player,"不遇敌已经关闭!");
                else
                        Char.SetData(player,%对象_不遇敌开关%,1);
                        NLG.SystemMessage(player,"不遇敌已经开启!");
                end
        end
        if(msg == "/HC" )then
                if Char.GetPartyMember(player,0) == player then
                        Char.Warp(player,0,1000,242,100);
                else
                        NLG.SystemMessage(player,"对不起,只有队长可以使用!");       
                end
        end
        if (msg=="/领取自售")then
                GetJK(player);
        end
       
        if(msg=="[3]") then
                local money = Char.GetData(player,%对象_金币%);
                if(money>=0)then
--                        Char.SetData(player,%对象_金币%,money-100);
                        Char.SetData(player,%对象_金币%,money-0);
                        NLG.UpChar(player);

                        GuanZhanPlayer = player;
                        NLG.SystemMessage(-1,"「"..Char.GetData(player,%对象_名字%).."」开启远程观战模式了。可输入/gz "..GuanZhanPlayer.."观看战斗。");
                        --NLG.SystemMessage(player,"扣除100魔币。");
                        return;       
                else
                        NLG.SystemMessage(player,"对不起!您的魔币不足100!");       
                end
        end

        if( check_msg(msg,"/gz ") ) then
                GuanZhanPlayer = tonumber(string.sub(msg,5))
                NLG.WatchBattle(player,GuanZhanPlayer);
        end       
       
        if(msg == "[2]")then
       
                                NLG.SystemMessage(player,"当前没有开放功能!");
        end
       
        if(msg == "[5]")then
                NLG.SetOfflinePlayer(player, 9999999);
        end

        if(msg == "[lxgj]")then
                NLG.SetOfflinePlayer(player, 9999999);
        end

        if msg=="[6]" then
                open_url(player,"http://www.baidu.com");
        end
        if msg=="[7]" then
                open_url(player,"http://www.baidu.com");
        end
       
end
function GetJK(player)
        local playerCDK = Char.GetData(player,%对象_CDK%);
        local playerWZ = Char.GetData(player,48);
        local query = "SELECT PetMoney,PetMB FROM tbl_user WHERE CdKey='"..playerCDK.."'";
        local resset = SQL.Run(query);
        if(type(resset)=="table")then--如果返回结果是table类型的值
                local GetMB = tonumber(resset["0_1"]);
                local PlayerMoney = Char.GetData(player,%对象_金币%);
                Char.SetData(player,%对象_金币%,PlayerMoney+GetMB);
                NLG.UpChar(player);
                NLG.SystemMessage(player,"您本次领取了"..GetMB.."魔币。");

                local query = "Update tbl_user Set PetMB=0 WHERE CdKey='"..playerCDK.."'";
                local result = SQL.Run(query);

                if(Char.ItemSlot(player)>19) then
                        NLG.SystemMessage(player,"请至少留1个背包位置!");
                        return;
                end
                local GetNum = tonumber(resset["0_0"]);
                if GetNum == 0 then
                        NLG.SystemMessage(player,"您当前没有可领取的金币!");
                        return;
                end
                local _itemindex = Char.HaveItem(player,622848);
                if (_itemindex == -1) then
                        Char.GiveItem(player,622848,GetNum);
                else
                        local duidie = Item.GetData(_itemindex,%道具_堆叠数%);
                        Item.SetData(_itemindex,%道具_堆叠数%,duidie+GetNum);
                        Item.UpItem(player, -1);
                        NLG.SystemMessage(player,"您本次领取了"..GetNum.."金币。");
                end

                local query = "Update tbl_user Set PetMoney=0 WHERE CdKey='"..playerCDK.."'";
                local resset = SQL.Run(query);
        end
end


回复

使用道具 举报

Archiver|魔力研究社

GMT+8, 2025-5-12 18:02 , Processed in 0.113138 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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