-- ÇÁ½ÃÄËÀ» À§ÇÑ ½ºÅ©¸³Æ® -- ½ºÅ³ 1 : ÀÏÁ¤½Ã°£ µ¥¹ÌÁö¸¦ ÀÏÁ¤·® ÀÌ»ó ¹Þ¾ÒÀ» ¶§ ¹ßµ¿ -- ½ºÅ³ 2 : HP¿¡ µû¶ó ¹ßµ¿ -- ½ºÅ©¸³Æ®ÀÇ ¸®ÅÏ°ª ReturnAI = {} ReturnAI.END = 1 -- Return_AI_END = 1;// -- ¸ðµç AI·çƾ ³¡ ReturnAI.CPP = 2 -- Return_AI_CPP = 2;// -- ·ç¾Æ·Î ÀϺΠó¸®ÇÑ ÈÄ cppÀÇ AI·çƾ µ¹¸² -- »ó¼ö Á¤ÀÇ C = {} C.Immune = {} -- µ¥¹ÌÁö ¸é¿ª ½ºÅ³ C.Immune.SkillIndex = "Psy_Psyken_Skill_N_MRS" -- ½ºÅ³ À̸§ -- MobAttackSequence¿¡¼­´Â Á¦°Å C.Immune.Interval = 20 -- 20ÃÊ ³» 20000 ÀÌ»óÀÇ µ¥¹ÌÁö¸¦ ¹Þ¾ÒÀ» ¶§ C.Immune.Damage = 50000 -- C.SummonTable = {} -- ÇÊ»ì±â Å×À̺í C.SummonTable[1] = {} C.SummonTable[1].HPRate = 950 -- 95% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.SummonTable[1].Summon = {} C.SummonTable[1].Summon[1] = "Psy_PsykenDog" --C.SummonTable[1].Summon[2] = "Psy_PsykenDog" -- PsykenDog 2¸¶¸® ¼Òȯ(´õ ÀÖÀ¸¸é C.SummonTable[1].Summon[3] ÀÌÈÄ¿¡ Ãß°¡ C.SummonTable[2] = {} C.SummonTable[2].HPRate = 700 -- 70% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.SummonTable[2].Summon = {} C.SummonTable[2].Summon[1] = "Psy_PsykenDog" C.SummonTable[2].Summon[2] = "Psy_PsykenDog" --C.SummonTable[2].Summon[3] = "Psy_PsykenDog" -- PsykenDog 3¸¶¸® ¼Òȯ(´õ ÀÖÀ¸¸é C.SummonTable[2].Summon[3] ÀÌÈÄ¿¡ Ãß°¡ C.SummonTable[3] = {} C.SummonTable[3].HPRate = 300 -- 30% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.SummonTable[3].Summon = {} C.SummonTable[3].Summon[1] = "Psy_PsykenDog" C.SummonTable[3].Summon[2] = "Psy_PsykenDog" C.SummonTable[3].Summon[3] = "Psy_PsykenDog" -- PsykenDog 3¸¶¸® ¼Òȯ(´õ ÀÖÀ¸¸é C.SummonTable[2].Summon[3] ÀÌÈÄ¿¡ Ãß°¡ MemBlock = {} function Psy_Psyken(Handle, MapIndex) cExecCheck "Psy_Psyken" if cIsObjectDead(Handle) then -- Á×¾úÀ½ cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú MemBlock[Handle] = nil -- ¸Þ¸ð¸®ÇØÁ¦ cDebugLog "Psy_Psyken Dead" return end local Var = MemBlock[Handle] if Var == nil then MemBlock[Handle] = {} Var = MemBlock[Handle] Var.Handle = Handle Var.MapIndex = MapIndex Var.LastCheck = cCurSec() -- 1ÃÊ¿¡ Çѹø¾¿ üũÇϱâ À§ÇØ Var.ImmunManage = {} -- HP °¨¼Ò¸¦ °¨½ÃÇÏ´Â Å×À̺í(¸é¿ª½ºÅ³À» À§ÇÑ) Var.ImmunManage.QueueHead = 1 for k = 1, C.Immune.Interval do Var.ImmunManage[k] = cObjectHP(Var.Handle) end Var.NextSummonIndex = 1 -- ÇÊ»ì±â¸¦ »ç¿ëÇϱâ À§ÇÑ Å×À̺í C.SummonTable[1].HPRate±îÁö ±â´Ù¸² Var.StepFunc = Psyken_Default end Var.StepFunc(Var) return ReturnAI.CPP end function Psyken_Default(Var) cExecCheck "Psyken_Default" local CurSec = cCurSec() if Var.LastCheck == CurSec then return end Var.LastCheck = CurSec -- 1ÃÊ¿¡ Çѹø¾¿ üũ ½ÃÀÛ local CurHP, MaxHP = cObjectHP(Var.Handle) -- HP °¨¼ÒÀ² °¨½Ã Var.ImmunManage.QueueHead = Var.ImmunManage.QueueHead + 1 if Var.ImmunManage.QueueHead > C.Immune.Interval then Var.ImmunManage.QueueHead = 1 end local LastHP = Var.ImmunManage[Var.ImmunManage.QueueHead] Var.ImmunManage[Var.ImmunManage.QueueHead] = CurHP if LastHP - CurHP > C.Immune.Damage then Var.StepFunc = Psyken_ImmunSkill -- ¸é¿ª½ºÅ³ ¹ßµ¿ return end -- HP °¨½Ã if CurHP == MaxHP then Var.NextSummonIndex = 1 else local HPRate = CurHP * 1000 / MaxHP if C.SummonTable[Var.NextSummonIndex] ~= nil and HPRate < C.SummonTable[Var.NextSummonIndex].HPRate then Var.StepFunc = Psyken_Summon -- ¼Òȯ½ºÅ³ return end end end function Psyken_ImmunSkill(Var) -- ¸é¿ª½ºÅ³ ¹ßµ¿ cExecCheck "Psyken_ImmunSkill" if cSkillBlast(Var.Handle, Var.Handle, C.Immune.SkillIndex) == nil then -- ½ÇÆÐ cDebugLog "Psyken_ImmunSkill : Other Skill using" return -- ´Ù¸¥ ½ºÅ³ »ç¿ëÁßÀ̹ǷΠ½ÇÆÐ - ´ÙÀ½ ·çƾ¿¡¼­ ´Ù½Ã ½Ãµµ end cDebugLog "Psyken_ImmunSkill : Blast" for k = 1, C.Immune.Interval do Var.ImmunManage[k] = cObjectHP(Var.Handle) end Var.StepFunc = Psyken_Default end function Psyken_Summon(Var) -- ¼Òȯ½ºÅ³ cExecCheck "Psyken_Summon" -- Àû´çÇÑ ½ºÅ³ ³ÖÀ»°Í --if cSkillBlast(Var.Handle, var.Handle, C.SummonTable.SkillIndexA) == nil then -- ½ÇÆÐ -- cDebugLog "Psyken_SummonA : Other Skill using" -- return -- ´Ù¸¥ ½ºÅ³ »ç¿ëÁßÀ̹ǷΠ½ÇÆÐ - ´ÙÀ½ ·çƾ¿¡¼­ ´Ù½Ã ½Ãµµ --end -- ¼Òȯ¹° ¸®Á¨ for k = 1, #C.SummonTable[Var.NextSummonIndex].Summon do local Handle = cMobRegen_Obj(C.SummonTable[Var.NextSummonIndex].Summon[k], Var.Handle) MemBlock[Handle] = {} MemBlock[Handle].Handle = Handle MemBlock[Handle].Master = Var.Handle cAIScriptSet(Handle, Var.Handle) cAIScriptFunc(Handle, "Entrance", "PsykenPet") --ÀÔ±¸ÇÔ¼ö´Â PsykenPet end Var.NextSummonIndex = Var.NextSummonIndex + 1 Var.StepFunc = Psyken_Default end --------------------------------------------------------------- function PsykenPet(Handle, MapIndex) cExecCheck "Psyken_Summon" if cIsObjectDead(Handle) then -- Á×¾úÀ½ cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú MemBlock[Handle] = nil -- ¸Þ¸ð¸®ÇØÁ¦ cDebugLog "Pen Dead" return ReturnAI.END end local Var = MemBlock[Handle] if Var == nil then MemBlock[Handle] = nil cNPCVanish(Handle) cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú return ReturnAI.END end if cIsObjectDead(Var.Master) then -- ÇÁ½ÃÄËÀÌ Á×¾úÀ½ MemBlock[Handle] = nil cNPCVanish(Handle) cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú return ReturnAI.END end local HP, MaxHP = cObjectHP(Var.Master) if HP == MaxHP then -- ÆòÈ­¸ðµå·Î ÇÇ°¡ °¡µæ áÀ½ MemBlock[Handle] = nil cNPCVanish(Handle) cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú return ReturnAI.END end return ReturnAI.CPP end