-------------------------------------------------------------------------------- -- King Slime 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 KingSlimeRoutine( Handle, MapIndex ) cExecCheck "KingSlimeRoutine" local Var = InstanceField[ MapIndex ] if Var == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end local RoutineTimeIndex = ""..Handle -- // 0.1Ãʸ¶´Ù üũÇÏ´Â ·çƾ if Var["RoutineTime"][ RoutineTimeIndex ] == nil then Var["RoutineTime"][ RoutineTimeIndex ] = cCurrentSecond() end if Var["RoutineTime"][ RoutineTimeIndex ] + 0.1 > cCurrentSecond() then return ReturnAI["CPP"] else Var["RoutineTime"][ RoutineTimeIndex ] = cCurrentSecond() end -- 0.1Ãʸ¶´Ù üũÇÏ´Â ·çƾ // if Var["Enemy"] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if Var["Enemy"][ Handle ] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- King Slime »ç¸Á if cIsObjectDead( Handle ) == 1 then cMobShout( Handle, KingSlimeChat["ScriptFileName"], KingSlimeChat["DeathShout"]["Index"] ) cAIScriptSet( Handle ) Var["Enemy"][ Handle ]["PhaseNumber"] = nil Var["Enemy"][ Handle ] = nil return ReturnAI["END"] end -- ÆäÀÌÁî Á¶°Ç üũ ÈÄ Çൿ if Var["Enemy"][ Handle ]["PhaseNumber"] == nil then Var["Enemy"][ Handle ]["PhaseNumber"] = 1 end local CurHP, MaxHP = cObjectHP( Handle ) local RoutineStepFunc = nil if CurHP == MaxHP then RoutineStepFunc = DummyPhaseFunc elseif Var["Enemy"][ Handle ]["PhaseNumber"] < #BossPhaseNameTable then local NextBossPhase = BossPhaseNameTable[ Var["Enemy"][ Handle ]["PhaseNumber"] + 1 ] local HP_RealRate = ( CurHP * 1000 ) / MaxHP -- 1000ºÐÀ² if HP_RealRate < KingSlimeSummon[ NextBossPhase ]["HP_Rate"] then -- ´ÙÀ½ ÆäÀÌÁî·Î ¹Ù²Û ÈÄÀÇ ÆäÀÌÁîÀÇ º¸½º ¾×¼Ç ½ÇÇà Var["Enemy"][ Handle ]["PhaseNumber"] = Var["Enemy"][ Handle ]["PhaseNumber"] + 1 RoutineStepFunc = PhaseActionFunc else RoutineStepFunc = DummyPhaseFunc end else RoutineStepFunc = DummyPhaseFunc end RoutineStepFunc( Handle, MapIndex ) return ReturnAI["CPP"] end function DummyPhaseFunc( ) cExecCheck "DummyPhaseFunc" end function PhaseActionFunc( BossHandle, MapIndex ) cExecCheck "PhaseActionFunc" if BossHandle == nil then return end if MapIndex == nil then return end local Var = InstanceField[ MapIndex ] if Var == nil then return end local PhaseNumber = Var["Enemy"][ BossHandle ]["PhaseNumber"] local BossPhase = BossPhaseNameTable[ PhaseNumber ] DebugLog( "Start PhaseActionFunc::"..BossPhase ) cMobShout( BossHandle, KingSlimeChat["ScriptFileName"], KingSlimeChat["SummonMobShout"]["Index"] ) for i = 1, #KingSlimeSummon[ BossPhase ]["SummonMobs"] do local SummonMobInfo = {} local SummonMobHandle = nil SummonMobHandle = cMobRegen_Obj( KingSlimeSummon[ BossPhase ]["SummonMobs"][i], BossHandle ) if SummonMobHandle ~= nil then cSetAIScript ( MainLuaScriptPath, SummonMobHandle ) cAIScriptFunc( SummonMobHandle, "Entrance", "SummonMobRoutine" ) Var["Enemy"][ SummonMobHandle ] = SummonMobInfo Var["Enemy"][ SummonMobHandle ]["Handle"] = SummonMobHandle end end DebugLog( "End PhaseActionFunc::"..BossPhase ) end function SummonMobRoutine( Handle, MapIndex ) cExecCheck "SummonMobRoutine" local Var = InstanceField[ MapIndex ] if Var == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end -- // 0.1Ãʸ¶´Ù üũÇÏ´Â ·çƾ local RoutineTimeIndex = ""..Handle if Var["RoutineTime"][ RoutineTimeIndex ] == nil then Var["RoutineTime"][ RoutineTimeIndex ] = cCurrentSecond() end if Var["RoutineTime"][ RoutineTimeIndex ] + 0.1 > cCurrentSecond() then return ReturnAI["CPP"] else Var["RoutineTime"][ RoutineTimeIndex ] = cCurrentSecond() end -- 0.1Ãʸ¶´Ù üũÇÏ´Â ·çƾ // if Var["Enemy"] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) Var["RoutineTime"][ RoutineTimeIndex ] = nil return ReturnAI["END"] end if Var["Enemy"][ Handle ] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) Var["RoutineTime"][ RoutineTimeIndex ] = nil return ReturnAI["END"] end if cIsObjectDead( Handle ) == 1 then cAIScriptSet( Handle ) Var["Enemy"][ Handle ] = nil Var["RoutineTime"][ RoutineTimeIndex ] = nil return ReturnAI["END"] end return ReturnAI["CPP"] end