-------------------------------------------------------------------------------- -- Promote Job2_Gamb Progress Func -- -------------------------------------------------------------------------------- ------------------------------------------------------ -- InitDungeon : ÃʱâÈ­ÇÔ¼ö( µµ¾î, ·ê·¿, ÁÖ»çÀ§, npc ¸®Á¨ ) ------------------------------------------------------ function InitDungeon( Var ) cExecCheck "InitDungeon" -- DebugLog( "==========================InitDungeon_Start==========================" ) if Var == nil then ErrorLog("InitDungeon::Var == nil") return end -- Ç÷¹À̾îÀÇ Ã¹ ·Î±×ÀÎÀ» ±â´Ù¸°´Ù. if Var["PlayerHandle"] == INVALID_HANDEL then -- DebugLog("Ç÷¹ÀÌ¾î ·Î±×ÀÎ ´ë±â") if Var["InitialSec"] + WAIT_PLAYER_MAP_LOGIN_SEC_MAX <= cCurrentSecond() then ErrorLog("Ç÷¹ÀÌ¾î ¸Ê¿¡ ·Î±×ÀÎ ¾ÈÇÔ") Var["StepFunc"] = QuestFailed return end return end -- Door Regen for i = 1, #RegenInfo["Door"] do local CurRegenDoor = RegenInfo["Door"][i] local CurDoorHandle = cDoorBuild( Var["MapIndex"], CurRegenDoor["MobIndex"], CurRegenDoor["X"], CurRegenDoor["Y"], CurRegenDoor["Dir"], CurRegenDoor["Scale"] ) if CurDoorHandle == nil then GoToFail( Var, "InitDungeon::Door was not created. : " ) return end if Var["Door"]["Handle"] == nil then Var["Door"]["Handle"] = {} end cDoorAction( CurDoorHandle, CurRegenDoor["DoorBlock"], "close" ) Var["Door"]["Handle"][i] = CurDoorHandle end -- DebugLog( "¹® ¸®Á¨ ¿Ï·á") -- NPC Regen local RegenNPC = RegenInfo["NPC"] local NPCHandle = cMobRegen_XY( Var["MapIndex"], RegenNPC["MobIndex"], RegenNPC["X"], RegenNPC["Y"], RegenNPC["Dir"] ) if NPCHandle == nil then GoToFail( Var, "InitDungeon:: NPC Regen Fail" ) return end Var["NPC"]["Handle"] = NPCHandle -- DebugLog( "npc ¸®Á¨ ¿Ï·á" ) -- Roullet Regen local CurRoulette = RegenInfo["Roulette"] local RouletteHandle = cMobRegen_XY( Var["MapIndex"], CurRoulette["MobIndex"], CurRoulette["X"], CurRoulette["Y"], CurRoulette["Dir"] ) if RouletteHandle == nil then GoToFail( Var, "InitDungeon:: Roullet Regen Fail" ) return end cSetAIScript ( MainLuaScriptPath, RouletteHandle ) cAIScriptFunc ( RouletteHandle, "Entrance", "DummyRoutineFunc" ) cAIScriptFunc ( RouletteHandle, "NPCClick", "Roulette_Click" ) Var["Roulette"]["Handle"] = RouletteHandle -- DebugLog( "Roulette ¸®Á¨ ¿Ï·á" ) -- Dice Regen for i = 1, #RegenInfo["Dice"] do local CurRegenDice = RegenInfo["Dice"][i] local CurDiceHandle = cMobRegen_XY( Var["MapIndex"], CurRegenDice["MobIndex"], CurRegenDice["X"], CurRegenDice["Y"], CurRegenDice["Dir"] ) if CurDiceHandle == nil then GoToFail( Var, "InitDungeon:: Dice was not created. : "..i ) return end cSetAIScript ( MainLuaScriptPath, CurDiceHandle ) cAIScriptFunc ( CurDiceHandle, "Entrance", "DummyRoutineFunc" ) cAIScriptFunc ( CurDiceHandle, "NPCClick", "Dice_Click" ) if Var["Dice"]["Handle"] == nil then Var["Dice"]["Handle"] = {} end Var["Dice"]["Handle"][i] = CurDiceHandle end -- DebugLog( "Dice ¸®Á¨ ¿Ï·á" ) -- ¸®Á¨¿Ï·á ÈÄ ´ÙÀ½´Ü°è ¼³Á¤ Var["StepFunc"] = WelcomeGamble Var["InitDungeon"] = nil end ------------------------------------------------------ -- WelcomeGamble : Á¶Ä¿ ȯ¿µÀλç ------------------------------------------------------ function WelcomeGamble( Var ) cExecCheck "WelcomeGamble" -- DebugLog( "==========================WelcomeGamble_Start==========================" ) if Var == nil then ErrorLog( "WelcomeGamble : Var nil" ) return end -- WelcomeGamble ÃʱâÈ­ local WelcomeGambleInfo = Var["WelcomeGamble"] if WelcomeGambleInfo == nil then -- DebugLog("WelcomeGamble :: ÃʱâÈ­") Var["WelcomeGamble"] = {} WelcomeGambleInfo = Var["WelcomeGamble"] WelcomeGambleInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["WelcomeGamble"] ) + DelayTime["WaitSeconds"] WelcomeGambleInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] WelcomeGambleInfo["DialogStep"] = 1 end if WelcomeGambleInfo["DialogTime"] ~= nil then -- DebugLog("WelcomeGamble :: ´ëÈ­¼³Á¤") if WelcomeGambleInfo["DialogTime"] > Var["CurSec"] then return end local CurMsg = ChatInfo["WelcomeGamble"] local DialogStep = WelcomeGambleInfo["DialogStep"] local MaxDialogStep = #ChatInfo["WelcomeGamble"] if DialogStep <= MaxDialogStep then cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] ) WelcomeGambleInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] WelcomeGambleInfo["DialogStep"] = DialogStep + 1 end if WelcomeGambleInfo["DialogStep"] > MaxDialogStep then WelcomeGambleInfo["DialogTime"] = nil WelcomeGambleInfo["DialogStep"] = nil end end if WelcomeGambleInfo["NextStepWaitTime"] > Var["CurSec"] then return end -- ŸÀÌ¸Ó ¼³Á¤ if Var["LimitTime"] == 0 then Var["LimitTime"] = Var["CurSec"] + DelayTime["LimitTime"] cTimer( Var["MapIndex"], DelayTime["LimitTime"] ) end -- DebugLog( "LimitTime"..Var["LimitTime"] ) -- DebugLog("´ÙÀ½´Ü°è·Î À̵¿") Var["StepFunc"] = HowToRouletteGame Var["WelcomeGamble"] = nil end ------------------------------------------------------ -- HowToRouletteGame : ·ê·¿°ÔÀÓ ±ÔÄ¢ ´ë»çó¸®, °ü·ÃµÈ º¯¼öµé ÃʱâÈ­ ------------------------------------------------------ function HowToRouletteGame( Var ) cExecCheck "HowToRouletteGame" -- DebugLog("==========================HowToRouletteGame_Start==========================") if Var == nil then ErrorLog( "PlayRouletteGame : Var nil" ) return end -- ½ÇÆÐÁ¶°Ç¿¡ ÇØ´çÇÏ´ÂÁö üũ if IsFail( Var ) == true then return end local PlayRouletteGameInfo = Var["PlayRouletteGame"] if PlayRouletteGameInfo == nil then Var["PlayRouletteGame"] = {} PlayRouletteGameInfo = Var["PlayRouletteGame"] PlayRouletteGameInfo["RouletteHandle"] = nil PlayRouletteGameInfo["SelectedDiceHandle"] = nil PlayRouletteGameInfo["SelectedDiceNum"] = nil PlayRouletteGameInfo["ReadyToGame"] = false PlayRouletteGameInfo["AnswerDiceNum"] = nil PlayRouletteGameInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] end -- ´ë»ç ÇÒ ½Ã°£ ¾ÆÁ÷ ¾È µÆÀ¸¸é return, ½Ã°£ µÆÀ¸¸é ´ë»çó¸® if PlayRouletteGameInfo["DialogTime"] ~= nil then if PlayRouletteGameInfo["DialogTime"] > Var["CurSec"] then return end cMobDialog( Var["MapIndex"], ChatInfo["PlayRouletteGame"]["Roulette1"]["SpeakerIndex"], ChatInfo["ScriptFileName"], ChatInfo["PlayRouletteGame"]["Roulette1"]["MsgIndex"] ) PlayRouletteGameInfo["DialogTime"] = nil Var["StepFunc"] = PlayRouletteGame end end ------------------------------------------------------ -- PlayRouletteGame : À¯Àú°¡ ÁÖ»çÀ§, ·ê·¿ ÅÃÇÏ´Â ´Ü°è ------------------------------------------------------ function PlayRouletteGame( Var ) cExecCheck "PlayRouletteGame" -- DebugLog("==========================PlayRouletteGame_Start==========================") if Var == nil then ErrorLog( "PlayRouletteGame : Var nil" ) return end -- ½ÇÆÐÁ¶°Ç¿¡ ÇØ´çÇÏ´ÂÁö üũ if IsFail( Var ) == true then return end -- ÃʱâÈ­ local PlayRouletteGameInfo = Var["PlayRouletteGame"] if PlayRouletteGameInfo == nil then ErrorLog( "PlayRouletteGame : PlayRouletteGameInfo nil" ) return end -- ·ê·¿ µ¹¸± Áغñ X : return / ·ê·¿ µ¹¸± Áغñ O : ·ê·¿µµ ÁÖ»çÀ§ ¼±ÅÃÇϱâÀ§ÇØ SetAnswerDice() È£Ãâ if PlayRouletteGameInfo["ReadyToGame"] == true then SetAnswerDice( Var ) local AnswerDiceNumber = PlayRouletteGameInfo["AnswerDiceNum"] if AnswerDiceNumber == nil then ErrorLog( "PlayRouletteGame::AnswerDiceNumber == nil" ); return end Var["StepFunc"] = ResultRouletteGame else return end end ------------------------------------------------------ -- ResultRouletteGame : ·ê·¿°ÔÀÓ °á°ú ó¸®( ·ê·¿, ÁÖ»çÀ§ ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® ¹× À¯Àú¼±Åà ÁÖ»çÀ§¿Í, ·ê·¿¼±Åà ÁÖ»çÀ§¸¦ ºñ±³, ±×¿¡ µû¸¥ ó¸® ) ------------------------------------------------------ function ResultRouletteGame( Var ) cExecCheck "ResultRouletteGame" -- DebugLog("==========================ResultRouletteGame_Start==========================") if Var == nil then ErrorLog( "ResultRouletteGame : Var nil" ) return end if IsFail( Var ) == true then return end local PlayRouletteGameInfo = Var["PlayRouletteGame"] if PlayRouletteGameInfo == nil then ErrorLog( "ResultRouletteGame : PlayRouletteGameInfo nil" ) return end -- ÃʱâÈ­ local ResultRouletteGameInfo = Var["ResultRouletteGame"] if ResultRouletteGameInfo == nil then Var["ResultRouletteGame"] = {} ResultRouletteGameInfo = Var["ResultRouletteGame"] ResultRouletteGameInfo["AniStartTime"] = Var["CurSec"] ResultRouletteGameInfo["NextStepWaitTime"] = Var["CurSec"] + DelayTime["WaitBeforeWinOrLose"] local AnswerDiceNumber = PlayRouletteGameInfo["AnswerDiceNum"] -- Á¶Ä¿ ´ë»ç ó¸®( Çà¿îÀ» ºôÁö.. ) cMobDialog( Var["MapIndex"], ChatInfo["PlayRouletteGame"]["Luck"]["SpeakerIndex"], ChatInfo["ScriptFileName"], ChatInfo["PlayRouletteGame"]["Luck"]["MsgIndex"] ) -- ·ê·¿ ¾Ö´Ï¸ÞÀÌ¼Ç ½ÃÀÛ cAnimate( PlayRouletteGameInfo["RouletteHandle"], "start", AnimationInfo["Roulette"][AnswerDiceNumber] ) -- ÁÖ»çÀ§ ¾Ö´Ï¸ÞÀ̼Ç( ¼±ÅÃÇÏÁö ¾ÊÀº ÁÖ»çÀ§µé¸¸ Animove¾Ö´Ï¸ÞÀÌ¼Ç Àç»ý ) for i =1, #Var["Dice"]["Handle"] do if Var["Dice"]["Handle"][i] ~= PlayRouletteGameInfo["SelectedDiceHandle"] then cAnimate( Var["Dice"]["Handle"][i], "start", AnimationInfo["Dice"]["AniMove"] ) end end -- ·ê·¿ ½ÃÀÛ ÀÌÆåÆ® cEffectRegen_Object ( Var["MapIndex"], EffectInfo["Roullete_start"]["FileName"], PlayRouletteGameInfo["RouletteHandle"], EffectInfo["Roullete_start"]["PlayTime"] ) end -- ´ÙÀ½´Ü°è ÁøÇàÇÒ ½Ã°£ÀÎÁö È®ÀÎ if ResultRouletteGameInfo["NextStepWaitTime"] > Var["CurSec"] then return end cAnimate( PlayRouletteGameInfo["RouletteHandle"], "stop" ) for i =1, #Var["Dice"]["Handle"] do if Var["Dice"]["Handle"][i] ~= PlayRouletteGameInfo["SelectedDiceHandle"] then cAnimate( Var["Dice"]["Handle"][i], "start", AnimationInfo["Dice"]["AniOff"] ) end end -- À¯Àú°¡ ¼±ÅÃÇÑ ÁÖ»çÀ§¿Í, ·ê·¿ÀÌ ¼±ÅÃÇÑ ÁÖ»çÀ§°¡ °°´Ù¸é if PlayRouletteGameInfo["SelectedDiceNum"] == PlayRouletteGameInfo["AnswerDiceNum"] then -- DebugLog("·ê·¿ ¸ÂÃ߱⠼º°ø") cEffectRegen_Object ( Var["MapIndex"], EffectInfo["Roullete_Match_Success"]["FileName"], PlayRouletteGameInfo["RouletteHandle"], EffectInfo["Roullete_Match_Success"]["PlayTime"] ) Var["StepFunc"] = WinRouletteGame -- À¯Àú°¡ ¼±ÅÃÇÑ ÁÖ»çÀ§¿Í, ·ê·¿ÀÌ ¼±ÅÃÇÑ ÁÖ»çÀ§°¡ ´Ù¸£´Ù¸é else -- DebugLog("·ê·¿ ¸ÂÃ߱⠽ÇÆÐ") cEffectRegen_Object ( Var["MapIndex"], EffectInfo["Roullete_Match_Fail"]["FileName"], PlayRouletteGameInfo["RouletteHandle"], EffectInfo["Roullete_Match_Fail"]["PlayTime"] ) Var["StepFunc"] = LoseRouletteGame end end ------------------------------------------------------ -- LoseRouletteGame : ·ê·¿°ÔÀÓ ½ÇÆнà ------------------------------------------------------ function LoseRouletteGame( Var ) cExecCheck "LoseRouletteGame" -- DebugLog("==========================LoseRouletteGame_Start==========================") if Var == nil then ErrorLog( "LoseRouletteGame : Var nil" ) return end -- ½ÇÆÐÁ¶°Ç¿¡ ÇØ´çÇÏ´ÂÁö üũ if IsFail( Var ) == true then return end local LoseRouletteGameInfo = Var["LoseRouletteGame"] if LoseRouletteGameInfo == nil then Var["LoseRouletteGame"] = {} LoseRouletteGameInfo = Var["LoseRouletteGame"] -- ·ê·¿ °ÔÀÓ È½¼ö 1 Áõ°¡ Var["RouletteCount"] = Var["RouletteCount"] + 1 LoseRouletteGameInfo["WaitMobRegen"] = Var["CurSec"] + DelayTime["WaitMobRegen"] -- ·ê·¿ÀÌ ¼±ÅÃÇÑ ÁÖ»çÀ§¿¡ µû¶ó ¸®Á¨µÉ ¸÷±×·ìÀÌ °áÁ¤ local MobRegenNum = Var["PlayRouletteGame"]["AnswerDiceNum"] for i = 1, #RegenInfo["Mob"][MobRegenNum] do if cGroupRegenInstance( Var["MapIndex"], RegenInfo["Mob"][MobRegenNum][i]) == nil then ErrorLog("LoseRouletteGame : ¸÷±×·ì ¸®Á¨½ÇÆÐ _ "..RegenInfo["Mob"][MobRegenNum][i]) end end end -- ¸÷ ¸®Á¨½Ã°£¸¸Å­ ±â´Ù¸° ÈÄ, ¸Ê¿¡ ÀÖ´Â ¸÷ÀÇ ¼ö Ä«¿îÆ®, ¸÷À» ¸ðµÎ Á×ÀÎ ÈÄ ´ÙÀ½´Ü°èÁøÇà°¡´É if LoseRouletteGameInfo["WaitMobRegen"] < Var["CurSec"] then if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) <= 0 then DiceLightOff( Var ) Var["LoseRouletteGame"] = nil Var["PlayRouletteGame"] = nil Var["ResultRouletteGame"] = nil Var["StepFunc"] = HowToRouletteGame end end end ------------------------------------------------------ -- WinRouletteGame : ·ê·¿°ÔÀÓ ¼º°ø½Ã ------------------------------------------------------ function WinRouletteGame( Var ) cExecCheck "WinRouletteGame" -- DebugLog("==========================WinRouletteGame_Start==========================") if Var == nil then ErrorLog( "WinRouletteGame : Var nil" ) return end if IsFail( Var ) == true then return end local WinRouletteGameInfo = Var["WinRouletteGame"] if WinRouletteGameInfo == nil then Var["WinRouletteGame"] = {} WinRouletteGameInfo = Var["WinRouletteGame"] WinRouletteGameInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] WinRouletteGameInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["Roulette_Result"] ) + DelayTime["WaitSeconds"] end -- ´ë»ç ÇÒ ½Ã°£ ¾ÆÁ÷ ¾È µÆÀ¸¸é return, ½Ã°£ µÆÀ¸¸é ´ë»çó¸® if WinRouletteGameInfo["DialogTime"] ~= nil then if WinRouletteGameInfo["DialogTime"] > Var["CurSec"] then return end cMobDialog( Var["MapIndex"], ChatInfo["Roulette_Result"]["PlayerWin"]["SpeakerIndex"], ChatInfo["ScriptFileName"], ChatInfo["Roulette_Result"]["PlayerWin"]["MsgIndex"] ) WinRouletteGameInfo["DialogTime"] = nil end if WinRouletteGameInfo["NextStepWaitTime"] > Var["CurSec"] then return else Var["WinRouletteGame"] = nil Var["PlayRouletteGame"] = nil Var["ResultRouletteGame"] = nil Var["StepFunc"] = BeforeBossBattle end end ------------------------------------------------------ -- BeforeBossBattle : À¯Àú°¡ ƯÁ¤¿µ¿ªÀ¸·Î ¿À±â¸¦ ±â´Ù¸®´Â ÇÔ¼ö ------------------------------------------------------ function BeforeBossBattle( Var ) cExecCheck "BeforeBossBattle" -- DebugLog("==========================BeforeBossBattle_Start==========================") if Var == nil then ErrorLog( "BeforeBossBattle : Var nil" ) return end -- ½ÇÆÐÁ¶°Ç¿¡ ÇØ´çÇÏ´ÂÁö üũ if IsFail( Var ) == true then return end local BeforeBossBattleInfo = Var["BeforeBossBattle"] if BeforeBossBattleInfo == nil then Var["BeforeBossBattle"] = {} BeforeBossBattleInfo = Var["BeforeBossBattle"] BeforeBossBattleInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] BeforeBossBattleInfo["CameraTime"] = Var["CurSec"] + CameraMoveInfo["KeepTime"] BeforeBossBattleInfo["bDoorOpen"] = false -- º¸½º¹æ µµ¾î ¿ÀÇ for i=1, #Var["Door"]["Handle"] do cDoorAction( Var["Door"]["Handle"][i], RegenInfo["Door"][i]["DoorBlock"], "open" ) end end -- Ä«¸Þ¶ó ¹«ºê ó¸® if BeforeBossBattleInfo["CameraTime"] ~= nil then if BeforeBossBattleInfo["bDoorOpen"] == false then local CurDoor = RegenInfo["Door"][1] if CurDoor == nil then ErrorLog( "BeforeBossBattleInfo:: RegenInfo[\"Door\"][1] nil" ) end cSetAbstate( Var["PlayerHandle"], CameraMoveInfo["AbstateIndex"], 1, CameraMoveInfo["AbstateTime"] ) cCameraMove( Var["MapIndex"], CurDoor["X"], CurDoor["Y"], ( CurDoor["Dir"] + 180 ) * (-1), CameraMoveInfo["AngleY"], CameraMoveInfo["Distance"], 1 ) -- º¸½º¹æ µµ¾î ¿ÀÇ for i=1, #Var["Door"]["Handle"] do cDoorAction( Var["Door"]["Handle"][i], RegenInfo["Door"][i]["DoorBlock"], "open" ) end BeforeBossBattleInfo["bDoorOpen"] = true end if BeforeBossBattleInfo["bDoorOpen"] == true then -- ¹«ºù ¸¶Ä¡´Â ½Ã°£¿¡, ´Ù½Ã ¿ø·¡ Ä«¸Þ¶ó °¢µµ·Î º¸³»ÁÜ if BeforeBossBattleInfo["CameraTime"] > Var["CurSec"] then return else cCameraMove( Var["MapIndex"], 0, 0, 0, 0, 0, 0 ) cResetAbstate( Var["PlayerHandle"], CameraMoveInfo["AbstateIndex"] ) BeforeBossBattleInfo["CameraTime"] = nil end end end -- Á¶Ä¿ ´ë»ç ó¸® if BeforeBossBattleInfo["DialogTime"] ~= nil then if BeforeBossBattleInfo["DialogTime"] > Var["CurSec"] then return else cMobDialog( Var["MapIndex"], ChatInfo["BeforeBossBattle"]["Reward"]["SpeakerIndex"], ChatInfo["ScriptFileName"], ChatInfo["BeforeBossBattle"]["Reward"]["MsgIndex"] ) BeforeBossBattleInfo["DialogTime"] = nil end end -- ÇØ´ç ¿µ¿ª¾È¿¡ Ç÷¹ÀÌ¾î ¾ÆÁ÷ ¾Èµé¾î¿ÔÀ¸¸é return / µé¾î¿À¸é BossBattleÇÔ¼ö ½ÇÇà if cGetAreaObject( Var["MapIndex"], AreaInfo["ToBossRoom"], Var["PlayerHandle"] ) == nil then return else -- DebugLog("BeforeBossBattle : ¿µ¿ª¾È¿¡ µé¾î¿È") Var["StepFunc"] = BossBattle Var["BeforeBossBattle"] = nil end end ------------------------------------------------------ -- BossBattle : ¸¶Áö¸· ¹æÀ¸·Î µé¾î°¬À»¶§ ------------------------------------------------------ function BossBattle( Var ) cExecCheck "BossBattle" -- DebugLog("==========================BossBattle Start==========================") if Var == nil then ErrorLog( "BossBattle : Var nil" ) return end if IsFail( Var ) == true then return end local BossBattleInfo = Var["BossBattle"] if BossBattleInfo == nil then Var["BossBattle"] = {} BossBattleInfo = Var["BossBattle"] BossBattleInfo["DialogTime"] = Var["CurSec"] BossBattleInfo["BossMob"] = nil for i=1, #Var["Door"]["Handle"] do cDoorAction( Var["Door"]["Handle"][i], RegenInfo["Door"][i]["DoorBlock"], "close" ) end end if BossBattleInfo["DialogTime"] ~= nil then if BossBattleInfo["DialogTime"] > Var["CurSec"] then return else cMobDialog( Var["MapIndex"], ChatInfo["BossBattle"]["Betray"]["SpeakerIndex"], ChatInfo["ScriptFileName"], ChatInfo["BossBattle"]["Betray"]["MsgIndex"] ) BossBattleInfo["DialogTime"] = nil end end -- º¸½º¸÷ ¸®Á¨ if BossBattleInfo["BossMob"] == nil then -- DebugLog("º¸½º¸÷ ¸®Á¨") local CurBossMob = RegenInfo["BossMob"] local BossMobHandle if CurBossMob == nil then ErrorLog( "BossBattle:: RegenInfo[\"BossMob\"] nil" ) end -- npc´Â »èÁ¦ cNPCVanish( Var["NPC"]["Handle"] ) BossMobHandle = cMobRegen_XY( Var["MapIndex"], CurBossMob["MobIndex"], CurBossMob["X"], CurBossMob["Y"], CurBossMob["Dir"] ) if BossMobHandle == nil then ErrorLog( "BossBattle:: BossMob Regen Fail" ) return end BossBattleInfo["BossMob"] = {} BossBattleInfo["BossMob"]["Handle"] = BossMobHandle BossBattleInfo["BossMob"]["WaitTime"] = Var["CurSec"] + DelayTime["WaitMobRegen"] end -- ¸÷¸®Á¨ ½Ã°£¸¸Å­ ÃæºÐÈ÷ ±â´Ù¸°ÈÄ, ¸÷ÀÌ Á×¾ú´ÂÁö È®ÀÎ if BossBattleInfo["BossMob"]["WaitTime"] >= Var["CurSec"] then return else if BossBattleInfo["BossMob"]["WaitTime"] < Var["CurSec"] then if cObjectCount( Var["MapIndex"], ObjectType["Mob"] ) <= 0 then if cDropItem( RegenInfo["RewardDropItem"]["Index"], Var["BossBattle"]["BossMob"]["Handle"], -1, RegenInfo["RewardDropItem"]["DropRate"] ) == nil then ErrorLog("BossBattle :: ItemDrop½ÇÆÐ") end Var["StepFunc"] = QuestSuccess Var["BossBattle"] = nil end end end end ------------------------------------------------------ -- QuestSuccess : Äù½ºÆ® ¼º°ø½Ã ------------------------------------------------------ function QuestSuccess( Var ) cExecCheck "QuestSuccess" -- DebugLog("==========================QuestSuccess_Start==========================") if Var == nil then ErrorLog( "QuestSuccess : Var nil" ) return end local QuestSuccessInfo = Var["QuestSuccess"] if QuestSuccessInfo == nil then Var["QuestSuccess"] = {} QuestSuccessInfo = Var["QuestSuccess"] QuestSuccessInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["QuestSuccess"] ) + DelayTime["WaitSeconds"] QuestSuccessInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] QuestSuccessInfo["DialogStep"] = 1 -- ¸Ê¿¡ ÀÖ´Â Job2_CloverT, Job2_DiaT¸¦ Á¦°Å VanishMob( Var ) cEffectMsg( Var["PlayerHandle"], EFFECT_MSG_TYPE["EMT_SUCCESS"] ) --ŸÀÌ¸Ó »èÁ¦ Var["LimitTime"] = "NoLimit" cTimer( Var["MapIndex"], 0 ) end if IsFail( Var ) == true then return end -- ´ë»ç ó¸® if QuestSuccessInfo["DialogTime"] ~= nil then if QuestSuccessInfo["DialogTime"] > Var["CurSec"] then return else local CurMsg = ChatInfo["QuestSuccess"] local DialogStep = QuestSuccessInfo["DialogStep"] local MaxDialogStep = #ChatInfo["QuestSuccess"] if DialogStep <= MaxDialogStep then cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] ) QuestSuccessInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"] QuestSuccessInfo["DialogStep"] = DialogStep + 1 end if QuestSuccessInfo["DialogStep"] > MaxDialogStep then QuestSuccessInfo["DialogTime"] = nil QuestSuccessInfo["DialogStep"] = nil end end end if QuestSuccessInfo["NextStepWaitTime"] > Var["CurSec"] then return else -- DebugLog( "ReturnToHome ´Ü°è·Î À̵¿" ) Var["StepFunc"] = ReturnToHome Var["QuestSuccess"] = nil end end ------------------------------------------------------ -- QuestFailed : Äù½ºÆ® ½ÇÆнà ------------------------------------------------------ function QuestFailed( Var ) cExecCheck "QuestFailed" -- DebugLog("==========================QuestFailed_Start==========================") if Var == nil then ErrorLog( "QuestFailed : Var nil" ) return end local QuestFailedInfo = Var["QuestFailed"] if QuestFailedInfo == nil then Var["QuestFailed"] = {} QuestFailedInfo = Var["QuestFailed"] QuestFailedInfo["NextStepWaitTime"] = Var["CurSec"] + DelayTime["WaitSeconds"] -- ¸Ê¿¡ ÀÖ´Â Job2_CloverT, Job2_DiaT¸¦ Á¦°Å VanishMob( Var ) cEffectMsg( Var["PlayerHandle"], EFFECT_MSG_TYPE["EMT_FAIL"] ) --ŸÀÌ¸Ó »èÁ¦ Var["LimitTime"] = "NoLimit" cTimer( Var["MapIndex"], 0 ) end if QuestFailedInfo["NextStepWaitTime"] > Var["CurSec"] then -- DebugLog("QuestFailedInfo _ ´ë±âÁß") return else Var["StepFunc"] = ReturnToHome Var["QuestFailed"] = nil end end ------------------------------------------------------ -- ReturnToHome : ±Íȯ ------------------------------------------------------ function ReturnToHome( Var ) cExecCheck "ReturnToHome" -- DebugLog("==========================ReturnToHome_Start==========================") if Var == nil then ErrorLog( "ReturnToHome : Var nil" ) return end local ReturnToHomeInfo = Var["ReturnToHome"] if ReturnToHomeInfo == nil then Var["ReturnToHome"] = {} ReturnToHomeInfo = Var["ReturnToHome"] ReturnToHomeInfo["ReturnStepSec"] = Var["CurSec"] ReturnToHomeInfo["ReturnStepNo"] = 1 ReturnToHomeInfo["WaitSecReturnToHome"] = Var["CurSec"] + DelayTime["WaitReturnToHome"] end if ReturnToHomeInfo["WaitSecReturnToHome"] > Var["CurSec"] then -- DebugLog( "ÁýÀ¸·Î µ¹¾Æ°¡±â ´ë±â.." ) return end -- Return : return notice substep if ReturnToHomeInfo["ReturnStepNo"] <= #NoticeInfo["IDReturn"] then if ReturnToHomeInfo["ReturnStepSec"] < Var["CurSec"] then -- Notice of Escape if NoticeInfo["IDReturn"][ ReturnToHomeInfo["ReturnStepNo"] ]["Index"] ~= nil then cNotice( Var["MapIndex"], NoticeInfo["ScriptFileName"], NoticeInfo["IDReturn"][ ReturnToHomeInfo["ReturnStepNo"] ]["Index"] ) end -- Go To Next Notice ReturnToHomeInfo["ReturnStepNo"] = Var["ReturnToHome"]["ReturnStepNo"] + 1 ReturnToHomeInfo["ReturnStepSec"] = Var["CurSec"] + DelayTime["GapReturnNotice"] end return end -- Return : linkto substep if ReturnToHomeInfo["ReturnStepNo"] > #NoticeInfo["IDReturn"] then -- DebugLog( "¸ðµç ´ë»ç ¿Ï·á!" ) if ReturnToHomeInfo["ReturnStepSec"] <= Var["CurSec"] then -- DebugLog( "ÀÌÁ¦ÁøÂ¥¶°³¯½Ã°£" ) cLinkToAll( Var["MapIndex"], LinkInfo["ReturnMap"]["MapIndex"], LinkInfo["ReturnMap"]["X"], LinkInfo["ReturnMap"]["Y"] ) cVanishAll( Var["MapIndex"] ) --Var["StepFunc"] = TheEnd Var["StepFunc"] = DummyFunc Var["ReturnToHome"] = nil -- 2014.12.23 Ãß°¡ÀÛ¾÷ cDropFilm( Var["MapIndex"], MainLuaScriptPath ) -- DebugLog( "End ReturnToHome" ) -- DebugLog("==========================TheEnd==========================") end return end end