function NPC6040317_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) --获取玩家等级 local FreeSize = role.GetBagFreeSize(RoleID) local num1 = role.GetRoleItemNum(RoleID, 4810136) --稀有觉醒石 local num2 = role.GetRoleItemNum(RoleID, 4810137) --觉醒重置石 local Silver = role.GetRoleSilver(MapID,InstanceID,RoleID) if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 207227) --战场BUFF商:\n 使用10战场金币可以换取更强BUFF支持与保护 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 207228) msg.AddMsgEvent(MsgID, 21, 5) msg.AddMsgEvent(MsgID, 1, 207229) msg.AddMsgEvent(MsgID, 21, 14) msg.AddMsgEvent(MsgID, 1, 100002) --取消 msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then if FreeSize >= 1 then if num1 >= 1000 then if Silver >= 800000 then role.AddRoleItem(MapID, InstanceID, RoleID, 4820260, 1, -1, 8, 102) role.RemoveFromRole(MapID, InstanceID, RoleID, 4810136, 1000, 420) role.DecRoleSilver(MapID, InstanceID, RoleID,500000, 420) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 100013) -- 1000 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) -- 确定按钮 msg.AddMsgEvent(MsgID, 1, 100001) -- “确定” msg.DispatchRoleMsgEvent(RoleID, MsgID) end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 207225) -- 1000 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) -- 确定按钮 msg.AddMsgEvent(MsgID, 1, 100001) -- “确定” msg.DispatchRoleMsgEvent(RoleID, MsgID) end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 444266) -- 1000 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) -- 确定按钮 msg.AddMsgEvent(MsgID, 1, 100001) -- “确定” msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 5 then if FreeSize >= 1 then if num2 >= 20000 then if Silver >= 500000 then role.AddRoleItem(MapID, InstanceID, RoleID, 4820260, 1, -1, 8, 102) role.RemoveFromRole(MapID, InstanceID, RoleID, 4810137, 20000, 420) role.DecRoleSilver(MapID, InstanceID, RoleID,800000, 420) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 100013) -- 1000 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) -- 确定按钮 msg.AddMsgEvent(MsgID, 1, 100001) -- “确定” msg.DispatchRoleMsgEvent(RoleID, MsgID) end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 207226) -- 1000 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) -- 确定按钮 msg.AddMsgEvent(MsgID, 1, 100001) -- “确定” msg.DispatchRoleMsgEvent(RoleID, MsgID) end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 444266) -- 1000 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) -- 确定按钮 msg.AddMsgEvent(MsgID, 1, 100001) -- “确定” msg.DispatchRoleMsgEvent(RoleID, MsgID) end end end aux.RegisterCreatureEvent(6040317, 7, "NPC6040317_OnTalk")