文章编辑人员:雪舞
内容测试时间:2023-7-28 01:38:11
客户的代码太乱,405行90%的无效代码,就给他重新改写了一下,改完之后只需要42行代码。
以下是完整内容,徒弟可参阅。
--雪舞修复VIP商店 Q:784055837 WAYLEE 2023-7-28 01:19:33
shopCodes = {
[8881] = {minValue = 600, shop = 7},
[8882] = {minValue = 500, shop = 8},
[8883] = {minValue = 8000, shop = 9},
[8884] = {minValue = 10000, shop = 10},
[8885] = {minValue = 12000, shop = 11},
[8886] = {minValue = 15000, shop = 12},
[8887] = {minValue = 18000, shop = 13},
[8888] = {minValue = 20000, shop = 14},
}
function x990091_OnDefaultEvent(sceneId, selfId, targetId)
local g_LeiJiDianShu = GetMissionData(sceneId, selfId, MD_YJCZ)
BeginEvent(sceneId)
if GetLevel(sceneId, selfId) >= 10 then
AddText(sceneId, "#r#G 您已累积充值" .. g_LeiJiDianShu .. "元")
AddText(sceneId, " #G累计充值600RMB即可打开会员商店功能")
if g_LeiJiDianShu >= 600 then
AddNumText(sceneId, x990091_g_scriptId, "VIP会员商店", 2, 8881)
end
end
EndEvent(sceneId)
DispatchEventList(sceneId, selfId, targetId)
end
function x990091_OnEventRequest(sceneId, selfId, targetId, eventId)
local numText = GetNumText()
local CZ = GetMissionData(sceneId, selfId, MD_YJCZ)
local shopCode = shopCodes[numText]
if shopCode then
if CZ < shopCode.minValue then
x990091_tips(sceneId, selfId, format("你的充值不满%d元,无法显示!", shopCode.minValue))
return
end
DispatchShopItem(sceneId, selfId, targetId, shopCode.shop)
end
end
function x990091_tips(sceneId, selfId, Tip)
BeginEvent(sceneId)
AddText(sceneId, Tip)
EndEvent(sceneId)
DispatchEventList(sceneId, selfId, -1)
end
\home\tlbb\Public\Data\Script\event\prize\eprize.lua x888899_BuyRet函数的if( 2 == ntype ) then下加入
SetMissionData(sceneId,selfId,MD_YJCZ,GetMissionData( sceneId,selfId,MD_YJCZ)+nYuanBao)
\home\tlbb\Public\Data\Script\ScriptGlobal.lua 加入:
--永久充值记录 此ID禁止占用 雪舞 2023-7-28 01:21:53
MD_YJCZ = 334
|
|