-- Å°¸Þ¶ó¸¦ À§ÇÑ ½ºÅ©¸³Æ® -- ½ºÅ³ 1 : ÀÏÁ¤½Ã°£ µ¥¹ÌÁö¸¦ ÀÏÁ¤·® ÀÌ»ó ¹Þ¾ÒÀ» ¶§ ¹ßµ¿ -- ½ºÅ³ 2 : HP¿¡ µû¶ó ¹ßµ¿ -- ½ºÅ©¸³Æ®ÀÇ ¸®ÅÏ°ª ReturnAI = {} ReturnAI.END = 1 -- Return_AI_END = 1;// -- ¸ðµç AI·çƾ ³¡ ReturnAI.CPP = 2 -- Return_AI_CPP = 2;// -- ·ç¾Æ·Î ÀϺΠó¸®ÇÑ ÈÄ cppÀÇ AI·çƾ µ¹¸² --µÎ¹ø° Å°¸Þ¶ó ¸®Á¨½ÃÅ°¸é ¾îµð¼±°¡ Fail -- »ó¼ö Á¤ÀÇ --Chimera_Skill_W03_2Target.nif ºÒµ¢ÀÌ ¶³¾îÁö´Â ÀÌÆåÆ® ¹× Ÿ°Ù ÀÌÆåÆ® --Psy_Chimera_Skill_W03_3DOT.nif µµÆ®ÀÌÆåÆ® --Psy_Chimera_Skill_W03_3DOTLoop.nif µµÆ® ·çÇÁ ÀÌÆåÆ® C = {} C.Immune = {} -- µ¥¹ÌÁö ¸é¿ª ½ºÅ³ C.Immune.SkillIndex = "Chimera_Skill_N_ACS" -- ½ºÅ³ À̸§ C.Immune.Interval = 600 -- 600ÃÊ ³» 500,000 ÀÌ»óÀÇ µ¥¹ÌÁö¸¦ ¹Þ¾ÒÀ» ¶§ C.Immune.Damage = 500000 -- C.LethalMoveTime = {} -- ÇÊ»ì±â Å×À̺í C.LethalMoveTime[1] = 950 -- 95% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[2] = 850 -- 85% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[3] = 750 -- 75% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[4] = 650 -- 65% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[5] = 600 -- 60% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[6] = 550 -- 55% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[7] = 450 -- 45% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[8] = 350 -- 35% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[9] = 300 -- 30% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[10] = 250 -- 25% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[11] = 200 -- 20% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[12] = 150 -- 15% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[13] = 120 -- 12% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[14] = 90 -- 9% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime[15] = 50 -- 5% ÀÌÇÏÀÏ ¶§ Çѹø »ç¿ë C.LethalMoveTime.Instance = {} -- ¼ø°£µ¥¹ÌÁö½ºÅ³ C.LethalMoveTime.Instance.SkillIndexPush = "Chimera_Skill_W03_1" -- ½ºÅ³ À̸§(½ÇÁ¦·Î ¹ßµ¿ÇÏ´Â ½ºÅ³) C.LethalMoveTime.Instance.SkillIndexDamage = "Chimera_Skill_W03_2" -- ½ºÅ³ À̸§(¹ßµ¿ÇÏÁö´Â ¾ÊÁö¸¸ 2Â÷µ¥¹ÌÁö¸¦ °è»êÇϱâ À§ÇÑ ½ºÅ³) C.LethalMoveTime.Instance.Range = 2000 -- ½ºÅ³ »çÁ¤°Å¸® C.LethalMoveTime.Instance.SpotViewSec = 3 -- ½ºÅ³ ¹ß»ç 3ÃÊ ÈÄ µ¥¹ÌÁö¹üÀ§ Ãâ·Â C.LethalMoveTime.Instance.SpotLifeTime = 7 -- ºÒµ¢¾î¸® ÀÌÆåÆ®ÀÇ Áö¼Ó½Ã°£ C.LethalMoveTime.Instance.SpotDamageSecond = 4 -- ºÒµ¢¾î¸® ÀÌÆåÆ® ÈÄ µ¥¹ÌÁö °è»ê ½Ã°£ C.LethalMoveTime.Instance.DamageArea = 150 -- µ¥¹ÌÁö ³ÏÀÌ(¹ÝÁö¸§) C.LethalMoveTime.Instance.Meteor = {} C.LethalMoveTime.Instance.Meteor.Number = 16 -- ºÒµ¢ÀÌ 10 °³°¡ ¶³¾îÁü C.LethalMoveTime.Instance.Meteor.Interval = 0.4 -- 0.0 ÃÊ°£°Ý -- µ¥¹ÌÁö °ø½Ä¿¡ ÀÇÇØ µ¥¹ÌÁö °è»êÇÒ ¶§ C.LethalMoveTime.Instance.MinMA = 10000 -- ¸¶¹ý°ø°Ý·Â C.LethalMoveTime.Instance.MaxMA = 15000 -- ¸¶¹ý°ø°Ý·Â C.LethalMoveTime.Instance.MH = 5000 -- ¸¶¹ýÈ÷Æ® -- HP¿¡ µû¶ó µ¥¹ÌÁö°¡ ´Þ¶óÁú °æ¿ì C.LethalMoveTime.Instance.DamageRate = 980 -- MaxHPÀÇ 98% µ¥¹ÌÁö C.LethalMoveTime.MagicFieldSkill = "Chimera_Skill_W03_2" -- ¾î¶² ½ºÅ³¿¡ ÀÇÇÑ ¸ÅÁ÷ÇʵåÀÎÁö C.LethalMoveTime.MagicFieldLocX = 3677 -- ÇʵåÀÇ Áß½ÉÁ¡ C.LethalMoveTime.MagicFieldLocY = 18467 C.LethalMoveTime.MagicFieldWhen = "Last" -- ù("First")/¸·("Last") ºÒµ¢ÀÌ°¡ ¶³¾îÁú¶§ ±ò¸² C.LethalMoveTime.TotalSecond = 10 MemBlock = {} function Chimera(Handle, MapIndex) cExecCheck "Chimera" if cIsObjectDead(Handle) then -- Á×¾úÀ½ cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú MemBlock[Handle] = nil -- ¸Þ¸ð¸®ÇØÁ¦ cDebugLog "Chimera Dead" return ReturnAI.END 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.Lethal = {} Var.Lethal.SkillBlastSec = 0 -- ½ºÅ³À» ¹ßµ¿ÇÑ ½Ã°£ - ½ºÅ³ ÁøÇàÇϱâ À§ÇØ Var.ImmunManage = {} -- HP °¨¼Ò¸¦ °¨½ÃÇÏ´Â Å×À̺í(¸é¿ª½ºÅ³À» À§ÇÑ) Var.ImmunManage.QueueHead = 1 for k = 1, C.Immune.Interval do Var.ImmunManage[k] = cObjectHP(Var.Handle) end Var.MeteorTargetList = {} -- ºÒµ¢¾î¸®ÀÇ Å¸°ÙµéÀ» ÀúÀåÇϱâ À§ÇÑ Å×À̺í Var.MeteorTick = 0.0 -- ºÒµ¢¾î¸®°¡ ¶³¾îÁö±â ½ÃÀÛÇÏ´Â ½Ã°£ Var.MeteorNumber = 0 -- ¶³¾îÁø ºÒµ¢¾î¸® °¹¼ö Var.NextLethalIndex = 1 -- ÇÊ»ì±â¸¦ »ç¿ëÇϱâ À§ÇÑ Å×À̺í C.LethalMoveTime[1]±îÁö ±â´Ù¸² Var.StepFunc = Chimera_Default end return Var.StepFunc(Var) end function Chimera_Default(Var) cExecCheck "Chimera_Default" local CurSec = cCurSec() if Var.LastCheck == CurSec then return ReturnAI.CPP 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 = Chimera_ImmunSkill -- ¸é¿ª½ºÅ³ ¹ßµ¿ return ReturnAI.CPP end -- HP °¨½Ã if CurHP == MaxHP then Var.NextLethalIndex = 1 else local HPRate = CurHP * 1000 / MaxHP if C.LethalMoveTime[Var.NextLethalIndex] ~= nil and HPRate < C.LethalMoveTime[Var.NextLethalIndex] then Var.NextLethalIndex = Var.NextLethalIndex + 1 Var.StepFunc = Chimera_LethalMove -- ÇÊ»ì±â ¹ßµ¿ return ReturnAI.CPP end end return ReturnAI.CPP end function Chimera_ImmunSkill(Var) -- ¸é¿ª½ºÅ³ ¹ßµ¿ cExecCheck "Chimera_ImmunSkill" if cSkillBlast(Var.Handle, Var.Handle, C.Immune.SkillIndex) == nil then -- ½ÇÆÐ cDebugLog "Chimera_ImmunSkill : Other Skill using" return ReturnAI.CPP -- ´Ù¸¥ ½ºÅ³ »ç¿ëÁßÀ̹ǷΠ½ÇÆÐ - ´ÙÀ½ ·çƾ¿¡¼­ ´Ù½Ã ½Ãµµ end cDebugLog "Chimera_ImmunSkill : Blast" for k = 1, C.Immune.Interval do Var.ImmunManage[k] = cObjectHP(Var.Handle) end Var.StepFunc = Chimera_Default return ReturnAI.CPP end function Chimera_LethalMove(Var) -- ÇÊ»ì±â ¹ßµ¿ cExecCheck "Chimera_LethalMove" if cSkillBlast(Var.Handle, Var.Handle, C.LethalMoveTime.Instance.SkillIndexPush) == nil then -- ½ÇÆÐ cDebugLog "Chimera_LethalMove : Other Skill using" return ReturnAI.CPP -- ´Ù¸¥ ½ºÅ³ »ç¿ëÁßÀ̹ǷΠ½ÇÆÐ - ´ÙÀ½ ·çƾ¿¡¼­ ´Ù½Ã ½Ãµµ end cDebugLog "Chimera_LethalMove : Blast" Var.Lethal.SkillBlastSec = cCurSec() Var.StepFunc = Chimera_Spotting return ReturnAI.END end function Chimera_Spotting(Var) cExecCheck "Chimera_Spotting" if cCurSec() < Var.Lethal.SkillBlastSec + C.LethalMoveTime.Instance.SpotViewSec then return ReturnAI.END end -- º¹¼öÀÇ Å¸°Ù¼³Á¤ Var.MeteorTargetList = {} -- ºÒµ¢¾î¸®ÀÇ Å¸°ÙµéÀ» ÀúÀåÇϱâ À§ÇÑ Å×À̺í local TargetList = {cAggroList(Var.Handle, C.LethalMoveTime.Instance.Range)} -- Range ¾È¿¡ ÀÖ´Â Àûµé ¸®½ºÆ® ¾òÀ½ local TargetNum = C.LethalMoveTime.Instance.Meteor.Number if TargetNum < #TargetList then TargetNum = #TargetList end for k = 1, TargetNum do local rnd = cRandomInt(1, #TargetList) Var.MeteorTargetList[#Var.MeteorTargetList + 1] = TargetList[rnd] -- ¸¶Áö¸· ¿ø¼Ò¸¦ rnd¿¡ ³¢¿ö³Ö°í ¸¶Áö¸·¿ø¼Ò Áö¿ò TargetList[rnd] = TargetList[#TargetList] TargetList[#TargetList] = nil end --for k = 1, #Var.MeteorTargetList do -- cDebugLog("Target : " .. Var.MeteorTargetList[k]) --end Var.MeteorTick = cCurrentSecond() -- ºÒµ¢¾î¸®°¡ ¶³¾îÁö±â ½ÃÀÛÇÏ´Â ½Ã°£ Var.MeteorNumber = 0 -- ¶³¾îÁø ºÒµ¢¾î¸® °¹¼ö Var.StepFunc = Chimera_MeteorShower return ReturnAI.END end function Chimera_MeteorShower(Var) cExecCheck "Chimera_MeteorShower" local CurrentSecond = cCurrentSecond() if CurrentSecond < Var.MeteorTick then return ReturnAI.END end if #Var.MeteorTargetList == 0 then -- Ÿ°Ù ¸ðµÎ ½èÀ½ Var.StepFunc = Chimera_SkillEnd return ReturnAI.END end Var.MeteorTick = Var.MeteorTick + C.LethalMoveTime.Instance.Meteor.Interval -- ¸¶Áö¸· Ÿ°Ù ²¨³¿ local TargetHandle = Var.MeteorTargetList[#Var.MeteorTargetList] Var.MeteorTargetList[#Var.MeteorTargetList] = nil local X, Y = cObjectLocate(TargetHandle) if X ~= nil and Y ~= nil then local SpotHandle = cEffectRegen_XY(Var.MapIndex, "Chimera_Skill_W03_2Target", -- x, y À§Ä¡¿¡ ¿ÀºêÁ§Æ® Ãâ·Â -- ¸ÊÀ̸§, ÀÌÆåÆ® À̸§, X, Y, 0, C.LethalMoveTime.Instance.SpotLifeTime, 0) -- xÁÂÇ¥, yÁÂÇ¥, dir, Áö¼Ó½Ã°£, ·çÇÁ, [½ºÄÉÀÏ]) cAIScriptSet(SpotHandle, Var.Handle) cAIScriptFunc(SpotHandle, "Entrance", "Effect_TargetSpot") --ÀÔ±¸ÇÔ¼ö´Â HorseMain MemBlock[SpotHandle] = {} MemBlock[SpotHandle].Handle = SpotHandle MemBlock[SpotHandle].X = X MemBlock[SpotHandle].Y = Y MemBlock[SpotHandle].Chimera = Var MemBlock[SpotHandle].ExploseTime = CurrentSecond + C.LethalMoveTime.Instance.SpotDamageSecond Var.MeteorNumber = Var.MeteorNumber + 1 -- ¸ÅÁ÷ÇÊµå ±ò¸®´Â ºÒµ¢ÀÌ? if Var.MeteorNumber == 1 and C.LethalMoveTime.MagicFieldWhen == "First" then MemBlock[SpotHandle].MagicField = true end if #Var.MeteorTargetList == 0 and C.LethalMoveTime.MagicFieldWhen == "Last" then MemBlock[SpotHandle].MagicField = true end end return ReturnAI.END end function Chimera_SkillEnd(Var) if cCurSec() > Var.Lethal.SkillBlastSec + C.LethalMoveTime.TotalSecond then Var.StepFunc = Chimera_Default cDebugLog "SkillEnd" end return ReturnAI.CPP -- SkillEndWait¿¡¼­ ±â´Ù¸®´Â µ¿¾È ÀüÅõ¸ðµå Ç®¸®Áö ¾Êµµ·Ï end -------------------------------------------------------- function Effect_TargetSpot(Handle, MapIndex) cExecCheck "Effect_TargetSpot" local Var = MemBlock[Handle] if Var == nil then cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú return end if cCurrentSecond() < Var.ExploseTime then return end cDebugLog "Effect_TargetSpot : Explose" local ChimeraHandle = Var.Chimera.Handle local TargetList = {cGetTargetList(ChimeraHandle, Var.X, Var.Y, C.LethalMoveTime.Instance.DamageArea)} -- cGetTargetListÀÇ Ãâ·ÂÀº ÇÚµé ¿©·¯°³À̹ǷΠ±× ÇÚµéµéÀ» ÇϳªÀÇ Å×À̺í·Î ¸¸µê for k = 1, #TargetList do local Target = TargetList[k] if Target ~= nil then -- CPPÀÇ µ¥¹ÌÁö °ø½Ä¿¡ ÀÇÇØ µ¥¹ÌÁö °è»ê --local Damage = cSkillDamageCalculate(Var.Handle, C.LethalMoveTime.Instance.SkillIndexDamage, Target, C.LethalMoveTime.Instance) -- HP¿¡ µû¶ó µ¥¹ÌÁö°¡ ´Þ¶óÁü local CurHP, MaxHP = cObjectHP(Target) local Damage = MaxHP * C.LethalMoveTime.Instance.DamageRate / 1000. -- target¿¡ µ¥¹ÌÁö Àû¿ë if Damage ~= nil then cDamaged(Target, Damage, Var.Handle) end end end if Var.MagicField then cDebugLog "MagicField Spread" cMagicFieldSpread(ChimeraHandle, C.LethalMoveTime.MagicFieldLocX, C.LethalMoveTime.MagicFieldLocY, 0, C.LethalMoveTime.MagicFieldSkill, 1) -- Tick, Keep, DOT µî ¸ÅÁ÷Çʵå Á¤º¸´Â Å×À̺í·Î Àü´Þ end cAIScriptSet(Handle) -- ½ºÅ©¸³Æ® ¾ø¾Ú MemBlock[Handle] = nil end