-------------------------------------------------------------------------------- -- Secret Laboratory 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 else ErrorLog( "InitDungeon::Door"..i.." was not created." ) 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 -- Á¤ÇØÁø ±ÔÄ¢¿¡ ÀÇ°ÅÇÑ Ãþ º° ÆÐÅÏ ¼ÂÆà --[[ ³×ÀÓÅ×À̺íÀ» Çϳª¾¿ °¡Á®¿Í¼­ ÃÑ ÆÐÅÏ °³¼ö¸¦ ±¸ÇÑ´Ù. ÆÐÅÏ À̸§°ú ¼ø¹øÀº ÇØ´ç ´øÀü ³»ºÎ ¸Þ¸ð¸®¿¡ ¼ÂÆÃÇÑ´Ù. Á¤ÇؽŠ¼ø¼­´ë·Î Çϳª¾¿ äÅà ¹Ì¸® ¹è¿­À» ¸¸µé¾î¼­ »ç¿ëµÇ±â·Î ÇÑ ÆÐÅÏÀº üũ¸¦ Çصּ­ °ãÄ¡Áö ¾Ê°Ô Çϳª¾¿ °í¸¥´Ù. ±×·¸°Ô 10°³ ÆÐÅÏÀ» Á¤·ÄÇÑ´Ù. ÁøÇà ½Ã¿¡´Â Á¤·ÄµÈ °÷¿¡¼­ Çϳª¾¿ »©¿Â´Ù. ]] -- ÆÐÅÏÀ» °¢ Ãþ¿¡ ¼ÂÆÃÇÑ Á¤º¸¸¦ º¸°üÇÏ´Â Å×À̺í local PatternSettingTable = {} -- °¢ ÆÐÅÏÀ» ÅëÇÕÇÏ¿© ¼ø¹øÀ» ¸Å°Ü³õÀº Å×À̺í local PatternPointerTable = {} -- ÃÑ ÆÐÅÏ ¼ö local nPatternCount = 0 for i = 1, #PatternNameTable do -- ÃÑ °³¼ö ¼¼±â local sPattern = PatternNameTable[i] -- ÅëÇÕ¼ø¹ø°ú °¢ ¼ø¹ø ¸ÅĪ for k = 1, #RegenInfo["Group"]["EachPattern"][ sPattern ] do PatternPointerTable[ nPatternCount + k ] = { PatternName = sPattern, PatternOrderNo = k } end nPatternCount = nPatternCount + #RegenInfo["Group"]["EachPattern"][ sPattern ] end DebugLog( "InitDungeon::Pattern pointer table was set - Size : "..#PatternPointerTable ) local CheckPatternSelected = {} -- À妽º: ÅëÇÕ¼ø¹ø, °ª: üũ µÉ °æ¿ì true local nCheckPatternSelectedCount = 0 -- ¼±ÅÿϷáµÈ ÆÐÅÏÀÇ ¼ö -- ÆÐÅÏ ÁöÁ¤( Ãþ °³¼ö ¸¸Å­ ) while nCheckPatternSelectedCount < #FloorPatternInfoTable do for i = 1, #PatternPointerTable do -- ÇØ´ç ¼ø¹ø¿¡ ¸Â´Â ÆÐÅÏ Á¾·ù°¡ °ñ¶óÁ³À¸¸é üũÇغ¸°í »ç¿ëÀÌ µÈ°Å¶ó¸é »ç¿ë ¾ÈµÈ ½ºÅ×ÀÌÁö°¡ ¼±ÅÃµÉ ¶§±îÁö ã´Â´Ù. if PatternPointerTable[ i ]["PatternName"] == FloorPatternInfoTable[ nCheckPatternSelectedCount + 1 ] then if CheckPatternSelected[ i ] ~= true then nCurPatternSelected = i break else if i == #PatternPointerTable then ErrorLog( "InitDungeon::Pattern Setting is Failed(Logic or Data Error)" ) end end else if i == #PatternPointerTable then ErrorLog( "InitDungeon::Pattern Setting is Failed(Logic or Data Error)" ) end end end -- ÅëÇÕ¼ø¹ø°ú ¼ø¹ø¸ÅĪÁ¤º¸°¡ ¾øÀ¸¸é ÆÐÅÏ ÁöÁ¤ ºÒ°¡ÇϹǷΠÇØ´ç ÆÐÅÏ Æнº if PatternPointerTable[ nCurPatternSelected ] ~= nil then -- ÀÌ¹Ì ¼±ÅÃµÈ °ÍÀº Á¦¿Ü if CheckPatternSelected[ nCurPatternSelected ] ~= true 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 -- Ưº°º¸»ó ¿©ºÎ ¼³Á¤ Var["bSpecialRewardMode"] = true -- ¸Þ¸ð¸®¿¡ ÆÐÅÏ ¼ÂÆà Á¤º¸ ÀúÀå Var["StageInfo"]["PatternSetting"] = PatternSettingTable -- ´ë±â½Ã°£ ¼³Á¤ 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 -- °¢ Ãþ ¼ÂÆà ¹× ÁøÇà 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 ] -- ÃʱâÈ­ Á¶°Ç ¼ÂÆà local bInitFlag = false if Var["EachFloor"..CurStepNo ] == nil then bInitFlag = true else if Var["EachFloor"..CurStepNo ]["bEntranceArea"] == false then bInitFlag = true end end -- °¢ ´Ü°è Ãʱ⠼³Á¤ if bInitFlag == true then if Var["EachFloor"..CurStepNo ] == nil then DebugLog( "Start EachFloor "..CurStepNo ) Var["EachFloor"..CurStepNo ] = {} -- ÆäÀ̽ºÄÆ ´Ü°è ±¸ºÐ¿ë º¯¼ö ¼³Á¤ Var["EachFloor"..CurStepNo ]["BeforeDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["BeforeDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["BossSummonDialogStepSec"] = Var["CurSec"] Var["EachFloor"..CurStepNo ]["BossSummonDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["HelpUsChatStepSec"] = Var["CurSec"] -- ÆäÀ̽ºÄÆ Á¾·á ¿©ºÎ ¼³Á¤ Var["EachFloor"..CurStepNo ]["bBeforeDialogEnd"] = false Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedDialogEnd"] = nil -- ½ÇÇèÁßÀÎ ¸÷ÀÌ ±ú¾î³ª¸é false·Î ¼ÂÆà Var["EachFloor"..CurStepNo ]["bBossSummonDialogEnd"] = nil -- º¸½º°¡ ¼ÒȯÇϸé false·Î ¼ÂÆÃÇÏ¿© ÁøÇà Var["EachFloor"..CurStepNo ]["nHP_BossSummonDialog"] = nil -- º¸½º°¡ ¼ÒȯÇϸé ÇØ´ç ½ºÅ³ÀÇ HPÁ¤º¸¸¦ ÀÔ·ÂÇÏ¿© ÁøÇà -- ÁøÇà´Ü°è ¼³Á¤ Ç÷¡±× Var["EachFloor"..CurStepNo ]["bMobEliminated"] = false -- ½ÇÇèÁßÀÎ ¸÷À» Á¦¿ÜÇÑ ¸÷ÀÌ ¸ðµÎ Á×¾úÀ» °æ¿ì True Var["EachFloor"..CurStepNo ]["bSemiBossWarned60Sec"] = false -- ÀÔÀåÇÑÁö 2ºÐ ÈÄ °æ°í ÈÄ true Var["EachFloor"..CurStepNo ]["bSemiBossWarned30Sec"] = false -- ÀÔÀåÇÑÁö 2ºÐ 30ÃÊ ÈÄ °æ°í ÈÄ true Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedWarn"] = false -- ½ÇÇèÁßÀÎ ¸÷ÀÌ ±ú¾î³µdÀ¸¸é °æ°í ÈÄ true Var["EachFloor"..CurStepNo ]["bSemiBossAwakened"] = false -- ½ÇÇèÁßÀÎ ¸÷ÀÌ ±ú¾î³µ´Â°¡ end Var["EachFloor"..CurStepNo ]["bCanGenerateMonsters"] = true -- ŸÀÓ¾îÅà ÆÐÅÏ¿¡¼­ ù ÀÔÀå üũ( óÀ½ ÀÔÀåÀÌ ÀÎ½Ä µÉ ¶§ ±îÁö¸¸ ÇÔ ) if CurPatternInfo["PatternName"] == "Pattern_TimeAttack" then Var["EachFloor"..CurStepNo ]["bCanGenerateMonsters"] = false if Var["EachFloor"..CurStepNo ]["bEntranceArea"] == nil then Var["EachFloor"..CurStepNo ]["bEntranceArea"] = false end local EntranceArea = AreaIndexTable[ CurPatternInfo["PatternOrderNo"] ] if EntranceArea ~= nil then local InBossAreaHandleList = { cGetAreaObjectList( Var["MapIndex"], EntranceArea, ObjectType["Player"] ) } if #InBossAreaHandleList > 0 then Var["EachFloor"..CurStepNo ]["bCanGenerateMonsters"] = true Var["EachFloor"..CurStepNo ]["bEntranceArea"] = true if cNoticeRedWarningCode( Var["MapIndex"], SemiBossWarning["Entrance"]["Code"] ) == nil then ErrorLog( "EachFloor"..CurStepNo.."::cNoticeRedWarningCode is Failed - Entrance" ) end else -- ¾ÆÁ÷ ÇØ´ç ±¸¿ª¿¡ ÀÔÀå ¾ÈÇÔ end else ErrorLog( "EachFloor"..CurStepNo.."::Area Info does not exist!" ) return end end if CurPatternInfo["PatternName"] == "Pattern_KillBoss" then if Var["BossBattle"] == nil then Var["BossBattle"] = {} end else Var["BossBattle"] = nil end if Var["EachFloor"..CurStepNo ]["bCanGenerateMonsters"] == true then -- ´ÜÀÏ ¸÷ Á¨ local CurMobRegen = RegenInfo["Mob"]["EachPattern"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] if CurMobRegen ~= nil then for MobType, MobRegenInfo in pairs ( CurMobRegen ) do local MobHandle = cMobRegen_XY( Var["MapIndex"], MobRegenInfo["Index"], RegenInfo["Coord"][ CurStepNo ]["x"], RegenInfo["Coord"][ CurStepNo ]["y"], MobRegenInfo["dir"] ) 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 == "SemiBoss" then Var["EachFloor"..CurStepNo ]["SemiBossHandle"] = MobHandle -- ŸÀÓ¾îÅà ¼ÂÆà if MobRegenInfo["Index"] == "Lab_Slime" then cSetAbstate( MobHandle, SemiBossAbstate["TimeAttackMini"]["Index"], SemiBossAbstate["TimeAttackMini"]["Strength"], SemiBossAbstate["TimeAttackMini"]["KeepTime"] ) else cSetAbstate( MobHandle, SemiBossAbstate["TimeAttack"]["Index"], SemiBossAbstate["TimeAttack"]["Strength"], SemiBossAbstate["TimeAttack"]["KeepTime"] ) cAnimate( MobHandle, "start", "&TimeAttack_Stand" ) end cAIScriptFunc( MobHandle, "Entrance", "SemiBossRoutine" ) elseif MobType == "MidBoss" then Var["StageInfo"]["BossTypeNo"] = 1 Var["EachFloor"..CurStepNo ]["MidBossHandle"] = MobHandle cAIScriptFunc( MobHandle, "Entrance", "BossRoutine" ) cAIScriptFunc( MobHandle, "MobDamaged", "BossDamaged" ) elseif MobType == "Boss" then Var["StageInfo"]["BossTypeNo"] = 2 Var["EachFloor"..CurStepNo ]["BossHandle"] = MobHandle cAIScriptFunc( MobHandle, "Entrance", "BossRoutine" ) cAIScriptFunc( MobHandle, "MobDamaged", "BossDamaged" ) end end end end -- ¸÷ ±×·ì Á¨ local CurGroupRegen = RegenInfo["Group"]["EachPattern"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] if CurGroupRegen ~= nil then for i = 1, #CurGroupRegen do cGroupRegenInstance( Var["MapIndex"], CurGroupRegen[ i ] ) end end -- °¨¿Á Á¨ : ÃÖÁ¾ º¸½ºÀü¿¡ »ý¼ºµÊ if CurStepNo == #StepNameTable - 1 then local CurRegenPrison = RegenInfo["Stuff"]["Prison"] local nCurPrisonHandle = cDoorBuild( Var["MapIndex"], CurRegenPrison["Index"], CurRegenPrison["x"], CurRegenPrison["y"], CurRegenPrison["dir"], CurRegenPrison["scale"] ) if nCurPrisonHandle ~= nil then cDoorAction( nCurPrisonHandle , CurRegenPrison["Block"], "close" ) Var["Prison"] = {} Var["Prison"]["RegenInfo"] = CurRegenPrison Var["Prison"]["Handle"] = nCurPrisonHandle Var["Prison"]["bOpened"] = false if cSetAIScript ( MainLuaScriptPath, nCurPrisonHandle ) == nil then ErrorLog( "EachFloor "..CurStepNo.."::cSetAIScript ( MainLuaScriptPath, nCurPrisonHandle ) == nil" ) end if cAIScriptFunc( nCurPrisonHandle, "NPCClick", "PrisonClick" ) == nil then ErrorLog( "EachFloor "..CurStepNo.."::cAIScriptFunc( nCurPrisonHandle, \"NPCClick\", \"PrisonClick\" ) == nil" ) end else ErrorLog( "EachFloor "..CurStepNo.."::Prison"..i.." was not created." ) end end -- ½Ã°£ üũ Var["EachFloor"..CurStepNo ]["WaitMobGenSec"] = Var["CurSec"] + DelayTime["WaitAfterGenMob"] Var["EachFloor"..CurStepNo ]["TimeAttack_R60"] = Var["CurSec"] + SemiBossWarning["Remain_60_Sec"]["OccurSec"] Var["EachFloor"..CurStepNo ]["TimeAttack_R30"] = Var["CurSec"] + SemiBossWarning["Remain_30_Sec"]["OccurSec"] end -- ¸÷ Á¨ ¼³Á¤ if¹® ³¡À§Ä¡/////// end -- Ãʱ⼳Á¤ ³¡//////////// -- ŸÀÓ¾îÅà ½ÃÀÛ ÈĺÎÅÍ Ã¼Å©ÇÏ´Â ºÎºÐ if CurPatternInfo["PatternName"] == "Pattern_TimeAttack" then if Var["EachFloor"..CurStepNo ]["bEntranceArea"] == true then if Var["Enemy"][ Var["EachFloor"..CurStepNo ]["SemiBossHandle"] ] ~= nil then -- ½ÇÇèÁßÀÎ ¸÷ÀÌ ±ú¾î³² if Var["EachFloor"..CurStepNo ]["bSemiBossAwakened"] == true then if Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedDialogEnd"] == nil then Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedDialogEnd"] = false end end -- 1ºÐÀü °æ°í if Var["EachFloor"..CurStepNo ]["bSemiBossWarned60Sec"] == false then if Var["CurSec"] >= Var["EachFloor"..CurStepNo ]["TimeAttack_R60"] then if cNoticeRedWarningCode( Var["MapIndex"], SemiBossWarning["Remain_60_Sec"]["Code"] ) == nil then ErrorLog( "EachFloor"..CurStepNo.."::cNoticeRedWarningCode is Failed - Remain1min" ) end Var["EachFloor"..CurStepNo ]["bSemiBossWarned60Sec"] = true end end -- 30ÃÊÀü °æ°í if Var["EachFloor"..CurStepNo ]["bSemiBossWarned30Sec"] == false then if Var["CurSec"] >= Var["EachFloor"..CurStepNo ]["TimeAttack_R30"] then if cNoticeRedWarningCode( Var["MapIndex"], SemiBossWarning["Remain_30_Sec"]["Code"] ) == nil then ErrorLog( "EachFloor"..CurStepNo.."::cNoticeRedWarningCode is Failed - Remain30Sec" ) end Var["EachFloor"..CurStepNo ]["bSemiBossWarned30Sec"] = true end end -- ±ú¾î³² °æ°í if Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedWarn"] == false then if Var["EachFloor"..CurStepNo ]["bSemiBossAwakened"] == true then if cNoticeRedWarningCode( Var["MapIndex"], SemiBossWarning["Awakened"]["Code"] ) == nil then ErrorLog( "EachFloor"..CurStepNo.."::cNoticeRedWarningCode is Failed - BeAwakened" ) end Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedWarn"] = true end end else --ErrorLog( "EachFloor"..CurStepNo.."::Egg Info does not exist." ) end end end -- äÆà local CurChat = ChatInfo["EachPattern"][ CurPatternInfo["PatternName"] ][ CurPatternInfo["PatternOrderNo"] ] -- ÀüÅõ Àü if CurChat["BeforeDialog"] ~= nil then if Var["EachFloor"..CurStepNo ]["bBeforeDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["BeforeDialogStepNo"] if nCurDialogNo <= #CurChat["BeforeDialog"] then if Var["EachFloor"..CurStepNo ]["BeforeDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["BeforeDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["BeforeDialog"][ 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_TimeAttack" then if Var["EachFloor"..CurStepNo ]["bEntranceArea"] ~= true then return end end -- °¨¿Á¿¡ °¤Èù ¾ÆÀ̵éÀÌ ±¸ÇØ´Þ¶ó°í ÇÏ´Â ¸»µé if CurChat["HelpUsChat"] ~= nil then local nCurDialogNo = cRandomInt( 1, #CurChat["HelpUsChat"] ) if nCurDialogNo <= #CurChat["HelpUsChat"] then if Var["EachFloor"..CurStepNo ]["HelpUsChatStepSec"] <= Var["CurSec"] then cMobChat( Var["Prison"]["Handle"], ChatInfo["ScriptFileName"], CurChat["HelpUsChat"][ nCurDialogNo ]["Index"], true ) Var["EachFloor"..CurStepNo ]["HelpUsChatStepSec"] = Var["CurSec"] + DelayTime["GapHelpUsChat"] end end end -- ½ÇÇèÁßÀÎ ¸÷ÀÌ ±ú¾î³µÀ» ¶§ if CurChat["SemiBossAwakenedDialog"] ~= nil then if Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepNo"] if nCurDialogNo <= #CurChat["SemiBossAwakenedDialog"] then if Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["SemiBossAwakenedDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["SemiBossAwakenedDialog"][ nCurDialogNo ]["Index"] ) Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepNo"] = Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["SemiBossAwakenedDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["bSemiBossAwakenedDialogEnd"] = true end -- º¸½º°¡ ¸÷À» ¼ÒȯÇßÀ» ¶§ if Var["EachFloor"..CurStepNo ]["nHP_BossSummonDialog"] ~= nil then local sDialogIndex = "Summon"..Var["EachFloor"..CurStepNo ]["nHP_BossSummonDialog"].."Dialog" if CurChat[ sDialogIndex ] ~= nil then if Var["EachFloor"..CurStepNo ]["bBossSummonDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["BossSummonDialogStepNo"] if nCurDialogNo <= #CurChat[ sDialogIndex ] then if Var["EachFloor"..CurStepNo ]["BossSummonDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat[ sDialogIndex ][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat[ sDialogIndex ][ nCurDialogNo ]["Index"] ) DebugLog( "EachFloor"..CurStepNo .."::SummonDialog-"..Var["EachFloor"..CurStepNo ]["nHP_BossSummonDialog"].."/"..nCurDialogNo ) Var["EachFloor"..CurStepNo ]["BossSummonDialogStepNo"] = Var["EachFloor"..CurStepNo ]["BossSummonDialogStepNo"] + 1 Var["EachFloor"..CurStepNo ]["BossSummonDialogStepSec"] = Var["CurSec"] + DelayTime["GapSummonDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["EachFloor"..CurStepNo ]["BossSummonDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["bBossSummonDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["EachFloor"..CurStepNo ]["BossSummonDialogStepNo"] = 1 Var["EachFloor"..CurStepNo ]["bBossSummonDialogEnd"] = true end end -- ¸÷ Àü¸êüũ if Var["EachFloor"..CurStepNo ]["bMobEliminated"] == false then if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) <= 0 then Var["EachFloor"..CurStepNo ]["bMobEliminated"] = true end return else -- ÀüÅõ ³¡ ÀÌÈÄ if CurChat["AfterDialog"] ~= nil then if Var["EachFloor"..CurStepNo ]["bAfterDialogEnd"] == false then local nCurDialogNo = Var["EachFloor"..CurStepNo ]["AfterDialogStepNo"] if nCurDialogNo <= #CurChat["AfterDialog"] then if Var["EachFloor"..CurStepNo ]["AfterDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["AfterDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["AfterDialog"][ 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 and Var["EachFloor"..CurStepNo ]["bMobEliminated"] == true then -- Ŭ¸®¾î ¾×¼Ç 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 CurStepNo == #StepNameTable - 1 then Var["EachFloor"] = nil GoToNextStep( Var ) return end return end end end -- ¾ÆÀÌµé ±¸Ãâ function RescuedChildren( Var ) cExecCheck "RescuedChildren" if Var == nil then return end local nBossType = Var["StageInfo"]["BossTypeNo"] if Var["Prison"] == nil then return end if Var["Prison"]["bOpened"] == true then cQuestMobKill_AllInMap( Var["MapIndex"], QuestMobKillInfo["QuestID"], QuestMobKillInfo["MobIndex"], QuestMobKillInfo["MaxKillCount"] ) else return end if Var["RescuedChildren"] == nil then DebugLog( "RescuedChildren::Start" ) Var["RescuedChildren"] = {} -- Ưº°ÇÑ º¸»ó »óÀÚ Á¨ if Var["bSpecialRewardMode"] == true then local RewardBoxInfo = RegenInfo["Mob"]["RescuedChildren"]["SpecialRewardBox"] local nRewardBoxHandle = cMobRegen_XY( Var["MapIndex"], RewardBoxInfo["Index"], RewardBoxInfo["x"], RewardBoxInfo["y"], RewardBoxInfo["dir"] ) if nRewardBoxHandle == nil then ErrorLog( "RescuedChildren::SpecialRewardBox was not created - SpecialRewardMode" ) end end -- ¾ÆÀ̵é Á¨ for Index, ChildRegenInfo in pairs( RegenInfo["NPC"]["RescuedChildren"] ) do if ChildRegenInfo ~= nil then local nChildHandle = cMobRegen_XY( Var["MapIndex"], ChildRegenInfo["Index"], ChildRegenInfo["x"], ChildRegenInfo["y"], ChildRegenInfo["dir"] ) if nChildHandle ~= nil then Var["Friend"][ ChildRegenInfo["Index"] ] = nChildHandle DebugLog( "RescuedChildren::Child Gen : "..Index.."-"..ChildRegenInfo["Index"].."-"..nChildHandle ) else ErrorLog( "RescuedChildren::Child Gen Failed" ) end end end -- äÆà ´Ü°è ¼³Á¤¿ë º¯¼ö ¼ÂÆà Var["RescuedChildren"]["PrisonVanishStepSec"] = Var["CurSec"] + DelayTime["BeforePrisonVanish"] Var["RescuedChildren"]["SequentialDialogStepSec"] = Var["CurSec"] Var["RescuedChildren"]["SequentialDialogStepNo"] = 1 Var["RescuedChildren"]["AfterAnimationChatStepSec"] = Var["CurSec"] Var["RescuedChildren"]["AfterAnimationChatStepNo"] = 1 Var["RescuedChildren"]["ChildrenRunToExitStepSec"] = Var["CurSec"] Var["RescuedChildren"]["ChildrenVanishStepSec"] = Var["CurSec"] Var["RescuedChildren"]["bPrisonVanishEnd"] = false Var["RescuedChildren"]["bSequentialDialogEnd"] = false Var["RescuedChildren"]["bAfterAnimationChatEnd"] = nil -- ¾Ö´Ï¸ÞÀÌ¼Ç ³¡³ª¸é false·Î ¹Ù²î¾î ½ÇÇà Var["RescuedChildren"]["bChildrenRunToExitEnd"] = nil -- ¾ÆÀ̵é À̾߱⠳¡³ª¸é false·Î ¹Ù²î¾î ½ÇÇà Var["RescuedChildren"]["bChildrenVanishEnd"] = nil -- ¾ÆÀÌµé ´Þ¸®±â ³¡³ª¸é false·Î ¹Ù²î¾î ½ÇÇà end --------------------------------------------------------------------------------------------------------------------------------------------------- -- °¨¿Á »ç¶óÁö±â if Var["RescuedChildren"]["bPrisonVanishEnd"] == false then if Var["RescuedChildren"]["PrisonVanishStepSec"] <= Var["CurSec"] then cAIScriptSet( Var["Prison"]["Handle"] ) cNPCVanish( Var["Prison"]["Handle"] ) Var["RescuedChildren"]["bPrisonVanishEnd"] = true DebugLog( "RescuedChildren::Prison was vanished." ) end end --------------------------------------------------------------------------------------------------------------------------------------------------- -- ¾Ö´Ï¸ÞÀÌ¼Ç if Var["RescuedChildren"]["bSequentialDialogEnd"] == true and Var["RescuedChildren"]["bAfterAnimationChatEnd"] == nil then for Index, AnimationInfo in pairs ( NPC_Animation ) do if AnimationInfo ~= nil then local nHandle = Var["Friend"][ AnimationInfo["ActorIndex"] ] if nHandle == nil then ErrorLog( "RescuedChildren::Animation NPC Handle does not exist." ) else cAnimate( nHandle, "start", AnimationInfo["Index"] ) Var["RescuedChildren"]["AfterAnimationChatStepSec"] = Var["CurSec"] + DelayTime["AnimationTime"] -- ¾Ö´Ï¸ÞÀ̼ÇÀÌ ´Ù µ¹°í³ª¼­ ¾ÖµéÀÌ ¸»ÇÏ°Ô Çϱâ À§ÇÔ. end end end Var["RescuedChildren"]["bAfterAnimationChatEnd"] = false end -- ±¸ÃâµÈ ¾ÆÀ̵éÀÇ À̾߱Ⱑ ³¡³ª°í ´Þ¸®±â ¸ðµå·Î ¼ÂÆà if Var["RescuedChildren"]["bAfterAnimationChatEnd"] == true and Var["RescuedChildren"]["bChildrenRunToExitEnd"] == nil then Var["RescuedChildren"]["bChildrenRunToExitEnd"] = false Var["RescuedChildren"]["ChildrenRunToExitStepSec"] = Var["CurSec"] + DelayTime["BeforeChildrenRun"] end -- ¾ÆÀ̵éÀÌ ´Þ¸®´Ù »ç¶óÁö´Â ¸ðµå·Î ¼ÂÆà if Var["RescuedChildren"]["bChildrenRunToExitEnd"] == true and Var["RescuedChildren"]["bChildrenVanishEnd"] == nil then Var["RescuedChildren"]["bChildrenVanishEnd"] = false Var["RescuedChildren"]["ChildrenVanishStepSec"] = Var["CurSec"] + DelayTime["AfterChildrenRun"] end --------------------------------------------------------------------------------------------------------------------------------------------------- -- äÆà local CurChat = ChatInfo["RescuedChildren"] -- °¨¿ÁÀÌ ¿­¸®ÀÚ¸¶ÀÚ if CurChat["SequentialDialog"] ~= nil then if Var["RescuedChildren"]["bSequentialDialogEnd"] == false then local nCurDialogNo = Var["RescuedChildren"]["SequentialDialogStepNo"] if nCurDialogNo <= #CurChat["SequentialDialog"] then if Var["RescuedChildren"]["SequentialDialogStepSec"] <= Var["CurSec"] then cMobDialog( Var["MapIndex"], CurChat["SequentialDialog"][ nCurDialogNo ]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurChat["SequentialDialog"][ nCurDialogNo ]["Index"] ) Var["RescuedChildren"]["SequentialDialogStepNo"] = Var["RescuedChildren"]["SequentialDialogStepNo"] + 1 Var["RescuedChildren"]["SequentialDialogStepSec"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["RescuedChildren"]["bSequentialDialogEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["RescuedChildren"]["bSequentialDialogEnd"] = true end -- ¾ÆÀÌ ÇѸíÀÇ ¾Ö´Ï¸ÞÀ̼ÇÀÌ ½ÇÇàµÇ°í³ª¼­.. if CurChat["AfterAnimationChat"] ~= nil then if Var["RescuedChildren"]["bAfterAnimationChatEnd"] == false then local nCurDialogNo = Var["RescuedChildren"]["AfterAnimationChatStepNo"] if nCurDialogNo <= #CurChat["AfterAnimationChat"] then if Var["RescuedChildren"]["AfterAnimationChatStepSec"] <= Var["CurSec"] then local nHandle = Var["Friend"][ CurChat["AfterAnimationChat"][ nCurDialogNo ]["SpeakerIndex"] ] if nHandle == nil then ErrorLog( "RescuedChildren::Animation NPC Handle does not exist." ) else if nCurDialogNo == 1 then cAnimate( nHandle, "stop" ) end cMobChat( nHandle, ChatInfo["ScriptFileName"], CurChat["AfterAnimationChat"][ nCurDialogNo ]["Index"], true ) end Var["RescuedChildren"]["AfterAnimationChatStepNo"] = Var["RescuedChildren"]["AfterAnimationChatStepNo"] + 1 Var["RescuedChildren"]["AfterAnimationChatStepSec"] = Var["CurSec"] + DelayTime["GapChildrenChat"] end -- ÇØ´ç ÆäÀ̽ºÄÆ Å¸À̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return else -- ÆäÀ̽ºÄÆ Á¾·á Var["RescuedChildren"]["bAfterAnimationChatEnd"] = true end end else -- ÆäÀ̽ºÄÆ ÀÚü°¡ ¾øÀ» ¶§ Var["RescuedChildren"]["bAfterAnimationChatEnd"] = true end -- ¾ÆÀÌµé ´Þ¸®±â if NPC_RunTo ~= nil then if Var["RescuedChildren"]["bChildrenRunToExitEnd"] == false then if Var["RescuedChildren"]["ChildrenRunToExitStepSec"] <= Var["CurSec"] then for Index, RunInfo in pairs ( NPC_RunTo ) do if RunInfo ~= nil then if Var["Friend"][ RunInfo["ActorIndex"] ] ~= nil then if cRunTo( Var["Friend"][ RunInfo["ActorIndex"] ], RunInfo["x"], RunInfo["y"], 1000 ) == nil then ErrorLog( "RescuedChildren::"..RunInfo["ActorIndex"].."-cRunTo was failed." ) end else ErrorLog( "RescuedChildren::RunMode - "..RunInfo["ActorIndex"].." does not exist." ) end end end Var["RescuedChildren"]["bChildrenRunToExitEnd"] = true end -- ´Þ¸®±â ŸÀ̹ÖÀÌ µÉ ¶§±îÁö ´Ù¸¥±â´É ½ÇÇà ¾øÀÌ µô·¹ÀÌ °É±â return end else -- ´Þ¸®±â Á¤º¸°¡ ¾øÀ» ‹š Var["RescuedChildren"]["bChildrenRunToExitEnd"] = true end -- ¾ÆÀÌµé »ç¶óÁö±â(±Í°¡ÇÔ-_-;) if Var["RescuedChildren"]["bChildrenVanishEnd"] == false then if Var["RescuedChildren"]["ChildrenVanishStepSec"] <= Var["CurSec"] then for Index, ChildHandle in pairs ( Var["Friend"] ) do cNPCVanish( ChildHandle ) end Var["RescuedChildren"]["bChildrenVanishEnd"] = true end -- ±Í°¡ ŸÀ̹ÖÀÌ µÉ ¶§ ±îÁö ´ë±â return end -- ¾ÆÀ̵éÀÌ ´Ù »ç¶óÁö¸é Ãⱸ °ÔÀÌÆ®·Î ³ª°¥ ¼ö ÀÖÀ½ if Var["RescuedChildren"]["bChildrenVanishEnd"] == true then -- ÃⱸÂÊ Ãⱸ°ÔÀÌÆ® »ý¼º 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 Var["RescuedChildren"] = nil Var["Prison"] = nil Var["Friend"] = nil GoToNextStep( Var ) DebugLog( "RescuedChildren::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 = RescuedChildren, Name = "RescuedChildren", }, { 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