-------------------------------------------------------------------------------- -- Mini Dragon (Hard Mode) 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 -- ½Ã°£ ¼³Á¤ÀÌ ¾ÆÁ÷ µÇÁö ¾ÊÀº °æ¿ì¿¡´Â ¾Æ¹«°Íµµ ½ÇÇàÇÏÁö ¾Ê´Â´Ù. if Var["KQLimitTime"] == nil then return end if Var["CurSec"] == nil then return end -- ÇöÀç ½Ã°£ ±âÁØÀ¸·Î Á¦Çѽð£À» ¹Þ¾Æ¼­ ¿äûÇÑ´Ù. local nLimitSec = Var["KQLimitTime"] - Var["CurSec"] cShowKQTimerWithLife_Obj( Handle, nLimitSec ) end function MidBossRoutine( Handle, MapIndex ) cExecCheck "MidBossRoutine" if Handle == nil then ErrorLog( "MidBossRoutine::Handle == nil" ) return ReturnAI["END"] end if MapIndex == nil then ErrorLog( "MidBossRoutine::MapIndex == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "MidBossRoutine::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( "MidBossRoutine::Var[\"Enemy\"] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if Var["Enemy"][ Handle ] == nil then ErrorLog( "MidBossRoutine::Var[\"Enemy\"]["..Handle.."] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- Mid Boss »ç¸Á if cIsObjectDead( Handle ) == 1 then cAIScriptSet( Handle ) Var["Enemy"][ Handle ] = nil return ReturnAI["END"] end return ReturnAI["CPP"] 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["BossBattle"] == nil then ErrorLog( "BossDamaged::Var[\"BossBattle\"] == nil" ) return end -- ½ÃÀüÁß¿¡ ´ëÇÑ Á¤º¸¸¦ ÀúÀåÇÏ°í °øÀ¯Çϱâ À§ÇÔ if Var["BossBattle"]["Casting"] == nil then Var["BossBattle"]["Casting"] = {} end local HP_Rate = ( CurHP * 1000 ) / MaxHP -- ½ºÅ³º°·Î Çѹø ¾¿ Ž»ö for nIndex, sSkillName in pairs ( BossSkillNameTable ) do -- ¾øÀ»°æ¿ì ½ºÅ³ÆäÀÌÁî¼ø¹ø ÃʱâÈ­ if Var["BossBattle"][ sSkillName.."PhaseNo"] == nil then Var["BossBattle"][ sSkillName.."PhaseNo"] = 1 end -- ½ÇÁ¦ ½ºÅ³ ½ÃÀüÀ» À§ÇÑ Å×À̺íÀÌ ¾øÀ»°æ¿ì »ý¼º if Var["BossBattle"][ sSkillName ] == nil then Var["BossBattle"][ sSkillName ] = {} end -- ½ºÅ³ ÆäÀÌÁî ¼ø¹ø local nCurPhase = Var["BossBattle"][ sSkillName.."PhaseNo"] local nMaxPhase = #ThresholdTable[ sSkillName.."HP"] if nCurPhase <= nMaxPhase then -- ÇöÀç HP¿Í ½ºÅ³ÀÇ Threshold ¿Í ºñ±³ÇÏ¿© ¼øÂ÷ÀûÀ¸·Î ¼Ò±Þ Àû¿ëÇÏ¿© ½ÃÀü while ThresholdTable[ sSkillName.."HP"][ nCurPhase ] >= HP_Rate do -- ½ÃÀüÇÒ ½ºÅ³ÀÇ Å×ÀÌºí ³» À妽º ¹Þ¾Æ¿À±â local sCurSkillIndex = "HP"..ThresholdTable[ sSkillName.."HP"][ nCurPhase ] if BossSkill[ sSkillName ][ sCurSkillIndex ] ~= nil then -- ½ºÅ³À» ·çƾ¿¡¼­ ½ÃÀüÇϵµ·Ï ¼³Á¤ if Var["BossBattle"][ sSkillName ][ nCurPhase ] == nil then Var["BossBattle"][ sSkillName ][ nCurPhase ] = {} Var["BossBattle"][ sSkillName ][ nCurPhase ]["bCasting"] = true Var["BossBattle"][ sSkillName ][ nCurPhase ]["sSkillTableIndex"] = sCurSkillIndex DebugLog( "BossDamaged::SetSkillCasting-"..sSkillName.." "..sCurSkillIndex.." "..nCurPhase ) end end nCurPhase = nCurPhase + 1 if nCurPhase > nMaxPhase then break end end -- ½ºÅ³À» ½ÃÀüÇ϶ó°í ¼ø¼­´ë·Î ¼ÂÆÃÇØÁÖ´Â ·çÇÁ -- ¸Þ¸ð¸®ÀÇ ½ºÅ³ ÆäÀÌÁî ¼ø¹ø °ª °»½Å Var["BossBattle"][ sSkillName.."PhaseNo"] = nCurPhase end -- °¢ ½ºÅ³ÀÇ ¼ø¹øÀÌ ÃÊ°úÇß´ÂÁö È®ÀÎÇØÁÖ´Â Á¶°Ç¹® // end -- ½ºÅ³º°·Î Çѹø¾¿ Ž»öÇÏ´Â ·çÇÁ // end function MiniDragonRoutine( Handle, MapIndex ) cExecCheck "MiniDragonRoutine" if Handle == nil then ErrorLog( "MiniDragonRoutine::Handle == nil" ) return ReturnAI["END"] end if MapIndex == nil then ErrorLog( "MiniDragonRoutine::MapIndex == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "MiniDragonRoutine::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( "MiniDragonRoutine::Var[\"Enemy\"] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if Var["Enemy"][ Handle ] == nil then ErrorLog( "MiniDragonRoutine::Var[\"Enemy\"]["..Handle.."] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- Mini Dragon »ç¸Á if cIsObjectDead( Handle ) == 1 then DebugLog( "MiniDragonRoutine::BossDead" ) cAIScriptSet( Handle ) Var["Enemy"][ Handle ] = nil return ReturnAI["END"] end if Var["BossBattle"] == nil then ErrorLog( "MiniDragonRoutine::Var[\"BossBattle\"] == nil" ) cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- ÃÖÃÊ Å¸°Ù ¼³Á¤½Ã DetectRange º¯°æ if Var["BossBattle"]["BossInitialTargetHandle"] == nil then Var["BossBattle"]["BossInitialTargetHandle"] = cTargetHandle( Handle ) if Var["BossBattle"]["BossInitialTargetHandle"] ~= nil then cMobDetectRange( Handle, BossDetectRange["View"] ) end end -- MobDamaged ·çƾ µî·Ï cAIScriptFunc( Handle, "MobDamaged", "BossDamaged" ) -- ÃÖÃÊ ½ºÅ³ È®·ü ¼³Á¤À» À§ÇÑ MobDamaged ·çƾ °­Á¦ ½ÇÇàÀ» ÇØÁÜ if Var["BossBattle"]["bInitialSkillRateSet"] == nil then Var["BossBattle"]["bInitialSkillRateSet"] = true local CurHP, MaxHP = cObjectHP( Handle ) BossDamaged( MapIndex, 0, MaxHP, CurHP, Handle ) end -- ½ºÅ³º°·Î Çѹø ¾¿ Ž»ö for nIndex, sSkillName in pairs ( BossSkillNameTable ) do -- ´ÙÀ½ ½ºÅ³ ¼ø¹ø°ú ÇØ´ç ½ºÅ³ ½ÃÀüÅ×À̺íÀÌ ¾ø´Ù¸é ¾ÆÁ÷ ½ÃÀüµµ ¾ÈµÈ °ÍÀ̹ǷΠÆнº if Var["BossBattle"][ sSkillName.."PhaseNo"] ~= nil and Var["BossBattle"][ sSkillName ] ~= nil then -- ½ÃÀü½ÂÀÎµÈ ½ºÅ³µé¸¸ ¼ø¼­´ë·Î ½ÃÀüÇؾßÇÔ. for i = 1, #Var["BossBattle"][ sSkillName ] do -- ¿¡·¯Ã¼Å© if Var["BossBattle"][ sSkillName ][ i ] == nil then break end -- ÁغñµÈ ½ºÅ³ ½ÃÀü if Var["BossBattle"][ sSkillName ][ i ]["bCasting"] == true then local sCurSkillTableIndex = Var["BossBattle"][ sSkillName ][ i ]["sSkillTableIndex"] local CurSkillInfo = BossSkill[ sSkillName ][ sCurSkillTableIndex ] if sSkillName == "SkillRateChange" -- ½ºÅ³È®·ü º¯È¯ then DebugLog( "BossDamaged::StartSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) local Values = CurSkillInfo["SkillRate"] cMobWeaponRate( Handle, Values[1], Values[2], Values[3], Values[4] ) DebugLog( "BossDamaged::CastSkill-"..sSkillName.." "..sCurSkillTableIndex.." "..i..":"..Values[1].." "..Values[2].." "..Values[3].." "..Values[4] ) -- ½ÃÀü ¿Ï·á ó¸® Var["BossBattle"][ sSkillName ][ i ]["bCasting"] = false DebugLog( "BossDamaged::EndSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) elseif sSkillName == "Summon" -- Àܸ÷ ¼Òȯ then DebugLog( "BossDamaged::StartSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) for i = 1, #CurSkillInfo["SummonMobs"] do cMobRegen_Obj( CurSkillInfo["SummonMobs"][ i ], Handle ) DebugLog( "BossDamaged::CastSkill-"..sSkillName.." "..sCurSkillTableIndex.." "..i..":"..CurSkillInfo["SummonMobs"][ i ] ) end -- ½ÃÀü ¿Ï·á ó¸® Var["BossBattle"][ sSkillName ][ i ]["bCasting"] = false DebugLog( "BossDamaged::EndSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) elseif sSkillName == "Heal" -- ÀÚÈú then -- ½ÃÀüÁßÀÌ ¾Æ´Ò°æ¿ì ½ÃÀüÁßÀ¸·Î ¹Ù²ãÁÖ¸ç Ãʱ⠼³Á¤À» ÇÔ if Var["BossBattle"]["bBossIsHealingItself"] ~= true then DebugLog( "BossDamaged::StartSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) Var["BossBattle"]["bBossIsHealingItself"] = true -- Èú ´Ü°è ¼³Á¤ ÃʱâÈ­ Var["BossBattle"]["HealCastingStepNo"] = 1 Var["BossBattle"]["HealCastingStepSec"] = Var["CurSec"] local BossHealAbstate = BossSkill["Heal"]["Abstate"] cSetAbstate( Handle, BossHealAbstate["Index"], BossHealAbstate["Strength"], BossHealAbstate["KeepTime"] ) cAnimate( Handle, "start", BossSkill["Heal"]["AnimationIndex"] ) end -- ½ÃÀüÁßÀÏ°æ¿ì ŸÀ̹ÖÀÌ µÉ ¶§¸¶´Ù ÈúÀ» ½ÃÀü if Var["BossBattle"]["bBossIsHealingItself"] == true then -- Èú ½ÃÀüÁß if Var["BossBattle"]["HealCastingStepNo"] <= BossSkill["Heal"]["TickCount"] then if Var["BossBattle"]["HealCastingStepSec"] <= Var["CurSec"] then cHeal( Handle, BossSkill["Heal"][ sCurSkillTableIndex ]["HealAmount"] ) DebugLog( "BossDamaged::CastSkill-"..sSkillName.." "..sCurSkillTableIndex.." "..i..":"..Var["BossBattle"]["HealCastingStepNo"].." "..BossSkill["Heal"][ sCurSkillTableIndex ]["HealAmount"] ) Var["BossBattle"]["HealCastingStepNo"] = Var["BossBattle"]["HealCastingStepNo"] + 1 Var["BossBattle"]["HealCastingStepSec"] = Var["BossBattle"]["HealCastingStepSec"] + BossSkill["Heal"]["TickTimeSec"] break -- ÇØ´ç Á¾·ùÀÇ ½ºÅ³ÀÇ ·çÇÁ¸¸ ºüÁ®³ª¿Â´Ù. end else cAnimate( Handle, "stop" ) Var["BossBattle"]["bBossIsHealingItself"] = false -- ½ÃÀü ¿Ï·á ó¸® Var["BossBattle"][ sSkillName ][ i ]["bCasting"] = false DebugLog( "BossDamaged::EndSkillCasting-"..sSkillName.." "..sCurSkillTableIndex.." "..i ) end end end -- ½ºÅ³ À̸§ °ü·Ã Á¶°Ç¹® // end -- ½ºÅ³ ½ÃÀüÀÌ Áغñ µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â Á¶°Ç¹® // end -- ÇÑ ½ºÅ³¿¡ ´ëÇÑ ¼øÂ÷Àû ½ÃÀü ·çÇÁ // end -- ½ºÅ³ ½ÃÀü ÀÚü¸¦ Çߴ°¡ È®ÀÎÇÏ´Â Á¶°Ç¹® // end -- °¢ ½ºÅ³À» Çѹø¾¿ Ž»öÇÏ´Â ·çÇÁ // return ReturnAI["CPP"] end