搜索
LUA

LUA

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

Talk_Watch.lua--游戏战斗转播,收费请自行修改脚本

GP 发表于 2025-5-10 02:48:05 | 显示全部楼层 |阅读模式
102 0
Global_Reg.RegTalkEvent("TalkEvent_Watch");
LB = {};
local TalkConfig={1,500};--1表示是否收费0为不收费,500表示收取的费用,

function TalkEvent_Watch(_charaIndex, _msg, _color, _range, _size)
        if(string.sub(_msg,1,7)=="P|/转播")then
                ShowLB(_charaIndex);
                return -1;
        end
        if(string.sub(_msg,1,7)=="P|/停播")then
                StopLB(_charaIndex);
                return -1;
        end
        if(string.sub(_msg,1,8)=="P|/观战 ")then
                  local NewMsg = Stringsplitplus(_msg," ");
                Date = NewMsg[2];
                if(Date == "")then
                        return 1;
                end
                StartLB(_charaIndex,Date);
                return -1;
        end
       
end
function ShowLB(_PlayerIndex)
        local CheckGold = 0;
        if(NLG.Get_Char_Date(_PlayerIndex, 273)>0)then
                if(LB [_PlayerIndex]==1)then
                        NLG.SystemMessage(_PlayerIndex,"[观战系统] 您当前已经是开启着战况转播[转播码为:".._PlayerIndex.."],无需再次开启,如果需要全服公告您的转播码请先/停播后再次/转播");
                        return;
                end
                if(tonumber(TalkConfig[1]) == 1)then
                        local gold=Char.GetData(_PlayerIndex, %对象_金币%);
                        if(gold >= tonumber(TalkConfig[2]))then
                                NLG.AddGold(_PlayerIndex,-500);
                        else
                                NLG.SystemMessage(_PlayerIndex,"[观战系统] 您当前魔币少于500无法发起战况转播分享");
                                return;
                        end
                end
               
                LB [_PlayerIndex] = 1;
                NLG.TalkToCli( _PlayerIndex,"[观战系统] 您开启了战况转播您的转播码为:" .. _PlayerIndex,4, 1);
                NLG.TalkToCli( _PlayerIndex,"[观战系统] 关闭实况转播模式,请输入 /停播 或直接注销登出即可" , 4, 1);
--如果需要全服把下面的--去掉即可
                NLG.SystemMessage(-1,"[观战系统] "..Char.GetData(_PlayerIndex, %对象_原名%).."开启了战况转播,转播码:".._PlayerIndex.."(远程观战使用方式对话框 /观战 N,N为转播码)");
               
               
        else
                NLG.SystemMessage(_PlayerIndex,"[观战系统] 当前不在战斗中无法开启战况转播");
        end
        return;
end
function StopLB(_PlayerIndex)
        if(LB [_PlayerIndex]==1)then
                NLG.SystemMessage(_PlayerIndex,"[观战系统] 关闭战况转播,如需再开启请输入 /转播");
                LB [_PlayerIndex]=0;
                return;
        else
                NLG.SystemMessage(_PlayerIndex,"[观战系统] 您并无开启战况转播如需开启请输入 /转播");
                return;
        end
end
function StartLB(_PlayerIndex,LBnum)
        if(ISstring(LBnum)==1)then
                return;
        end
       
        local lennumber=0;
        lennumber=tonumber(LBnum);
       
        if(lennumber<0)then
                return;
        end

        if(LB [tonumber(LBnum)] == 1)then
                NLG.WatchEntry(_PlayerIndex,LBnum);
        end
end

function ISstring(str)

local lenInByte = #str
if(lenInByte>4)then
        return 1;
end
for i=1,lenInByte do
    local curByte = string.byte(str, i)
       
       if(curByte>57 or curByte<48)then
                return 1;
           end
end
return 0;
end


回复

使用道具 举报

全部评论

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

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

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

  • admin 2025-5-11

    首先到教堂招魂的那个地方找到NPC牧师乌咝 和她对话 (年轻人,你相信爱情会是永远的 ...

  • 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