天龙脚本-激情泡点

——————–源文件据说是来自莫问 因为源文件没有任何注释——————————
x460078210_g_scriptId = 999222 —脚本号
x999222_g_SceneId = 538 —场景号
x999222_g_Exp = 100 —经验值
x999222_g_ZD = 0 –这里原本老咸鱼我是准备给赠点
x999222_g_YB = 0–这里原本老咸鱼我是准备给元宝
x999222_g_MaxObj = 50 —最大人数限制 一般不用限制 可以给到999
——————脚本是用泡点脚本—————————–
—这个脚本挺好用的可以加入一些自己需要的检测 比如赠点没达到多少就踢出去,比如血没达到多少就踢出去。比如等级高于多少就踢出去,反正任你写 下面条件检测我写了几个示范的
–**********************************
— OnTime
–**********************************
function x999222_OnSceneTimer(sceneId)
if 1 ~= x999222_CheckTime() then
x999222_TransAll(sceneId)
StopTimer(sceneId)
return
end

local nHumanCount = LuaFnGetCopyScene_HumanCount(sceneId)
if nHumanCount < 1 then
return
end

if nHumanCount > x999222_g_MaxObj then
x999222_TipAll(sceneId, “地图人数多与 “..x999222_g_MaxObj..” 人,什么都不加,赶紧干掉其他玩家吧。”) —x999222_g_MaxObj = 50 如果给到999 就不会出现这个 意思是地图最大人数
return
end
for i=0, nHumanCount-1 do
local nHumanId = LuaFnGetCopyScene_HumanObjId(sceneId, i)
if x999222_CheckCondition(sceneId, nHumanId) ~= 1 then
x999222_MsgBox(sceneId, nHumanId, “条件不足”)
x999222_Exit(sceneId, nHumanId)
end
local ret = x999222_DoAutoGetExpLogic( sceneId, nHumanId )
–if ret == 1 then
— x999222_MsgBox(sceneId, nHumanId, “当前人数:”..nHumanCount)
–end———-这一大段可以注释掉
end

