--*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###* -- Notes cDebugLog( "MagicStone_Click : nil NPC " .. NPCHandle ) -- idk where this one outputs to cAssertLog( "TestData: Main MapIndex2 = " .. EventMemory["MapIndex"] ) -- outputs to the zone assert log --*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###*###* --Add this to common.lua -- ########## New section for 2016 ########## EFFECT_MSG_TYPE = { EMT_WIN = 0, EMT_LOSE = 1, EMT_DRAW = 2, EMT_START = 3, EMT_COUNT_8_SEC = 4, EMT_SUCCESS = 5, EMT_FAIL = 6, EMT_START_OLYMPIC = 7, EMT_GOAL_OLYMPIC = 8, EMT_SOCCER_WIN = 9, EMT_SOCCER_LOSE = 10, EMT_SOCCER_DRAW = 11, EMT_SOCCER_KICK_OFF = 12, EMT_SOCCER_GOAL = 13, EMT_WATER_START = 14, } -- Kingdom Quest Team KQ_TEAM = { RED = 0, BLUE = 1, MAX = 2, } -- Maximum time to wait for first player to sign in to map WAIT_PLAYER_MAP_LOGIN_SEC_MAX = 240 -- ########## End new section for 2016 ########## --###################### CONVERSIONS ######################## --comment out this: -- cSetFieldScript ( Var["MapIndex"], MainLuaScriptPath ) -- cFieldScriptFunc( Var["MapIndex"], "MapLogin", "PlayerMapLogin" ) --============================================================ --Alternate:1 function PlayerMapLogin( MapIndex, Handle ) cExecCheck "PlayerMapLogin" if MapIndex == nil then DebugLog( "PlayerMapLogin::MapIndex == nil") return end if Handle == nil then DebugLog( "PlayerMapLogin::Handle == nil") return end local Var = InstanceField[ MapIndex ] if Var == nil then DebugLog( "PlayerMapLogin::Var == nil") return end -- First player map login check Var["bPlayerMapLogin"] = true end --Replace in the __ script: if Var["bPlayerMapLogin"] == nil then if Var["InitialSec"] + WAIT_PLAYER_MAP_LOGIN_SEC_MAX <= cCurrentSecond() then GoToFail( Var ) return end return end -- with: =================== local PlayerList = { cGetPlayerList( Var.MapIndex ) } if PlayerList == nil then cAssertLog( "TestEvent: Playerlist Blank" ) if Var["InitialSec"] + WAIT_PLAYER_MAP_LOGIN_SEC_MAX <= cCurrentSecond() then GoToFail( Var ) return end else cAssertLog( "TestEvent: Playerlist has players " ) cAssertLog( "TestEvent: Playerlist: "..#PlayerList.." " ) Var["bPlayerMapLogin"] = true cAssertLog( "TestEvent passed: bPlayerMapLogin" ) end --============================================================ --Alternate:2 (from WarN) function PlayerMapLogin( Field, Player ) local Var = InstanceField[Field] if Var == nil then return end -- Send map marking to display gate location local MapMarkTable = {} for i=1, #ElementRoom do local DoorLoc = RoomCoordDataTable[ElementRoom[i]["RoomCoordData"]]["Door"] local mmData = {} mmData["Group"] = MAPMARK_GROUP["Door_C"] + i mmData["x"] = DoorLoc["x"] mmData["y"] = DoorLoc["y"] mmData["KeepTime"] = MAPMARK_TIME["Door_C"] mmData["IconIndex"] = MAPMARK_ICON["Door_C"] MapMarkTable[mmData["Group"]] = mmData end cMapMark( Field, MapMarkTable ) end --Replace in the __ script: --CMapMark is unneeded function. just comment out and leave blank -- with: =================== --============================================================ --Alternate:3 (from WarL) function PlayerMapLogin( Field, Player ) local EventMemory = InstanceField[Field] if EventMemory == nil then return end cMapObjectControl( EventMemory["MapIndex"], "L_Line", EventMemory["ObjectState"]["L_Line"], 1 ) cMapObjectControl( EventMemory["MapIndex"], "R_Line", EventMemory["ObjectState"]["R_Line"], 1 ) MAPMARK( EventMemory ) end --Replace in the __ script: --cMapMark is unneeded function. just comment out and leave blank -- with: =================== -- Not sure about this yet if none is fine --############################################################ -- cStaticDamage( PlayerList[i], STATICDAMAGE ) --Replaced with: =================== -- function doesn't exist. just comment out and leave blank --############################################################ -- cScriptMessage_Obj( AggroList[i], "CoinReward_Notice", PlayerName, tostring(PlayerCoinLot) ) --Replaced with: =================== -- function doesn't exist. just comment out and leave blank --############################################################ -- cRewardItem( AggroList[i], PlayerCoinIndex, PlayerCoinLot ) --Replaced with: =================== -- function doesn't exist. just comment out and leave blank --############################################################ -- cNPCRegen( Var["MapIndex"], RegenInfo["NPC"][ i ] ) --Replaced with: =================== cMobRegen_XY( Var["MapIndex"], RegenInfo["NPC"][ i ], 0, 0, 0 ) --############################################################ -- cNotice( Var["MapIndex"], NoticeInfo["ScriptFileName"], NoticeInfo["IDReturn"][ Var["ReturnToHome"]["ReturnStepNo"] ]["Index"] ) --Replaced with: =================== cScriptMessage( Var["MapIndex"], NoticeInfo["IDReturn"][ Var["ReturnToHome"]["ReturnStepNo"] ]["Index"] ) -- then you'll need to add the lines into NpcDialogData.shn -- cScriptMessage( Var.MapIndex, AnnounceInfo.AdlF_Msg_01_001 ) -- cScriptmessage( {MapIndex is put here}, {announcement id in NpcDialogData.shn} --############################################################ -- cLinkToAll( Var["MapIndex"], LinkInfo["ReturnMap"]["MapIndex"], LinkInfo["ReturnMap"]["x"], LinkInfo["ReturnMap"]["y"] ) --Replaced with: =================== Not sure yet --############################################################ --Exit Gate popup (not manditory) -- cLinkTo( PlyHandle, LinkInfo["ReturnMap"]["MapIndex"], LinkInfo["ReturnMap"]["x"], LinkInfo["ReturnMap"]["y"] ) --Replaced with: =================== cServerMenu( PlyHandle, NPCHandle, LinkInfo["ReturnMap"]["Title"], LinkInfo["ReturnMap"]["Yes"], "LinkToVillage", LinkInfo["ReturnMap"]["No"], "GateDummy") -- and this LinkInfo = { ReturnMap = { MapIndex = "BerFrz01", x = 24870, y = 471, Title = "Exit Gate", Yes = "Exit", No = "Cancel" }, } function LinkToVillage( NPCHandle, PlyHandle, RegistNumber ) cExecCheck "LinkToVillage" -- local Var = GateMemBlock[NPCHandle] -- if Var == nil then -- return -- end cLinkTo( PlyHandle, LinkInfo["ReturnMap"]["MapIndex"], LinkInfo["ReturnMap"]["x"], LinkInfo["ReturnMap"]["y"] ) end function GateDummy( NPCHandle, PlyHandle, RegistNumber ) end --############################################################ -- local nCurDoorHandle = cDoorBuild( Var["MapIndex"], CurRegenDoor["Index"], CurRegenDoor["x"], CurRegenDoor["y"], CurRegenDoor["dir"], CurRegenDoor["scale"] ) --Replaced with: =================== local nCurDoorHandle = cMobRegen_XY( Var["MapIndex"], CurRegenDoor["Index"], CurRegenDoor["x"], CurRegenDoor["y"], CurRegenDoor["dir"] ) -- and this -- missing functions that connect to the GATE NAME ("Gate_ID_Complete") -- add these at the end of the main .lua script?? -- example CompleteGate= { Index = "Gate_ID_Complete", x = 12720, y = 8518, dir = 48, Title = "Exit Gate", Yes = "Exit", No = "Cancel" }, function Gate_ID_Complete( Handle, MapIndex ) cExecCheck "Gate_ID_Complete" return Gate_Main( Handle, MapIndex ) end function Gate_Main( Handle, MapIndex ) cExecCheck "Gate_Main" local Var = GateMemBlock[Handle] if cIsObjectDead( Handle ) then -- 죽었음 cAIScriptSet( Handle ) -- 스크립트 없앰 GateMemBlock[Handle] = nil -- 메모리해제 return ReturnAI.END end if Var == nil then GateMemBlock[Handle] = {} Var = GateMemBlock[Handle] Var.Handle = Handle Var.MapIndex = MapIndex end return ReturnAI.END end --############################################################ -- for instant opening door instead of using a key (since keys don't work on doors) -- cDoorAction( nCurDoorHandle, Var["Door"][ nCurDoorHandle ]["Info"]["Block"], "open" ) --Replaced with: =================== local CurDoorInfo = CurItemDeopList[ i ]["Door"] -- BossInfo.S_CyrusKey.ItemDropList.1.door ="Door2" local nCurDoorHandle = Var["Door"][ CurDoorInfo ] -- Var.Door.Door2 local DoorInfo = Var["Door"][ nCurDoorHandle ]["Info"] -- Var.Door.Door2.Info cDoorAction( nCurDoorHandle, DoorInfo["Block"], "open" ) --############################################################ -- local MapIndex = cGetCurMapIndex( NPCHandle ) --Replaced with: =================== local MapIndex = GateMemBlock[NPCHandle][ "MapIndex" ] -- requires the Gate_Main() function --############################################################ -- cCastTeleport( PlyHandle, "SpecificCoord", CurPortalInfo["x"], CurPortalInfo["y"] ); --Replaced with: =================== cLinkTo( PlyHandle, Var.MapIndex, CurPortalInfo["x"], CurPortalInfo["y"] ) --############################################################ -- if cAggroListSize( Avanas["Handle"] ) == 0 then --Replaced with: =================== --############################################################ -- cSetAbstateInArea( EventMemory["MapIndex"], "StaBRNWarH", 1, 1000, "WarH_BossRoom", 22255, 12636 ) --Replaced with: =================== --############################################################ --Replaced with: =================== --############################################################