-------------------------------------------------------------------------------- -- Routine -- -------------------------------------------------------------------------------- function DummyRoutineFunc() cExecCheck "DummyRoutineFunc" return ReturnAI["END"] end ---------------------------------------------------------------------- -- MapLogin Function ---------------------------------------------------------------------- function PlayerMapLogin( MapIndex, Handle ) cExecCheck "PlayerMapLogin" local CurSec = cCurrentSecond() local TeamType = cGetKQTeamType( Handle ) local CharNo = cGetCharNo( Handle ) local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "PlayerMapLogin : Var nil" ) return end if CurSec == nil then ErrorLog( "PlayerMapLogin : CurSec nil" ) return end if TeamType == nil then ErrorLog( "PlayerMapLogin : TeamType nil" ) return end if TeamType ~= KQ_TEAM["RED"] and TeamType ~= KQ_TEAM["BLUE"] then ErrorLog( "PlayerMapLogin : Invalid TeamType "..TeamType ) return end if CharNo == nil then ErrorLog( "PlayerMapLogin : CharNo nil" ) return end if Var["Team"] == nil then ErrorLog( "PlayerMapLogin : Var[\"Team\"] nil" ) return end -- Á¢¼Ó½Ã »èÁ¦ ½ÃÄÑÁÙ »óÅÂÀÌ»ó for i = 1, #LoginResetAbstate do cResetAbstate( Handle, LoginResetAbstate[ i ] ) end -- Ç÷¹À̾î Á¤º¸ Ãß°¡, °»½Å local PlayerInfo = Player_Get( Var, CharNo ) if PlayerInfo == nil then -- ½Å±Ô Ç÷¹À̾î Á¤º¸ Ãß°¡ Player_Insert( Var, CharNo, Handle, TeamType ) else -- ±âÁ¸ Ç÷¹À̾î Á¤º¸ °»½Å PlayerInfo["Handle"] = Handle PlayerInfo["IsInMap"] = true end -- ÆÀ À¯´ÏÆû Âø¿ë for i = 1, #TeamUniform[ TeamType ] do cViewSlotEquip( Handle, TeamUniform[ TeamType ][ i ] ) cSetAbstate( Handle, TeamAbstate[ TeamType ]["Index"], TeamAbstate[ TeamType ]["Str"], TeamAbstate[ TeamType ]["KeepTime"], Handle ) end -- À̵¿ ¼Óµµ °íÁ¤ cStaticWalkSpeed( Handle, true, 33 ) cStaticRunSpeed( Handle, true, 127 ) -- ¶ó¿îµå ÁøÇà ÁßÀÌ ¾Æ´Ï¸é ÇÔ¼ö Á¾·á if Var["RoundEndTime"] <= 0 then return end -- Á¡¼ö, ŸÀÌ¸Ó Á¤º¸ Àü¼Û local RedTeamInfo = Var["Team"][ KQ_TEAM["RED"] ] local BlueTeamInfo = Var["Team"][ KQ_TEAM["BLUE"] ] -- ¶ó¿îµå ÁøÇà Áß, Ç÷¹À̾î Á¤º¸°¡ ÀÖÀ¸¸é if PlayerInfo ~= nil then if PlayerInfo["IsOut"] == false then Var["Team"][ TeamType ]["Score"] = Var["Team"][ TeamType ]["Score"] + 1 end end -- Á¡¼ö, ½Ã°£ Á¤º¸ ¾Ë¸² cScoreBoard( Handle, true, Var["Round"], RedTeamInfo["RoundResultCount"]["Win"], RedTeamInfo["Score"], BlueTeamInfo["RoundResultCount"]["Win"], BlueTeamInfo["Score"] ) cTimer_Obj( Handle, (Var["RoundEndTime"] - CurSec) ) end ---------------------------------------------------------------------- -- ServantSummon Function ---------------------------------------------------------------------- function ServantSummon( MapIndex, ServantHandle, ServantIndex, MasterHandle ) cExecCheck "ServantSummon" if ServantIndex == WaterBalloon["MobIndex"] then cSetAIScript ( MainLuaScriptPath, ServantHandle ) cAIScriptFunc( ServantHandle, "Entrance", "WaterBallon_Entrance" ) cAIScriptFunc( ServantHandle, "NPCAction", "WaterBallon_NPCAction" ) elseif ServantIndex == WaterCannon["MobIndex"] then cSetAIScript ( MainLuaScriptPath, ServantHandle ) cAIScriptFunc( ServantHandle, "Entrance", "WaterCannon_Entrance" ) end end ---------------------------------------------------------------------- -- WaterBallon_Explosion Function ---------------------------------------------------------------------- function WaterBallon_Explosion( Var, NPCHandle ) cExecCheck "WaterBallon_Explosion" local CurSec = cCurrentSecond() local TeamType = cGetKQTeamType( NPCHandle ) if Var == nil then ErrorLog( "WaterBallon_Explosion : Var nil" ) return end if NPCHandle == nil then ErrorLog( "WaterBallon_Explosion : Var nil" ) return end if CurSec == nil then ErrorLog( "WaterBallon_Explosion : CurSec nil" ) return end if TeamType == nil then ErrorLog( "WaterBallon_Explosion : TeamType nil" ) return end if TeamType ~= KQ_TEAM["RED"] and TeamType ~= KQ_TEAM["BLUE"] then ErrorLog( "WaterBallon_Explosion : Invalid TeamType "..TeamType ) return end -- ¶ó¿îµå ½ÃÀÛ ÀüÀÌ¸é ¾Æ¹« 󸮵µ ÇÏÁö ¾Ê´Â´Ù if Var["RoundEndTime"] > 0 then -- Ç÷¹ÀÌ¾î ¸®½ºÆ®¿¡¼­ ÀûÀÇ °Å¸®¸¦ È®ÀÎ local PlayerList = Var["Player"] if PlayerList == nil then ErrorLog( "WaterBallon_Explosion : PlayerList nil" ) return end for i = 1, #PlayerList do local PlayerInfo = PlayerList[ i ] -- ´ë»ó Á¶°Ç È®ÀÎ if PlayerInfo["IsInMap"] == true and -- ¸Ê¿¡ Á¸ÀçÇÏ´ÂÁö PlayerInfo["TeamType"] == OpposingTeamInfo[ TeamType ] and -- Àû ÆÀÀÎÁö PlayerInfo["PrisonLinkToWaitTime"] == 0 and -- °¨¿Á¿¡ µé¾î°¥ ¿¹Á¤ÀÎÁö PlayerInfo["IsOut"] == false and -- °¨¿Á¿¡ ¹Û¿¡ ÀÖ´ÂÁö cDistanceSquar( NPCHandle, PlayerInfo["Handle"] ) <= (WaterBalloon["Dist"] * WaterBalloon["Dist"]) -- ¹üÀ§ ¾È¿¡ Á¸ÀçÇÏ´ÂÁö then local Player_x, Player_y = cObjectLocate( PlayerInfo["Handle"] ) if Player_x ~= nil and Player_y ~= nil then if cFindAttackBlockLocate( NPCHandle, Player_x, Player_y ) == true -- ¾îÅà ºí·° È®ÀÎ then PlayerInfo["BalloonHandle"] = NPCHandle PlayerInfo["BalloonAbstateTime"] = CurSec + WaterBalloon["SetAbstateWait"] PlayerInfo["PrisonLinkToWaitTime"] = CurSec + WaterBalloon["LinktoWait"] end end end end end cSkillBlast( NPCHandle, NPCHandle, WaterBalloon["SkillIndex"] ) cVanishReserv( NPCHandle, 3 ) end ---------------------------------------------------------------------- -- WaterBallon_Entrance Function ---------------------------------------------------------------------- function WaterBallon_Entrance( Handle, MapIndex ) cExecCheck "WaterBallon_Entrance" -- Á×¾úÀ¸¸é ½ºÅ©¸³Æ® ÇØÁ¦ if cIsObjectDead( Handle ) ~= nil then cAIScriptSet( Handle ) return ReturnAI["END"] end -- Á×À½ ´ë±â¸é ½ºÅ©¸³Æ® ÇØÁ¦ if cIsObjectAlreadyDead( Handle ) == true then cAIScriptSet( Handle ) return ReturnAI["END"] end -- À̵¿ÀÌ ¸ØÃß¾úÀ¸¸é Æø¹ß if cGetMoveState( Handle ) ~= 0 then return ReturnAI["CPP"] end local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "WaterCannon_Entrance : Var nil" ) return ReturnAI["END"] end WaterBallon_Explosion( Var, Handle ) return ReturnAI["END"] end ---------------------------------------------------------------------- -- WaterBallon_NPCAction Function ---------------------------------------------------------------------- function WaterBallon_NPCAction( MapIndex, NPCHandle, PlyHandle, PlyCharNo ) cExecCheck "WaterBallon_NPCAction" local TeamType = cGetKQTeamType( NPCHandle ) local Var = InstanceField[ MapIndex ] local MasterHandle = cGetMaster( NPCHandle ) if Var == nil then ErrorLog( "WaterBallon_NPCAction : Var nil" ) return end if TeamType == nil then ErrorLog( "WaterBallon_NPCAction : TeamType nil" ) return end if TeamType ~= KQ_TEAM["RED"] and TeamType ~= KQ_TEAM["BLUE"] then ErrorLog( "WaterBallon_NPCAction : Invalid TeamType "..TeamType ) return end -- ¼Òȯ¼ö ¸¶½ºÅÍ È®ÀÎ if MasterHandle == PlyHandle then return end -- NPCÀ̵¿ Á¤Áö cMoveStop( NPCHandle ) -- Æø¹ß WaterBallon_Explosion( Var, NPCHandle ) end ---------------------------------------------------------------------- -- WaterCannon_Entrance Function ---------------------------------------------------------------------- function WaterCannon_Entrance( Handle, MapIndex ) cExecCheck "WaterCannon_Entrance" local CurSec = cCurrentSecond() local TeamType = cGetKQTeamType( Handle ) local Var = InstanceField[ MapIndex ] if Var == nil then ErrorLog( "WaterCannon_Entrance : Var nil" ) return end -- ¶ó¿îµå ½ÃÀÛ ÀüÀÌ¸é ¾Æ¹« 󸮵µ ÇÏÁö ¾Ê´Â´Ù. if Var["RoundEndTime"] <= 0 then return end if CurSec == nil then ErrorLog( "WaterCannon_Entrance : CurSec nil" ) return end if TeamType == nil then ErrorLog( "WaterCannon_Entrance : TeamType nil" ) return end if TeamType ~= KQ_TEAM["RED"] and TeamType ~= KQ_TEAM["BLUE"] then ErrorLog( "WaterCannon_Entrance : Invalid TeamType "..TeamType ) return end -- Ç÷¹ÀÌ¾î ¸®½ºÆ®¿¡¼­ ÀûÀÇ °Å¸®¸¦ È®ÀÎ local PlayerList = Var["Player"] if PlayerList == nil then ErrorLog( "WaterCannon_Entrance : PlayerList nil" ) return false end for i = 1, #PlayerList do local PlayerInfo = PlayerList[ i ] -- ´ë»ó Á¶°Ç È®ÀÎ if PlayerInfo["IsInMap"] == true and -- ¸Ê¿¡ Á¸ÀçÇÏ´ÂÁö PlayerInfo["TeamType"] == OpposingTeamInfo[ TeamType ] and -- Àû ÆÀÀÎÁö PlayerInfo["PrisonLinkToWaitTime"] == 0 and -- °¨¿Á¿¡ µé¾î°¥ ¿¹Á¤ÀÎÁö PlayerInfo["IsOut"] == false and -- °¨¿Á¿¡ ¹Û¿¡ ÀÖ´ÂÁö cDistanceSquar( Handle, PlayerInfo["Handle"] ) <= (WaterCannon["Dist"] * WaterCannon["Dist"]) -- ¹üÀ§ ¾È¿¡ ÀÖ´ÂÁö then local Player_x, Player_y = cObjectLocate( PlayerInfo["Handle"] ) if Player_x ~= nil and Player_y ~= nil then if cFindAttackBlockLocate( Handle, Player_x, Player_y ) == true -- ¾îÅà ºí·° È®ÀÎ then cSetAbstate( PlayerInfo["Handle"], WaterCannon["Abstate"]["Index"], 1, WaterCannon["Abstate"]["KeepTime"], Handle ) PlayerInfo["PrisonLinkToWaitTime"] = CurSec + WaterCannon["LinktoWait"] end end end end cNPCVanish( Handle ) return ReturnAI["END"] end