- 打卡等级:本地老炮
- 打卡总天数:377
- 打卡月天数:25
- 打卡总奖励:375
- 最近打卡:2025-12-25 08:50:09
|
源端使用:
--特殊运营修改-摆摊回调
--exchange stall
--脚本号
x410002_g_ScriptId = 410002
-- 总控开关
x410002_g_MF_BAN = 0 --flag为0/1的时候,就禁止交易
-- MF_IS_BAN_EXCHANGE = 116 -- 是否禁止交易
-- MF_IS_BAN_STALL = 117 -- 是否禁止摆摊
-- MF_IS_BAN_RECEXCHANGE = 118 -- 是否允许被交易
-- MF_IS_BAN_STALLBUY = 119 -- 是否禁止摆摊购买
--**********************************
--请求摆摊 返回值:0允许 其他拒绝
--**********************************
function x410002_stallAllow( sceneId, selfId, nMovieId)
if LuaFnIsObjValid(sceneId, selfId) ~= 1 or LuaFnIsCanDoScriptLogic(sceneId,selfId) ~= 1 then
return 1
end
if GetMissionFlag(sceneId, selfId,MF_IS_BAN_STALL) == x410002_g_MF_BAN then
x410002_NotifyTip(sceneId,selfId,"没有摆摊权限!")
return 1;
end
return 0;
end
--**********************************
-- 摆摊购买回调 返回值:2允许 其他拒绝
--**********************************
function x410002_stallBuy(sceneId, selfId)
if LuaFnIsObjValid(sceneId, selfId) ~= 1 or LuaFnIsCanDoScriptLogic(sceneId,selfId) ~= 1 then
return 1
end
if GetMissionFlag(sceneId, selfId,MF_IS_BAN_STALLBUY) == x410002_g_MF_BAN then
x410002_NotifyTip(sceneId,selfId,"没有摆摊购买权限!")
return 1;
end
return 0;
end
--**********************************
-- 交易请求 返回值:0允许 其他拒绝
--**********************************
function x410002_exchangeAllow( sceneId, selfId, tarobjID)
if LuaFnIsObjValid(sceneId, selfId) ~= 1 or LuaFnIsCanDoScriptLogic(sceneId,selfId) ~= 1 then
return 1
end
if LuaFnIsObjValid(sceneId, tarobjID) ~= 1 or LuaFnIsCanDoScriptLogic(sceneId,tarobjID) ~= 1 then
return 1
end
if GetMissionFlag(sceneId, selfId,MF_IS_BAN_EXCHANGE) == x410002_g_MF_BAN then
x410002_NotifyTip(sceneId,selfId,"你没有交易权限!")
return 1;
end
if GetMissionFlag(sceneId,tarobjID,MF_IS_BAN_EXCHANGE) == x410002_g_MF_BAN then
x866000_Tips(sceneId,selfId,"目标玩家没有交易权限!")
return 1;
end
return 0;
end
--**********************************
--醒目提示
--**********************************
function x410002_NotifyTip( sceneId, selfId, Msg )
BeginEvent( sceneId )
AddText( sceneId, Msg )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end
适用版本:0.85.0600
;交易前判断回调
768991==\NewScript\callback_Exchange.lua
--交易确认回调
--返回值: 允许交易:0 阻止交易:任何其他数
--获取物品信息:local item_id, count = GetData(sceneId, id1, "ITEM", i)
--获取珍兽信息:local pet_id_H, pet_id_L = GetData(sceneId, id1, "PET", i)
function x768990_ExchangeConfirmation(sceneId, selfId, targetId, GetData)
local Allow = 0 --默认允许交易
-- --物品、珍兽信息
-- for i = 0, 4 do
-- local item_id, count = GetData(sceneId, selfId, "ITEM", i)
-- if item_id > 0 then
-- AddGlobalCountNews( sceneId,tostring(i) .. " 物品ID:" .. tostring(item_id) .. " 物品数量:" .. tostring(count))
-- end
-- end
-- for i = 0, 4 do
-- local pet_id_H, pet_id_L = GetData(sceneId, selfId, "PET", i)
-- if pet_id_H > 0 then
-- AddGlobalCountNews( sceneId,tostring(i) .. " 珍兽高位:" .. tostring(pet_id_H) .. " 珍兽低位:" .. tostring(pet_id_L))
-- end
-- end
-- if Allow ~= 0 then
-- x768990_NotifyTip(sceneId,selfId,"存在违禁品,请检查交易物品后再次尝试。") --弹出提示信息
-- end
--交易是否拦截
return Allow
end
|
|