如何使用:妖城在线论坛; A; @! {+ ], T9 f1 p& t8 c
服务端部分
config.lua中引用 mijing_server.lua—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート5 g+ Q6 W5 K9 `1 w4 A
luac.lua中加入 luac.txt内代码
bbs.mocwww.com7 F5 e# B( u$ u- @
客户端部分
GA二建端:直接把mijing_client.lua 与 image文件夹丢入客户端的lua中
GA商业版:用打包器直接打包以上脚本3 j9 Y0 b( b5 H( v0 j
GE(GXSIM):用打包器GA2GE.exe直接打包以上脚本bbs.mocwww.com0 q4 r/ P7 R+ X
—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート: O/ ?# X$ a' @: t2 S
妖城在线论坛+ O! B# G' A# c |* Q5 i: x
呼出界面:
block 3 P$ w" Z8 l T7 _
showmj魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表2 ^$ @) s) c0 ]
妖城在线论坛% F( u9 T4 R+ ~1 |) k/ U+ f
魔力私服,最新魔力宝贝私服技术交流, y ]' E8 {) a4 E k
设定层锁:—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート! s( ~- B# t4 {9 @7 {9 B8 y/ D& h( I
block—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート ]. C4 {) `8 G1 ?* U- n" h
luac setmj 1,3 设置秘境1开启第三层( K+ t) }0 B+ v) z: ]
—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート" b; j5 I% O- O2 v' R1 G% @
以上均可以使用道具或NPC脚本设定0 x1 g) A" g, o; B F
bbs.mocwww.com6 D, g3 ^, |( C+ U
bbs.mocwww.com1 O! |/ c+ t; U+ }% c% l" {
其他配置可以打开mijing_server.lua 查看
以下是代码部分:
      
客户端:
--[[
秘境挑战 客户端lua部分
支持平台:GA、GE(GXSIM)
一个界面化的副本挑战
]]
tbl_mj = {}; --存储秘境配置,数据从服务器传入
mj_thisselect = 1;
mj_thisselect_cs = 1;
tbl_cssetting = {"第一","第二","第三","第四","第五","最终"};
mj_sycs = 0;
function Myrw_init(view)
if view.IsInit then
-- 如果窗体第一次载入,开始摆放控件
view.settop();
-- 摆放关闭按钮
view.add(new.closebutton("myclose_test"));
for i=1,6 do
-- 摆放锁按钮
view.add(new.bmpbutton("mj_suo_".. i,"mijing_suo.bmp"));
end
for i=1,6 do
-- 摆放道具
view.add(new.image("mj_itembox_".. tostring(i)));
end
-- 摆放开始挑战按钮
view.add(new.bmpbutton("mj_huain","mijing_btn2.bmp"));
-- 摆放当前挑战背景
view.add(new.bmpbutton("ditutu","mijing_bg_huayao.bmp"));
for i=1,#tbl_mj do
view.add(new.bmpbutton("mj_select_" .. tostring(i),"mijing_btn1.bmp"));
end
view.add(new.bmpbutton("mj_bg","mijing_bg.bmp"));
return;
end
-- 窗体初始显示位置
view.xpos = 60;
view.ypos = 60;
if Cli.GetHD() then --960*720时
view.xpos = 180;
view.ypos = 180;
end
local close = view.find("myclose_test");
close.enable = 1;
close.xpos = 548;
close.ypos = 8;
close.event = function(object)
-- 当关闭按钮被按下时
Audio.Bell(54,320)
return 1;
end
-- 初始奖励道具显示偏移
local tbl2 = {{425,205},{480,205},{535,205},{425,255},{480,255},{535,255}};
for i=1,6 do
local object = view.find("mj_itembox_".. tostring(i));
object.enable = 1;
object.sizex = 48;
object.sizey = 48;
object.xpos = tbl2[i][1] - 50 ;
object.ypos = tbl2[i][2] - 50;
object._select3 = tostring(i);
object.event = function(object,event)
if event == Cevent.mouseover then
-- 把道具数据文字画到游戏中
if tbl_mj[mj_thisselect]["itemdatainfo_"..mj_thisselect_cs] ~= nil then
local info = tbl_mj[mj_thisselect]["itemdatainfo_"..mj_thisselect_cs][tonumber(object._select3)];
if info ~= nil then
this.spText(view.xpos+373,view.ypos+139,9,info)
end
end
end
end
end
for i=1,6 do
local object = view.find("mj_suo_" .. tostring(i));
object.enable = 1;
if i == 1 then
object.xpos = 135;
object.ypos = 220;
end
if i == 2 then
object.xpos = 172;
object.ypos = 193;
end
if i == 3 then
object.xpos = 215;
object.ypos = 220;
end
if i == 4 then
object.xpos = 255;
object.ypos = 193;
end
if i == 5 then
object.xpos = 290;
object.ypos = 235;
end
if i == 6 then
object.xpos = 215;
object.ypos = 275;
end
object._select3 = tostring(i);
object.event = function(object,event)
local num = tonumber(object._select3)
if num <= tonumber(tbl_mj[mj_thisselect].dqcs) then
object.id = "mijing_jiesuo.bmp";
else
object.id = "mijing_suo.bmp";
end
if event == Cevent.click then
mj_thisselect_cs = num;
end
end
end
for i=1,#tbl_mj do
local object = view.find("mj_select_" .. tostring(i));
object.enable = 1;
object.xpos = 20;
object.ypos = 110 + ((i - 1) * 25);
object._select3 = tostring(i);
object.event = function(object,event)
local num = tonumber(object._select3)
local view = object.mainview;
local selected = "A";
if event == Cevent.mouseover then
selected = "5";
end
if mj_thisselect == num then
selected = "4";
end
if num ~= nil and tbl_mj[num] ~= nil then
this.spText(view.xpos+object.xpos+8,view.ypos+object.ypos+4,9,"$"..selected.. tbl_mj[num].name .."$0")
end
if event == Cevent.click then
mj_thisselect = tonumber(object._select3);
mj_thisselect_cs = 1;
end
end
end
local object = view.find("mj_bg");
object.enable = 1;
object.xpos = 0;
object.ypos = 0;
object.event = function(object,event)
local view = object.mainview;
this.spText(view.xpos + 407,view.ypos + 75,9,"$4"..tbl_cssetting[mj_thisselect_cs].."层:"..tbl_mj[mj_thisselect].name.."$0")
local itemdata = tbl_mj[mj_thisselect]["itemdata_"..mj_thisselect_cs];
local tbl = {{425,205},{480,205},{535,205},{425,255},{480,255},{535,255}};
local is = 1;
if itemdata ~= nil then
for k,v in ipairs(itemdata) do
if v ~= nil then
this.spImage(view.xpos + tbl[is][1] -24 ,view.ypos + tbl[is][2] -22,tonumber(v));
is = is + 1;
end
end
end
local close = view.find("myclose_test_close");
this.spImage(view.xpos + close.xpos + 5,view.ypos + close.ypos + 6 ,close.imageID);
end
local object = view.find("ditutu");
object.enable = 1;
object.xpos = 130;
object.ypos = 60;
object.event = function(object,event)
object.id = tbl_mj[mj_thisselect].mapid;
end
local object = view.find("mj_huain");
object.enable = 1;
object.xpos = 470;
object.ypos = 270;
object.event = function(object,event)
local selected = "4";
if event == Cevent.mouseover then
selected = "5";
end
if event == Cevent.click then
-- 向服务器请求挑战
Cli.Send("MJWARP:"..mj_thisselect..":"..mj_thisselect_cs);
end
this.spText(view.xpos+object.xpos-95,view.ypos+object.ypos+4,9,"$B本日还剩 $6"..mj_sycs.." $B次$0")
this.spText(view.xpos+object.xpos+9,view.ypos+object.ypos+4,9,"$"..selected.."开始挑战$0")
end
view.sizex = 588;
view.sizey = 339;
view.pxpos = 588;
end
Cli.Send().wait["MIKING_RET1"] = function (tbl)
mj_sycs = tonumber(tbl["res"])
end
Cli.Send().wait["MIKING_RET2"] = function (tbl)
-- 等待服务器发送数据
tbl_mj = tbl;
-- 打开窗体
new.ShowView(101,Myrw_init)
end