-------------------------------------------------------------------------------- -- Crystal Castle Progress Func -- -------------------------------------------------------------------------------- -- ´øÀü ÃʱâÈ­ function InitDungeon( Var ) cExecCheck "InitDungeon" if Var == nil then return end -- ÀνºÅϽº ´øÀü ½ÃÀÛ Àü¿¡ Ç÷¹À̾îÀÇ Ã¹ ·Î±×ÀÎÀ» ±â´Ù¸°´Ù. if Var["bPlayerMapLogin"] == nil then if Var["InitialSec"] + WAIT_PLAYER_MAP_LOGIN_SEC_MAX <= cCurrentSecond() then GoToFail( Var ) return end return end if Var["InitDungeon"] == nil then DebugLog( "Start InitDungeon" ) Var["InitDungeon"] = {} -- Ãþ »çÀÌ¿¡ ÀÖ´Â ¹® »ý¼º for i = 0, (#StepNameTable - 2) do local DoorTableIndex = nil DoorTableIndex = "Door"..i local CurRegenDoor = RegenInfo["Stuff"][ DoorTableIndex ] if CurRegenDoor ~= nil then local nCurDoorHandle = cDoorBuild( Var["MapIndex"], CurRegenDoor["Index"], CurRegenDoor["x"], CurRegenDoor["y"], CurRegenDoor["dir"], CurRegenDoor["scale"] ) if nCurDoorHandle ~= nil then cDoorAction( nCurDoorHandle , CurRegenDoor["Block"], "close" ) -- ¸®Á¨ Á¤º¸ º¸°ü Var["Door"][ nCurDoorHandle ] = CurRegenDoor -- ÇÚµé º¸°ü : Á¢±Ù¿ëÀ¸·Î Var["Door"..i ] = nCurDoorHandle end end end -- ÀÔ±¸ÂÊ Ãⱸ°ÔÀÌÆ® »ý¼º local RegenExitGate = RegenInfo["Stuff"]["StartExitGate"] local nExitGateHandle = cDoorBuild( Var["MapIndex"], RegenExitGate["Index"], RegenExitGate["x"], RegenExitGate["y"], RegenExitGate["dir"], RegenExitGate["scale"] ) if nExitGateHandle ~= nil then if cSetAIScript ( MainLuaScriptPath, nExitGateHandle ) == nil then ErrorLog( "InitDungeon::cSetAIScript ( MainLuaScriptPath, nExitGateHandle ) == nil" ) end if cAIScriptFunc( nExitGateHandle, "NPCClick", "ExitGateClick" ) == nil then ErrorLog( "InitDungeon::cAIScriptFunc( nExitGateHandle, \"NPCClick\", \"ExitGateClick\" ) == nil" ) end end -- Á¤ÇØÁø ±ÔÄ¢¿¡ ÀÇ°ÅÇÑ Ãþ º° ÆÐÅÏ ¼ÂÆà --[[ ³×ÀÓÅ×À̺íÀ» Çϳª¾¿ °¡Á®¿Í¼­ ÃÑ ÆÐÅÏ °³¼ö¸¦ ±¸ÇÑ´Ù. ·£´ýÇÔ¼ö¸¦ ÀÌ¿ëÇÏ¿© ¼øȯ¹æ½ÄÀ¸·Î Çϳª¾¿ äÅà ¹Ì¸® ¹è¿­À» ¸¸µé¾î¼­ »ç¿ëµÇ±â·Î ÇÑ ÆÐÅÏÀº üũ¸¦ Çصּ­ °ãÄ¡Áö ¾Ê°Ô Çϳª¾¿ °í¸¥´Ù. ±×·¸°Ô 9°³ ÆÐÅÏÀ» °í¸£°í º¸½ºµµ °ñ¶ó ³õ´Â´Ù. ÀÌÁ¦ °Å±â¼­ »©¿Â´Ù. ÆÐÅÏ À̸§°ú ¼ø¹øÀ» ÇØ´ç ´øÀü ³»ºÎ ¸Þ¸ð¸®¿¡ ÀúÀåÇسõ´Â´Ù. ]] -- ÆÐÅÏÀ» °¢ Ãþ¿¡ ¼ÂÆÃÇÑ Á¤º¸¸¦ º¸°üÇÏ´Â Å×À̺í local PatternSettingTable = {} -- °¢ ÆÐÅÏÀ» ÅëÇÕÇÏ¿© ¼ø¹øÀ» ¸Å°Ü³õÀº Å×À̺í local PatternPointerTable = {} -- ÃÑ ÆÐÅÏ ¼ö local nPatternCount = 0 for i = 1, #PatternNameTable do -- ÃÑ °³¼ö ¼¼±â local sPattern = PatternNameTable[i] -- ÅëÇÕ¼ø¹ø°ú °¢ ¼ø¹ø ¸ÅĪ for k = 1, #RegenInfo["Group"][ sPattern ] do PatternPointerTable[ nPatternCount + k ] = { PatternName = sPattern, PatternOrderNo = k } end nPatternCount = nPatternCount + #RegenInfo["Group"][ sPattern ] end local CheckPatternSelected = {} -- À妽º: ÅëÇÕ¼ø¹ø, °ª: üũ µÉ °æ¿ì true local nCheckPatternSelectedCount = 0 -- ¼±ÅÿϷáµÈ ÆÐÅÏÀÇ ¼ö -- ÆÐÅÏ ÁöÁ¤( Ãþ °³¼ö ¸¸Å­ ) while nCheckPatternSelectedCount < #StepNameTable - 2 do local nCurPatternSelected = cRandomInt( 1, nPatternCount ) -- Àá½Ã ÆÐÅÏÀÇ ÅëÇÕ¼ø¹øÀ» ·£´ýÀ¸·Î ¼±Åà -- ÅëÇÕ¼ø¹ø°ú ¼ø¹ø¸ÅĪÁ¤º¸°¡ ¾øÀ¸¸é ÆÐÅÏ ÁöÁ¤ ºÒ°¡ÇϹǷΠÇØ´ç ÆÐÅÏ Æнº if PatternPointerTable[ nCurPatternSelected ] ~= nil then -- ÀÌ¹Ì ¼±ÅÃµÈ °ÍÀº Á¦¿Ü if CheckPatternSelected[ nCurPatternSelected ] ~= true then -- ÃÖÃÊ 5°³ ÃþÀº Pattern_KamarisTrap À» Á¦¿ÜÇÔ DebugLog( "InitDungeon::Pattern is Tried ( "..PatternPointerTable[ nCurPatternSelected ]["PatternName"].." "..PatternPointerTable[ nCurPatternSelected ]["PatternOrderNo"].." )" ) if nCheckPatternSelectedCount >= 5 or PatternPointerTable[ nCurPatternSelected ]["PatternName"] ~= "Pattern_KamarisTrap" then -- ÆÐÅÏ ¼±Åà PatternSettingTable[ nCheckPatternSelectedCount + 1 ] = PatternPointerTable[ nCurPatternSelected ] -- ÆÐÅÏ ¼±Åà ¿©ºÎ üũ CheckPatternSelected[ nCurPatternSelected ] = true DebugLog( "InitDungeon::Pattern is Selected ( "..PatternPointerTable[ nCurPatternSelected ]["PatternName"].." "..PatternPointerTable[ nCurPatternSelected ]["PatternOrderNo"].." )" ) -- Ä«¿îÆà nCheckPatternSelectedCount = nCheckPatternSelectedCount + 1 end end end end -- ¸Þ¸ð¸®¿¡ ÆÐÅÏ ¼ÂÆà Á¤º¸ ÀúÀå Var["StageInfo"]["PatternSetting"] = PatternSettingTable -- È®·ü ÃÑÇÕ Ã¼Å© local nTotalProb = BossSelectProbablityPercent["Boss1"] + BossSelectProbablityPercent["Boss2"] + BossSelectProbablityPercent["Boss3"] if nTotalProb ~= 100 then ErrorLog( "InitDungeon::TotalProb ~= 100 in Boss Selecting Mode" ) return end -- Á¤ÇØÁø È®·ü¿¡ ÀÇ°ÅÇÑ º¸½º ¼±Åà local nPercent = cRandomInt( 1, 100 ) if nPercent <= BossSelectProbablityPercent["Boss1"] then Var["StageInfo"]["BossTypeNo"] = 1 elseif nPercent <= BossSelectProbablityPercent["Boss1"] + BossSelectProbablityPercent["Boss2"] then Var["StageInfo"]["BossTypeNo"] = 2 else Var["StageInfo"]["BossTypeNo"] = 3 end -- ´ë±â½Ã°£ ¼³Á¤ Var["InitDungeon"]["WaitSecDuringInit"] = Var["CurSec"] + DelayTime["AfterInit"] end -- ´ë±â ÈÄ ´ÙÀ½ ´Ü°è·Î if Var["InitDungeon"]["WaitSecDuringInit"] <= Var["CurSec"] then cDoorAction( Var["Door0"], Var["Door"][ Var["Door0"] ]["Block"], "open" ) GoToNextStep( Var ) Var["InitDungeon"] = nil DebugLog( "End InitDungeon" ) return end end -- 1~9 ¹ø° ÃþÀÇ ¸÷µé°ú º¸½ºÀü function EachFloor( Var ) cExecCheck "EachFloor" if Var == nil then return end if Var["EachFloor"] == nil then Var["EachFloor"] = {} end -- ´Ü°è ¹øÈ£ ¼³Á¤ if Var["EachFloor"]["StepNumber"] == nil then Var["EachFloor"]["StepNumber"] = 1 end -- ´Ü°èÀ̸§ ¹Þ¾Æ¿À±â local CurStepNo = Var["EachFloor"]["StepNumber"] -- ex) 1 local CurStep = StepNameTable[ CurStepNo ] -- ex) Floor01 -- ¸®Á¨ Á᫐ ÁÂÇ¥ °¡Á®¿À±â local CurRegenCoord = RegenInfo["Coord"][ CurStepNo ] -- ÆÐÅÏÀÌ ¼ÂÆà µÇÁö ¾Ê¾ÒÀ¸¸é ÁøÇà ºÒ°¡ if Var["StageInfo"]["PatternSetting"] == nil then return end if Var["StageInfo"]["PatternSetting"][ CurStepNo ] == nil then return end local CurPatternInfo = Var["StageInfo"]["PatternSetting"][ CurStepNo ] -- °¢ ´Ü°è Ãʱ⠼³Á¤ if Var["EachFloor"..CurStepNo ] == nil then DebugLog( "Start EachFloor "..CurStepNo ) Var["EachFloor"..CurStepNo ] = {} -- ¸÷ ±×·ì Á¨ local CurGroupRegen = RegenInfo["Group"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] if CurGroupRegen ~= nil then if CurPatternInfo["PatternName"] ~= "Pattern_KamarisTrap" and CurPatternInfo["PatternName"] ~= "Pattern_OnlyOneIsKey" then for i = 1, #CurGroupRegen do cGroupRegenInstance_XY( Var["MapIndex"], CurGroupRegen[ i ], CurRegenCoord["x"], CurRegenCoord["y"] ) end elseif CurPatternInfo["PatternName"] == "Pattern_KamarisTrap" then -- Ä«¸¶¸®½º¸¸ ºÒ·¯³¿ for i = 1, #CurGroupRegen[ 1 ] do cGroupRegenInstance_XY( Var["MapIndex"], CurGroupRegen[ 1 ][ i ], CurRegenCoord["x"], CurRegenCoord["y"] ) end end end -- ´ÜÀÏ ¸÷ Á¨ local CurMobRegen = RegenInfo["Mob"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] if CurMobRegen ~= nil then for MobType, MobRegenInfo in pairs ( CurMobRegen ) do local nMobCount = MobRegenInfo["count"] if nMobCount == nil then nMobCount = 1 end for i = 1, nMobCount do local MobHandle = cMobRegen_Circle( Var["MapIndex"], MobRegenInfo["Index"], RegenInfo["Coord"][ CurStepNo ]["x"], RegenInfo["Coord"][ CurStepNo ]["y"], MobRegenInfo["radius"] ) if MobHandle ~= nil then Var["Enemy"][ MobHandle ] = { Index = MobRegenInfo["Index"], x = RegenInfo["Coord"][ CurStepNo ]["x"], y = RegenInfo["Coord"][ CurStepNo ]["y"], radius = MobRegenInfo["radius"] } Var["RoutineTime"][ MobHandle ] = cCurrentSecond() cSetAIScript ( MainLuaScriptPath, MobHandle ) if MobType == "Boss" then Var["EachFloor"..CurStepNo ]["MidBossHandle"] = MobHandle cAIScriptFunc( MobHandle, "Entrance", "MidBossMobRoutine" ) elseif MobType == "Key" then cAIScriptFunc( MobHandle, "Entrance", "KeyBoxRoutine" ) elseif MobType == "Mob" then cAIScriptFunc( MobHandle, "Entrance", "MobBoxRoutine" ) elseif MobType == "Jewel" then cAIScriptFunc( MobHandle, "Entrance", "JewelBoxRoutine" ) end end end end end -- ÆäÀ̽ºÄÆ ´Ü°è ±¸ºÐ¿ë º¯¼ö ¼³Á¤ Var["EachFloor"..CurStepNo ]["BeforeDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["BeforeDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["AfterDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["AfterDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["OpenMobDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["OpenMobDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["AppearMobDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["AppearMobDialogStepNo"] = 1 -- ÆäÀ̽ºÄÆ Á¾·á ¿©ºÎ ¼³Á¤ Var["EachFloor"..CurStepNo ]["bBeforeDialogEnd"] = false Var["EachFloor"..CurStepNo ]["bAfterDialogEnd"] = false Var["EachFloor"..CurStepNo ]["bOpenMobDialogEnd"] = nil -- ¸÷»óÀÚ¸¦ ¿­¶§¸¶´Ù false°¡ µÇ°í ¸Þ¼¼Áö ¶á ÈÄ true µÊ. Var["EachFloor"..CurStepNo ]["bOpenKeyDialogEnd"] = nil -- ´ç÷»óÀÚ¸¦ ¿­¸é false°¡ µÇ¾î »óÀÚ°¡ 1°³À̹ǷΠ1ȸ ½ÇÇà Var["EachFloor"..CurStepNo ]["bAppearMobDialogEnd"] = false -- ¸÷ Àü¸ê ¿©ºÎ ¼³Á¤ Var["EachFloor"..CurStepNo ]["bMobEliminated"] = false Var["EachFloor"..CurStepNo ]["bDestroyedKamaris"] = false Var["EachFloor"..CurStepNo ]["WaitMobGenSec"] = Var["CurSec"] + DelayTime["WaitAfterGenMob"] end -- äÆà local CurChat = ChatInfo["EachPattern"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] -- ÀüÅõ Àü if CurChat["Before"] ~= nil then if Var["EachFloor"..CurStepNo ]["bBeforeDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["BeforeDialogStepNo"] if nCurDialogNo <= #CurChat["Before"] then if Var["EachFloor"..CurStepNo ]["BeforeDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["Before"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["Before"][ nCurDialogNo ]["Index"] ) Var["EachFloor"..CurStepNo ]["BeforeDialogStepNo"] = Var["EachFloor"..CurStepNo ]["BeforeDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["BeforeDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["bBeforeDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["bBeforeDialogEnd"] = true end -- »óÀÚ¿­±â ÆÐÅÏ if CurPatternInfo["PatternName"] == "Pattern_OnlyOneIsKey" then if Var["EachFloor"..CurStepNo ]["nMobBoxOpened"] == nil then Var["EachFloor"..CurStepNo ]["nMobBoxOpened"] = 0 end if Var["EachFloor"..CurStepNo ]["nMobBoxOpened"] > 0 and Var["EachFloor"..CurStepNo ]["bOpenMobDialogEnd"] ~= false then -- ¸÷»óÀÚ ¿ÀÇ ´ÙÀ̾ó·Î±× ¶ç¿ìµµ·Ï ¼³Á¤ Var["EachFloor"..CurStepNo ]["bOpenMobDialogEnd"] = false -- ¸÷ ±×·ì Á¨ local CurGroupRegen = RegenInfo["Group"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] if CurGroupRegen ~= nil then -- ¸÷ »óÀÚ¸¦ ¿­¸é ³ªÅ¸³ª´Â ¸÷ for i = 1, #CurGroupRegen do cGroupRegenInstance_XY( Var["MapIndex"], CurGroupRegen[ i ], CurRegenCoord["x"], CurRegenCoord["y"] ) end end -- äÆà ´Ü°è º¯¼ö ÃʱâÈ­ Var["EachFloor"..CurStepNo ]["OpenMobDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["OpenMobDialogStepSec"] = Var["CurSec"] -- ¿­¸° »óÀÚ ¼ö¸¦ Çϳª ÁÙ¿©ÁÜ( ¿­¸° »óÀÚ¿¡ ´ëÇÑ Ã³¸®¸¦ ¿Ï·á Ç߱⠶§¹®¿¡ ) Var["EachFloor"..CurStepNo ]["nMobBoxOpened"] = Var["EachFloor"..CurStepNo ]["nMobBoxOpened"] - 1 end if Var["EachFloor"..CurStepNo ]["KeyBoxOpened"] == true then -- Á¤´ä »óÀÚ ¿ÀÇ ´ÙÀ̾ó·Î±× ¶ç¿ìµµ·Ï ¼³Á¤ Var["EachFloor"..CurStepNo ]["bOpenKeyDialogEnd"] = false Var["EachFloor"..CurStepNo ]["KeyBoxOpened"] = false end -- ¸÷ ³ª¿Ã °æ¿ì : ¹Ýº¹ if CurChat["OpenMob"] ~= nil then if Var["EachFloor"..CurStepNo ]["bOpenMobDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["OpenMobDialogStepNo"] if nCurDialogNo <= #CurChat["OpenMob"] then if Var["EachFloor"..CurStepNo ]["OpenMobDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["OpenMob"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["OpenMob"][ nCurDialogNo ]["Index"] ) Var["EachFloor"..CurStepNo ]["OpenMobDialogStepNo"] = Var["EachFloor"..CurStepNo ]["OpenMobDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["OpenMobDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["bOpenMobDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["bOpenMobDialogEnd"] = true end -- »óÀÚ°¡ ½Ï »ç¶óÁú °æ¿ì : 1ȸ if CurChat["OpenKey"] ~= nil then if Var["EachFloor"..CurStepNo ]["bOpenKeyDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepNo"] if nCurDialogNo <= #CurChat["OpenKey"] then if Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["OpenKey"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["OpenKey"][ nCurDialogNo ]["Index"] ) Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepNo"] = Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["OpenKeyDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["bOpenKeyDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["bOpenKeyDialogEnd"] = true end -- Ä«¸¶¸®½º ÆÐÅÏ elseif CurPatternInfo["PatternName"] == "Pattern_KamarisTrap" then -- ¸÷ Àü¸êüũ if Var["EachFloor"..CurStepNo ]["bDestroyedKamaris"] == false then if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) <= 0 then Var["EachFloor"..CurStepNo ]["bDestroyedKamaris"] = true -- ¸÷ ±×·ì Á¨ local CurGroupRegen = RegenInfo["Group"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] if CurGroupRegen ~= nil then if CurGroupRegen[ 2 ] ~= nil then -- Ä«¸¶¸®½º ºÎ¼ø ÈÄ ³ªÅ¸³ª´Â ¸÷ for i = 1, #CurGroupRegen[ 2 ] do cGroupRegenInstance_XY( Var["MapIndex"], CurGroupRegen[ 2 ][ i ], CurRegenCoord["x"], CurRegenCoord["y"] ) end end end end return else -- Ä«¸¶¸®½º°¡ Á×°í ¸÷ÀÌ ÂÓ ¼ßµÇ´Â °æ¿ì : 1ȸ if CurChat["AppearMob"] ~= nil then if Var["EachFloor"..CurStepNo ]["bAppearMobDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["AppearMobDialogStepNo"] if nCurDialogNo <= #CurChat["AppearMob"] then if Var["EachFloor"..CurStepNo ]["AppearMobDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["AppearMob"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["AppearMob"][ nCurDialogNo ]["Index"] ) Var["EachFloor"..CurStepNo ]["AppearMobDialogStepNo"] = Var["EachFloor"..CurStepNo ]["AppearMobDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["AppearMobDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["bAppearMobDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["bAppearMobDialogEnd"] = true end end else -- There is no process here. end -- ¸÷ Àü¸êüũ if Var["EachFloor"..CurStepNo ]["bMobEliminated"] == false then if Var["EachFloor"..CurStepNo ]["WaitMobGenSec"] <= Var["CurSec"] then if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) <= 0 then Var["EachFloor"..CurStepNo ]["bMobEliminated"] = true end end return else -- ÀüÅõ ³¡ ÀÌÈÄ if CurChat["After"] ~= nil then if Var["EachFloor"..CurStepNo ]["bAfterDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["AfterDialogStepNo"] if nCurDialogNo <= #CurChat["After"] then if Var["EachFloor"..CurStepNo ]["AfterDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["After"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["After"][ nCurDialogNo ]["Index"] ) Var["EachFloor"..CurStepNo ]["AfterDialogStepNo"] = Var["EachFloor"..CurStepNo ]["AfterDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["AfterDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["bAfterDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["bAfterDialogEnd"] = true end end -- Next Case : ÇØ´ç ÃþÀÇ ¸÷ Àü¸ê ÈÄ Å¬¸®¾î ÆäÀ̽ºÄÆ ¿©ºÎ¿¡ µû¶ó ±× ÆäÀ̽º ÄÆÀÌ Á¾·áÇϸé. if Var["EachFloor"..CurStepNo ]["WaitMobGenSec"] <= Var["CurSec"] then if Var["EachFloor"..CurStepNo ]["bAfterDialogEnd"] == true then if CurPatternInfo["PatternName"] == "Pattern_KamarisTrap" then if Var["EachFloor"..CurStepNo ]["bDestroyedKamaris"] ~= true then return end elseif CurPatternInfo["PatternName"] == "Pattern_OnlyOneIsKey" then if Var["EachFloor"..CurStepNo ]["bOpenKeyDialogEnd"] ~= true then return end else if Var["EachFloor"..CurStepNo ]["bMobEliminated"] ~= true then return end end -- Ŭ¸®¾î ¾×¼Ç if Var["Door"..CurStepNo ] ~= nil then cDoorAction( Var["Door"..CurStepNo ], Var["Door"][ Var["Door"..CurStepNo ] ]["Block"], "open" ) end -- ´ÙÀ½ ´Ü°è·Î Var["EachFloor"..CurStepNo ] = nil Var["EachFloor"]["StepNumber"] = CurStepNo + 1 DebugLog( "End EachFloor "..CurStepNo ) -- ¸ðµç Ãþ Ŭ¸®¾î ½Ã if Var["EachFloor"]["StepNumber"] > #StepNameTable - 2 then Var["EachFloor"] = nil GoToNextStep( Var ) return end return end end end -- º¸½ºÀü function BossBattle( Var ) cExecCheck "BossBattle" if Var == nil then return end if Var["StageInfo"]["BossTypeNo"] == nil then ErrorLog( "BossBattle::Var[\"StageInfo\"][\"BossTypeNo\"] == nil" ) return end local nBossType = Var["StageInfo"]["BossTypeNo"] if Var["BossBattle"] == nil then DebugLog( "BossBattle::Start" ) Var["BossBattle"] = {} -- ¸÷ ±×·ì Á¨ for i = 1, #RegenInfo["Group"]["BossBattle"][ nBossType ] do cGroupRegenInstance( Var["MapIndex"], RegenInfo["Group"]["BossBattle"][ nBossType ][ i ] ) end -- º¸½º Á¨ if Var["BossBattle"]["BossAC_PlusEffectCount"] == nil then Var["BossBattle"]["BossAC_PlusEffectCount"] = 0 end if Var["BossBattle"]["BossMR_PlusEffectCount"] == nil then Var["BossBattle"]["BossMR_PlusEffectCount"] = 0 end if Var["BossBattle"]["BossImmortalEffectCount"] == nil then Var["BossBattle"]["BossImmortalEffectCount"] = 0 end for MobType, MobRegenInfo in pairs( RegenInfo["Mob"]["BossBattle"][ nBossType ] ) do local nMobHandle = cMobRegen_XY( Var["MapIndex"], MobRegenInfo["Index"], MobRegenInfo["x"], MobRegenInfo["y"], MobRegenInfo["dir"] ) if nMobHandle ~= nil then -- °øÅë ó¸® Var["Enemy"][ nMobHandle ] = MobRegenInfo Var["RoutineTime"][ nMobHandle ] = cCurrentSecond() cSetAIScript ( MainLuaScriptPath, nMobHandle ) -- ºÐ·ù ó¸® if MobType == "LizardManGuardian" or MobType == "HeavyOrc" or MobType == "JewelGolem" then Var["BossHandle"] = nMobHandle cAIScriptFunc( nMobHandle, "Entrance", "BossRoutine" ) cAIScriptFunc( nMobHandle, "MobDamaged", "BossDamaged" ) elseif MobType == "PhysicalPillar" then cAIScriptFunc( nMobHandle, "Entrance", "PhysicalPillarRoutine" ) -- º¸½º ¹°¸® ¹æ¾î °­È­ È¿°ú¸¦ ÁÖ´Â ÇÊ·¯ °³¼ö¸¦ Á¨ ÇÒ ¶§¸¶´Ù ¼ÂÆà Var["BossBattle"]["BossAC_PlusEffectCount"] = Var["BossBattle"]["BossAC_PlusEffectCount"] + 1 elseif MobType == "MagicalPillar" then cAIScriptFunc( nMobHandle, "Entrance", "MagicalPillarRoutine" ) -- º¸½º ¸¶¹ý ¹æ¾î °­È­ È¿°ú¸¦ ÁÖ´Â ÇÊ·¯ °³¼ö¸¦ Á¨ ÇÒ ¶§¸¶´Ù ¼ÂÆà Var["BossBattle"]["BossMR_PlusEffectCount"] = Var["BossBattle"]["BossMR_PlusEffectCount"] + 1 elseif MobType == "ImmortalPillar1" or MobType == "ImmortalPillar2" or MobType == "ImmortalPillar3" or MobType == "ImmortalPillar4" then cAIScriptFunc( nMobHandle, "Entrance", "ImmortalPillarRoutine" ) -- º¸½º ¹«ÀûÈ¿°ú¸¦ ÁÖ´Â ÇÊ·¯ °³¼ö¸¦ Á¨ ÇÒ ¶§¸¶´Ù ¼ÂÆà Var["BossBattle"]["BossImmortalEffectCount"] = Var["BossBattle"]["BossImmortalEffectCount"] + 1 end else DebugLog( "BossBattle::nMobHandle == nil" ) end end -- º¸½ºÁ¨ for¹® -- ÆäÀ̽ºÄÆ ´Ü°è ±¸ºÐ¿ë º¯¼ö ¼³Á¤ Var["BossBattle"]["InitDialogStepSec"] = Var["CurSec"] Var["BossBattle"]["InitDialogStepNo"] = 1 Var["BossBattle"]["ReInitDialogStepSec"] = Var["CurSec"] Var["BossBattle"]["ReInitDialogStepNo"] = 1 Var["BossBattle"]["ShutDoorDialogAndNoticeStepSec"] = Var["CurSec"] Var["BossBattle"]["ShutDoorDialogAndNoticeStepNo"] = 1 Var["BossBattle"]["ClearDialogAndNoticeStepSec"] = Var["CurSec"] Var["BossBattle"]["ClearDialogAndNoticeStepNo"] = 1 -- ÆäÀ̽ºÄÆ Á¾·á ¿©ºÎ ¼³Á¤ Var["BossBattle"]["bInitDialogEnd"] = false Var["BossBattle"]["bReInitDialogEnd"] = nil -- Àç½ÃÀÛ Á¶°Ç½Ã false°¡ µÇ¾î ÃʱâÈ­°¡ ½ÇÇàµÊ. Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] = nil -- ¹®´ÝÈû Á¶°Ç½Ã false°¡ µÇ¾î ÃʱâÈ­°¡ ½ÇÇàµÊ. Var["BossBattle"]["bClearDialogAndNoticeEnd"] = nil -- Á¾·á Á¶°Ç½Ã Á¾·á -- ¸÷ Àü¸ê ¿©ºÎ ¼³Á¤ Var["BossBattle"]["bMobEliminated"] = false Var["BossBattle"]["WaitMobGenSec"] = Var["CurSec"] + DelayTime["WaitAfterGenMob"] end -- BossBattle ÃʱâÈ­ if¹® -- Àç½ÃÀÛ Á¶°Ç if Var["BossBattle"]["bRestartCondition"] == true then DebugLog( "BossBattle::Restart-Vanish All" ) -- ±âÁ¸ ¸÷ »ç¶óÁö±â local CenterCoord = { x = RegenInfo["Mob"]["BossBattle"][ 1 ]["LizardManGuardian"]["x"], y = RegenInfo["Mob"]["BossBattle"][ 1 ]["LizardManGuardian"]["y"] } local PreviousMobHandleList = { cGetNearObjListByCoord( Var["MapIndex"], CenterCoord["x"], CenterCoord["y"], 1000, ObjectType["Mob"], "so_ObjectType", 50 ) } for i = 1, #PreviousMobHandleList do cNPCVanish( PreviousMobHandleList[ i ] ) end -- ´Ù »ç¶óÁ³´Â°¡ üũÇϱâ if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) > 0 then ErrorLog( "BossBattle::Mob Reinitializing(Vanishing Step) is failed." ) return end cDoorAction( Var["Door"..(#StepNameTable - 2) ], RegenInfo["Stuff"]["Door"..(#StepNameTable - 2) ]["Block"], "open" ) DebugLog( "BossBattle::Restart-Regen" ) Var["BossBattle"] = nil Var["BossBattle"] = {} -- ¸÷ ±×·ì Á¨ for i = 1, #RegenInfo["Group"]["BossBattle"][ nBossType ] do cGroupRegenInstance( Var["MapIndex"], RegenInfo["Group"]["BossBattle"][ nBossType ][ i ] ) end -- º¸½º Á¨ if Var["BossBattle"]["BossAC_PlusEffectCount"] == nil then Var["BossBattle"]["BossAC_PlusEffectCount"] = 0 end if Var["BossBattle"]["BossMR_PlusEffectCount"] == nil then Var["BossBattle"]["BossMR_PlusEffectCount"] = 0 end if Var["BossBattle"]["BossImmortalEffectCount"] == nil then Var["BossBattle"]["BossImmortalEffectCount"] = 0 end for MobType, MobRegenInfo in pairs( RegenInfo["Mob"]["BossBattle"][ nBossType ] ) do local nMobHandle = cMobRegen_XY( Var["MapIndex"], MobRegenInfo["Index"], MobRegenInfo["x"], MobRegenInfo["y"], MobRegenInfo["dir"] ) if nMobHandle ~= nil then -- °øÅë ó¸® Var["Enemy"][ nMobHandle ] = MobRegenInfo Var["RoutineTime"][ nMobHandle ] = cCurrentSecond() cSetAIScript ( MainLuaScriptPath, nMobHandle ) -- ºÐ·ù ó¸® if MobType == "LizardManGuardian" or MobType == "HeavyOrc" or MobType == "JewelGolem" then -- º¸½º ÇÚµé Ãß°¡ µî·Ï ¹× AI ¼³Á¤ Var["BossHandle"] = nMobHandle cAIScriptFunc( nMobHandle, "Entrance", "BossRoutine" ) cAIScriptFunc( nMobHandle, "MobDamaged", "BossDamaged" ) elseif MobType == "PhysicalPillar" then cAIScriptFunc( nMobHandle, "Entrance", "PhysicalPillarRoutine" ) -- º¸½º ¹°¸® ¹æ¾î °­È­ È¿°ú¸¦ ÁÖ´Â ÇÊ·¯ °³¼ö¸¦ Á¨ ÇÒ ¶§¸¶´Ù ¼ÂÆà Var["BossBattle"]["BossAC_PlusEffectCount"] = Var["BossBattle"]["BossAC_PlusEffectCount"] + 1 elseif MobType == "MagicalPillar" then cAIScriptFunc( nMobHandle, "Entrance", "MagicalPillarRoutine" ) -- º¸½º ¸¶¹ý ¹æ¾î °­È­ È¿°ú¸¦ ÁÖ´Â ÇÊ·¯ °³¼ö¸¦ Á¨ ÇÒ ¶§¸¶´Ù ¼ÂÆà Var["BossBattle"]["BossMR_PlusEffectCount"] = Var["BossBattle"]["BossMR_PlusEffectCount"] + 1 elseif MobType == "ImmortalPillar1" or MobType == "ImmortalPillar2" or MobType == "ImmortalPillar3" or MobType == "ImmortalPillar4" then cAIScriptFunc( nMobHandle, "Entrance", "ImmortalPillarRoutine" ) -- º¸½º ¹«ÀûÈ¿°ú¸¦ ÁÖ´Â ÇÊ·¯ °³¼ö¸¦ Á¨ ÇÒ ¶§¸¶´Ù ¼ÂÆà Var["BossBattle"]["BossImmortalEffectCount"] = Var["BossBattle"]["BossImmortalEffectCount"] + 1 end else DebugLog( "BossBattle::nMobHandle == nil" ) end end -- º¸½ºÁ¨ for¹® -- ÆäÀ̽ºÄÆ ´Ü°è ±¸ºÐ¿ë º¯¼ö ¼³Á¤ Var["BossBattle"]["ReInitDialogStepSec"] = Var["CurSec"] Var["BossBattle"]["ReInitDialogStepNo"] = 1 Var["BossBattle"]["ShutDoorDialogAndNoticeStepSec"] = Var["CurSec"] Var["BossBattle"]["ShutDoorDialogAndNoticeStepNo"] = 1 Var["BossBattle"]["ClearDialogAndNoticeStepSec"] = Var["CurSec"] Var["BossBattle"]["ClearDialogAndNoticeStepNo"] = 1 -- ÆäÀ̽ºÄÆ Á¾·á ¿©ºÎ ¼³Á¤ Var["BossBattle"]["bInitDialogEnd"] = true -- ÀÌ¹Ì ÀÌ ºÎºÐÀº ³¡³­ »óȲÀÓ Var["BossBattle"]["bReInitDialogEnd"] = false -- Àç½ÃÀÛ Á¶°ÇÀÌ µÇ¾úÀ¸¹Ç·Î ÇØ´ç ´ÙÀ̾ó·Î±× ½ÃÀÛ Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] = nil -- ¹® ´ÝÈû Á¶°ÇÀÌ µÇ¸é false°¡ µÇ¾î ½ÇÇà Var["BossBattle"]["bClearDialogAndNoticeEnd"] = nil -- Ŭ¸®¾î Á¶°ÇÀÌ µÇ¸é ÇØ´ç ±¸¹® ½ÇÇà -- ¸÷ Àü¸ê ¿©ºÎ ¼³Á¤ Var["BossBattle"]["bMobEliminated"] = false Var["BossBattle"]["WaitMobGenSec"] = Var["CurSec"] + DelayTime["WaitAfterGenMob"] end -- BossBattle Àç½ÃÀÛ¿ë ÃʱâÈ­ if¹® -- ¹® ´ÝÈû Á¶°Ç üũ ¹× ¼³Á¤ if Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] == nil then -- ¸ðµç Ç÷¹À̾î Áß ÇѸíÀÌ¶óµµ ¿µ¿ª¾È¿¡ µé¾î¿Â »óÅ¿¡¼­ ÀÏÁ¤½Ã°£ÀÌ Áö³ª¸é ³ª°¡Áö ¸øÇϵµ·Ï µÚÂÊ ¹®À» ´Ý´Â´Ù. local InBossAreaHandleList = { cGetAreaObjectList( Var["MapIndex"], BossArea["Index"], ObjectType["Player"] ) } if #InBossAreaHandleList > 0 then if Var["BossBattle"]["InAreaStackCount"] == nil then Var["BossBattle"]["InAreaStackCount"] = 0 end Var["BossBattle"]["InAreaStackCount"] = Var["BossBattle"]["InAreaStackCount"] + 1 if Var["BossBattle"]["InAreaStackCount"] > BossArea["TriggerCount"] then cDoorAction( Var["Door"..(#StepNameTable - 2) ], RegenInfo["Stuff"]["Door"..(#StepNameTable - 2) ]["Block"], "close" ) Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] = false end end end -- Ŭ¸®¾î Á¶°Ç üũ ¹× äÆà Á¶°Ç ¼³Á¤ if Var["BossBattle"]["bClearDialogAndNoticeEnd"] == nil then if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) < 1 then Var["BossBattle"]["bClearDialogAndNoticeEnd"] = false end end --------------------------------------------------------------------------------------------------------------------------------------------------- -- äÆà local CurChat = ChatInfo["BossBattle"]["Boss"..nBossType ] -- ÃÖÃÊ ÃʱâÈ­ ½Ã if CurChat["InitDialog"] ~= nil then if Var["BossBattle"]["bInitDialogEnd"] == false then local nCurDialogNo = Var["BossBattle"]["InitDialogStepNo"] if nCurDialogNo <= #CurChat["InitDialog"] then if Var["BossBattle"]["InitDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["InitDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["InitDialog"][ nCurDialogNo ]["Index"] ) Var["BossBattle"]["InitDialogStepNo"] = Var["BossBattle"]["InitDialogStepNo"] + 1 Var["BossBattle"]["InitDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["BossBattle"]["bInitDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["BossBattle"]["bInitDialogEnd"] = true end -- ¸ðµç Ç÷¹À̾ ¹üÀ§ ¹ÛÀ¸·Î ¹þ¾î³ª¼­ ÃʱâÈ­ µÈ °æ¿ì if CurChat["ReInitDialog"] ~= nil then if Var["BossBattle"]["bReInitDialogEnd"] == false then local nCurDialogNo = Var["BossBattle"]["ReInitDialogStepNo"] if nCurDialogNo <= #CurChat["ReInitDialog"] then if Var["BossBattle"]["ReInitDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["ReInitDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["ReInitDialog"][ nCurDialogNo ]["Index"] ) Var["BossBattle"]["ReInitDialogStepNo"] = Var["BossBattle"]["ReInitDialogStepNo"] + 1 Var["BossBattle"]["ReInitDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["BossBattle"]["bReInitDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["BossBattle"]["bReInitDialogEnd"] = true end -- º¸½º¹æ ¹® ´ÝÈû ´ÙÀ̾ó·Î±× Á¶°ÇÀÌ µÈ °æ¿ì if CurChat["ShutDoorDialog"] ~= nil and CurChat["ShutDoorNotice"] ~= nil then if Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] == false then local nCurDialogNo = Var["BossBattle"]["ShutDoorDialogAndNoticeStepNo"] if nCurDialogNo <= #CurChat["ShutDoorDialog"] then if Var["BossBattle"]["ShutDoorDialogAndNoticeStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["ShutDoorDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["ShutDoorDialog"][ nCurDialogNo ]["Index"] ) if Var["BossBattle"]["ShutDoorDialogAndNoticeStepNo"] == 1 then cNotice( Var["MapIndex"], ChatInfo["ScriptFileName"], CurChat["ShutDoorNotice"][ nCurDialogNo ]["Index"] ) end Var["BossBattle"]["ShutDoorDialogAndNoticeStepNo"] = Var["BossBattle"]["ShutDoorDialogAndNoticeStepNo"] + 1 Var["BossBattle"]["ShutDoorDialogAndNoticeStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["BossBattle"]["bShutDoorDialogAndNoticeEnd"] = true end -- º¸½º Ŭ¸®¾î Á¶°ÇÀÌ µÈ °æ¿ì if CurChat["ClearDialog"] ~= nil and CurChat["ClearNotice"] ~= nil then if Var["BossBattle"]["bClearDialogAndNoticeEnd"] == false then local nCurDialogNo = Var["BossBattle"]["ClearDialogAndNoticeStepNo"] if nCurDialogNo <= #CurChat["ClearDialog"] then if Var["BossBattle"]["ClearDialogAndNoticeStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["ClearDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["ClearDialog"][ nCurDialogNo ]["Index"] ) if nCurDialogNo == 1 then cNotice( Var["MapIndex"], ChatInfo["ScriptFileName"], CurChat["ClearNotice"][ nCurDialogNo ]["Index"] ) end Var["BossBattle"]["ClearDialogAndNoticeStepNo"] = Var["BossBattle"]["ClearDialogAndNoticeStepNo"] + 1 Var["BossBattle"]["ClearDialogAndNoticeStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["BossBattle"]["bClearDialogAndNoticeEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["BossBattle"]["bClearDialogAndNoticeEnd"] = true end -- ´ÙÀ½ ´Ü°è·Î ³Ñ¾î°¥ Á¶°Ç if Var["BossBattle"]["bClearDialogAndNoticeEnd"] == true then -- Quest Mob Kill ¼¼±â. Var["BossBattle"] = nil DebugLog( "BossBattle::End" ) cDoorAction( Var["Door"..(#StepNameTable - 2) ], RegenInfo["Stuff"]["Door"..(#StepNameTable - 2) ]["Block"], "open" ) cQuestMobKill_AllInMap( Var["MapIndex"], QuestMobKillInfo["QuestID"], QuestMobKillInfo["MobIndex"], QuestMobKillInfo["MaxKillCount"] ) GoToNextStep( Var ) end end -- ¾ÆÀÌÁ©ÀÇ º¸»ó function IyzelReward( Var ) cExecCheck "IyzelReward" if Var == nil then return end local nBossType = Var["StageInfo"]["BossTypeNo"] if Var["IyzelReward"] == nil then DebugLog( "IyzelReward::Start" ) Var["IyzelReward"] = {} -- ¾ÆÀÌÁ© Á¨ local IyzelRegenInfo = RegenInfo["NPC"]["IyzelReward"]["Iyzel"] local nIyzelHandle = cMobRegen_XY( Var["MapIndex"], IyzelRegenInfo["Index"], IyzelRegenInfo["x"], IyzelRegenInfo["y"], IyzelRegenInfo["dir"] ) if nIyzelHandle ~= nil then Var["Enemy"][ nIyzelHandle ] = IyzelRegenInfo Var["IyzelHandle"] = nIyzelHandle -- ¾ÆÀÌÁ© ¹«Àû ó¸® local AbstateInfo = NPC_Abstate["Immortal"] cSetAbstate( nIyzelHandle, AbstateInfo["Index"], AbstateInfo["Strength"], AbstateInfo["KeepTime"] ) else ErrorLog( "IyzelReward::Iyzel Gen Failed" ) end -- ÃⱸÂÊ Ãⱸ°ÔÀÌÆ® »ý¼º local RegenExitGate = RegenInfo["Stuff"]["EndExitGate"] local nExitGateHandle = cDoorBuild( Var["MapIndex"], RegenExitGate["Index"], RegenExitGate["x"], RegenExitGate["y"], RegenExitGate["dir"], RegenExitGate["scale"] ) if nExitGateHandle ~= nil then if cSetAIScript ( MainLuaScriptPath, nExitGateHandle ) == nil then ErrorLog( "ReturnToHome::cSetAIScript ( MainLuaScriptPath, nExitGateHandle ) == nil" ) end if cAIScriptFunc( nExitGateHandle, "NPCClick", "ExitGateClick" ) == nil then ErrorLog( "ReturnToHome::cAIScriptFunc( nExitGateHandle, \"NPCClick\", \"ExitGateClick\" ) == nil" ) end end -- Ưº°ÇÑ º¸»ó »óÀÚ Á¨ local TreasureBoxRegenInfo = RegenInfo["Mob"]["IyzelReward"][ nBossType ] local nBoxHandle = cMobRegen_Circle( Var["MapIndex"], TreasureBoxRegenInfo["Index"], TreasureBoxRegenInfo["x"], TreasureBoxRegenInfo["y"], TreasureBoxRegenInfo["radius"] ) if nBoxHandle ~= nil then Var["Enemy"][ nBoxHandle ] = TreasureBoxRegenInfo Var["RoutineTime"][ nBoxHandle ] = cCurrentSecond() if cSetAIScript( MainLuaScriptPath, nBoxHandle ) == nil then ErrorLog( "IyzelReward::Special Box cSetAIScript( ) Failed" ) end if cAIScriptFunc( nBoxHandle, "Entrance", "TreasureBoxRoutine" ) == nil then ErrorLog( "IyzelReward::Special Box cAIScriptFunc( ) Failed - Entrance Mode" ) end if cAIScriptFunc( nBoxHandle, "ObjectDied", "TreasureBoxOpened" ) == nil then ErrorLog( "IyzelReward::Special Box cAIScriptFunc( ) Failed - ObjectDied Mode" ) end else ErrorLog( "IyzelReward::Special Box Gen Failed" ) end -- º¸»ó »óÀÚ ±×·ì Á¨ local RewardBoxesRegenInfo = RegenInfo["Group"]["IyzelReward"][ nBossType ] for i = 1, #RewardBoxesRegenInfo do cGroupRegenInstance( Var["MapIndex"], RewardBoxesRegenInfo[ i ] ) end -- äÆà ´Ü°è ¼³Á¤¿ë º¯¼ö ¼ÂÆà Var["IyzelReward"]["AppearDialogStepSec"] = Var["CurSec"] Var["IyzelReward"]["AppearDialogStepNo"] = 1 Var["IyzelReward"]["OpenBoxTimeOverDialogStepSec"] = Var["CurSec"] + DelayTime["RewardBoxTryTime"] Var["IyzelReward"]["OpenBoxTimeOverDialogStepNo"] = 1 Var["IyzelReward"]["bAppearDialogEnd"] = false Var["IyzelReward"]["bOpenBoxTimeOverDialogEnd"] = nil -- Á¦Çѽ𣠳¡³ª¸é false·Î ¹Ù²î¾î ½ÇÇà cTimer( Var["MapIndex"], DelayTime["RewardBoxTryTime"] ) end --------------------------------------------------------------------------------------------------------------------------------------------------- -- ´Ü°è ¼³Á¤ if Var["IyzelReward"]["OpenBoxTimeOverDialogStepSec"] <= Var["CurSec"] then Var["IyzelReward"]["bOpenBoxTimeOverDialogEnd"] = false ---[[ -- ¹Ú½º Á׾ ¾ÆÀÌÅÛ ³»¹ñ±â ¸ðµå local HandleList = { cNearObjectList( Var["IyzelHandle"], 500, ObjectType["Mob"] ) } for DummyIndex, nTargetHandle in pairs ( HandleList ) do if nTargetHandle ~= Var["IyzelHandle"] then cMobSuicide( Var["MapIndex"], nTargetHandle ) end end --]] --[[ -- ¹Ú½º »ç¶óÁö±â ¸ðµå for nIndex, sIndexName in pairs ( RewardBoxIndexes ) do cVanishAll( Var["MapIndex"], sIndexName ) end --]] end --------------------------------------------------------------------------------------------------------------------------------------------------- -- äÆà local CurChat = ChatInfo["IyzelReward"]["Boss"..nBossType ] local sIyzelIndex = ChatInfo["IyzelReward"]["SpeakerIndex"] -- ¾ÆÀÌÁ©ÀÌ ³ªÅ¸³ªÀÚ¸¶ÀÚ if CurChat["IyzelAppearDialog"] ~= nil then if Var["IyzelReward"]["bAppearDialogEnd"] == false then local nCurDialogNo = Var["IyzelReward"]["AppearDialogStepNo"] if nCurDialogNo <= #CurChat["IyzelAppearDialog"] then if Var["IyzelReward"]["AppearDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], sIyzelIndex, ChatInfo["ScriptFileName"], CurChat["IyzelAppearDialog"][ nCurDialogNo ]["Index"] ) Var["IyzelReward"]["AppearDialogStepNo"] = Var["IyzelReward"]["AppearDialogStepNo"] + 1 Var["IyzelReward"]["AppearDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["IyzelReward"]["bAppearDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["IyzelReward"]["bAppearDialogEnd"] = true end -- º¸»ó»óÀÚ Á¦Çѽð£ÀÌ Áö³ª°í ³ª¼­ if CurChat["OpenBoxTimeOverDialog"] ~= nil then if Var["IyzelReward"]["bOpenBoxTimeOverDialogEnd"] == false then local nCurDialogNo = Var["IyzelReward"]["OpenBoxTimeOverDialogStepNo"] if nCurDialogNo <= #CurChat["OpenBoxTimeOverDialog"] then if Var["IyzelReward"]["OpenBoxTimeOverDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], sIyzelIndex, ChatInfo["ScriptFileName"], CurChat["OpenBoxTimeOverDialog"][ nCurDialogNo ]["Index"] ) Var["IyzelReward"]["OpenBoxTimeOverDialogStepNo"] = Var["IyzelReward"]["OpenBoxTimeOverDialogStepNo"] + 1 Var["IyzelReward"]["OpenBoxTimeOverDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["IyzelReward"]["bOpenBoxTimeOverDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["IyzelReward"]["bOpenBoxTimeOverDialogEnd"] = true end -- ³¡ if Var["IyzelReward"]["bOpenBoxTimeOverDialogEnd"] == true then Var["IyzelReward"] = nil GoToNextStep( Var ) DebugLog( "IyzelReward::End" ) end end -- Å·´ý Äù½ºÆ® Ŭ¸®¾î : ÀÌ ID ¿¡¼± ±â´É ¾øÀ½ function QuestSuccess( Var ) cExecCheck "QuestSuccess" if Var == nil then return end GoToNextStep( Var ) DebugLog( "QuestSuccess::End" ) end -- Å·´ý Äù½ºÆ® ½ÇÆÐ : ID ¿¡¼± ±â´É ¾øÀ½ function QuestFailed( Var ) cExecCheck "QuestFailed" if Var == nil then return end GoToNextStep( Var ) DebugLog( "QuestFailed::End" ) end -- ±Íȯ : ID ¿¡¼± ±â´É ¾øÀ½ function ReturnToHome( Var ) cExecCheck "ReturnToHome" if Var == nil then return end GoToNextStep( Var ) DebugLog( "End ReturnToHome" ) end -- ½ºÅÜ ±¸ºÐÀ» À§ÇÑ ´øÀü ÁøÇà ÇÔ¼ö ¸®½ºÆ® ID_StepsList = { { Function = InitDungeon, Name = "InitDungeon", }, { Function = EachFloor, Name = "EachFloor", }, { Function = BossBattle, Name = "BossBattle", }, { Function = IyzelReward, Name = "IyzelReward", }, { Function = QuestSuccess, Name = "QuestSuccess", }, { Function = QuestFailed, Name = "QuestFailed", }, { Function = ReturnToHome, Name = "ReturnToHome", }, } -- ¿ªÂüÁ¶ ¸®½ºÆ® ID_StepsIndexList = { } for index, funcValue in pairs ( ID_StepsList ) do ID_StepsIndexList[ funcValue["Name"] ] = index end