--[[ º¸½º »óÀ§¹öÀü - Èĸ¶¸£ 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 = {} ---------------------------------------------------------------------- -- Mantis 7984 -- º¸¹°»óÀÚ ¼Òȯ Á¤º¸ BH_HumarBox = { { Index = "BH_Humar_X", ItemDropMobIndex = "BH_Humar_O", x = 3060, y = 3126, width = 303, height = 494, rotate = 4 }, { Index = "BH_Humar_X", ItemDropMobIndex = "BH_Humar_O_02", x = 3060, y = 3126, width = 303, height = 494, rotate = 4 }, { Index = "BH_Humar_X", ItemDropMobIndex = "BH_Humar_O_03", x = 3060, y = 3126, width = 303, height = 494, rotate = 4 }, { Index = "BH_Humar_X", ItemDropMobIndex = "BH_Humar_O_04", x = 3060, y = 3126, width = 303, height = 494, rotate = 4 }, } ---------------------------------------------------------------------- function Common_RemoveTreasure(MapIndex) cExecCheck "Common_RemoveTreasure" cDebugLog "Common_RemoveTreasure" cRegenGroupActiv("BH_Cracker", "BH_HumarBox", 0) -- »óÀÚ°¡ ³ª¿ÀÁö ¾Êµµ·Ï(¼¼¹ø° Àμö¸¦ »ý·«Çϰųª 1À̸é activ) -- cVanishAll(MapIndex, "BH_Humar_O") -- cVanishAll(MapIndex, "BH_Humar_O_02") -- cVanishAll(MapIndex, "BH_Humar_O_03") -- cVanishAll(MapIndex, "BH_Humar_O_04") cVanishAll(MapIndex, "BH_Humar_X") end -- ºÎÇϵéÀº ½ºÅ©¸³Æ®Ã³¸® ¾ÈÇÔ - CPP ·çƾ »ç¿ë ------------------------------------------------------------------ ----------------------- Humar Part -------------------------- ------------------------------------------------------------------ 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 -- Åõ¸íÀΰ£ ¼Òȯ - º¸¹°»óÀÚ Á¦¾î¿ë local InvisibleHandle = cMobRegen_Obj("InvisibleMan", Handle) cAIScriptSet(InvisibleHandle, Handle) -- ºñÁêÀÇ AI½ºÅ©¸³Æ®¸¦ Var.Handle(Çï°¡)ÀÇ AI½ºÅ©¸³Æ®·Î ¼¼Æà MemBlock[InvisibleHandle] = {} MemBlock[InvisibleHandle].Handle = InvisibleHandle MemBlock[InvisibleHandle].MapIndex = MapIndex MemBlock[InvisibleHandle].StepFunc = Invisible_Init MemBlock[Handle] = nil end return ReturnAI.END end if Var == nil then -- óÀ½ ¸®Á¨µÇ¾úÀ½ MemBlock[Handle] = {} Var = MemBlock[Handle] Var.Handle = Handle Var.MapIndex = MapIndex Var.FellowHandle = {} Var.FellowHandle[1] = -1 Var.FellowHandle[2] = -1 Var.NextSummonIndex = 1 Var.BoxVanish = 0 -- 10ÃÊ¿¡ Çѹø¾¿ ¹Ú½º¸¦ Áö¿ì±â À§ÇØ 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 CurSecond = cCurSec() if CurSecond > Var.BoxVanish then Common_RemoveTreasure(Var.MapIndex) Var.BoxVanish = CurSecond + 10 end local hp local maxhp hp, maxhp = cObjectHP(Var.Handle) if hp < maxhp then Var.NextBuff = cCurSec() + HumarBuffSec Var.StepFunc = Boss_SummonCheck end if hp == maxhp and Var.NextSummonIndex ~= 1 then Var.NextSummonIndex = 1 cDebugLog "Summon Reset" end return ReturnAI.END end function Boss_BuffCheck(Var) cExecCheck "Boss_BuffCheck" hp, maxhp = cObjectHP(Var.Handle) if hp == maxhp then Var.StepFunc = Boss_WaitInvader -- ÀüÅõ ³¡, ÇÇ È¸º¹µÇ¾úÀ½ return end 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 cDebugLog("Summon Index " .. Var.NextSummonIndex) 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 ------------------------------------------------------------------------- ----------------------- InvisibleMan Part -------------------------- ------------------------------------------------------------------------- -- º¸¹°»óÀÚ Á¦¾î¿ë ¿ÀºêÁ§Æ® function InvisibleMan(Handle, MapIndex) cExecCheck "InvisibleMan" local Var = MemBlock[Handle] if Var == nil then ----cDebugLog("InvisibleMan Handle Error:" .. Handle) return end if Var.StepFunc ~= nil then Var.StepFunc(Var) end return ReturnAI.END end function Invisible_Init(Var) cExecCheck "Invisible_Init" cDebugLog "Invisible_Init" ---------------------------------------------------------------------- -- Mantis 7984 -- ¡Ø º¸¹°»óÁ¦ ¼Òȯ ¹× ¾ÆÀÌÅÛµå¶ø±×·ì ¸ó½ºÅÍ ¼ÂÆà for i = 1, #BH_HumarBox do local BoxHandle = cMobRegen_Rectangle( Var["MapIndex"], BH_HumarBox[i]["Index"], BH_HumarBox[i]["x"], BH_HumarBox[i]["y"], BH_HumarBox[i]["width"], BH_HumarBox[i]["height"], BH_HumarBox[i]["rotate"] ) if BoxHandle ~= nil then cSetItemDropMobID( BoxHandle, BH_HumarBox[i]["ItemDropMobIndex"] ) end end ---------------------------------------------------------------------- cGroupRegen("BH_Cracker", "BH_HumarBox") -- »óÀÚ°¡ ³ª¿Àµµ·Ï Var.Wait = {} Var.Wait.Second = cCurSec() + 60 Var.StepFunc = Invisible_AllVanish end function Invisible_AllVanish(Var) cExecCheck "Invisible_AllVanish" if cCurSec() > Var.Wait.Second then cDebugLog "Invisible_AllVanish" cRegenGroupActiv("BH_Cracker", "BH_HumarBox", 0) -- »óÀÚ°¡ ³ª¿ÀÁö ¾Êµµ·Ï(¼¼¹ø° Àμö¸¦ »ý·«Çϰųª 1À̸é activ) Common_RemoveTreasure(Var.MapIndex) cNPCVanish(Var.Handle) Var.StepFunc = nil end end