--[[ º¸½º »óÀ§¹öÀü - Èĸ¶¸£ 9Data/Here/World/FineScript.txt ÇÊ¿ä 9Data/Hero/Script/BH_Humar.txt ÇÊ¿ä ]] -- ½ºÅ©¸³Æ®ÀÇ ¸®Åϰª ReturnAI = {} ReturnAI.END = 1 -- Return_AI_END = 1;// -- ¸ðµç AI·çƾ ³¡ ReturnAI.CPP = 2 -- Return_AI_CPP = 2;// -- ·ç¾Æ·Î ÀϺΠó¸®ÇÑ ÈÄ cppÀÇ AI·çƾ µ¹¸² --BossIndex = "BH_Humar" FellowIndex = {} FellowIndex[1] = "BH_Looter" FellowIndex[2] = "BH_Guardian" HumarBuffSkill = "BH_Humar_Skill_N_APU" HumarBuffAbState = "StaMobAPU01" HumarBuffSec = 60 SummonSkillName = "BH_Humar_Skill_S" SummonSkillCastSecond = 5 --¾î±×·Î Á¦°Å½Ã ºÎÇÏ ¾ø¾Ö°í inactiv»óÅ·ΠSummonRate = {} SummonRate[1] = 750 -- 75%, 50%, 25%¿¡¼­ Çѹø¾¿ ºÎÇÏµé ¸®Á¨ SummonRate[2] = 500 SummonRate[3] = 250 SummonRate[4] = 0 -- ¸¶Áö¸·Àº Ç×»ó 0ÀÎ°Í Ãß°¡ ÇÊ¿ä MemBlock = {} -- ºÎÇϵéÀº ½ºÅ©¸³Æ®Ã³¸® ¾ÈÇÔ - CPP ·çƾ »ç¿ë function BH_Humar(Handle, MapIndex) cExecCheck "BH_Humar" local Var = MemBlock[Handle] if cIsObjectDead(Handle) ~= nil then if Var ~= nil then -- º¸½º°¡ Á×¾úÀ½ cDebugLog("Boss Dead") for k = 1, 2 do if Var.FellowHandle[k] ~= -1 then cNPCVanish(Var.FellowHandle[k]) Var.FellowHandle[k] = -1 end end MemBlock[Handle] = nil end return ReturnAI.END end if Var == nil then -- óÀ½ ¸®Á¨µÇ¾úÀ½ MemBlock[Handle] = {} Var = MemBlock[Handle] Var.Handle = Handle Var.FellowHandle = {} Var.FellowHandle[1] = -1 Var.FellowHandle[2] = -1 Var.NextSummonIndex = 1 Var.TargetLostSec = 0 -- Ÿ°ÙÀ» ÀÒÀº ½Ã°£ Var.NextBuff = 0 -- ´ÙÀ½¹ø ¹öÇÁ¹ÞÀ» ½Ã°£ Var.Wait = {} Var.Wait.Second = 0; Var.Wait.NextFunc = nil Var.StepFunc = Boss_WaitInvader end return Var.StepFunc(Var) end function Boss_Wait(Var) -- Var.Wait.Second±îÁö ±â´Ù¸° ÈÄ StepFuncÀ» WaitFunctionÀ¸·Î ¼¼ÆÃ cExecCheck "Boss_Wait" if cCurSec() >= Var.Wait.Second then Var.StepFunc = Var.Wait.NextFunc end end function Boss_WaitInvader(Var) cExecCheck "Boss_WaitInvader" local hp local maxhp hp, maxhp = cObjectHP(Var.Handle) if hp < maxhp then Var.NextBuff = cCurSec() + HumarBuffSec Var.StepFunc = Boss_SummonCheck end return ReturnAI.END end function Boss_BuffCheck(Var) cExecCheck "Boss_BuffCheck" if cCurSec() >= Var.NextBuff then cDebugLog "Buffing" if cNPCSkillUse(Var.Handle, Var.Handle, HumarBuffSkill) ~= nil then Var.NextBuff = cCurSec() + HumarBuffSec else cDebugLog "Fail" end end Var.StepFunc = Boss_SummonCheck end function Boss_SummonCheck(Var) cExecCheck "Boss_SummonCheck" local hp local maxhp hp, maxhp = cObjectHP(Var.Handle) if hp * 1000 < maxhp * SummonRate[Var.NextSummonIndex] and cNPCSkillUse(Var.Handle, Var.Handle, SummonSkillName) == 1 then Var.NextSummonIndex = Var.NextSummonIndex + 1 Var.Wait.Second = cCurSec() + SummonSkillCastSecond Var.Wait.NextFunc = Boss_SummomFellow Var.StepFunc = Boss_Wait return end -- ºÎÇϵé Á×¾ú´ÂÁö È®ÀÎ for fel = 1, 2 do if Var.FellowHandle[fel] ~= -1 and cIsObjectDead(Var.FellowHandle[fel]) ~= nil then Var.FellowHandle[fel] = -1 end end if cTargetHandle(Var.Handle) ~= nil then -- Ÿ°Ù ÀÖÀ½ Var.TargetLostSec = cCurSec() elseif Var.TargetLostSec + 10 < cCurSec() then -- Ÿ°Ù »ç¶óÁü Var.StepFunc = Boss_WaitInvader cResetAbstate(Var.Handle, HumarBuffAbState) -- ¹öÇÁ ÇØÁ¦ -- Remove fallows for k = 1, 2 do if Var.FellowHandle[k] ~= -1 then cNPCVanish(Var.FellowHandle[k]) Var.FellowHandle[k] = -1 end end end Var.StepFunc = Boss_BuffCheck return ReturnAI.CPP end function Boss_SummomFellow(Var) cExecCheck "Boss_SummomFellow" local summon = false for fel = 1, 2 do if Var.FellowHandle[fel] == -1 then Var.FellowHandle[fel] = cMobRegen_Obj(FellowIndex[fel], Var.Handle) summon = true end end if summon then cNPCChat(Var.Handle, "BH_Humar_Sum") end Var.StepFunc = Boss_SummonCheck end