--[[***** *****]]-- --[[***** ¸÷ ó¸® ·çƾ ¸ÞÀÎ *****]]-- --[[***** : ¼ÒȯµÇ¾î Á¦¾î°¡ ÇÊ¿ä¾ø´Â ¸÷À» Á¦¿ÜÇÑ ¸÷µéÀ» ó¸® *****]]-- --[[***** *****]]-- function MobRoutine( Handle, MapIndex ) if InstanceField[MapIndex] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if InstanceField[MapIndex]["WaveRunner"] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end local Var = InstanceField[MapIndex]["WaveRunner"][Handle] if Var == nil then cAIScriptSet( Handle ) -- Ãß°¡ °³¼± 6. ¸ó½ºÅÍ°¡ ¸ñÃ¥¿¡ ºÎµúÈú ¶§, Á×´Â ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® -- cNPCVanish( Handle ) return ReturnAI["END"] end if cIsObjectDead( Handle ) then cAIScriptSet( Handle ) InstanceField[MapIndex]["WaveRunner"][Handle] = nil return ReturnAI["END"] end BoomMobProcess ( Var ) -- ÀÚÆø¸÷ ó¸® SummonGroupProcess( Var ) -- ¼Òȯ¸÷ Á¸ÀçÇϴ°æ¿ì ó¸® EscortGroupProcess( Var ) -- È£À§¸÷ Á¸ÀçÇϴ°æ¿ì ó¸® EscortMobProcess ( Var ) -- È£À§¸÷ À̵¿ ó¸® PathTypeProcess ( Var ) -- °æ·Î°¡ Á¸ÀçÇϴ°æ¿ì ó¸® -- Æøź ŸÀÔÀÇ À̵¿ 󸮸¦ ±âÁ¸ AI »ç¿ë local rtn = ReturnAI["END"] if Var["BoomTarget"] ~= nil then rtn = ReturnAI["CPP"] end return rtn end -- À̵¿ »óÅ°ª flag MOVESTATE = {} MOVESTATE["STOP"] = "STOP" MOVESTATE["MOVE"] = "MOVE" --[[ ]]-- --[[ BoomType¿¡ µû¶ó Æøź ó¸® ]]-- --[[ ]]-- function BoomMobProcess( Var ) if Var == nil then return end if Var["BoomType"] == nil then return end if Var["BoomProgress"] == nil then local BoomProgress = {} BoomProgress["PlayerCheckTime"] = cCurrentSecond() Var["BoomProgress"] = BoomProgress end local CurSec = cCurrentSecond() -- Ç÷¹ÀÌ¾î °Ë»ö ÁÙÀ̱â À§ÇØ 1ÃÊ¿¡ Çѹø üũ if Var["BoomProgress"]["PlayerCheckTime"] + BOOMTYPE_CHK_DLY > CurSec then return end Var["BoomProgress"]["PlayerCheckTime"] = CurSec -- Ÿ°ÙÀÌ ¼³Á¤ µÆ´ÂÁö üũ if Var["BoomTarget"] ~= nil then -- Ÿ°ÙÀÌ »ç¶óÁø °æ¿ì Ÿ°Ù Á¦°Å if cIsObjectDead( Var["BoomTarget"] ) then cAggroReset( Var["Handle"], Var["BoomTarget"] ) Var["BoomTarget"] = nil return end local dist = cDistanceSquar( Var["Handle"], Var["BoomTarget"] ) -- °Å¸®°¡ ¸Ö¾îÁø °æ¿ì Ÿ°Ù Á¦°Å if dist > Var["BoomType"]["FollowInterval"] * Var["BoomType"]["FollowInterval"] then cAggroReset( Var["Handle"], Var["BoomTarget"] ) Var["BoomTarget"] = nil return end -- °Å¸® üũ Çؼ­ »óÅÂÀÌ»ó °É¾îÁÜ if dist <= (Var["BoomType"]["ExplosionGap"] * Var["BoomType"]["ExplosionGap"]) then if AbstateTypeTable[Var["BoomType"]["AbstateType"]] ~= nil then cSetAbstate( Var["BoomTarget"], AbstateTypeTable[Var["BoomType"]["AbstateType"]]["Index"], 1, AbstateTypeTable[Var["BoomType"]["AbstateType"]]["KeepTime"], Var["Handle"] ) end InstanceField[Var["MapIndex"]]["WaveRunner"][Var["Handle"]] = nil -- Ãß°¡ °³¼± 6. ¸ó½ºÅÍ°¡ ¸ñÃ¥¿¡ ºÎµúÈú ¶§, Á×´Â ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® cAIScriptSet( Var["Handle"] ) cNPCVanish( Var["Handle"] ) -- ÀÌ ÀÌÈÄ Ã³¸® ¹«½ÃÇϱâ À§ÇØ nil·Î ÃʱâÈ­ Var = nil return end end -- Ÿ°ÙÀ» ãÀ½ local Target = cFindNearPlayer( Var["Handle"], Var["BoomType"]["FollowInterval"], FollowTypeTable[Var["BoomType"]["FollowType"]] ) if Target ~= nil then Var["BoomTarget"] = Target cAggroSet( Var["Handle"], Var["BoomTarget"], BOOM_AP ) local speed local speedrate speed = Var["MobSettingType"]["Speed"] speedrate = ( Var["BoomType"]["FollowSpeedRate"] / 1000 ) + ( InstanceField[Var["MapIndex"]]["Balance"]["SpeedRate"] / 1000 ) cSetNPCParam( Var["Handle"], "RunSpeed", speed * speedrate ) end end --[[ ]]-- --[[ SummonType¿¡ µû¶ó ¸÷ ¼Òȯ ó¸® ]]-- --[[ ]]-- function SummonGroupProcess( Var ) if Var == nil then return end if Var["SummonType"] == nil then return end if Var["SummonProgress"] == nil then local SummonProgress = {} SummonProgress["LastSummonTime"] = cCurrentSecond() SummonProgress["PlayerCheckTime"] = cCurrentSecond() Var["SummonProgress"] = SummonProgress end local CurSec = cCurrentSecond() -- ¼Òȯ½Ã°£ üũ if Var["SummonProgress"]["LastSummonTime"] + Var["SummonType"]["CoolTime"] > CurSec then return end -- Ç÷¹ÀÌ¾î °Ë»ö ÁÙÀ̱â À§ÇØ 1ÃÊ¿¡ Çѹø üũ if Var["SummonProgress"]["PlayerCheckTime"] + SUMMTYPE_CHK_DLY > CurSec then return end Var["SummonProgress"]["PlayerCheckTime"] = CurSec -- ÁÖº¯ Ç÷¹À̾î üũ if cFindNearPlayer( Var["Handle"], Var["SummonType"]["CheckRange"], FollowTypeTable["All"] ) == nil then return end local CurSummonGroupType = SummonGroupTypeTable[Var["SummonType"]["SummonGroupType"]] for i=1, #CurSummonGroupType do local CurSummonMobType = SummonMobTypeTable[CurSummonGroupType[i]["SummonMobType"]] local CurMobSettingData = MobSettingTypeTable[CurSummonMobType["MobSettingType"]] local RegenCoord = {} local Dir = CurSummonGroupType[i]["Dir"] if CurSummonGroupType[i]["Rotate"] == true then Dir = Dir + cGetDirect( Var["Handle"] ) end RegenCoord["x"], RegenCoord["y"] = cGetAroundCoord( Var["Handle"], Dir, CurSummonGroupType[i]["Dist"] ) -- ¼Òȯ¸÷ ¸®Á¨ ¹× ¼ÂÆà local RegenMob = {} RegenMob["Handle"] = cMobRegen_XY( Var["MapIndex"], CurMobSettingData["Index"], RegenCoord["x"], RegenCoord["y"], 0 ) if RegenMob["Handle"] ~= nil then RegenMob["MapIndex"] = Var["MapIndex"] RegenMob["MobSettingType"] = MobSettingTypeTable[CurSummonMobType["MobSettingType"]] RegenMob["BoomType"] = BoomTypeTable [CurSummonMobType["BoomType"] ] local DamageRate = (InstanceField[Var["MapIndex"]]["Balance"]["DamageRate"] + InstanceField[Var["MapIndex"]]["FenceBalance"]["DamageRate"]) / 2000 local HPRate = (InstanceField[Var["MapIndex"]]["Balance"]["HPRate"] + InstanceField[Var["MapIndex"]]["FenceBalance"]["HPRate"]) / 2000 local SpeedRate = (InstanceField[Var["MapIndex"]]["Balance"]["SpeedRate"] + InstanceField[Var["MapIndex"]]["FenceBalance"]["SpeedRate"]) / 2000 RegenMob["Damage"] = CurMobSettingData["Demage"] * DamageRate cSetNPCParam( RegenMob["Handle"], "MaxHP", CurMobSettingData["HP"] * HPRate ) cSetNPCParam( RegenMob["Handle"], "HP", CurMobSettingData["HP"] * HPRate ) cSetNPCParam( RegenMob["Handle"], "RunSpeed", CurMobSettingData["Speed"] * SpeedRate ) cSetNPCParam( RegenMob["Handle"], "HPRegen", CurMobSettingData["HPRegen"] ) cSetNPCParam( RegenMob["Handle"], "AC", CurMobSettingData["AC"] ) cSetNPCParam( RegenMob["Handle"], "MR", CurMobSettingData["MR"] ) cSetNPCParam( RegenMob["Handle"], "MobEXP", CurMobSettingData["Exp"] ) cSetNPCResist( RegenMob["Handle"], ResistTypeTable[CurSummonMobType["ResistType"]] ) cSetNPCIsItemDrop( RegenMob["Handle"], CurMobSettingData["ItemDrop"] ) -- ¸®Á¨½Ã °É¸®´Â ¹«Àû »óÅÂÀÌ»ó Ç®¾îÁÜ cResetAbstate( RegenMob["Handle"], ABSTATE_IMT_IDX ) -- ¼ÒȯµÈ¸÷ ÆøźŸÀÔ ÀÏ °æ¿ì Á¤º¸ ÀúÀå if RegenMob["BoomType"] ~= nil then cSetAIScript( SCRIPT_MAIN, RegenMob["Handle"] ) cAIScriptFunc( RegenMob["Handle"], "Entrance", "MobRoutine" ) InstanceField[Var["MapIndex"]]["WaveRunner"][RegenMob["Handle"]] = RegenMob end end end -- ¼Òȯ½Ã°£ °»½Å Var["SummonProgress"]["LastSummonTime"] = CurSec end --[[ ]]-- --[[ EscortGroupType¿¡ µû¶ó ¸÷ ¼Òȯ ó¸® ]]-- --[[ ]]-- function EscortGroupProcess( Var ) if Var == nil then return end if Var["EscortGroupType"] == nil then return end for i=1, #Var["EscortGroupType"] do local CurSummonMobType = SummonMobTypeTable[Var["EscortGroupType"][i]["SummonMobType"]] local CurMobSettingData = MobSettingTypeTable[CurSummonMobType["MobSettingType"]] local RegenCoord = {} local Dir = Var["EscortGroupType"][i]["Dir"] if Var["EscortGroupType"][i]["Rotate"] == true then Dir = Dir + cGetDirect( Var["Handle"] ) end RegenCoord["x"], RegenCoord["y"] = cGetAroundCoord( Var["Handle"], Dir, Var["EscortGroupType"][i]["Dist"] ) -- È£À§¸÷ ¸®Á¨ ¹× ¼ÂÆà local RegenMob = {} RegenMob["Handle"] = cMobRegen_XY( Var["MapIndex"], CurMobSettingData["Index"], RegenCoord["x"], RegenCoord["y"], 0 ) if RegenMob["Handle"] ~= nil then RegenMob["MapIndex"] = Var["MapIndex"] RegenMob["MobSettingType"] = MobSettingTypeTable[CurSummonMobType["MobSettingType"]] RegenMob["BoomType"] = BoomTypeTable [CurSummonMobType["BoomType"] ] -- È£À§¸÷ ó¸® °ü·ÃÁ¤º¸ RegenMob["Master"] = Var["Handle"] RegenMob["Rotate"] = Var["EscortGroupType"][i]["Rotate"] RegenMob["Dir"] = Var["EscortGroupType"][i]["Dir"] RegenMob["Dist"] = Var["EscortGroupType"][i]["Dist"] local DamageRate = (InstanceField[Var["MapIndex"]]["Balance"]["DamageRate"] + InstanceField[Var["MapIndex"]]["FenceBalance"]["DamageRate"]) / 2000 local HPRate = (InstanceField[Var["MapIndex"]]["Balance"]["HPRate"] + InstanceField[Var["MapIndex"]]["FenceBalance"]["HPRate"]) / 2000 local SpeedRate = (InstanceField[Var["MapIndex"]]["Balance"]["SpeedRate"] + InstanceField[Var["MapIndex"]]["FenceBalance"]["SpeedRate"]) / 2000 RegenMob["Damage"] = CurMobSettingData["Demage"] * DamageRate cSetNPCParam( RegenMob["Handle"], "MaxHP", CurMobSettingData["HP"] * HPRate ) cSetNPCParam( RegenMob["Handle"], "HP", CurMobSettingData["HP"] * HPRate ) cSetNPCParam( RegenMob["Handle"], "RunSpeed", CurMobSettingData["Speed"] * SpeedRate ) cSetNPCParam( RegenMob["Handle"], "HPRegen", CurMobSettingData["HPRegen"] ) cSetNPCParam( RegenMob["Handle"], "AC", CurMobSettingData["AC"] ) cSetNPCParam( RegenMob["Handle"], "MR", CurMobSettingData["MR"] ) cSetNPCParam( RegenMob["Handle"], "MobEXP", CurMobSettingData["Exp"] ) cSetNPCResist( RegenMob["Handle"], ResistTypeTable[CurSummonMobType["ResistType"]] ) cSetNPCIsItemDrop( RegenMob["Handle"], CurMobSettingData["ItemDrop"] ) -- ¸®Á¨½Ã °É¸®´Â ¹«Àû »óÅÂÀÌ»ó Ç®¾îÁÜ cResetAbstate( RegenMob["Handle"], ABSTATE_IMT_IDX ) cSetAIScript( SCRIPT_MAIN, RegenMob["Handle"] ) cAIScriptFunc( RegenMob["Handle"], "Entrance", "MobRoutine" ) -- ¼ÒȯµÈ¸÷ Á¤º¸ ÀúÀå InstanceField[Var["MapIndex"]]["WaveRunner"][RegenMob["Handle"]] = RegenMob end end Var["EscortGroupType"] = nil end --[[ ]]-- --[[ EscortGroupProcess¿¡¼­ ¼ÒȯµÈ ¸÷ ó¸® ]]-- --[[ ]]-- function EscortMobProcess( Var ) if Var == nil then return end if Var["Master"] == nil then return end -- Æøź ŸÀÔÀΰæ¿ì Ÿ°ÙÀÌ ¼³Á¤µÇ¸é À̵¿Ã³¸® ¹«½Ã if Var["BoomType"] ~= nil then if Var["BoomTarget"] ~= nil then return end end -- ¸¶½ºÅÍ°¡ Á×¾úÀ» °æ¿ì ó¸® if cIsObjectDead( Var["Master"] ) then if Var["BoomType"] ~= nil then local ply = cFindNearPlayer( Var["Handle"], Var["BoomType"]["ExplosionGap"], FollowTypeTable["All"] ) if ply ~= nil then local AbstateTypeData = AbstateTypeTable[Var["BoomType"]["AbstateType"]] cSetAbstate( ply, AbstateTypeData["Index"], 1, AbstateTypeData["KeepTime"], Var["Handle"] ) end end InstanceField[Var["MapIndex"]]["WaveRunner"][Var["Handle"]] = nil -- Ãß°¡ °³¼± 6. ¸ó½ºÅÍ°¡ ¸ñÃ¥¿¡ ºÎµúÈú ¶§, Á×´Â ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® cAIScriptSet( Var["Handle"] ) cNPCVanish( Var["Handle"] ) return end if Var["EscortProgress"] == nil then local EscortProgress = {} EscortProgress["CurGoalX"] = ESCORT_H_G_INIT EscortProgress["CurGoalY"] = ESCORT_H_G_INIT EscortProgress["LastCheckTime"] = cCurrentSecond() EscortProgress["CurMoveState"] = MOVESTATE["STOP"] Var["EscortProgress"] = EscortProgress end if Var["EscortProgress"]["CurMoveState"] == MOVESTATE["STOP"] then if cWillMovement( Var["Handle"] ) == nil then -- ¿òÁ÷ÀÏ ¼ö ¾ø´Â »óÅ return end Var["EscortProgress"]["CurMoveState"] = MOVESTATE["MOVE"] else if cWillMovement( Var["Handle"] ) == nil then -- ¿òÁ÷ÀÏ ¼ö ¾ø´Â »óÅ Var["EscortProgress"]["CurGoalX"] = ESCORT_H_G_INIT Var["EscortProgress"]["CurGoalX"] = ESCORT_H_G_INIT Var["EscortProgress"]["CurMoveState"] = MOVESTATE["STOP"] return end end local CurSec = cCurrentSecond() if Var["EscortProgress"]["LastCheckTime"] + ESCOTYPE_CHK_DLY <= CurSec then Var["EscortProgress"]["LastCheckTime"] = CurSec local CurAroundCoord = {} local CurMasterCoord = {} local CurMasterGoal = {} local CalcTempCoord = {} local CalcTempDist = 0 local Dir = Var["Dir"] if Var["Rotate"] == true then Dir = Dir + cGetDirect( Var["Master"] ) end CurAroundCoord["x"], CurAroundCoord["y"] = cGetAroundCoord( Var["Master"], Dir, Var["Dist"] ) -- ÇöÀç ¸÷ÀÌ À̵¿ÇÏ°í ÀÖ¾î¾ßÇÒ ÁÂÇ¥¿Í ¸¹ÀÌ Â÷ÀÌ ³¯ °æ¿ì ó¸® CalcTempCoord["x"], CalcTempCoord["y"] = cObjectLocate( Var["Handle"] ) CalcTempDist = cDistanceSquar( CalcTempCoord["x"], CalcTempCoord["y"], CurAroundCoord["x"], CurAroundCoord["y"] ) if CalcTempDist >= ESCORT_H_GAP then cRunTo( Var["Handle"], CurAroundCoord["x"], CurAroundCoord["y"], ESCORT_H_S_RATE ) Var["EscortProgress"]["CurGoalX"] = ESCORT_H_G_INIT Var["EscortProgress"]["CurGoalY"] = ESCORT_H_G_INIT return end CurMasterCoord["x"], CurMasterCoord["y"] = cObjectLocate( Var["Master"] ) CurMasterGoal["x"], CurMasterGoal["y"] = cMove2Where( Var["Master"] ) -- ÀϹÝÀûÀÎ °æ¿ì À̵¿ ó¸® CalcTempCoord["x"] = CurMasterGoal["x"] - CurMasterCoord["x"] CalcTempCoord["y"] = CurMasterGoal["y"] - CurMasterCoord["y"] CalcTempCoord["x"] = CalcTempCoord["x"] + CurAroundCoord["x"] CalcTempCoord["y"] = CalcTempCoord["y"] + CurAroundCoord["y"] CalcTempDist = cDistanceSquar( CalcTempCoord["x"], CalcTempCoord["y"], Var["EscortProgress"]["CurGoalX"], Var["EscortProgress"]["CurGoalY"] ) if CalcTempDist >= ESCORT_M_GAP then Var["EscortProgress"]["CurGoalX"] = CalcTempCoord["x"] Var["EscortProgress"]["CurGoalY"] = CalcTempCoord["y"] cRunTo( Var["Handle"], CalcTempCoord["x"], CalcTempCoord["y"], 1000 ) end end end --[[ ]]-- --[[ PathType¿¡ µû¶ó ¸÷ À̵¿ ó¸® ]]-- --[[ ]]-- function PathTypeProcess( Var ) if Var == nil then return end if Var["PathType"] == nil then return end -- Æøź ŸÀÔÀΰæ¿ì Ÿ°ÙÀÌ ¼³Á¤µÇ¸é À̵¿Ã³¸® ¹«½Ã if Var["BoomType"] ~= nil then if Var["BoomTarget"] ~= nil then return end end if Var["PathProgress"] == nil then local PathProgress = {} PathProgress["GoalCheckTime"] = cCurrentSecond() PathProgress["CurPathStep"] = 1 PathProgress["CurMoveState"] = MOVESTATE["STOP"] Var["PathProgress"] = PathProgress end if Var["PathProgress"]["CurPathStep"] > #Var["PathType"] then -- ¸ñÀûÁö±îÁö ¿ÏÁÖÇÑ°æ¿ì Á¤º¸ Ŭ¸®¾î ½ÃŲ´Ù Var["PathType"] = nil Var["PathProgress"] = nil return end if Var["PathProgress"]["CurMoveState"] == MOVESTATE["STOP"] then if cWillMovement( Var["Handle"] ) == nil then -- ¿òÁ÷ÀÏ ¼ö ¾ø´Â »óÅ return end -- À̵¿¼Óµµ õºÐ·üÀº ÇÊ¿äÇÏ¸é º¯°æ cRunTo( Var["Handle"], Var["PathType"][Var["PathProgress"]["CurPathStep"]]["x"], Var["PathType"][Var["PathProgress"]["CurPathStep"]]["y"], 1000 ) Var["PathProgress"]["CurMoveState"] = MOVESTATE["MOVE"] end if Var["PathProgress"]["CurMoveState"] == MOVESTATE["MOVE"] then if cWillMovement( Var["Handle"] ) == nil then -- ¿òÁ÷ÀÏ ¼ö ¾ø´Â »óÅ Var["PathProgress"]["CurMoveState"] = MOVESTATE["STOP"] return end end -- ¸ñÇ¥Á¡ üũ Á¦ÇÑ local CurSec = cCurrentSecond() if Var["PathProgress"]["GoalCheckTime"] + PATHTYPE_CHK_DLY > CurSec then return end Var["PathProgress"]["GoalCheckTime"] = CurSec -- ¸ñÇ¥Á¡ üũ local curr = {} local goal = {} curr["x"], curr["y"] = cObjectLocate( Var["Handle"] ) goal["x"] = Var["PathType"][Var["PathProgress"]["CurPathStep"]]["x"] goal["y"] = Var["PathType"][Var["PathProgress"]["CurPathStep"]]["y"] local dx = goal["x"] - curr["x"] local dy = goal["y"] - curr["y"] local distsquar = dx * dx + dy * dy if distsquar < PATHTYPE_GAP then Var["PathProgress"]["CurPathStep"] = Var["PathProgress"]["CurPathStep"] + 1 Var["PathProgress"]["CurMoveState"] = MOVESTATE["STOP"] return end -- ¸÷ÀÌ À̵¿ ¸ØÃß´Â Çö»ó ¶§¹®¿¡ ¸ñÀûÁö üũ curr["x"], curr["y"] = cMove2Where( Var["Handle"] ) if curr["x"] ~= goal["x"] and curr["y"] ~= goal["y"] then cRunTo( Var["Handle"], Var["PathType"][Var["PathProgress"]["CurPathStep"]]["x"], Var["PathType"][Var["PathProgress"]["CurPathStep"]]["y"], 1000 ) end return end --[[***** *****]]-- --[[***** °ÔÀÌÆ® ó¸® ·çƾ ¸ÞÀÎ *****]]-- --[[***** : *****]]-- --[[***** *****]]-- GateMapIndex = {} -- ¿£ÇǾ¾Å¬¸¯½Ã¿¡ ¸ÊÀ妽º¸¦ ¹ÞÁö ¾Ê¾Æ ¸®Á¨½Ã¿¡ ¸ÊÀ妽º¸¦ ÀúÀå function GateRoutine( Handle, MapIndex ) if InstanceField[MapIndex] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) GateMapIndex[Handle] = nil return ReturnAI["END"] end if InstanceField[MapIndex]["GateList"] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) GateMapIndex[Handle] = nil return ReturnAI["END"] end if InstanceField[MapIndex]["GateList"][Handle] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) GateMapIndex[Handle] = nil return ReturnAI["END"] end if cIsObjectDead( Handle ) then cAIScriptSet( Handle ) InstanceField[MapIndex]["GateList"][Handle] = nil GateMapIndex[Handle] = nil return ReturnAI["END"] end if GateMapIndex[Handle] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) InstanceField[MapIndex]["GateList"][Handle] = nil return ReturnAI["END"] end return ReturnAI["END"] end function GateFunc( NPCHandle, PlyHandle, RegistNumber ) local MapIndex = GateMapIndex[NPCHandle] if MapIndex == nil then return end if InstanceField[MapIndex] == nil then return end if InstanceField[MapIndex]["GateList"] == nil then return end local Var = InstanceField[MapIndex]["GateList"][NPCHandle] if Var == nil then return end cLinkTo( PlyHandle, MapIndex, Var["GateData"]["GoalX"], Var["GateData"]["GoalY"] ) end --[[***** *****]]-- --[[***** ¹æ¾î¿ÀºêÁ§Æ® ó¸® ·çƾ ¸ÞÀÎ *****]]-- --[[***** : *****]]-- --[[***** *****]]-- DefObjMapIndex = {} -- ¿£ÇǾ¾Å¬¸¯½Ã¿¡ ¸ÊÀ妽º¸¦ ¹ÞÁö ¾Ê¾Æ ¸®Á¨½Ã¿¡ ¸ÊÀ妽º¸¦ ÀúÀå function DefObjRoutine( Handle, MapIndex ) if InstanceField[MapIndex] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) DefObjMapIndex[Handle] = nil return ReturnAI["END"] end if InstanceField[MapIndex]["DefObjList"] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) DefObjMapIndex[Handle] = nil return ReturnAI["END"] end local Var = InstanceField[MapIndex]["DefObjList"][Handle] if Var == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) DefObjMapIndex[Handle] = nil return ReturnAI["END"] end if cIsObjectDead( Handle ) then cAIScriptSet( Handle ) InstanceField[MapIndex]["DefObjList"][Handle] = nil DefObjMapIndex[Handle] = nil return ReturnAI["END"] end if DefObjMapIndex[Handle] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) InstanceField[MapIndex]["DefObjList"][Handle] = nil return ReturnAI["END"] end DefObjDamage( Var ) return ReturnAI["END"] end function DefObjDamage( Var ) if Var == nil then return end local MapIndex = DefObjMapIndex[Var["Handle"]] if MapIndex == nil then return end if InstanceField[MapIndex]["WaveRunner"] == nil then return end -- hp üũ if Var["CurHP"] <= 0 then return end -- üũ µô·¹ÀÌ local CurSec = cCurrentSecond() if Var["LastCheckTime"] + DEF_TYPE_CHK_DLY > CurSec then return end Var["LastCheckTime"] = CurSec local ObjList = { cNearObjectList( Var["Handle"], Var["Data"]["DamageRange"], ObjectType["Mob"] ) } local tmpHP = Var["CurHP"] for index, value in pairs( ObjList ) do local obj = InstanceField[MapIndex]["WaveRunner"][value] if obj ~= nil then Var["CurHP"] = Var["CurHP"] - obj["Damage"] -- ¿þÀ̺ê¸÷ Á¦°Å InstanceField[MapIndex]["WaveRunner"][value] = nil cAIScriptSet( value ) -- Ãß°¡ °³¼± 6. ¸ó½ºÅÍ°¡ ¸ñÃ¥¿¡ ºÎµúÈú ¶§, Á×´Â ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® --cNPCVanish( value ) local CurHP, MaxHP = cObjectHP( value ) cDamaged( value, CurHP, Var["Handle"] ) if Var["CurHP"] <= 0 then break end end end -- hp º¯È­°¡ ÀÖ´ÂÁö üũ if tmpHP == Var["CurHP"] then return end if Var["CurHP"] <= 0 then cScriptMessage( MapIndex, AnnounceInfo["KDMine_Fence_Dst"], Var["MMGroup"] ) -- ¸ñÃ¥ÀÌ Æı«µÊ -- ü·ÂÀÌ ¸ðµÎ ¼Ò¸ðµÈ Æı« »óÅ -- ÇöÀç »óÅÂ¿Í ´Ù¸£¸é ¾ÆÀÌÄÜ ¹Ù²ãÁÜ if Var["CurMM"] ~= MMGroupTypeTable[Var["Data"]["MMGroupType"]]["Destruct"] then Var["CurMM"] = MMGroupTypeTable[Var["Data"]["MMGroupType"]]["Destruct"] local MapMarkTable = {} local mmData = {} mmData["Group"] = MM_G_FENCE + Var["MMGroup"] mmData["x"] = Var["Data"]["x"] mmData["y"] = Var["Data"]["y"] mmData["KeepTime"] = MapMarkTypeTable[Var["CurMM"]]["KeepTime"] mmData["IconIndex"] = MapMarkTypeTable[Var["CurMM"]]["IconIndex"] MapMarkTable[mmData["Group"]] = mmData cMapMark( MapIndex, MapMarkTable ) end -- Æı«µÈ°æ¿ì ÄðŸÀÓ ¼Â Var["DestroyTime"] = CurSec -- ¹ë·±½º°ª Á¶Á¤ local FenceBalance = InstanceField[MapIndex]["FenceBalance"] if FenceBalance ~= nil then local BalanceData = DefBalanceTypeTable[Var["Data"]["DefBalanceType"]] if BalanceData ~= nil then FenceBalance["DamageRate"] = FenceBalance["DamageRate"] + BalanceData["DamageRate"] FenceBalance["SpeedRate"] = FenceBalance["SpeedRate"] + BalanceData["SpeedRate"] FenceBalance["HPRate"] = FenceBalance["HPRate"] + BalanceData["HPRate"] end end else -- µ¥¹ÌÁö ÀÔÀº »óÅ cScriptMessage( MapIndex, AnnounceInfo["KDMine_Fence_Atk"], Var["MMGroup"] ) -- ¸ñÃ¥ÀÌ °ø°Ý¹Þ°í ÀÖÀ½ -- ÇöÀç »óÅÂ¿Í ´Ù¸£¸é ¾ÆÀÌÄÜ ¹Ù²ãÁÜ if Var["CurMM"] ~= MMGroupTypeTable[Var["Data"]["MMGroupType"]]["Damage"] then Var["CurMM"] = MMGroupTypeTable[Var["Data"]["MMGroupType"]]["Damage"] local MapMarkTable = {} local mmData = {} mmData["Group"] = MM_G_FENCE + Var["MMGroup"] mmData["x"] = Var["Data"]["x"] mmData["y"] = Var["Data"]["y"] mmData["KeepTime"] = MapMarkTypeTable[Var["CurMM"]]["KeepTime"] mmData["IconIndex"] = MapMarkTypeTable[Var["CurMM"]]["IconIndex"] MapMarkTable[mmData["Group"]] = mmData cMapMark( MapIndex, MapMarkTable ) end end local CurHPRate = (Var["CurHP"] * 1000) / Var["Data"]["HP"] local CurAniData = AniStateTypeTable[Var["Data"]["AniStateType"]] for i=1, #CurAniData do if CurHPRate <= CurAniData[i]["HPRate"] then -- ¾Ö´Ï¸ÅÀÌ¼Ç º¯È­°¡ ÀÖÀ¸¸é ¹Ù²ãÁÜ if Var["CurAni"] ~= i then Var["CurAni"] = i cAnimate( Var["Handle"], "start", CurAniData[i]["AniIndex"] ) end break end end end function DefObjClick( NPCHandle, PlyHandle, PlyRegNum ) local MapIndex = DefObjMapIndex[NPCHandle] if MapIndex == nil then return end if InstanceField[MapIndex] == nil then return end if InstanceField[MapIndex]["DefObjList"] == nil then return end local Var = InstanceField[MapIndex]["DefObjList"][NPCHandle] if Var == nil then return end if Var["CurHP"] > 0 then return end if Var["DestroyTime"] + Var["Data"]["RepairDlyTime"] > cCurrentSecond() then return end cCastingBar( PlyHandle, NPCHandle, (Var["Data"]["RepairTime"] * 1000), CHAR_CASTING ) end function DefObjCasting( NPCHandle, PlyHandle, PlyRegNum, Menu ) local MapIndex = DefObjMapIndex[NPCHandle] if MapIndex == nil then return end if InstanceField[MapIndex] == nil then return end if InstanceField[MapIndex]["DefObjList"] == nil then return end local Var = InstanceField[MapIndex]["DefObjList"][NPCHandle] if Var == nil then return end if Var["CurHP"] > 0 then return end -- ¹ë·±½º°ª Á¶Á¤ local FenceBalance = InstanceField[MapIndex]["FenceBalance"] if FenceBalance ~= nil then local BalanceData = DefBalanceTypeTable[Var["Data"]["DefBalanceType"]] if BalanceData ~= nil then FenceBalance["DamageRate"] = FenceBalance["DamageRate"] - BalanceData["DamageRate"] FenceBalance["SpeedRate"] = FenceBalance["SpeedRate"] - BalanceData["SpeedRate"] FenceBalance["HPRate"] = FenceBalance["HPRate"] - BalanceData["HPRate"] end end Var["CurHP"] = Var["Data"]["HP"] Var["CurAni"] = #AniStateTypeTable[Var["Data"]["AniStateType"]] Var["CurMM"] = MMGroupTypeTable[Var["Data"]["MMGroupType"]]["Normal"] local MapMarkTable = {} local mmData = {} mmData["Group"] = MM_G_FENCE + Var["MMGroup"] mmData["x"] = Var["Data"]["x"] mmData["y"] = Var["Data"]["y"] mmData["KeepTime"] = MapMarkTypeTable[Var["CurMM"]]["KeepTime"] mmData["IconIndex"] = MapMarkTypeTable[Var["CurMM"]]["IconIndex"] MapMarkTable[mmData["Group"]] = mmData cMapMark( MapIndex, MapMarkTable ) cScriptMessage( MapIndex, AnnounceInfo["KDMine_Fence_Rep"], Var["MMGroup"] ) -- ¸ñÃ¥ÀÌ ¼ö¸®µÊ cAnimate( NPCHandle, "start", AniStateTypeTable[Var["Data"]["AniStateType"]][Var["CurAni"]]["AniIndex"] ) end --[[***** *****]]-- --[[***** ¸ÞÀοÀºêÁ§Æ® ó¸® ·çƾ ¸ÞÀÎ *****]]-- --[[***** : *****]]-- --[[***** *****]]-- function MainObjRoutine( Handle, MapIndex ) if InstanceField[MapIndex] == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end local Var = InstanceField[MapIndex]["MainObj"] if Var == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if cIsObjectDead( Handle ) then cAIScriptSet( Handle ) InstanceField[MapIndex]["MainObj"] = nil return ReturnAI["END"] end MainObjDamage( Var ) end function MainObjDamage( Var ) if Var == nil then return end -- üũ µô·¹ÀÌ local CurSec = cCurrentSecond() if Var["LastCheckTime"] + DEF_TYPE_CHK_DLY > CurSec then return end Var["LastCheckTime"] = CurSec local ObjList = { cNearObjectList( Var["Handle"], Var["Data"]["DamageRange"], ObjectType["Mob"] ) } local tmpHP = Var["CurHP"] for index, value in pairs( ObjList ) do local obj = InstanceField[Var["MapIndex"]]["WaveRunner"][value] if obj ~= nil then Var["CurHP"] = Var["CurHP"] - obj["Damage"] -- ¿þÀ̺ê¸÷ Á¦°Å InstanceField[Var["MapIndex"]]["WaveRunner"][value] = nil cAIScriptSet( value ) cNPCVanish( value ) if Var["CurHP"] <= 0 then break end end end -- hp º¯È­°¡ ÀÖ´ÂÁö üũ if tmpHP == Var["CurHP"] then return end -- Ãß°¡ °³¼± 1. ÃÖÁ¾ ¿ÀºêÁ§Æ®ÀÎ Å»Ãⱸ¸¦ ¸ó½ºÅÍ°¡ ºÎµúÈú ¶§, local TotalDmg = (MainDefenceObject["HP"] - Var["CurHP"]) if Var["CurHP"] <= 0 then -- Æı« »óÅ -- Ãß°¡ °³¼± 1. ÃÖÁ¾ ¿ÀºêÁ§Æ®ÀÎ Å»Ãⱸ¸¦ ¸ó½ºÅÍ°¡ ºÎµúÈú ¶§, cScriptMessage( Var["MapIndex"], AnnounceInfo["KDMine_Gate_Dst"], TotalDmg ) -- cScriptMessage( Var["MapIndex"], AnnounceInfo["KDMine_Gate_Dst"] ) else -- µ¥¹ÌÁö ÀÔÀº »óÅ -- Ãß°¡ °³¼± 1. ÃÖÁ¾ ¿ÀºêÁ§Æ®ÀÎ Å»Ãⱸ¸¦ ¸ó½ºÅÍ°¡ ºÎµúÈú ¶§, cScriptMessage( Var["MapIndex"], AnnounceInfo["KDMine_Gate_Esc"], TotalDmg ) -- cScriptMessage( Var["MapIndex"], AnnounceInfo["KDMine_Gate_Esc"] ) end end --[[***** *****]]-- --[[***** Áö·Ú ó¸® ·çƾ ¸ÞÀÎ *****]]-- --[[***** : *****]]-- --[[***** *****]]-- MineMemory = {} -- °³º° ¸Þ¸ð¸®·Î ó¸® function MineRoutine( Handle, MapIndex ) local Var = MineMemory[Handle] if Var == nil then cAIScriptSet( Handle ) cNPCVanish( Handle ) return ReturnAI["END"] end if cIsObjectDead( Handle ) then cAIScriptSet( Handle ) MineMemory[Handle] = nil return ReturnAI["END"] end if InstanceField[MapIndex] == nil then MineMemory[Handle] = nil return ReturnAI["END"] end local CurSec = cCurrentSecond() if Var["BoomFlag"] ~= nil then if Var["RegenTime"] + Var["Data"]["HitTime"] < CurSec then if InstanceField[MapIndex]["WaveRunner"] ~= nil then local ObjList = { cNearObjectList( Var["Handle"], Var["Data"]["Range"], ObjectType["Mob"] ) } for index, value in pairs( ObjList ) do local obj = InstanceField[MapIndex]["WaveRunner"][value] if obj ~= nil and cIsObjectDead( value ) == nil then cDamaged( value, Var["Data"]["Damage"], Var["Handle"] ) local Abstate = AbstateTypeTable[Var["Data"]["AbstateType"]] if Abstate ~= nil then cSetAbstate( value, Abstate["Index"], 1, Abstate["KeepTime"], Var["Handle"] ) end end end end Var["BoomFlag"] = nil end end if Var["RegenTime"] + Var["Data"]["LifeTime"] < CurSec then MineMemory[Handle] = nil end return ReturnAI["END"] end