当前位置 :| 主页>天龙>技术文章>

天龙八部到一定级别送元宝脚本

来源: 作者: 点击:
游戏里到一定级别送元宝

odali_yuanbaoxiaofuweng.lua


-- 领奖NPC
x002093_g_scriptId = 002093
--奖励标记
x002093_g_flag = {
[70] = MF_LINGQUZENGDIAN,
[80] = MF_LINGQUYUANBAO80,
[90] = MF_LINGQUYUANBAO90,

}
--**********************************
--事件交互入口
--**********************************
function x002093_OnDefaultEvent( sceneId, selfId, targetId )
BeginEvent( sceneId )
strText = "欢迎来到593天龙,没钱找我就对啦。嘿嘿,出生送1万赠点。80级7万元宝和7万赠点,90级15万元宝和15万赠点。"
AddText( sceneId, strText )
AddNumText( sceneId, x002093_g_scriptId, "领取赠点。", 5, 101 )
AddNumText( sceneId, x002093_g_scriptId, "领取元宝。", 5, 102 )
EndEvent( sceneId )
DispatchEventList( sceneId, selfId, targetId )
end
--**********************************
--事件列表选中一项
--**********************************
function x002093_OnEventRequest( sceneId, selfId, targetId, eventId )
if GetNumText() == 101 then
local index = GetMissionFlag( sceneId, selfId, MF_LINGQUZENGDIAN )
if index == 1 then
x002093_TalkMsg( sceneId, selfId, targetId, "您已经领取过该项奖励,不能再领了。" )
return
end
ZengDian(sceneId,selfId,targetId,1,10000)
SetMissionFlag( sceneId, selfId, MF_LINGQUZENGDIAN, 1 )
BeginEvent(sceneId)
AddText(sceneId,"领取元宝成功,您获得了10000赠点。谢谢你对XX天龙的支持。")
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
elseif GetNumText() == 102 then
BeginEvent(sceneId)
AddText(sceneId,"为了回馈广大玩家对XX天龙的支持,现推出免费领取元宝的奖励的活动。请选择相应的等级领取奖励。")
AddNumText( sceneId, x002093_g_scriptId, "领取80级7万元宝奖励。", 5, 80 )
AddNumText( sceneId, x002093_g_scriptId, "领取90级15万元宝奖励。", 5, 90 )
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
elseif GetNumText() == 80 or GetNumText() == 90 then
x002093_lingquyuanbao( sceneId, selfId, targetId )
return
end
end
--**********************************
--对话提示
--**********************************
function x002093_TalkMsg( sceneId, selfId, targetId, str )
BeginEvent(sceneId)
AddText(sceneId, str)
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
--**********************************
--领取元宝
--**********************************
function x002093_lingquyuanbao( sceneId, selfId, targetId )
local mylevel = GetLevel( sceneId, selfId )
if mylevel < GetNumText() then
local strText = format("您的等级不够,待等级达到%d级再来找我吧。", GetNumText() )
x002093_TalkMsg( sceneId, selfId, targetId, strText )
return
end
if GetNumText()==80 then
local index = GetMissionFlag( sceneId, selfId, MF_LINGQUYUANBAO80 )
if index == 1 then
x002093_TalkMsg( sceneId, selfId, targetId, "您已经领取过该项奖励,不能再领了。" )
return
end
YuanBao(sceneId,selfId,targetId,1,70000)
ZengDian(sceneId,selfId,targetId,1,70000)
SetMissionFlag( sceneId, selfId, MF_LINGQUYUANBAO80, 1 )
x002093_TalkMsg( sceneId, selfId, targetId, "领取元宝成功,您获得了70000元宝和70000赠点。谢谢你对XX天龙的支持。" )
elseif GetNumText()==90 then
local index = GetMissionFlag( sceneId, selfId, MF_LINGQUYUANBAO90 )
if index == 1 then
x002093_TalkMsg( sceneId, selfId, targetId, "您已经领取过该项奖励,不能再领了。" )
return
end
YuanBao(sceneId,selfId,targetId,1,150000)
ZengDian(sceneId,selfId,targetId,1,150000)
SetMissionFlag( sceneId, selfId, MF_LINGQUYUANBAO90, 1 )
x002093_TalkMsg( sceneId, selfId, targetId, "领取元宝成功,您获得了150000元宝和150000赠点。谢谢你对XX天龙的支持。" )
end
end