Kết quả 1 đến 2 của 2
Chủ đề: Phó Bản
-
20-09-17, 09:16 AM #1Thành Viên
- Ngày tham gia
- Nov 2010
- Bài viết
- 58
- Thanks
- 16
- Thanked 3 Times in 3 Posts
Phó Bản
Có ai biết cách Add một phụ bản mới vào Game ko ..hướng dẫn mình với...
Khách viếng thăm hãy cùng thanh06 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
29-09-17, 12:29 AM #2Super Moderator
- Ngày tham gia
- Apr 2011
- Đang ở
- 地獄
- Bài viết
- 3,991
- Thanks
- 369
- Thanked 4,069 Times in 1,403 Posts
Ðề: Phó Bản
Mình có đoạn code sau về phụ bản bạn chịu khó đọc dịch và hiểu nhé. Còn add vào thì nó như các pb thường thôi. Bạn tham khảo các pb của bọn tàu nó làm ấy chỉ cần bước đó là đủ.
Code tổng quát của pb có dạng như sau
Code:--Powered by TLBB-LuaEditor --Script: YOUR SCRIPT DESCRIPTION --Author: YOUR NAME --Date: CURRENT DATE --************************-- x000000_g_ScriptId = 000000 --ID of this script. Remember replace all 000000 text by your script index with exactly 6 digits --************************-- x000000_g_CopySceneType = --This constant is the index of this CopyScene. Find it at ScriptGlobal and register it at scene.lua. (Eg: FUBEN_TEST) x000000_g_CopySceneLifeTime = --The lifetime of this CopyScene (milis) x000000_g_CopySceneMissionData = --The MD of this CopyScene (Ex: MD_FUBEN_TEST) x000000_g_LoadMonster = "_monster.ini" --Set loading monster file for this CopyScene (Ex: "test_monster.ini") x000000_g_LoadScene = ".nav" --Set loading scene file for this CopyScene (Ex: "test.nav") x000000_g_LoadArea = "_area.ini" --Set loading area file for this CopyScene (Ex: "test_area.ini") x000000_g_NoUserTime = 5000 --The time of closing CopyScene while no player is inside (milis) x000000_g_Relive_PosX = --The relive position X of player at the CopyScene x000000_g_Relive_PosY = --The relive position Y of player at the CopyScene x000000_g_Limit_Member = --The minimum number of player that able to attend this CopyScene x000000_g_TurnPerDay = --The maximum number of attending time of player at this CopyScene x000000_g_Need_Level = --The minimum level of player that able to attend this CopyScene --These values belows should be default x000000_g_CopySceneTimer = 9 --Variable index 10 stores the time of CopyScene to generate MilisTime x000000_g_CopySceneTimeLeft = 10 --Variable index 10 stores the time left of CopyScene x000000_g_CopySceneStep = 11 --Controller step of CopyScene -- TODO init some variables index below with value range [12..36] --************************-- --=========================================================-- -- [DEFAULT] -- This function is called to add the selection of this event to a NPC -- sceneId: ID of current scene -- playerId: ID of player -- targetId: ID of NPC --=========================================================-- function x000000_OnEnumerate(sceneId,playerId,targetId) --************************-- AddNumText(sceneId,x000000_g_ScriptId,"Create copy scene",3,0) AddNumText(sceneId,x000000_g_ScriptId,"Leave",3,1) --************************-- -- TODO your code below. --************************-- end --=========================================================-- -- [DEFAULT] -- This function is called to catch the selection event of this event -- sceneId: ID of current scene -- playerId: ID of player -- targetId: ID of NPC --=========================================================-- function x000000_OnDefaultEvent(sceneId,playerId,targetId) --************************-- if GetNumText()==0 then local result,nTip=x000000_OnCheckCondition(sceneId,playerId) if result==0 then BeginEvent(sceneId) AddText(sceneId,nTip) EndEvent(sceneId) DispatchEventList(sceneId,playerId,targetId) return end x000000_MakeCopyScene(sceneId,playerId) end --************************-- if GetNumText()==1 then BeginUICommand(sceneId) EndUICommand(sceneId) DispatchUICommand(sceneId,playerId,1000) end --************************-- -- TODO your code below. --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to check some conditions of player before entering -- sceneId: ID of current scene -- playerId: ID of player --=========================================================-- function x000000_OnCheckCondition(sceneId,playerId) --************************-- if LuaFnHasTeam(sceneId,playerId)~=1 then return 0,"You need to join in a team!" end --************************-- if GetTeamLeader(sceneId,playerId)~=playerId then return 0,"You are not team leader!" end --************************-- if GetTeamSize(sceneId,playerId)<x000000_g_Limit_Member then return 0,"Your team needs to have at least #G"..x000000_g_Limit_Member.."#W member!" end --************************-- local NearTeamSize = GetNearTeamCount(sceneId,playerId) if GetTeamSize(sceneId,playerId)~=NearTeamSize then return 0,"Your teammates need to stay near by me!" end --************************-- local Humanlist={} local nHumanNum=0 for i=0,NearTeamSize-1 do local teammateId=GetNearTeamMember(sceneId,playerId,i) if GetLevel(sceneId,teammateId)<x000000_g_Need_Level then Humanlist[nHumanNum]=GetName(sceneId,teammateId) nHumanNum = nHumanNum+1 end end if nHumanNum > 0 then local msg="Your team has " for i=0,nHumanNum-2 do msg=msg..Humanlist[i]..", " end msg=msg..Humanlist[nHumanNum-1].." whose level is not enough #G"..x000000_g_Need_Level..", can`t join in this event!" return 0,msg end --************************-- local Humanlist={} local nHumanNum=0 local CurDayTime = GetDayTime() for i=0,NearTeamSize-1 do local teammateId=GetNearTeamMember(sceneId,playerId,i) local lastTime = GetMissionData(sceneId,teammateId,x000000_g_CopySceneMissionData) local lastDayTime = floor(lastTime/100) local lastDayCount = mod(lastTime,100) if CurDayTime > lastDayTime then lastDayTime = CurDayTime lastDayCount = 0 end if lastDayCount >= x000000_g_TurnPerDay then Humanlist[nHumanNum]=GetName(sceneId,teammateId) nHumanNum = nHumanNum+1 end end if nHumanNum > 0 then local msg="Your team has " for i=0,nHumanNum-2 do msg=msg..Humanlist[i]..", " end msg=msg..Humanlist[nHumanNum-1].." who attent that event enough times today!" return 0,msg end --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to create the copy scene -- sceneId: ID of current scene -- playerId: ID of player --=========================================================-- function x000000_MakeCopyScene(sceneId,playerId) --************************-- local x,y=GetWorldPos(sceneId,playerId) LuaFnSetSceneLoad_Map(sceneId,x000000_g_LoadScene) LuaFnSetCopySceneData_TeamLeader(sceneId,LuaFnObjId2Guid(sceneId,playerId)) LuaFnSetCopySceneData_NoUserCloseTime(sceneId,x000000_g_NoUserTime) LuaFnSetCopySceneData_Timer(sceneId,1) LuaFnSetCopySceneData_Param(sceneId,0,x000000_g_CopySceneType) LuaFnSetCopySceneData_Param(sceneId,1,x000000_g_ScriptId) LuaFnSetCopySceneData_Param(sceneId,2,0) LuaFnSetCopySceneData_Param(sceneId,3,sceneId) LuaFnSetCopySceneData_Param(sceneId,4,x) LuaFnSetCopySceneData_Param(sceneId,5,y) LuaFnSetCopySceneData_Param(sceneId,6,GetTeamId(sceneId,playerId)) LuaFnSetCopySceneData_Param(sceneId,7,0) --************************-- for i=8,31 do LuaFnSetCopySceneData_Param(sceneId,i,0) end --************************-- LuaFnSetSceneLoad_Area(sceneId,x000000_g_LoadArea) LuaFnSetSceneLoad_Monster(sceneId,x000000_g_LoadMonster) local bRetSceneID=LuaFnCreateCopyScene(sceneId) BeginEvent(sceneId) if bRetSceneID>0 then AddText(sceneId,"Transfer succeeded!") else AddText(sceneId,"Over number of copyscene. Please try again later!") end EndEvent(sceneId) DispatchMissionTips(sceneId,playerId) --************************-- end --=========================================================-- -- [DEFAULT] -- This function is called to take players to the copy scene. This function should be kept default -- sceneId: ID of current scene -- destsceneId: ID of target scene --=========================================================-- function x000000_OnCopySceneReady(sceneId,destsceneId) --************************-- LuaFnSetCopySceneData_Param(destsceneId,3,sceneId) leaderguid=LuaFnGetCopySceneData_TeamLeader(destsceneId) leaderObjId=LuaFnGuid2ObjId(sceneId,leaderguid) local nearteammembercount=GetNearTeamCount(sceneId,leaderObjId) local mems={} for i=0,nearteammembercount-1 do mems[i]=GetNearTeamMember(sceneId,leaderObjId,i) NewWorld(sceneId,mems[i],destsceneId,x000000_g_Relive_PosX,x000000_g_Relive_PosY) end --************************-- end --=========================================================-- -- [DEFAULT] -- This function is called every short tick lifetimer of this copy scene -- sceneId: ID of current scene -- nowTime: Current system time --=========================================================-- function x000000_OnCopySceneTimer(sceneId,nowTime) --************************-- local nTick = x000000_UpdateTimerMilis(sceneId,nowTime) --This is the milis time, use it base on your goal x000000_ShowCopySceneTimer(sceneId,nTick) --************************-- local nStep = LuaFnGetCopySceneData_Param(sceneId,x000000_g_CopySceneStep) --************************-- if nStep==0 then x000000_InitCopySceneData(sceneId) LuaFnSetCopySceneData_Param(sceneId,x000000_g_CopySceneStep,1) end --************************-- -- TODO your code below. with `nStep` start with value = 1 --************************-- end --=========================================================-- -- [DEFAULT] -- This function is called to do something when players enter copy scene (includes disconnect then reconnect) -- sceneId: ID of current scene -- playerId: ID of player --=========================================================-- function x000000_OnPlayerEnter(sceneId,playerId) --************************-- local lastTime = GetMissionData(sceneId,playerId,x000000_g_CopySceneMissionData) local lastDayTime = floor(lastTime/100) local lastDayCount = mod(lastTime,100) local CurDayTime = GetDayTime() if CurDayTime > lastDayTime then lastDayTime = CurDayTime lastDayCount = 0 end lastDayCount = lastDayCount+1 lastTime = lastDayTime*100+lastDayCount --************************-- SetMissionData(sceneId,playerId,x000000_g_CopySceneMissionData,lastTime) --************************-- SetPlayerDefaultReliveInfo(sceneId,playerId,"%10",-1,"0",sceneId,x000000_g_Relive_PosX,x000000_g_Relive_PosY) --************************-- -- TODO your code below. --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to update the timeleft of copy scene -- sceneId: ID of current scene -- nowTime: Current system time --=========================================================-- function x000000_UpdateTimerMilis(sceneId,nowTime) --************************-- if LuaFnGetCopySceneData_Param(sceneId,x000000_g_CopySceneTimeLeft)==0 then LuaFnSetCopySceneData_Param(sceneId,x000000_g_CopySceneTimeLeft,x000000_g_CopySceneLifeTime) end --************************-- local nTick = nowTime-LuaFnGetCopySceneData_Param(sceneId,x000000_g_CopySceneTimeLeft) LuaFnSetCopySceneData_Param(sceneId,x000000_g_CopySceneTimeLeft,nowTime) return nTick --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to show the copyscene timeleft to player -- sceneId: ID of current scene -- nTick: The milis timer between previous call and current call --=========================================================-- function x000000_ShowCopySceneTimer(sceneId,nTick) --************************-- local timeLeft = LuaFnGetCopySceneData_Param(sceneId,x000000_g_CopySceneTimeLeft)-nTick LuaFnSetCopySceneData_Param(sceneId,x000000_g_CopySceneTimeLeft,timeLeft) --************************-- -- TODO your code below. --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to initialize some paramaters of copyscene -- sceneId: ID of current scene --=========================================================-- function x000000_InitCopySceneData(sceneId) --************************-- -- TODO your code below. --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to kick out all players from this copy scene -- You need to call it when you want to do this action -- sceneId: ID of current scene --=========================================================-- function x000000_KickOutAllPlayer(sceneId) --************************-- local nHumanNum=LuaFnGetCopyScene_HumanCount(sceneId) local Scene=LuaFnGetCopySceneData_Param(sceneId,3) local x=LuaFnGetCopySceneData_Param(sceneId,4) local y=LuaFnGetCopySceneData_Param(sceneId,5) for i=0,nHumanNum-1 do local teamMateId=LuaFnGetCopyScene_HumanObjId(sceneId,i) if LuaFnIsObjValid(sceneId,teamMateId)==1 and LuaFnIsCanDoScriptLogic(sceneId,teamMateId)==1 then CallScriptFunction((400900),"TransferFunc",sceneId,teamMateId,Scene,x,y) end end --************************-- end --=========================================================-- -- [ADDITION] -- This function is called to show notification tip to all players inside this copy scene -- You need to call it when you want to do this action -- sceneId: ID of current scene --=========================================================-- function x000000_TipAllHuman(sceneId,nTip) --************************-- local nHumanNum=LuaFnGetCopyScene_HumanCount(sceneId) for i=0,nHumanNum-1 do local teamMateId=LuaFnGetCopyScene_HumanObjId(sceneId,i) if LuaFnIsObjValid(sceneId,teamMateId)==1 and LuaFnIsCanDoScriptLogic(sceneId,teamMateId)==1 then BeginEvent(sceneId) AddText(sceneId,nTip) EndEvent(sceneId) DispatchMissionTips(sceneId,teamMateId) end end --************************-- end
Được gọi qua 1 NPC như này.
Code:--Powered by TLBB-LuaEditor --Script: YOUR SCRIPT DESCRIPTION --Author: YOUR NAME --Date: CURRENT DATE --************************-- x000000_g_ScriptId = 000000 --ID of this script. Remember replace all 000000 text by your script index with exactly 6 digits --************************-- x000000_g_Event_ScriptId = 000001 --Script event. Remember replace 000001 by the script index of your target event --************************-- --=========================================================-- -- [DEFAULT] -- This function is called firstly when a player clicks on NPC -- sceneId: ID of current scene -- playerId: ID of player -- targetId: ID of NPC --=========================================================-- function x000000_OnDefaultEvent(sceneId,playerId,targetId) --************************-- BeginEvent(sceneId) AddText(sceneId,"SOME TEXT") CallScriptFunction(x000000_g_Event_ScriptId,"OnEnumerate",sceneId,playerId,targetId) EndEvent(senceId) DispatchEventList(sceneId,playerId,x000000_g_ScriptId) --************************-- end --=========================================================-- -- [DEFAULT] -- This function is called when a selection is detected -- sceneId: ID of current scene -- playerId: ID of player -- targetId: ID of NPC -- eventId: ID of selection event (Don`t need to pay attention to it) --=========================================================-- function x000000_OnEventRequest(sceneId,playerId,targetId,eventId) --************************-- if eventId==x000000_g_Event_ScriptId then CallScriptFunction(eventId,"OnDefaultEvent",sceneId,playerId,targetId) return end --************************-- end
Khách viếng thăm hãy cùng Sói Đẹp Trai xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
Chọn nhanh
Hỏi Đáp/ Yêu Cầu
Lên trên
- Khu vực riêng
- Thiếp lập
- Tin nhắn riêng
- Các theo dõi
- Đang trực tuyến
- Tìm diễn đàn
- Trang chính
- Diễn đàn
- ĐẠI SẢNH CLBGAMESVN
- GIAO LƯU CÙNG DOANH NGHIỆP
- CLB NGHIÊN CỨU & PHÁT TRIỂN MMORPG
- Mu Server
- Võ Lâm Truyền Kỳ (Jx Server)
- Thiên Long Bát Bộ
- Kiếm Thế Server
- Gunny - Webgame Bắn Súng
- Hiệp Khách Giang Hồ
- Tổng Hợp Các Server Games Khác
- Private Server For Linux
- CHUYÊN ĐỀ WEB GAMES
- Old Archived Server
- GIỚI THIỆU CÁC SERVER GAME PRIVATE
- CLB GAMES OFFLINE & THẢO LUẬN GAMES
- CLB WEBMASTER - SECURITY - SOFTWARE
- CHUYÊN MỤC GIẢI TRÍ
- LINH TINH KHÁC
Các Chủ đề tương tự
-
EASEUS Partition Master 10.0 Technican Edition - Phần mềm phân chia phân vùng
Bởi anhkhongdoiqua trong diễn đàn Công cụ dành cho PCTrả lời: 0Bài viết cuối: 11-04-14, 04:29 PM -
Chân dung tỷ phú John Jamelske Nô lệ tình dục của… tỷ phú (Kỳ 1)
Bởi vietmagic trong diễn đàn Thông Tin 24hTrả lời: 0Bài viết cuối: 11-06-09, 12:26 PM -
Phát triển nhiệm vụ 10 môn phái
Bởi akarizone trong diễn đàn Guides - Kho Lưu trữTrả lời: 38Bài viết cuối: 22-12-08, 04:17 PM