end
–通告
function x999222_OnScenePlayerEnter(sceneId, selfId)
local name = GetName(sceneId,selfId)
local str = format(“#{_INFOUSR%s}#P进入了每日经验图”,GetName(sceneId,selfId),GetSceneName(sceneId))–进入地图的系统通知
LuaFnCancelSpecificImpact( sceneId, selfId, 5927 )
LuaFnCancelSpecificImpact( sceneId, selfId, 54 )
BroadMsgByChatPipe(sceneId, objId, str, 4)
end
–时间检测
function x999222_CheckTime(sceneId, selfId)
local CurHour = GetHour()
if CurHour == 20 then —这里是检测时间的 如果不是这个时间点就踢出去 可以定义多个时间点 比如 if CurHour == 20 or CurHour ==21 or CurHour == 22 then
return 1
end
return -1
end
–条件检测
function x999222_CheckCondition(sceneId, objId)
— local yb = YuanBao(sceneId,selfId,targetId,3,0) 定义取得元宝数量
–local xueliang = GetMaxHp(sceneId,selfId) 定义取得血量

–这段是示范 需要先定义取得的数据 然后如果数据不满足就踢出去 –这里是我自己写的
if GetLevel(sceneId, objId) < 40 or —等级检测 等级小于40
GetMoney(sceneId, objId) < 50000 –or —包裹里金币检测这里的50000=5金币
— xueliang < 10000 or 这里检测血量
— yb > 10000 then 这里是检测元宝数量如果大于多少就踢出去

then

return 0
end
return 1
end—-这一大段是用来检测的 你可以加入自己的一些检测
–传送回去
function x999222_Exit( sceneId, selfId)
CallScriptFunction(400900,”TransferFunc”,sceneId, selfId, 2,155, 165)—条件不足回去的场景号和坐标
end
–提示所有人
function x999222_TipAll(sceneId,Str)
— 获得场景里头的所 腥?
local nHumanNum = LuaFnGetCopyScene_HumanCount(sceneId)

— 没有人的场景,什么都不做
if nHumanNum < 1 then
return
end

for i=0, nHumanNum-1 do
local PlayerId = LuaFnGetCopyScene_HumanObjId(sceneId, i)
BeginEvent(sceneId)
AddText(sceneId, Str)
EndEvent(sceneId)
DispatchMissionTips(sceneId, PlayerId)
end
end
function x999222_TransAll(sceneId)
— 获得场景里头的所有人
local nHumanNum = LuaFnGetCopyScene_HumanCount(sceneId)

— 没有人的场景,什么都不做
if nHumanNum < 1 then
return
end

for i=0, nHumanNum-1 do
local PlayerId = LuaFnGetCopyScene_HumanObjId(sceneId, i)
LuaFnSendSystemMail( sceneId, GetName(sceneId,PlayerId), ” 本次已经结束活动已经结束,等待下一次的开启吧。每天#Y20点#W准时开启。” )—-邮件通知
x999222_MsgBox(sceneId,PlayerId,”时间已经过了”)—界面提示
x999222_Exit(sceneId, PlayerId)
end
end

–**********************************
— 挂机加经验逻辑
–**********************************
function x999222_DoAutoGetExpLogic( sceneId, selfId )

if LuaFnIsObjValid( sceneId, selfId ) ~= 1 then
return -1
end

if LuaFnIsCanDoScriptLogic( sceneId, selfId ) ~= 1 then
return -2
end
if LuaFnIsCharacterLiving(sceneId, selfId) ~= 1 then
return -3
end

–获得经验….
LuaFnAddExp( sceneId, selfId, x999222_g_Exp);—给经验 当然你也可以给点其他的东西
return 1

end

–**********************************
–消息提示
–**********************************
function x999222_MsgBox( sceneId, selfId, str )
BeginEvent( sceneId )
AddText( sceneId, str )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end
–死亡事件
–扣除死亡者50金,奖励杀人者30J
function x999222_OnDie(sceneId, selfId, killerId)
CallScriptFunction(400900,”TransferFunc”,sceneId, selfId, 538,20, 38) —538是地图号
CostMoney(sceneId, selfId,50000) –被杀死扣除金币
AddMoney(sceneId, killerId,30000)—击杀给金币
if GetMoney(sceneId, selfId) < 50000 then
x999222_Exit(sceneId, selfId)
end
local kname = format(“#{_INFOUSR%s}”,GetName(sceneId,killerId))
local dname = format(“#{_INFOUSR%s}”,GetName(sceneId,selfId))
local str = format(“%s#P跑到#Y每日经验#P地图想要占点便宜,结果却被霸气的%s#P一下弄死搞残怀孕。还掉了#W50金币#P真是一个悲剧啊,实力不行就别逞强撒。”,dname,kname)
BroadMsgByChatPipe(sceneId, objId, str, 4)
local str = format(“%s#P正在#Y每日经验#P地图享受快速升级的快感,不料%s#P不长眼的走进了他的视线。抄起杀猪刀,一下秒杀,跟杀猪一样,捡起30金币。大叫:谁要不服,给爷爷进来。”,kname,dname)
BroadMsgByChatPipe(sceneId, objId, str, 4)
end

在服务端脚本 scene.lua添加计时器 —注意先搜索 if sceneId == 然后 在那个区间添加
if sceneId == 538 then —-538是地图号 意思是说如果地图号=538 就启动这个脚本
CallScriptFunction(999222), “OnScenePlayerEnter”,sceneId, playerId) —需要检测的脚本
if CheckTimer(sceneId, 0) == 0 then
SetTimer(sceneId, playerId, 999222, “OnSceneTimer”,10000) —999222是需要启动时间的脚本号 10000是检测间隔
end
end
脚本的注释很完善

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容