633 lines
24 KiB
Lua
633 lines
24 KiB
Lua
ClickOnItem = {}
|
||
|
||
ClickOnItem.cfg = {
|
||
["盟重传送石"] = function(actor, ...)
|
||
MapCfg.gotomap(actor, "3", 330, 330, 8)
|
||
-- gohome(actor)
|
||
return true
|
||
end,
|
||
["随机传送石"] = function(actor, ...)
|
||
local _map = getbaseinfo(actor, ConstCfg.gbase.mapid)
|
||
if MapCfg.dalumap[_map] and MapCfg.dalumap[_map].notrandom then
|
||
Func.sendmsg9(actor, "[随机传送石]:#70|此地图禁止随机!")
|
||
return false
|
||
else
|
||
map(actor, _map)
|
||
end
|
||
return true
|
||
end,
|
||
["开天斩"] = function(actor, ...)
|
||
Func.messagebox(actor, string.format("是否确认开始练习“%s”?", "开天斩"), "@click_addmagic,开天斩", "@exit")
|
||
return false
|
||
end,
|
||
["逐日剑法"] = function(actor, ...)
|
||
Func.messagebox(actor, string.format("是否确认开始练习“%s”?", "开天斩"), "@click_addmagic,逐日剑法", "@exit")
|
||
return false
|
||
end,
|
||
["四转材料宝箱"] = function(actor, ...)
|
||
gives(actor, "四转紫晶石#1#819&四转五彩石#1#819", "四转材料宝箱")
|
||
return true
|
||
end,
|
||
["金条"] = function(actor, ...)
|
||
changemoney(actor, 1, "+", 1000000, "金条兑换", true)
|
||
return true
|
||
end,
|
||
["蟠桃"] = function(actor, ...)
|
||
local pantao = Player.getint(actor, VarCfg.Player.int["蟠桃"]) or 0
|
||
|
||
if pantao < 10 then
|
||
Player.addint(actor, VarCfg.Player.int["蟠桃"], 1)
|
||
ReloadAttOBJ.main(actor)
|
||
return true
|
||
else
|
||
Func.sendmsg9(actor, "[蟠桃]:#70|您已经使用了10颗了!")
|
||
return false
|
||
end
|
||
end,
|
||
["万年何首乌"] = function(actor, ...)
|
||
local pantao = Player.getint(actor, VarCfg.Player.int["何首乌"]) or 0
|
||
|
||
if pantao < 10 then
|
||
Player.addint(actor, VarCfg.Player.int["何首乌"], 1)
|
||
ReloadAttOBJ.main(actor)
|
||
return true
|
||
else
|
||
Func.sendmsg9(actor, "[何首乌]:#70|您已经使用了10颗了!")
|
||
return false
|
||
end
|
||
end,
|
||
["千年灵芝"] = function(actor, ...)
|
||
local pantao = Player.getint(actor, VarCfg.Player.int["千年灵芝"]) or 0
|
||
|
||
if pantao < 10 then
|
||
Player.addint(actor, VarCfg.Player.int["千年灵芝"], 1)
|
||
ReloadAttOBJ.main(actor)
|
||
return true
|
||
else
|
||
Func.sendmsg9(actor, "[千年灵芝]:#70|您已经使用了10颗了!")
|
||
return false
|
||
end
|
||
end,
|
||
|
||
["人参果"] = function(actor, ...)
|
||
local pantao = Player.getint(actor, VarCfg.Player.int["人参果"]) or 0
|
||
|
||
if pantao < 10 then
|
||
Player.addint(actor, VarCfg.Player.int["人参果"], 1)
|
||
ReloadAttOBJ.main(actor)
|
||
return true
|
||
else
|
||
Func.sendmsg9(actor, "[人参果]:#70|您已经使用了10颗了!")
|
||
return false
|
||
end
|
||
end,
|
||
["天山雪莲"] = function(actor, ...)
|
||
local pantao = Player.getint(actor, VarCfg.Player.int["天山雪莲"]) or 0
|
||
|
||
if pantao < 10 then
|
||
Player.addint(actor, VarCfg.Player.int["天山雪莲"], 1)
|
||
ReloadAttOBJ.main(actor)
|
||
return true
|
||
else
|
||
Func.sendmsg9(actor, "[天山雪莲]:#70|您已经使用了10颗了!")
|
||
return false
|
||
end
|
||
end,
|
||
["10万经验卷"] = function(actor, ...)
|
||
clickon_exp(actor, "10万经验卷")
|
||
-- changeexp(actor, "+", 100000, false)
|
||
return false
|
||
end,
|
||
["300万经验卷"] = function(actor, ...)
|
||
LOGDump(...)
|
||
batch_exp(actor, "300万经验卷")
|
||
-- Func.messagebox(actor, "使用300万经验卷将消耗:#251|千年玄石x3#215|\\是否确认使用?#249", "@clickon_exp,300万经验卷", "@exit", 16)
|
||
return false
|
||
end,
|
||
["100万经验卷"] = function(actor, ...)
|
||
batch_exp(actor, "100万经验卷")
|
||
|
||
-- Func.messagebox(actor, "使用100万经验卷将消耗:#251|千年玄石x1#215|\\是否确认使用?#249", "@clickon_exp,100万经验卷", "@exit", 16)
|
||
return false
|
||
end,
|
||
["5000万经验卷"] = function(actor, ...)
|
||
batch_exp(actor, "5000万经验卷")
|
||
|
||
-- Func.messagebox(actor, "使用5000万经验卷将消耗:#251|千年玄石x50#215|\\是否确认使用?#249", "@clickon_exp,5000万经验卷", "@exit", 16)
|
||
return false
|
||
end,
|
||
["1000万经验卷"] = function(actor, ...)
|
||
batch_exp(actor, "1000万经验卷")
|
||
-- Func.messagebox(actor, "使用1000万经验卷将消耗:#251|千年玄石x10#215|\\是否确认使用?#249", "@clickon_exp,1000万经验卷", "@exit", 16)
|
||
return false
|
||
end,
|
||
|
||
["游艇"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 500)
|
||
return true
|
||
end,
|
||
["鼠标"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 100)
|
||
return true
|
||
end,
|
||
["键盘"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 50)
|
||
return true
|
||
end,
|
||
["咖啡"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 15)
|
||
return true
|
||
end,
|
||
["大苹果"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 7)
|
||
return true
|
||
end,
|
||
["可乐"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 3)
|
||
return true
|
||
end,
|
||
["香蕉"] = function(actor, ...)
|
||
giveitem(actor, "灵符", 1)
|
||
return true
|
||
end,
|
||
["女儿红"] = function(actor, ...)
|
||
if hasbuff(actor, 10027) or hasbuff(actor, 10028) then
|
||
Func.sendmsg9(actor, "[酒肆小二]:#70|您处于醉酒状态中,不可以重复使用哦!")
|
||
return false
|
||
end
|
||
addbuff(actor, 10027)
|
||
Func.sendmsg9(actor, "[酒肆小二]:#70|使用成功!伤害减免+10%,持续300s.中途可以再使用女儿红或者高粱酒.")
|
||
return true
|
||
end,
|
||
["高粱酒"] = function(actor, ...)
|
||
if hasbuff(actor, 10027) or hasbuff(actor, 10028) then
|
||
Func.sendmsg9(actor, "[酒肆小二]:#70|您处于醉酒状态中,不可以重复使用哦!")
|
||
return false
|
||
end
|
||
addbuff(actor, 10028)
|
||
Func.sendmsg9(actor, "[酒肆小二]:#70|使用成功!攻击伤害+10%,持续300s.中途可以再使用女儿红或者高粱酒.")
|
||
return true
|
||
end,
|
||
["鞭尸丹"] = function(actor, ...)
|
||
local _num = Player.getint(actor, VarCfg.Player.int["鞭尸丹"])
|
||
if _num < 999 then
|
||
Player.addint(actor, VarCfg.Player.int["鞭尸丹"], 1)
|
||
Func.sendmsg9(actor, string.format("[鞭尸丹]:#70|使用成功,100%%鞭尸1次,已叠加:%d次.", _num + 1))
|
||
return true
|
||
else
|
||
Func.sendmsg9(actor, "[鞭尸丹]:#70|叠加已达上限.")
|
||
return false
|
||
end
|
||
end,
|
||
["祝福油"] = function(actor, ...)
|
||
local equipMakeIndex = GetItemByPos(actor, 1)
|
||
if equipMakeIndex == "0" then
|
||
return false
|
||
else
|
||
local itemid = getiteminfo(actor, equipMakeIndex, 2)
|
||
local lucky_item = getstditematt(itemid, 39)
|
||
local set_Luck = GetItemLuck(actor, equipMakeIndex)
|
||
if set_Luck + lucky_item >= 9 then
|
||
return false
|
||
end
|
||
|
||
if (lucky_item + set_Luck) > 1 and Func.random(20, 500) then
|
||
SetItemLuck(actor, equipMakeIndex, set_Luck - 1)
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗你的武器被诅咒了.","Type":1,"FColor":255,"BColor":249}')
|
||
elseif (lucky_item + set_Luck) < 1 then
|
||
if Func.random(100) then
|
||
SetItemLuck(actor, equipMakeIndex, set_Luck + 1)
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗武器被加幸运了...","Type":1,"FColor":255,"BColor":249}')
|
||
else
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗无效.","Type":1,"FColor":255,"BColor":249}')
|
||
end
|
||
elseif (lucky_item + set_Luck) < 3 then
|
||
if Func.random(60) then
|
||
SetItemLuck(actor, equipMakeIndex, set_Luck + 1)
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗武器被加幸运了...","Type":1,"FColor":255,"BColor":249}')
|
||
else
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗无效.","Type":1,"FColor":255,"BColor":249}')
|
||
end
|
||
elseif (lucky_item + set_Luck) < 7 then
|
||
if Func.random(30) then
|
||
SetItemLuck(actor, equipMakeIndex, set_Luck + 1)
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗武器被加幸运了...","Type":1,"FColor":255,"BColor":249}')
|
||
else
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗无效.","Type":1,"FColor":255,"BColor":249}')
|
||
end
|
||
else
|
||
if Func.random(5, 200) then
|
||
SetItemLuck(actor, equipMakeIndex, set_Luck + 1)
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗武器被加幸运了...","Type":1,"FColor":255,"BColor":249}')
|
||
else
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗无效.","Type":1,"FColor":255,"BColor":249}')
|
||
end
|
||
end
|
||
end
|
||
end,
|
||
["高级祝福油"] = function(actor, ...)
|
||
local equipMakeIndex = GetItemByPos(actor, 1)
|
||
if equipMakeIndex == "0" then
|
||
return false
|
||
else
|
||
local itemid = getiteminfo(actor, equipMakeIndex, 2)
|
||
local lucky_item = getstditematt(itemid, 39)
|
||
local set_Luck = GetItemLuck(actor, equipMakeIndex)
|
||
if set_Luck + lucky_item >= 9 then
|
||
return false
|
||
end
|
||
SetItemLuck(actor, equipMakeIndex, set_Luck + 1)
|
||
sendmsg(actor, 1, '{"Msg":"〖提示〗武器被加幸运了...","Type":1,"FColor":255,"BColor":249}')
|
||
end
|
||
end,
|
||
["竹叶青"] = function(actor, ...)
|
||
ZhiJinHuLuOBJ:addjiuqi(actor, 1)
|
||
return false
|
||
end,
|
||
["特戒碎片"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "特戒碎片", 10, 0 } }, true, true) then
|
||
local cfg = {
|
||
{ "复活戒指", 2 },
|
||
{ "麻痹戒指", 2 },
|
||
{ "护身戒指", 2 },
|
||
{ "隐身戒指", 17 },
|
||
{ "防御戒指", 17 },
|
||
{ "火焰戒指", 15 },
|
||
{ "邪眼指环", 15 },
|
||
{ "冰雪乾坤戒", 15 },
|
||
{ "冰雪龙渊戒", 15 },
|
||
}
|
||
local random = math.random(1, 100)
|
||
local total = 0
|
||
for _, v in ipairs(cfg) do
|
||
total = total + v[2]
|
||
if random <= total then
|
||
giveitem(actor, v[1], 1, 0, "特戒碎片")
|
||
Func.sendmsg9(actor, string.format("[特戒碎片]:#70|恭喜获得#251|%s#249|!", v[1]))
|
||
break
|
||
end
|
||
end
|
||
end
|
||
return false
|
||
end,
|
||
|
||
---* 10个生肖碎片 → 随机黄金生肖
|
||
["生肖碎片"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "生肖碎片", 10, 0 } }, true, true) then
|
||
local cfg = {
|
||
"黄金鼠", "黄金牛", "黄金虎", "黄金兔", "黄金龙", "黄金蛇",
|
||
"黄金马", "黄金羊", "黄金猴", "黄金鸡", "黄金狗", "黄金猪",
|
||
}
|
||
local idx = math.random(1, #cfg)
|
||
giveitem(actor, cfg[idx], 1, 0, "生肖碎片")
|
||
Func.sendmsg9(actor, string.format("[生肖碎片]:#70|恭喜获得#251|%s#249|!", cfg[idx]))
|
||
end
|
||
return false
|
||
end,
|
||
|
||
---* 10个黄金生肖精华 → 随机钻石生肖
|
||
["黄金生肖精华"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "黄金生肖精华", 10, 0 } }, true, true) then
|
||
local cfg = {
|
||
"钻石鼠", "钻石牛", "钻石虎", "钻石兔", "钻石龙", "钻石蛇",
|
||
"钻石马", "钻石羊", "钻石猴", "钻石鸡", "钻石狗", "钻石猪",
|
||
}
|
||
local idx = math.random(1, #cfg)
|
||
giveitem(actor, cfg[idx], 1, 0, "黄金生肖精华")
|
||
Func.sendmsg9(actor, string.format("[黄金生肖精华]:#70|恭喜获得#251|%s#249|!", cfg[idx]))
|
||
end
|
||
return false
|
||
end,
|
||
|
||
---* 10个钻石生肖精华 → 随机至尊生肖
|
||
["钻石生肖精华"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "钻石生肖精华", 10, 0 } }, true, true) then
|
||
local cfg = {
|
||
"至尊鼠", "至尊牛", "至尊虎", "至尊兔", "至尊龙", "至尊蛇",
|
||
"至尊马", "至尊羊", "至尊猴", "至尊鸡", "至尊狗", "至尊猪",
|
||
}
|
||
local idx = math.random(1, #cfg)
|
||
giveitem(actor, cfg[idx], 1, 0, "钻石生肖精华")
|
||
Func.sendmsg9(actor, string.format("[钻石生肖精华]:#70|恭喜获得#251|%s#249|!", cfg[idx]))
|
||
end
|
||
return false
|
||
end,
|
||
|
||
["混沌碎片宝箱"] = function(actor, ...)
|
||
local result1, result2 = ransjstr("混沌战盔[碎片]#1|混沌战链[碎片]#1|混沌战镯[碎片]#1|混沌战戒[碎片]#1|混沌战腰[碎片]#1|混沌战靴[碎片]#1", 1, 3)
|
||
giveitem(actor, result1, 1, 0)
|
||
-- ZhiJinHuLuOBJ:addjiuqi(actor, 1)
|
||
return true
|
||
end,
|
||
["主宰碎片宝箱"] = function(actor, ...)
|
||
local result1, result2 = ransjstr("主宰战盔[碎片]#1|主宰战链[碎片]#1|主宰战镯[碎片]#1|主宰战戒[碎片]#1|主宰战腰[碎片]#1|主宰战靴[碎片]#1", 1, 3)
|
||
giveitem(actor, result1, 1, 0)
|
||
-- ZhiJinHuLuOBJ:addjiuqi(actor, 1)
|
||
return true
|
||
end,
|
||
|
||
---* 10个混沌战盔碎片 → 混沌战盔
|
||
["混沌战盔[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "混沌战盔[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "混沌战盔", 1, 0, "混沌战盔[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|混沌战盔#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个混沌战链碎片 → 混沌战链
|
||
["混沌战链[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "混沌战链[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "混沌战链", 1, 0, "混沌战链[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|混沌战链#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个混沌战镯碎片 → 混沌战镯
|
||
["混沌战镯[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "混沌战镯[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "混沌战镯", 1, 0, "混沌战镯[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|混沌战镯#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个混沌战戒碎片 → 混沌战戒
|
||
["混沌战戒[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "混沌战戒[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "混沌战戒", 1, 0, "混沌战戒[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|混沌战戒#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个混沌战腰碎片 → 混沌战腰
|
||
["混沌战腰[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "混沌战腰[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "混沌战腰", 1, 0, "混沌战腰[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|混沌战腰#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个混沌战靴碎片 → 混沌战靴
|
||
["混沌战靴[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "混沌战靴[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "混沌战靴", 1, 0, "混沌战靴[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|混沌战靴#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
|
||
---* 10个主宰战盔碎片 → 主宰战盔
|
||
["主宰战盔[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "主宰战盔[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "主宰战盔", 1, 0, "主宰战盔[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|主宰战盔#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个主宰战链碎片 → 主宰战链
|
||
["主宰战链[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "主宰战链[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "主宰战链", 1, 0, "主宰战链[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|主宰战链#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个主宰战镯碎片 → 主宰战镯
|
||
["主宰战镯[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "主宰战镯[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "主宰战镯", 1, 0, "主宰战镯[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|主宰战镯#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个主宰战戒碎片 → 主宰战戒
|
||
["主宰战戒[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "主宰战戒[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "主宰战戒", 1, 0, "主宰战戒[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|主宰战戒#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个主宰战腰碎片 → 主宰战腰
|
||
["主宰战腰[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "主宰战腰[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "主宰战腰", 1, 0, "主宰战腰[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|主宰战腰#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
---* 10个主宰战靴碎片 → 主宰战靴
|
||
["主宰战靴[碎片]"] = function(actor, ...)
|
||
if Func.takeitmes(actor, { { "主宰战靴[碎片]", 10, 0 } }, true, true) then
|
||
giveitem(actor, "主宰战靴", 1, 0, "主宰战靴[碎片]")
|
||
Func.sendmsg9(actor, "[合成]:#70|恭喜获得#251|主宰战靴#249|!")
|
||
end
|
||
return false
|
||
end,
|
||
|
||
["行会召集令"] = function(actor, ...)
|
||
local _map = getbaseinfo(actor, ConstCfg.gbase.mapid)
|
||
if MapCfg.dalumap[_map] and not MapCfg.dalumap[_map].chuanyunjian then
|
||
Func.sendmsg9(actor, "[提示]:#70|当前地图不能使用行会召集令!")
|
||
return false
|
||
end
|
||
local _x = getbaseinfo(actor, ConstCfg.gbase.x)
|
||
local _y = getbaseinfo(actor, ConstCfg.gbase.y)
|
||
|
||
local link = string.format("chuanyuanjian,%s,%d,%d,%s,%s", _map, _x, _y, getbaseinfo(actor, ConstCfg.gbase.name),
|
||
getbaseinfo(actor, ConstCfg.gbase.map_title))
|
||
gotolabel(actor, 1, link)
|
||
playeffect(actor, 82, 0, 0, 1, 0, 1)
|
||
return true
|
||
end,
|
||
|
||
---* 拾取精灵:嗷嗷虎
|
||
["拾取精灵:嗷嗷虎"] = function(actor, ...)
|
||
if getflagstatus(actor, VarCfg.Falg_shiqujinlin) == 1 then
|
||
Func.sendmsg9(actor, "[嗷嗷虎]:#70|拾取精灵已激活,无需重复使用!")
|
||
return false
|
||
end
|
||
setflagstatus(actor, VarCfg.Falg_shiqujinlin, 1)
|
||
createsprite(actor, "嗷嗷虎")
|
||
pickupitems(actor, 1, 10, 500)
|
||
Func.sendmsg9(actor, "[嗷嗷虎]:#70|拾取精灵已激活,10格范围自动拾取开启!")
|
||
return true
|
||
end,
|
||
}
|
||
|
||
|
||
|
||
function chuanyuanjian(actor, mapid, x, y, name, maptitle)
|
||
local _map = getbaseinfo(actor, ConstCfg.gbase.mapid)
|
||
|
||
local _bool = false
|
||
if _map ~= mapid then
|
||
_bool = true
|
||
else
|
||
_bool = not Npc.CheckRange(actor, x, y, 8)
|
||
end
|
||
|
||
if _bool then
|
||
local str = {}
|
||
table.insert(str, "<Img|reset=1|img=public/bg_npc_01.png|show=0|move=0|loadDelay=1|bg=1>")
|
||
table.insert(str, "<Layout|x=545|y=0|width=80|height=80|link=@exit>")
|
||
table.insert(str, "<Button|x=546|y=0|pimg=public/1900000511.png|nimg=public/1900000510.png|link=@exit>")
|
||
table.insert(str, "<Img|x=100.0|y=23.0|esc=0|img=public/word_sxbt_05.png>")
|
||
table.insert(str, "<Text|x=210.0|y=19.0|color=255|size=18|text=行会召唤>")
|
||
table.insert(str, "<Text|x=110.0|y=57.0|color=250|size=18|text=一支穿云箭,千军万马来相见>")
|
||
table.insert(str, "<Img|x=25.0|y=82.0|esc=0|img=public/btn_queding_01.png>")
|
||
table.insert(str, "<Text|x=59.0|y=88.0|color=255|size=18|text=行会成员:[" .. name .. "]正在召唤>")
|
||
table.insert(str, "<Img|x=336.0|y=90.0|esc=0|img=public/bg_zbxlzy_02.png>")
|
||
table.insert(str, "<Text|x=350.0|y=86.0|color=251|size=18|text=集结地:" .. maptitle .. ">")
|
||
table.insert(str, "<Text|x=30.0|y=131.0|color=249|size=18|text=倒计时:>")
|
||
table.insert(str, "<TIMETIPS|x=94.0|y=131.0|time=60|count=1|size=18|color=249|showWay=1|link=@exit>")
|
||
table.insert(str, "<Img|x=236.0|y=132.0|esc=0|img=public/btn_npcfh_03.png>")
|
||
table.insert(str, "<Text|x=261.0|y=130.0|size=18|color=251|text=立即前往|link=@goto_hanghui," .. mapid .. "," .. x .. "," .. y .. ">")
|
||
table.insert(str, "<Img|x=394.0|y=132.0|esc=0|img=public/btn_npcfh_03.png>")
|
||
table.insert(str, "<Text|x=419.0|y=130.0|size=18|color=251|text=拒绝前往|link=@exit>")
|
||
say(actor,table.concat(str))
|
||
end
|
||
end
|
||
|
||
function goto_hanghui(actor, mapid, x, y)
|
||
Func.sendmsg9(actor, "[提示]:#70|正在前往行会召集令指定位置...")
|
||
MapCfg.gotomap(actor, mapid, x, y,5)
|
||
end
|
||
|
||
|
||
|
||
|
||
function ClickOnItem:trigger(actor, item)
|
||
local item_name = Item.GetNameByObj(actor, item)
|
||
local func = self.cfg[item_name]
|
||
if func then
|
||
return func(actor, item)
|
||
end
|
||
end
|
||
|
||
for i = 0, 100, 1 do
|
||
_G["stdmodefunc" .. i] = function(actor, item)
|
||
return ClickOnItem:trigger(actor, item)
|
||
end
|
||
end
|
||
|
||
|
||
function click_addmagic(actor, magic_name)
|
||
if getskillinfo(actor, getskillindex(magic_name), 1) ~= nil then
|
||
return
|
||
end
|
||
|
||
if Func.takeitmes(actor, { { magic_name, 1, 0 } }, true, true) then
|
||
addskill(actor, getskillindex(magic_name), 3)
|
||
end
|
||
end
|
||
|
||
ClickOnItem.expcfg = {
|
||
["10万经验卷"] = {
|
||
exp = 100000,
|
||
xh = {
|
||
{ "10万经验卷", 1, 0 },
|
||
},
|
||
},
|
||
["100万经验卷"] = {
|
||
exp = 1000000,
|
||
xh = {
|
||
{ "100万经验卷", 1, 0 },
|
||
{ "千年玄石", 1, 0 },
|
||
},
|
||
},
|
||
["300万经验卷"] = {
|
||
exp = 3000000,
|
||
xh = {
|
||
{ "300万经验卷", 1, 0 },
|
||
{ "千年玄石", 3, 0 },
|
||
},
|
||
},
|
||
["500万经验卷"] = {
|
||
exp = 5000000,
|
||
xh = {
|
||
{ "500万经验卷", 1, 0 },
|
||
{ "千年玄石", 3, 0 },
|
||
},
|
||
},
|
||
["1000万经验卷"] = {
|
||
exp = 10000000,
|
||
xh = {
|
||
{ "1000万经验卷", 1, 0 },
|
||
{ "千年玄石", 10, 0 },
|
||
},
|
||
},
|
||
["5000万经验卷"] = {
|
||
exp = 50000000,
|
||
xh = {
|
||
{ "5000万经验卷", 1, 0 },
|
||
{ "千年玄石", 50, 0 },
|
||
},
|
||
},
|
||
}
|
||
|
||
|
||
function clickon_exp(actor, itemName, batch_num)
|
||
local level_lock = getlocklevel(actor)
|
||
|
||
if getbaseinfo(actor, ConstCfg.gbase.level) >= level_lock then
|
||
Func.sendmsg9(actor, "[提示]:#70|当前等级#251|已达上限,转生后解锁#215|更高等级!")
|
||
return
|
||
end
|
||
if ClickOnItem.expcfg[itemName] then
|
||
local _xh = table.Copy(ClickOnItem.expcfg[itemName].xh)
|
||
for i, v in ipairs(_xh or {}) do
|
||
v[2] = math.ceil(v[2] * batch_num)
|
||
end
|
||
|
||
if Func.takeitmes(actor, _xh, true, true) then
|
||
local _unbound_yuanbao = querymoney(actor, ConstCfg.sysMoney["元宝"])
|
||
local _exp = math.ceil(ClickOnItem.expcfg[itemName].exp * batch_num)
|
||
---* 非绑定元宝 > 1万 获得经验*1.2
|
||
if _unbound_yuanbao >= 10000 then
|
||
_exp = math.floor(_exp * 1.2)
|
||
end
|
||
|
||
changeexp(actor, "+", _exp, false)
|
||
close(actor)
|
||
end
|
||
end
|
||
end
|
||
|
||
function batch_exp(actor, itemName)
|
||
local _str = {}
|
||
|
||
local bag_top_num = getbagitemcount(actor, itemName)
|
||
|
||
local batch_num = tonumber(getconst(actor, "<$npcparams(3,N0)>")) or 1
|
||
|
||
|
||
table.insert(_str, "<Img|loadDelay=1|img=custom/37/bg.png|move=0|show=4|bg=1|esc=1|reset=1>")
|
||
table.insert(_str, "<Layout|x=545|y=0|width=80|height=80|link=@exit>")
|
||
table.insert(_str, "<Button|x=308.0|y=1.0|nimg=public/1900000510.png|pimg=public/1900000511.png|link=@exit>")
|
||
table.insert(_str, "<Text|a=4|x=154.0|y=34.0|color=255|size=18|text=" .. itemName .. ">")
|
||
table.insert(_str,
|
||
"<Button|x=95.0|y=136.0|nimg=custom/37/1.png|size=18|color=255|text=立即使用|link=@clickon_exp," ..
|
||
itemName .. "," .. batch_num .. ">")
|
||
table.insert(_str,
|
||
"<Slider|x=51.0|y=80.0|width=200|height=14|barimg=public/bg_szjm_02.png|defvalue=" ..
|
||
batch_num ..
|
||
"|bgimg=public/bg_szjm_01.png|ballimg=public/bg_szjm_02_1.png|maxvalue=" ..
|
||
bag_top_num .. "|sliderid=N0|link=@batch_exp," .. itemName .. ">")
|
||
table.insert(_str, "<Text|x=101.0|y=54.0|color=255|size=18|text=批量使用:" .. batch_num .. "/" .. bag_top_num .. "个>")
|
||
|
||
local xh = ClickOnItem.expcfg[itemName].xh[2]
|
||
if xh then
|
||
table.insert(_str, "<Text|x=92.0|y=113.0|color=255|size=18|text=消耗:>")
|
||
table.insert(_str,
|
||
"<ItemShow|x=119.0|y=88.0|width=70|height=70|itemname=" .. xh[1] .. "|itemcount=1|scale=0.6|showtips=1>")
|
||
table.insert(_str, "<Text|x=170.0|y=112.0|color=255|size=18|text=" .. xh[1] .. "x" .. (xh[2] * batch_num) .. ">")
|
||
end
|
||
|
||
|
||
|
||
|
||
|
||
say(actor, table.concat(_str))
|
||
end
|
||
|
||
return ClickOnItem
|