-------------------------------------------------------------------------------- -- Tower Of Iyzel Routine -- -------------------------------------------------------------------------------- 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 -- ù Ç÷¹À̾îÀÇ ¸Ê ·Î±×ÀΠüũ Var["bPlayerMapLogin"] = true end function ExitGateClick( NPCHandle, PlyHandle, RegistNumber ) cExecCheck "ExitGateClick" DebugLog( "ExitGateClick::Start" ) if NPCHandle == nil then ErrorLog( "ExitGateClick::NPCHandle == nil" ) return end if PlyHandle == nil then ErrorLog( "ExitGateClick::PlyHandle == nil" ) return end cLinkTo( PlyHandle, LinkInfo["ReturnMapOnGateClick"]["MapIndex"], LinkInfo["ReturnMapOnGateClick"]["x"], LinkInfo["ReturnMapOnGateClick"]["y"] ) DebugLog( "ExitGateClick::End" ) end function BossDamaged( MapIndex, AttackerHandle, MaxHP, CurHP, DefenderHandle ) cExecCheck "BossDamaged" if DefenderHandle == nil then ErrorLog( "BossDamaged::DefenderHandle == nil" ) return end if MapIndex == nil then ErrorLog( "BossDamaged::MapIndex == nil" ) return end if MaxHP == nil or CurHP == nil then ErrorLog( "BossDamaged::HP Info is nil" ) return end local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "BossDamaged::Var == nil" ) return end if Var["Enemy"] == nil then ErrorLog( "BossDamaged::Var[\"Enemy\"] == nil" ) return end if Var["Enemy"][ DefenderHandle ] == nil then ErrorLog( "BossDamaged::Var[\"Enemy\"]["..DefenderHandle.."] == nil" ) return end if Var["EachFloor"] == nil then ErrorLog( "BossDamaged::Var[\"EachFloor\"] == nil" ) return end -- ½ÃÀüÁß¿¡ ´ëÇÑ Á¤º¸¸¦ ÀúÀåÇÏ°í °øÀ¯Çϱâ À§ÇÔ if Var["EachFloor"]["Casting"] == nil then Var["EachFloor"]["Casting"] = {} end local HP_Rate = ( CurHP * 1000 ) / MaxHP -- ½ºÅ³º°·Î Çѹø ¾¿ Ž»ö for nIndex, sSkillName in pairs ( BossSkillNameTable ) do -- ¾øÀ»°æ¿ì ½ºÅ³ÆäÀÌÁî¼ø¹ø ÃʱâÈ­ if Var["EachFloor"][ sSkillName.."PhaseNo"] == nil then Var["EachFloor"][ sSkillName.."PhaseNo"] = 1 end -- ½ÇÁ¦ ½ºÅ³ ½ÃÀüÀ» À§ÇÑ Å×À̺íÀÌ ¾øÀ»°æ¿ì »ý¼º if Var["EachFloor"][ sSkillName ] == nil then Var["EachFloor"][ sSkillName ] = {} end -- ´Ü°èÀ̸§ ¹Þ¾Æ¿À±â local CurFloorNo = Var["EachFloor"]["StepNumber"] local CurFloor = StepNameTable[ CurFloorNo ] -- ½ºÅ³ ÆäÀÌÁî ¼ø¹ø local sThresholdTableIndex = sSkillName.."HP_"..CurFloor -- ex ) "SummonHP_Floor04 local nCurPhase = Var["EachFloor"][ sSkillName.."PhaseNo"] local nMaxPhase = #ThresholdTable[ sThresholdTableIndex ] if nCurPhase <= nMaxPhase then -- ÇöÀç HP¿Í ½ºÅ³ÀÇ Threshold ¿Í ºñ±³ÇÏ¿© ¼øÂ÷ÀûÀ¸·Î ¼Ò±Þ Àû¿ëÇÏ¿© ½ÃÀü while ThresholdTable[ sThresholdTableIndex ][ nCurPhase ] >= HP_Rate do -- ½ÃÀüÇÒ ½ºÅ³ÀÇ Å×ÀÌºí ³» À妽º ¹Þ¾Æ¿À±â local sCurSkillIndex = "HP"..ThresholdTable[ sThresholdTableIndex ][ nCurPhase ] -- ex) "HP800" local sBossSkillTableIndex = sSkillName.."_"..CurFloor -- ex) "Summon_Floor04" if BossSkill[ sBossSkillTableIndex ][ sCurSkillIndex ] ~= nil then -- ½ºÅ³À» ·çƾ¿¡¼­ ½ÃÀüÇϵµ·Ï ¼³Á¤ if Var["EachFloor"][ sSkillName ][ nCurPhase ] == nil then Var["EachFloor"][ sSkillName ][ nCurPhase ] = {} Var["EachFloor"][ sSkillName ][ nCurPhase ]["bCasting"] = true Var["EachFloor"][ sSkillName ][ nCurPhase ]["sSkillTableIndex"] = sCurSkillIndex DebugLog( "BossDamaged::SetSkillCasting-"..sSkillName.." "..sCurSkillIndex.." "..nCurPhase ) end end nCurPhase = nCurPhase + 1 if nCurPhase > nMaxPhase then break end end -- ½ºÅ³À» ½ÃÀüÇ϶ó°í ¼ø¼­´ë·Î ¼ÂÆÃÇØÁÖ´Â ·çÇÁ -- ¸Þ¸ð¸®ÀÇ ½ºÅ³ ÆäÀÌÁî ¼ø¹ø °ª °»½Å Var["EachFloor"][ sSkillName.."PhaseNo"] = nCurPhase end -- °¢ ½ºÅ³ÀÇ ¼ø¹øÀÌ ÃÊ°úÇß´ÂÁö È®ÀÎÇØÁÖ´Â Á¶°Ç¹® // end -- ½ºÅ³º°·Î Çѹø¾¿ Ž»öÇÏ´Â ·çÇÁ // end function BossRoutine( Handle, MapIndex ) cExecCheck "BossRoutine" if Handle == nil then ErrorLog( "BossRoutine::Handle == nil" ) return ReturnAI["END"] end if MapIndex == nil then ErrorLog( "BossRoutine::MapIndex == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "BossRoutine::Var == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- 0.2Ãʸ¶´Ù üũÇÏ´Â ·çƾ if Var["RoutineTime"][ Handle ] <= cCurrentSecond() then Var["RoutineTime"][ Handle ] = cCurrentSecond() + 0.2 else return ReturnAI["CPP"] end if Var["Enemy"] == nil then ErrorLog( "BossRoutine::Var[\"Enemy\"] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if Var["Enemy"][ Handle ] == nil then ErrorLog( "BossRoutine::Var[\"Enemy\"]["..Handle.."] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- Boss »ç¸Á if cIsObjectDead( Handle ) == 1 then DebugLog( "BossRoutine::BossDead" ) cMobSuicide( Var["MapIndex"] ) -- ½ºÅ³°ü·Ã ¸Þ¸ð¸® ÃʱâÈ­ for nIndex, sSkillName in pairs ( BossSkillNameTable ) do Var["EachFloor"][ sSkillName ] = nil Var["EachFloor"][ sSkillName.."PhaseNo"] = nil end cAIScriptSet( Handle ) Var["Enemy"][ Handle ] = nil return ReturnAI["END"] end if Var["EachFloor"] == nil then ErrorLog( "BossRoutine::Var[\"EachFloor\"] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- MobDamaged ·çƾ µî·Ï cAIScriptFunc( Handle, "MobDamaged", "BossDamaged" ) -- ½ºÅ³º°·Î Çѹø ¾¿ Ž»ö for nIndex, sSkillName in pairs ( BossSkillNameTable ) do -- ´ÙÀ½ ½ºÅ³ ¼ø¹ø°ú ÇØ´ç ½ºÅ³ ½ÃÀüÅ×À̺íÀÌ ¾ø´Ù¸é ¾ÆÁ÷ ½ÃÀüµµ ¾ÈµÈ °ÍÀ̹ǷΠÆнº if Var["EachFloor"][ sSkillName.."PhaseNo"] ~= nil and Var["EachFloor"][ sSkillName ] ~= nil then -- ½ÃÀü½ÂÀÎµÈ ½ºÅ³µé¸¸ ¼ø¼­´ë·Î ½ÃÀüÇؾßÇÔ. for i = 1, #Var["EachFloor"][ sSkillName ] do -- ¿¡·¯Ã¼Å© if Var["EachFloor"][ sSkillName ][ i ] == nil then break end -- ÁغñµÈ ½ºÅ³ ½ÃÀü if Var["EachFloor"][ sSkillName ][ i ]["bCasting"] == true then local sCurSkillTableIndex = Var["EachFloor"][ sSkillName ][ i ]["sSkillTableIndex"] -- ex) "HP800" -- ´Ü°èÀ̸§ ¹Þ¾Æ¿À±â local CurFloorNo = Var["EachFloor"]["StepNumber"] local CurFloor = StepNameTable[ CurFloorNo ] -- ½ºÅ³ Å×À̺í À妽º ¼³Á¤ local sBossSkillTableIndex = sSkillName.."_"..CurFloor -- ex) "Summon_Floor04" -- ½ºÅ³ Á¤º¸ °¡Á®¿À±â local CurSkillInfo = BossSkill[ sBossSkillTableIndex ][ sCurSkillTableIndex ] -- Àܸ÷ ¼Òȯ if sSkillName == "Summon" then DebugLog( "BossRoutine::StartSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) for i = 1, #CurSkillInfo["SummonMobs"] do cMobRegen_Obj( CurSkillInfo["SummonMobs"][ i ], Handle ) DebugLog( "BossRoutine::CastSkill-"..sSkillName.." "..sCurSkillTableIndex.." ("..i.."/"..#CurSkillInfo["SummonMobs"]..") :"..CurSkillInfo["SummonMobs"][ i ] ) end -- °æºñº´ÀÌ º¸½ºÀÇ ¼Òȯ ½ºÅ³À» °æ°íÇØÁÖ´Â ÆäÀ̽ºÄÆ if NPC_GuardChat["BossBattleDialog"][ CurFloor ] ~= nil then cMobDialog( Var["MapIndex"], NPC_GuardChat["SpeakerIndex"], NPC_GuardChat["ScriptFileName"], NPC_GuardChat["BossBattleDialog"][ CurFloor ][ i ]["Index"] ) else ErrorLog( "BossRoutine::There is no face-cut at This Floor" ) end -- ½ÃÀü ¿Ï·á ó¸® Var["EachFloor"][ sSkillName ][ i ]["bCasting"] = false DebugLog( "BossRoutine::EndSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) end -- ½ºÅ³ À̸§ °ü·Ã Á¶°Ç¹® // end -- ½ºÅ³ ½ÃÀüÀÌ Áغñ µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â Á¶°Ç¹® // end -- ÇÑ ½ºÅ³¿¡ ´ëÇÑ ¼øÂ÷Àû ½ÃÀü ·çÇÁ // end -- ½ºÅ³ ½ÃÀü ÀÚü¸¦ Çߴ°¡ È®ÀÎÇÏ´Â Á¶°Ç¹® // end -- °¢ ½ºÅ³À» Çѹø¾¿ Ž»öÇÏ´Â ·çÇÁ // return ReturnAI["CPP"] end