Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Script By: BERKYT
- --Links: VK: https://vk.com/b_e_r_k_y_t Discord: https://discord.gg/amMreCC YouTube: https://www.youtube.com/channel/UCaPBjmrAYO6p-ksHNaymwLg?view_as=subscriber
- --The script is distributed freely, provided that the author of the script is indicated - BERKYT
- import("ScarUtil.scar")
- import("WXPScarUtil.scar")
- function OnGameSetup()
- --Players
- g_Player1 = World_GetPlayerAt(0)
- g_Player2 = World_GetPlayerAt(1)
- g_Player3 = World_GetPlayerAt(2)
- Setup_Player(1, "BERKYT", "tau_race", 1)
- Setup_Player(2, "BERKYT", "npc_race", 0)
- --Warriors
- g_light_infantry = "guard_squad_guardsmen"
- g_base_warrior = "guard_squad_hellhound"
- g_base_warrior_2 = "guard_squad_guardsmen"
- g_support_warrior = "guard_squad_psyker"
- g_support_warrior_2 = "guard_squad_kasrkin"
- g_heavy_support_warrior = "guard_squad_ogryns"
- g_heavy_warrior = "guard_squad_sentinel_advance_sp"
- g_super_heavy_warrior = "guard_squad_ogryns"
- g_light_tank = "guard_squad_chimera"
- g_light_tank_2 = "guard_squad_basilisk"
- g_heavy_tank = "guard_squad_lemanruss"
- g_relic_warrior = "guard_squad_baneblade"
- g_hero = "guard_squad_command_squad"
- g_hero_2 = "guard_squad_assassin"
- --Reinforcement warriors
- g_reinforcement_light_warrior = "guard_squad_guardsmen"
- g_reinforcement_heavy_warrior = "guard_squad_kasrkin"
- g_reinforcement_tank = "guard_squad_lemanruss"
- --Interval
- g_interval = 60
- g_interval_s_s = 60 * 3
- --Squads
- g_sg_wave_troops = "sg_wave_troops"
- --Markers
- g_mkr_spawn_wave = "mkr_spawn_from"
- g_mkr_attack_wave = "mkr_attack_to"
- --Integer
- g_timer_wave = 0
- g_timer_s_s = 0
- g_count_waves = 20
- --Boolean
- g_check_exists_wave = false
- g_check_s_s = false
- g_check_s_s_bool = false
- --Varios
- g_check = 0
- g_check_s_s_hp = nil
- g_check_s_s_hp_2 = nil
- g_sgroupid = nil
- end
- function GuardInit()
- Rule_SetupMusicPlaylist()
- FOW_RevealAll()
- Fade_Start(2, true)
- Cpu_Enable(g_Player2, false)
- Rule_AddInterval(WebMoney, 60 * 2)
- Rule_AddInterval(Sberbank, 60 * 2 + 15)
- Rule_AddInterval(Wave, 1)
- Rule_AddInterval(Timer, 1)
- Rule_AddInterval(CheckingSquadStuck, 1)
- Rule_Add(CheckingLose)
- Util_CreateSquadsAtMarkerEx(g_Player3, "sg_BERKYT_SCRIPT", "space_marine_squad_servitor_sp", g_mkr_attack_wave, 1, 9)
- end
- Scar_AddInit(GuardInit)
- function Rule_SetupMusicPlaylist()
- Util_MissionTitle("By: BERKYT")
- --set the music
- t_IG_stronghold_music = { "MU_IG_STR_ImpGd_perc_brass", "MU_IG_STR_ImpGd", "MU_IG_STR_ImpGd_perc", "MU_IG_STR_ImpGd_perc_str",
- "MU_IG_STR_ImpGd_perc_voice"}
- Playlist_Manager( PC_Music, t_IG_stronghold_music, true, true , {2, 4})
- end
- function WebMoney()
- Util_MissionTitle("WebMoney: R515364081475(RUB) or Z262863085617(USD)(Check ReadMe - file)")
- end
- function Sberbank()
- Util_MissionTitle("Sberbank: 5469 4000 2976 6750 (Check ReadMe - file)")
- end
- function GameOver()
- World_SetGameOver()
- end
- function Wave()
- if (g_check > g_count_waves or g_check == g_count_waves) and check == nil then
- check = false
- Fade_Start(2, false)
- Util_MissionTitle("You win!")
- GameOver()
- end
- if g_check_exists_wave and g_timer_wave == g_interval and SGroup_GetAvgHealth(g_sg_wave_troops) == 0 then
- g_check_s_s = true
- g_check_s_s_bool = true
- g_check_exists_wave = false
- g_timer_s_s = 0
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_light_infantry, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_base_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- g_check = g_check + 1
- Util_MissionTitle("Wave number "..g_check)
- if g_check > World_GetRand(2, 5) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_base_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_base_warrior_2, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- if g_check > World_GetRand(5, 7) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_support_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_support_warrior_2, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- if g_check > World_GetRand(7, 10) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_heavy_support_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_light_tank, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- if g_check > World_GetRand(10, 15) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_super_heavy_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_heavy_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- if g_check > World_GetRand(14, 17) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_light_tank_2, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_heavy_tank, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- if g_check > World_GetRand(17, 20) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_relic_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_hero, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- if g_check > World_GetRand(18, 21) then
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_hero_2, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- Util_CreateSquadsAtMarkerEx(g_Player2, g_sg_wave_troops, g_base_warrior, g_mkr_spawn_wave, World_GetRand(1, 3 + g_check), World_GetRand(4, 13) + g_check)
- end
- SGroup_AddLeaders(g_sg_wave_troops)
- Cmd_AttackMoveMarker(g_sg_wave_troops, g_mkr_attack_wave)
- end
- end
- function Timer()
- SGroup_CreateIfNotFound(g_sg_wave_troops)
- if SGroup_GetAvgHealth(g_sg_wave_troops) == 0 then
- g_check_exists_wave = true
- g_timer_wave = g_timer_wave + 1
- if g_timer_wave > g_interval then
- g_timer_wave = 0
- end
- end
- end
- function CheckingSquadStuck()
- if g_check_s_s then
- SGroup_CreateIfNotFound(g_sg_wave_troops)
- if SGroup_IsUnderAttack(g_sg_wave_troops, false) == false then
- g_timer_s_s = g_timer_s_s + 1
- if g_timer_s_s == g_interval_s_s then
- g_check_s_s = false
- SGroup_DestroyAllSquads(g_sg_wave_troops)
- end
- else
- g_timer_s_s = 0
- g_check_s_s_hp = SGroup_GetAvgHealth(g_sg_wave_troops)
- end
- end
- end
- function CheckingLose()
- if SGroup_GetAvgHealth("sg_BERKYT_SCRIPT") == 0 and check == nil then
- check = false
- Fade_Start(2, false)
- Util_MissionTitle("You lose!")
- GameOver()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement