|
含白日门传奇工程源码编译资源虚拟机系统镜像端
带环境配置好可以打包服务端客户端源码
玩家等级变化时会触发triger_level方法
- local data={};
- function add_listener(fun)
- data[fun] = fun;
- end
- function triger_level(player,lv)
- for i,v in pairs(data) do
- v(player,lv);
- end
- check_level(player,lv);
- end
- function check_level(player,lv)
- if lv == 100 then
- player:go_home()
- end
- end
复制代码 需要监听升级变化回调的可以在这个理处理。
此文件主要是由c++中玩家各种信息变化时,主动触发调用的lua方法
- function onLoad(player)
- player:alert(110,0,"欢迎来到"..server.get_server_name().."!")
- player:alert(10,0,"健康游戏忠告:<br>抵制不良游戏 拒绝盗版游戏<br>注意自我保护 谨防受骗上当<br>适度游戏益脑 沉迷游戏伤身<br>合理安排时间 享受健康生活")
- player:alert(10000,0,"温馨提示:<br>上线后赠送88万钻石!!此钻石已经禁止寄售和交易")
- genxxx.gx(player)
- genxxx.set_bless(player)
- if( player:get_task_state(1) == 0 ) then
- player:set_task_state(1,1)
- login.first_login(player)
- player:add_skill(100)
- local job = player:get_job_name();
- if job == "warrior" then --战士
- player:add_skill(101);
- player:add_skill(103);
- player:set_short_cut(1, 2, 103);
- player:add_skill(104);
- player:set_short_cut(2, 2, 104);
- player:add_skill(105);
- player:set_short_cut(3, 2, 105);
- player:add_skill(106);
- player:set_short_cut(4, 2, 106);
- player:add_skill(110);
- player:set_short_cut(5, 2, 110);
- player:add_skill(109);
- player:set_short_cut(6, 2, 109);
- player:add_skill(111);
- player:set_short_cut(6, 2, 111);
- end
- end
- -- player:set_max_power(0,0,0)
- gui.PanelInnerPower.setInnerPower(player, 0)
- player:set_model(11,util.ppn(player,const.PP_WING_LEVEL))
- login.enter_game(player)
- gui.PanelCutting.CalculateCuttingValue(player)
- gui.PanelShield.CalculShieldValue(player)
- gui.PanelLingchong.duduValue(player)
- gui.PanelLingchong.yiyiValue1(player)
- mon.killMon.setclothlingValue(player)
- mon.killMon.setclothhuangValue(player)
- mon.killMon.setweaponlingValue(player)
- mon.killMon.setweaponchuiValue(player)
- mon.killMon.setwingrimianValue(player)
- mon.killMon.setfoothuhaiValue(player)
- mon.killMon.setfootxiariValue(player)
- mon.killMon.setbinghuoValue(player)
- mon.killMon.setleitingValue(player)
- gui.PanelGuild.refreshGuildPrayAttr(player)
- gui.PanelOfficial.refreshActPro(player)
- gui.PanelOfficial.refreshGuanweiattr(player)
- gui.PanelWuHun.setWuhunAttr(player,reduceOld)
- gui.PanelZhuanSheng.CalculateAttributeZS(player)
- gui.PanelWing.CalculateAttributeWing(player)
- if server.get_temp_var("isActivityNotice") ~= "true" then
- server.set_timer(2,3000)
- -- print("start activity notice")
- server.set_temp_var("isActivityNotice","true")
- end
- local dart_id = util.ppn(player,const.PP_DART_ID)
- if dart_id > 0 then
- if not player:bind_dart(dart_id) then
- player:set_param(const.PP_DART_ID,0)
- end
- end
- end
- function onUnload(player)
- login.unload_player(player)
- end
- function onEnterGame(player)--onEnterPlayGame(player)
- enter_game_triger_fun(player);-------进游戏触发的一些方法汇总
- player:set_param(const.PP_HUWEIN,0)
- player:set_param(const.PP_HUWEIT,0)
- local vipLv = util.ppn(player, const.PP_VIP_LEVEL)
- local vipEXP = util.ppn(player, const.PP_VIP_EXP)
- local z = math.random(8302004,8302011);
- local result = {}
- if vipLv<1 then
- player:set_param(const.PP_VIP_LEVEL, 10);
- player:set_param(const.PP_VIP_EXP, 100);
- player:set_status(39,86400,util.ppn(player, const.PP_VIP_LEVEL),1,1);
- player:set_model(5,util.ppn(player, const.PP_VIP_LEVEL));
- player:add_fuli(880000)
- player:add_item(32010002,99,1)
- player:add_item(32010003,99,1)
- end
- -- login.add_login_listener(setBaseValue)
- local buff = util.ppn(player, const.PP_QIEGE_BUFF);
- local buffon = util.ppn(player,const.PP_QIEGE_BUFF_ON)
- local qglevel = util.ppn(player,const.PP_QIEGE_LEVEL)
- if buffon == 1 and qglevel >=90 then
- player:set_buff(500011)
- else
- player:set_buff(buff)
- end
- local attackMode = util.ppn(player, const.PP_ATTACK_MODE);
- if attackMode == 0 then attackMode = 101; end
- player:set_attack_mode(attackMode);
- player:set_param(const.PP_ATTACK_MODE,attackMode)
- if util.ppn(player,const.PP_WING_LEVEL) > 0 then
- player:set_wing_lv(70001+util.ppn(player,const.PP_WING_LEVEL));-----翅膀
- end
- if player:get_name() == server.get_var("wlmz") then
- --server.info(10,0,"<font color='#ff00ff'>尊敬的武林盟主[<font color='#ff0000'>"..player:get_name().."</font>]上线了!</font>");
- -- npc.fenghao.youxifh(player);
- else
- -- npc.fenghao.youxifh(player);
- end
- local startTime = util.ppn(player, const.PP_OFFLINE_START_TIME)
- local second = player:get_last_login_time()-player:get_last_logout_time()
- local mapSelect = util.ppn(player, const.PP_OFFLINE_MAPIDX)
- if mapSelect>0 then
- local MAX_TIME = 7*24*60*60
- player:set_param(const.PP_OFFLINE_START_TIME,0)
- second = second + player:get_last_logout_time() - startTime
- second = util.bound(0,second,MAX_TIME);
- player:set_param(const.PP_OFFLINE_TIME,util.ppn(player,const.PP_OFFLINE_TIME)+second)
- player:set_param(const.PP_OFFLINE_STATE,0) --挂机结束
- gui.PanelOffline.CalculateAward(player)
- end
- local kingInfo = server.get_var("kingInfo")
- local king_tab = util.decode(kingInfo) or {}
- local king_guild = server.get_king_guild()
- local leaderOfKing = ""
- if king_guild and king_guild ~= "" then
- local guild_temp = server.find_guild(king_guild)
- if guild_temp then
- leaderOfKing = guild_temp:get_leader_name()
- if player:get_name()==leaderOfKing then
- if tonumber(os.date("%H%M", os.time())) <=2030 or tonumber(os.date("%H%M", os.time()))>=2100 then
- server.info(10000,0,"<font color='#ff0000'>皇城城主</font> <font color='#01ebff'>"..leaderOfKing.."</font> 上线了!")
- end
- local ret,position= player:check_item_fashion(15600008)
- if ret > 4 then
- player:add_item(15600008,1,1)
- end
- else
- local ret,position= player:check_item_fashion(15600008)
- if ret <= 4 then
- player:remove_item_by_type_pos(15600008, position, 1)
- if player:num_item(15600008,10) then
- player:remove_item_by_type_pos(15600008, -70, 1)
- end
- end
- end
- else
- local ret,position= player:check_item_fashion(15600008)
- if ret <= 4 then
- player:remove_item_by_type_pos(15600008, position, 1)
- if player:num_item(15600008,10) then
- player:remove_item_by_type_pos(15600008, -70, 1)
- end
- end
- end
- end
-
- if player:get_guild() ~= server.get_king_guild() then
-
- end
- if king_guild and king_guild ~= "" and not king_tab.guild then
- king_tab.name = leaderOfKing
- king_tab.guild = king_guild
- server.set_var("kingInfo",util.encode(king_tab))
- end
- if leaderOfKing~="" and player:get_name() == leaderOfKing and not king_tab.job then
- king_tab.job = player:get_job_name()
- king_tab.gender = player:get_gender_name()
- king_tab.fight = player:get_fightpoint()
- king_tab.level = player:get_level()
- king_tab.weapon = player:get_item_type_by_pos(const.ITEM_WEAPON_POSITION)
- king_tab.cloth = player:get_item_type_by_pos(const.ITEM_CLOTH_POSITION)
- server.set_var("kingInfo",util.encode(king_tab))
- end
- if util.ppn(player,const.PP_CHIP_SJ)>=100 then
- gui.PanelShenJiang.enterZhaoHuan(player)
- end
- -- player:set_timer(9, 120 * 1000)
- -- player:set_timer(13,1*1000)
- player:set_timer(15,10*1000)
- player:set_timer(16,60*1000)
- player:set_timer(778,1*10)
- player:set_timer(779,1*1000)
- player:set_timer(780,1*1000)
- player:set_timer(900,1*1000) --mxwx 套装属性头链
- player:set_timer(901,1*1000) --mxwx 套装属性戒镯
- player:set_timer(902,1*1000) --mxwx 套装属性带靴
- player:set_timer(903,1*1000) --mxwx 套装属性星座
- player:set_timer(904,1*1000) --mxwx 套装属性仙器
- player:set_timer(905,1*1000) --mxwx 套装属性神器
- player:set_timer(906,1*1000) --mxwx 套装属性神器
- player:set_timer(907,1*1000) --mxwx 套装属性神器
- player:set_timer(908,1*1000) --mxwx 套装属性神器
- player:set_timer(909,2*1000) --mxwx 套装属性神器
- player:set_timer(910,1*1000) --mxwx 套装属性神器
- player:set_timer(911,1*1000) --mxwx 套装属性神器
- player:set_timer(912,1*1000) --mxwx 套装属性神器
- player:set_timer(913,1*1000) --mxwx 套装属性神器
- player:set_timer(914,1*1000) --mxwx 套装属性神器
- player:set_timer(915,1*1000) --mxwx 套装属性神器
- player:set_timer(916,1*1000) --mxwx 套装属性神器
- player:set_timer(917,1*1000) --mxwx 套装属性神器
- --player:set_timer(10000,1*1000)
- tab.pushItemLimitToClient(player)
- end
复制代码
|
上一篇:新XO手游三端传奇引擎23.0327Android+IOS及微端下一篇:1.85霸者传奇三职业战神引擎开区服务端
|