Advertisement
Guest User

Untitled

a guest
Nov 15th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.66 KB | None | 0 0
  1. /**
  2. * Annihilation PvE Co-op GameMode
  3. * Author : is died during the game
  4.  
  5. * "Contact" : follow the road to the bottom of the road, access the cemetery and look for it
  6. */
  7.  
  8.  
  9. // ---------------------------------- //
  10.  
  11. // Requirements
  12.  
  13. // ---------------------------------- //
  14.  
  15. #Extends "Modes/ShootMania/ModeBase.Script.txt"
  16.  
  17.  
  18. #Const CompatibleMapTypes "AnnihilationArena"
  19.  
  20. #Const Version "2100-01-01"
  21.  
  22. #Const ScriptName "Annihilation.Script.txt"
  23.  
  24.  
  25. #Include "MathLib" as MathLib
  26.  
  27. #Include "TextLib" as TextLib
  28.  
  29. #Include "Libs/Nadeo/Message.Script.txt" as Message
  30.  
  31. #Include "Libs/Nadeo/Interface.Script.txt" as Interface
  32.  
  33. #Include "Libs/Nadeo/ShootMania/SM.Script.txt" as SM
  34.  
  35. #Include "Libs/Nadeo/ShootMania/Score.Script.txt" as Score
  36.  
  37. #Include "Libs/Nadeo/ShootMania/SpawnScreen.Script.txt" as SpawnScreen
  38.  
  39.  
  40.  
  41. // ---------------------------------- //
  42.  
  43. // Settings
  44.  
  45. // ---------------------------------- //
  46.  
  47.  
  48. //#Setting S_GameMode 0 as _("GameMode : 0 - Rounds, 1 - Survival, 2 - Custom (Enable option below)")
  49. //
  50.  
  51. #Setting S_NbPlayers 6 as _("Number of max players")
  52. #Setting S_NbBots 30 as _("Number of bots total")
  53.  
  54.  
  55. #Setting S_Saunter_Radius 10. as _("Radius of bots from their spawn")
  56.  
  57.  
  58. #Setting S_AggroRadius 30. as _("Radius vision of bots")
  59.  
  60.  
  61. #Setting S_DisengageDistance 10. as _("Distance of disengage from their start")
  62.  
  63. #Setting S_Accuracy 0.6 as _("Accuracy of bots")
  64.  
  65. #Setting S_WeaponNumber 1 as _("Used weapon (1: Laser, 2: Rocket, 3: Nucleus, 4: Arrow, 6: Missile, else: Random)")
  66.  
  67. #Setting S_ArmorMax 4 as _("Max armor of players") // Max armor of players
  68.  
  69. #Setting S_AmmoMax 1. as _("Max ammunition factor") // Max ammunition factor
  70.  
  71. #Setting S_AmmoGain 1.8 as _("Ammunition gain factor") // Speed of ammunition reload
  72.  
  73.  
  74.  
  75.  
  76. // ---------------------------------- //
  77.  
  78. // Constants
  79.  
  80. // ---------------------------------- //
  81.  
  82.  
  83. #Const C_KillStreakTime 2000 // Time between hits to perform a consecutive kill streak
  84.  
  85. #Const C_AutoSwitchWeapon False // Automatically switch weapons (tunnels & laser pads) - With rockets => AutoTrue
  86.  
  87. #Const C_StaminaFactor 1.0 // Stamina max & reload factor
  88.  
  89. #Const C_DisplayHitDist True // Enable to display the distance when you hit someone
  90.  
  91. #Const C_NearMissDist 0.7 // Max distance to show NearMiss message (-1 to disable the messages)
  92.  
  93. #Const C_AnnounceHeadshots True // Announce headshots with a headshot sound
  94.  
  95. #Const UITickPeriod 200
  96.  
  97. #Const MaxRounds 6
  98.  
  99.  
  100.  
  101. #Const Description _("TYPE: PvE Co-Op\nOBJECTIVE: Kill all bots before they get angry!\nINFOS\nGreen bots : Rocket\nRed bots : Nucleus\nBlue bots : Laser\nYellow bots : Arrow")
  102.  
  103.  
  104.  
  105. // ---------------------------------- //
  106.  
  107. // Global var
  108.  
  109. // ---------------------------------- //
  110.  
  111. declare CUILayer SoundLayerFirst;
  112.  
  113. declare CUILayer SoundLayerSecond;
  114.  
  115. declare CUILayer MatchInfo;
  116.  
  117.  
  118.  
  119. declare Integer LastHit;
  120.  
  121. declare Integer KillStreak;
  122.  
  123. declare Integer Score;
  124.  
  125. declare Integer TimeLimit;
  126.  
  127. declare Integer Round;
  128.  
  129.  
  130.  
  131.  
  132.  
  133. declare Text GamePhase;
  134.  
  135. declare Boolean CanPlay;
  136.  
  137.  
  138.  
  139. declare Integer _LatestUITickLayerTeam;
  140.  
  141. declare CUILayer _LayerTeam;
  142.  
  143. declare Text[Ident] _PlayerManialinkLines;
  144.  
  145.  
  146.  
  147. // ---------------------------------- //
  148.  
  149. // Set rules
  150.  
  151. // ---------------------------------- //
  152.  
  153. ***Rules***
  154.  
  155. ***
  156.  
  157. declare ModeName = "Annihilation";
  158.  
  159. declare ModeRules = TextLib::Compose(_("Kill all bots in the map before they get angry\nGreen bots : Rocket\nRed bots : Nucleus\nBlue bots : Laser\nYellow bots : Arrow"), "$"^SpawnScreen::GetModeColor());
  160.  
  161. SpawnScreen::ResetRulesSection();
  162.  
  163. SpawnScreen::AddSubsection(_("Annihilation - PvE Co-Op Gamemode"), ModeRules, 20.);
  164.  
  165. SpawnScreen::CreatePrettyRules(ModeName);
  166.  
  167. ModeStatusMessage = _("TYPE: PvE Co-Op\nOBJECTIVE: Kill all bots before they get angry!\nINFOS\nGreen bots : Rocket\nRed bots : Nucleus\nBlue bots : Laser\nYellow bots : Arrow");
  168.  
  169. ***
  170.  
  171.  
  172.  
  173. // ---------------------------------- //
  174.  
  175. // Server start
  176.  
  177. // ---------------------------------- //
  178.  
  179. ***StartServer***
  180.  
  181. ***
  182.  
  183. SoundLayerFirst = UIManager.UILayerCreate();
  184.  
  185. UIManager.UIAll.UILayers.add(SoundLayerFirst);
  186.  
  187. SoundLayerFirst.ManialinkPage = """
  188.  
  189. """;
  190.  
  191.  
  192.  
  193. SoundLayerSecond = UIManager.UILayerCreate();
  194.  
  195. UIManager.UIAll.UILayers.add(SoundLayerSecond);
  196.  
  197. SoundLayerSecond.ManialinkPage = """
  198.  
  199. """;
  200.  
  201.  
  202.  
  203. MatchInfo = UIManager.UILayerCreate();
  204.  
  205. UIManager.UIAll.UILayers.add(MatchInfo);
  206.  
  207. MatchInfo.ManialinkPage = """
  208.  
  209. """;
  210.  
  211.  
  212.  
  213. //Layer Team
  214.  
  215. _LayerTeam = UIManager.UILayerCreate();
  216.  
  217. UIManager.UIAll.UILayers.add(_LayerTeam);
  218.  
  219. _LayerTeam.ManialinkPage = """
  220.  
  221. """;
  222.  
  223. // ---------------------------------- //
  224.  
  225. // Set mode options
  226.  
  227. UseClans = True;
  228.  
  229. UseAllies = True;
  230.  
  231. // ---------------------------------- //
  232.  
  233. // Create the rules
  234.  
  235. ---Rules---
  236.  
  237.  
  238.  
  239. // ---------------------------------- //
  240.  
  241. // Initialize UI
  242.  
  243. SpawnScreen::CreateScores("Score.RoundPoints");
  244.  
  245. SpawnScreen::CreateMapInfo();
  246.  
  247. //Interface::CreateRank();
  248.  
  249.  
  250.  
  251. // ---------------------------------- //
  252.  
  253. // Create the scores table
  254.  
  255. ST2::SetStyle("LibST_SMBaseSolo");
  256.  
  257. ST2::SetStyle("LibST_SMBasePoints");
  258.  
  259. MB_SetScoresTableStyleFromXml(S_ScoresTableStylePath);
  260.  
  261. ST2::Build("SM");
  262.  
  263. ***
  264.  
  265.  
  266.  
  267.  
  268.  
  269. // ---------------------------------- //
  270.  
  271. // Map start
  272.  
  273. // ---------------------------------- //
  274.  
  275. ***StartMap***
  276.  
  277. ***
  278.  
  279. LastHit = Now;
  280.  
  281. KillStreak = 0;
  282.  
  283. Score = 0;
  284.  
  285. Round = 1;
  286.  
  287. GamePhase = "checking";
  288.  
  289.  
  290.  
  291. Score::MatchBegin();
  292.  
  293. SM::SetupDefaultVisibility();
  294.  
  295.  
  296.  
  297. // ---------------------------------- //
  298.  
  299. // Init bases
  300.  
  301. foreach (Base in MapBases) {
  302.  
  303. Base.Clan = 1;
  304.  
  305. Base.IsActive = True;
  306.  
  307. }
  308.  
  309.  
  310.  
  311. // ---------------------------------- //
  312.  
  313. // New map sound
  314.  
  315. UIManager.UIAll.UISequence = CUIConfig::EUISequence::Intro;
  316.  
  317.  
  318.  
  319. ***
  320.  
  321.  
  322.  
  323. // ---------------------------------- //
  324.  
  325. // Play loop
  326.  
  327. // ---------------------------------- //
  328.  
  329. ***PlayLoop***
  330.  
  331. ***
  332.  
  333. if(GamePhase == "checking"){
  334.  
  335. CheckSettings();
  336.  
  337. EndTime = 0;
  338.  
  339. }
  340.  
  341.  
  342.  
  343. if(GamePhase == "newRound"){
  344.  
  345. PlaySound("newRoundIn", -1);
  346.  
  347. declare Msg = "";
  348.  
  349.  
  350.  
  351. Msg = TextLib::Compose(_("$s$i$o$af0Round $f00%1$fff-$f00%2"), TextLib::ToText(Round), TextLib::ToText(MaxRounds));
  352.  
  353. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::PhaseChange, 0);
  354.  
  355.  
  356.  
  357. sleep(2000);
  358.  
  359.  
  360.  
  361. CreateBots();
  362.  
  363. SpawnPlayers();
  364.  
  365. UIManager.UIAll.UISequence = CUIConfig::EUISequence::Playing;
  366.  
  367.  
  368.  
  369.  
  370.  
  371. StartTime = Now;
  372.  
  373. TimeLimit = 50 - 5 * Players.count;
  374.  
  375. if (TimeLimit > 0) EndTime = StartTime + (TimeLimit * 1000) + 2500;
  376.  
  377. else EndTime = -1;
  378.  
  379. Score = 0;
  380.  
  381.  
  382.  
  383. sleep(1000);
  384.  
  385. PlaySound("play", 0);
  386.  
  387.  
  388.  
  389.  
  390.  
  391. Msg = TextLib::Compose(_("$s$i$o$f00|||"), TextLib::ToText(Round));
  392.  
  393. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::Silence, 0);
  394.  
  395.  
  396.  
  397. sleep(500);
  398.  
  399.  
  400.  
  401. Msg = TextLib::Compose(_("$s$i$o$f00||"), TextLib::ToText(Round));
  402.  
  403. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::Silence, 0);
  404.  
  405.  
  406.  
  407. sleep(500);
  408.  
  409.  
  410.  
  411. Msg = TextLib::Compose(_("$s$i$o$f00|"), TextLib::ToText(Round));
  412.  
  413. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::Silence, 0);
  414.  
  415.  
  416.  
  417. sleep(500);
  418.  
  419.  
  420.  
  421. Msg = TextLib::Compose(_("$s$i$o$af0Play!"), TextLib::ToText(Round));
  422.  
  423. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::Silence, 0);
  424.  
  425.  
  426.  
  427. MatchInfo(True);
  428.  
  429.  
  430.  
  431. GamePhase = "play";
  432.  
  433. } else if(GamePhase == "play"){
  434.  
  435. ShowLayerTeam(True);
  436.  
  437. foreach (Event, PendingEvents) {
  438.  
  439. // ---------------------------------- //
  440.  
  441. // On armor empty
  442.  
  443. if (Event.Type == CSmModeEvent::EType::OnArmorEmpty) {
  444.  
  445. if(Event.Victim.IsFakePlayer){
  446.  
  447. Score += 1;
  448.  
  449. declare Msg = "";
  450.  
  451. declare Gap = BotPlayers.count - Score;
  452.  
  453. declare Variant = 3 - Gap;
  454.  
  455. if (Gap > 0 && Gap <= 3) {
  456.  
  457. if (Gap > 1) {
  458.  
  459. Msg = TextLib::Compose(_("%1 $s$i$o$f90bots around..."), TextLib::ToText(Gap));
  460.  
  461. } else {
  462.  
  463. Msg = TextLib::Compose(_("$s$i$o$f00Pulverize the last bot!!!"));
  464.  
  465. }
  466.  
  467. Message::SendStatusMessage(Msg, 2000, 3, CUIConfig::EUISound::TieBreakPoint, Variant);
  468.  
  469. }
  470.  
  471. else if (Gap <= 0) {
  472.  
  473. Msg = TextLib::Compose(_("$s$i$o$f00All bots are powdered, good job!!!"));
  474.  
  475. Message::SendStatusMessage(Msg, 2000, 3, CUIConfig::EUISound::VictoryPoint, 0);
  476.  
  477. EndTime = 0;
  478.  
  479. GamePhase = "roundEnd";
  480.  
  481. } else {
  482.  
  483. Message::SendStatusMessage(TextLib::Compose("$af0%1 : %2 / %3", _("$s$i$o$af0Kills"), TextLib::ToText(Score), TextLib::ToText(BotPlayers.count)), 2000, 3, CUIConfig::EUISound::ScoreProgress, MathLib::Rand(0,3));
  484. }
  485.  
  486. MatchInfo(True);
  487.  
  488. XmlRpc::OnArmorEmpty(Event);
  489.  
  490. PassOn(Event);
  491.  
  492. } else{
  493.  
  494. declare statusMsg = TextLib::Compose(_("%1 $m$s$i$o$f00is dead!"), Event.Victim.Name);
  495.  
  496. ChangePlayerState(Event.Victim, False);
  497.  
  498. Message::SendStatusMessage(statusMsg, 2000, 3, CUIConfig::EUISound::EndMatch, 0);
  499.  
  500. XmlRpc::OnArmorEmpty(Event);
  501.  
  502. PassOn(Event);
  503.  
  504. }
  505.  
  506. }
  507.  
  508. // ---------------------------------- //
  509.  
  510. // On hit
  511.  
  512. else if (Event.Type == CSmModeEvent::EType::OnHit) {
  513.  
  514. if (Event.Victim == Null || Event.Shooter == Event.Victim) {
  515.  
  516. Discard(Event);
  517.  
  518. } else {
  519.  
  520. if(Event.Shooter.IsFakePlayer && !Event.Victim.IsFakePlayer){ //Bots shoots Players
  521.  
  522.  
  523.  
  524. Event.Damage = 100;
  525.  
  526. XmlRpc::OnHit(Event);
  527.  
  528. PassOn(Event);
  529.  
  530.  
  531.  
  532. } else if(!Event.Shooter.IsFakePlayer && Event.Victim.IsFakePlayer){ //Players shoots Bots
  533.  
  534. declare Points = 1;
  535.  
  536. Score::AddPoints(Event.Shooter, Points);
  537.  
  538. Event.ShooterPoints = Points;
  539.  
  540. declare Distance = SendHitDistanceMessage(Event);
  541.  
  542.  
  543.  
  544. SetPlayerAmmo(Event.Shooter, CSmMode::EWeapon::Laser, 1);
  545.  
  546.  
  547.  
  548. declare HitInterval = 700;
  549.  
  550. if(Now < LastHit + HitInterval){
  551.  
  552. KillStreak += 1;
  553.  
  554. LastHit = Now;
  555.  
  556. DoKillStreakAnnounce();
  557.  
  558. } else {
  559.  
  560. KillStreak = 0;
  561.  
  562. LastHit = Now;
  563.  
  564. }
  565.  
  566.  
  567.  
  568. declare lifeStealChance = MathLib::Rand(0,1);
  569.  
  570.  
  571.  
  572. if(lifeStealChance == 1){
  573.  
  574. Event.Shooter.Armor += 100;
  575.  
  576. declare UI <=> UIManager.GetUI(Event.Shooter);
  577.  
  578. UI.SendNotice(TextLib::Compose(_("$s$o$af0+1 Life!")), CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
  579.  
  580. }
  581.  
  582.  
  583.  
  584. if(Event.Victim.Armor == 100){
  585.  
  586. declare bonusTime = 0;
  587.  
  588.  
  589.  
  590. switch (Players.count){
  591.  
  592. case 1:
  593.  
  594. bonusTime = MathLib::Rand(3,4);
  595.  
  596. case 2:
  597.  
  598. bonusTime = MathLib::Rand(2,4);
  599.  
  600. case 3:
  601.  
  602. bonusTime = MathLib::Rand(2,3);
  603.  
  604. case 4:
  605.  
  606. bonusTime = MathLib::Rand(1,2);
  607.  
  608. default:
  609.  
  610. bonusTime = MathLib::Rand(3,4);
  611.  
  612. }
  613.  
  614.  
  615.  
  616. EndTime += (bonusTime * 1000);
  617.  
  618.  
  619.  
  620. if(KillStreak == 0){
  621.  
  622. if(bonusTime == 1){
  623.  
  624. Message::SendBigMessage(TextLib::Compose(_("$s$i$o$fff+%1 $af0second $fff!"), TextLib::ToText(bonusTime)), 3000, 0);
  625.  
  626. } else {
  627.  
  628. Message::SendBigMessage(TextLib::Compose(_("$s$i$o$fff+%1 $af0seconds $fff!"), TextLib::ToText(bonusTime)), 3000, 0);
  629.  
  630. }
  631.  
  632. } else {
  633.  
  634. if(bonusTime == 1){
  635.  
  636. Message::SendBigMessage(TextLib::Compose(_("$s$i$o$fff+%1 $af0second $fff! ($f00+%2!$fff)"), TextLib::ToText(bonusTime+1), TextLib::ToText(1)), 3000, 0);
  637. } else {
  638.  
  639. Message::SendBigMessage(TextLib::Compose(_("$s$i$o$fff+%1 $af0seconds $fff! ($f00+%2!$fff)"), TextLib::ToText(bonusTime+1), TextLib::ToText(1)), 3000, 0);
  640.  
  641. }
  642.  
  643. EndTime += 1000;
  644.  
  645. }
  646.  
  647.  
  648.  
  649. Event.Damage = 100;
  650.  
  651. }
  652.  
  653. XmlRpc::OnHit(Event);
  654.  
  655. PassOn(Event);
  656.  
  657. } else {
  658.  
  659. Discard(Event);
  660.  
  661. }
  662.  
  663. }
  664.  
  665. }
  666.  
  667. // ---------------------------------- //
  668.  
  669. // On player request respawn
  670.  
  671. else if (Event.Type == CSmModeEvent::EType::OnPlayerRequestRespawn) {
  672.  
  673. if(Event.Player.SpawnStatus == CSmPlayer::ESpawnStatus::Spawned) {
  674.  
  675. declare statusMsg = TextLib::Compose(_("%1 $m$s$i$o$f00is dead!"), Event.Player.Name);
  676.  
  677. Message::SendStatusMessage(statusMsg, 2000, 3, CUIConfig::EUISound::EndMatch, 0);
  678.  
  679. ChangePlayerState(Event.Player, False);
  680.  
  681. }
  682.  
  683. XmlRpc::OnPlayerRequestRespawn(Event);
  684.  
  685. PassOn(Event);
  686.  
  687. } else {
  688.  
  689. Discard(Event);
  690.  
  691. }
  692.  
  693. }
  694.  
  695. TimerSound();
  696.  
  697.  
  698.  
  699. if(EndTime < Now || Players.count == 0 || ClansNbPlayersAlive[1] == 0){
  700.  
  701. sleep(1000);
  702.  
  703. GamePhase = "roundEnd";
  704.  
  705.  
  706.  
  707. }
  708.  
  709.  
  710.  
  711. } else if (GamePhase == "roundEnd") {
  712.  
  713. ShowLayerTeam(False);
  714.  
  715. sleep(2000);
  716.  
  717. MatchInfo.ManialinkPage = "";
  718.  
  719. DestroyAllBotPlayers();
  720.  
  721. MatchInfo(False);
  722.  
  723. EndTime = 0;
  724.  
  725. declare Msg = "";
  726.  
  727. if(Score == BotPlayers.count) {
  728.  
  729. if(Round >= MaxRounds){
  730.  
  731. UnspawnPlayers();
  732.  
  733. Msg = TextLib::Compose(_("$m$s$i$o$af0You are the best pulverizer!!!"));
  734.  
  735. PlaySound("win", 0);
  736.  
  737. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::EndRound, 0);
  738.  
  739. UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::ForcedVisible;
  740.  
  741. UIManager.UIAll.UISequence = CUIConfig::EUISequence::PlayersPresentation;
  742.  
  743. sleep(3000);
  744.  
  745. Message::CleanBigMessages();
  746.  
  747. Message::CleanStatusMessages();
  748.  
  749. Score::MatchEnd(True);
  750.  
  751. Round = 1;
  752.  
  753. PlaySound("nextMap", 0);
  754.  
  755. MatchEndRequested = True;
  756.  
  757. sleep(8000);
  758.  
  759.  
  760.  
  761. } else {
  762.  
  763. Msg = TextLib::Compose(_("$s$i$o$af0Round $f00%1 $af0terminated!"), TextLib::ToText(Round));
  764.  
  765. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::EndRound, 0);
  766.  
  767. Score::RoundEnd();
  768.  
  769. PlaySound("excellent", 0);
  770.  
  771. Round += 1;
  772.  
  773. sleep(1000);
  774.  
  775. GamePhase = "checking";
  776.  
  777. }
  778.  
  779. } else {
  780.  
  781. UnspawnPlayers();
  782.  
  783. Msg = TextLib::Compose(_("$s$i$o$af0Terminated!"));
  784.  
  785. Score::RoundEnd();
  786.  
  787. PlaySound("lost", 0);
  788.  
  789. Message::SendBigMessage(Msg, 2000, 3, CUIConfig::EUISound::EndRound, 0);
  790.  
  791. UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::ForcedVisible;
  792.  
  793. UIManager.UIAll.UISequence = CUIConfig::EUISequence::PlayersPresentation;
  794.  
  795. Round = 1;
  796.  
  797. sleep(2000);
  798.  
  799. Score::MatchEnd();
  800.  
  801. Score::MatchBegin();
  802.  
  803. }
  804.  
  805. sleep(2000);
  806.  
  807. GamePhase = "checking";
  808.  
  809.  
  810. }
  811.  
  812. Message::Loop();
  813.  
  814. ***
  815.  
  816.  
  817.  
  818.  
  819.  
  820. // ---------------------------------- //
  821.  
  822. // Map end
  823.  
  824. // ---------------------------------- //
  825.  
  826. /****EndMap***
  827.  
  828. ***
  829.  
  830. ****/
  831.  
  832. // ---------------------------------- //
  833.  
  834. // Server end
  835.  
  836. // ---------------------------------- //
  837.  
  838. ***EndServer***
  839.  
  840. ***
  841.  
  842. UIManager.UILayerDestroyAll();
  843.  
  844. Interface::DestroyRank();
  845.  
  846. SpawnScreen::DestroyRules();
  847.  
  848. SpawnScreen::DestroyScores();
  849.  
  850. SpawnScreen::DestroyMapInfo();
  851.  
  852. ***
  853.  
  854.  
  855.  
  856. // ---------------------------------- //
  857.  
  858. // Functions
  859.  
  860. // ---------------------------------- //
  861.  
  862.  
  863.  
  864.  
  865.  
  866. Void ChangePlayerState(CSmPlayer Player, Boolean IsFree){
  867.  
  868. if(Player.CurrentClan==0) return;
  869.  
  870. if(IsFree){
  871.  
  872. _PlayerManialinkLines[Player.Id] = """<player login="{{{Player.Login}}}"/>""";
  873.  
  874. }else{
  875.  
  876. _PlayerManialinkLines[Player.Id] = """<player isalive="false" nickname="{{{TextLib::MLEncode(Player.Name)}}}"/>""";
  877.  
  878. }
  879.  
  880.  
  881.  
  882. }
  883.  
  884.  
  885.  
  886.  
  887.  
  888. Void PlaySound(Text soundName, Integer variant){
  889.  
  890. SoundLayerFirst.ManialinkPage = """""";
  891.  
  892. if(soundName == "cd"){
  893.  
  894. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  895.  
  896. <audio looping="0" hidden="1" play="1" data="https://dl.dropboxusercontent.com/u/42719494/Maniaplanet/Sounds/cd{{{variant}}}.ogg"/>
  897.  
  898. </manialink>""";
  899.  
  900. }
  901.  
  902. if(soundName == "30sec"){
  903.  
  904. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  905.  
  906. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1EQXBtc05ia0Vvems/Maniaplanet/Sounds/30_seconds_remain.ogg"/>
  907.  
  908. </manialink>""";
  909.  
  910. }
  911.  
  912. if(soundName == "excellent"){
  913.  
  914. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  915.  
  916. <audio looping="0" hidden="1" play="1" data="https://dl.dropboxusercontent.com/u/42719494/Maniaplanet/Sounds/excellent.ogg"/>
  917.  
  918. </manialink>""";
  919.  
  920. }
  921.  
  922. if(soundName == "play"){
  923.  
  924. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  925.  
  926. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1EOElrcTJPWUxrWkk/Maniaplanet/Sounds/Play.ogg"/>
  927.  
  928. </manialink>""";
  929.  
  930. }
  931.  
  932. if(soundName == "lost"){
  933.  
  934. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  935.  
  936. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1Ed2xnMXZJY0x0TGM/Maniaplanet/Sounds/You_Have_Lost_the_Match.ogg"/> </manialink>""";
  937.  
  938. }
  939.  
  940. if(soundName == "win"){
  941.  
  942. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  943.  
  944. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1EUjNORTJ4QmNxWU0/Maniaplanet/Sounds/You_Have_Won_the_Match.ogg"/> </manialink>""";
  945.  
  946. }
  947.  
  948. if(soundName == "newRoundIn"){
  949.  
  950. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  951.  
  952. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1EMF9pNGtuNm5jTlU/Maniaplanet/Sounds/NewRoundIn.ogg"/> </manialink>""";
  953.  
  954. }
  955.  
  956. if(soundName == "nextMap"){
  957.  
  958. SoundLayerFirst.ManialinkPage = """<manialink version="3">
  959.  
  960. <audio looping="0" hidden="1" play="1" data="https://dl.dropboxusercontent.com/u/42719494/Maniaplanet/Sounds/playstationOut.ogg"/> </manialink>""";
  961.  
  962. }
  963.  
  964. }
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971. Void CreateAnniBot(Text _Type, CSmMapLandmark _Spawn){
  972.  
  973. declare newBot = CreateBotPlayer(NullId, 0);
  974.  
  975.  
  976.  
  977. switch(_Type){
  978.  
  979. case "Laser":{
  980.  
  981. SetPlayerWeapon(newBot, CSmMode::EWeapon::Laser, False);
  982.  
  983. newBot.ForceColor = <0.0, 0.5, 0.5>;}
  984.  
  985. case "Rocket":{
  986.  
  987. SetPlayerWeapon(newBot, CSmMode::EWeapon::Rocket, False);
  988.  
  989. newBot.ForceColor = <0.0, 1.0, 0.0>;}
  990.  
  991. case "Nucleus":{
  992.  
  993. SetPlayerWeapon(newBot, CSmMode::EWeapon::Nucleus, False);
  994.  
  995. newBot.ForceColor = <0.5, 0.0, 0.5>;}
  996.  
  997. case "Arrow":{
  998.  
  999. SetPlayerAmmoMax(newBot, CSmMode::EWeapon::Arrow, 2);
  1000.  
  1001. SetPlayerWeapon(newBot, CSmMode::EWeapon::Arrow, False);
  1002.  
  1003. newBot.ForceColor = <0.5, 0.5, 0.0>;}
  1004.  
  1005. case "Special":{
  1006.  
  1007. SetPlayerWeapon(newBot, CSmMode::EWeapon::Rocket, False);
  1008.  
  1009. newBot.ForceColor = <1.0, 0.5, 0.0>;}
  1010.  
  1011. }
  1012.  
  1013.  
  1014.  
  1015. newBot.Driver.AttackFilter = CSmPlayerDriver::ESmAttackFilter::OppositePlayers;
  1016.  
  1017.  
  1018.  
  1019. if(_Type != "Special"){
  1020.  
  1021. newBot.Driver.Behaviour = CSmPlayerDriver::ESmDriverBehaviour::Saunter;
  1022.  
  1023. newBot.Driver.Saunter_AnchorPoint = _Spawn.Position;
  1024.  
  1025. newBot.Driver.Saunter_Radius = 10.;
  1026.  
  1027.  
  1028.  
  1029. newBot.Driver.AggroRadius = 30.;
  1030.  
  1031. newBot.Driver.DisengageDistance = 10.;
  1032.  
  1033. newBot.Driver.Accuracy = 0.6;
  1034.  
  1035. newBot.Driver.ShootPeriodMin = 500;
  1036.  
  1037. newBot.Driver.ShootPeriodMax = 500;
  1038.  
  1039. newBot.AmmoGain = 1.0;
  1040.  
  1041. } else {
  1042.  
  1043. newBot.Driver.Behaviour = CSmPlayerDriver::ESmDriverBehaviour::Turret;
  1044.  
  1045. newBot.Driver.AggroRadius = 100.;
  1046.  
  1047. newBot.Driver.DisengageDistance = 0.;
  1048. newBot.Driver.Accuracy = 1.0;
  1049.  
  1050. newBot.Driver.ShootPeriodMin = 10;
  1051.  
  1052. newBot.Driver.ShootPeriodMax = 10;
  1053.  
  1054. newBot.Driver.RocketAnticipation = True;
  1055.  
  1056. newBot.AmmoGain = 10.0;
  1057.  
  1058. }
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064. newBot.Driver.Fov = 360.0;
  1065.  
  1066. newBot.ArmorMax = 100;
  1067.  
  1068. newBot.Driver.AggroRadius = S_AggroRadius;
  1069.  
  1070. newBot.Driver.ShootRadius = newBot.Driver.AggroRadius;
  1071.  
  1072. newBot.Driver.DisengageDistance = newBot.Driver.AggroRadius;
  1073.  
  1074. newBot.Driver.TargetMinDistance = 1.;
  1075.  
  1076.  
  1077.  
  1078. SpawnBotPlayer(newBot, 0, 100, _Spawn.BotPath, Now);
  1079.  
  1080. }
  1081.  
  1082.  
  1083.  
  1084. Void CreateBots(){
  1085.  
  1086. //Bots creation
  1087.  
  1088. declare botCountId = 0;
  1089.  
  1090. while(botCountId < MathLib::Clamp(S_NbBots, 1, 256)) {
  1091.  
  1092. declare Spawn <=> MapLandmarks_BotPath[MathLib::Rand(0, MapLandmarks_BotPath.count-1)];
  1093.  
  1094.  
  1095.  
  1096. declare botsWeapons = 0;
  1097.  
  1098.  
  1099.  
  1100. if(Spawn.Tag == "BotPath"){
  1101.  
  1102. if(Round == 1){
  1103.  
  1104. botsWeapons = 1;
  1105.  
  1106. }
  1107.  
  1108. if(Round == 2){
  1109.  
  1110. botsWeapons = 2;
  1111.  
  1112. }
  1113.  
  1114. if(Round == 3){
  1115.  
  1116. botsWeapons = MathLib::Rand(2,3);
  1117.  
  1118. }
  1119.  
  1120. if(Round == 4){
  1121.  
  1122. botsWeapons = 3;
  1123.  
  1124. }
  1125.  
  1126. if(Round == 5){
  1127.  
  1128. botsWeapons = MathLib::Rand(3,4);
  1129.  
  1130. }
  1131.  
  1132. if(Round == 6){
  1133.  
  1134. botsWeapons = MathLib::Rand(1,4);
  1135.  
  1136. }
  1137.  
  1138.  
  1139.  
  1140. if(botsWeapons == 1){
  1141.  
  1142. CreateAnniBot("Laser",Spawn);
  1143.  
  1144. } else if(botsWeapons == 2){
  1145.  
  1146. CreateAnniBot("Rocket",Spawn);
  1147.  
  1148. } else if(botsWeapons == 3){
  1149.  
  1150. CreateAnniBot("Nucleus",Spawn);
  1151.  
  1152. } else if(botsWeapons == 4){
  1153.  
  1154. CreateAnniBot("Arrow", Spawn);
  1155.  
  1156. }
  1157.  
  1158. botCountId += 1;
  1159.  
  1160. }
  1161.  
  1162. }
  1163.  
  1164. foreach(BotPath, MapLandmarks_BotPath){
  1165.  
  1166. if(BotPath.Tag == "Special"){
  1167.  
  1168. if(Round == MaxRounds){
  1169.  
  1170. CreateAnniBot("Special", BotPath);
  1171.  
  1172. }
  1173.  
  1174. }
  1175.  
  1176. }
  1177.  
  1178. }
  1179.  
  1180.  
  1181.  
  1182.  
  1183. // Get the currently used weapon
  1184.  
  1185. CSmMode::EWeapon GetWeapon() {
  1186.  
  1187. declare WeaponNumber = S_WeaponNumber;
  1188.  
  1189.  
  1190.  
  1191. if (WeaponNumber < 1 || WeaponNumber > 6) {
  1192.  
  1193. // Random weapon
  1194.  
  1195. WeaponNumber = MathLib::Rand(1, 6);
  1196.  
  1197. }
  1198.  
  1199.  
  1200.  
  1201. // Return weapon
  1202.  
  1203. switch (WeaponNumber) {
  1204.  
  1205. case 1: {
  1206.  
  1207. return CSmMode::EWeapon::Laser;
  1208.  
  1209. }
  1210.  
  1211. case 3: {
  1212.  
  1213. return CSmMode::EWeapon::Nucleus;
  1214.  
  1215. }
  1216.  
  1217. case 4: {
  1218.  
  1219. return CSmMode::EWeapon::Arrow;
  1220.  
  1221. }
  1222.  
  1223. case 6: {
  1224.  
  1225. return CSmMode::EWeapon::Missile;
  1226.  
  1227. }
  1228.  
  1229. }
  1230.  
  1231. return CSmMode::EWeapon::Rocket;
  1232.  
  1233. }
  1234.  
  1235.  
  1236.  
  1237. // Get whether weapons should be switched automatically
  1238.  
  1239. Boolean GetAutoSwitchWeapon(CSmMode::EWeapon _Weapon) {
  1240.  
  1241. return (C_AutoSwitchWeapon || _Weapon == CSmMode::EWeapon::Rocket);
  1242.  
  1243. }
  1244.  
  1245.  
  1246.  
  1247. Void SpawnPlayers() {
  1248.  
  1249. foreach (Player in Players) {
  1250.  
  1251. if(Player.SpawnStatus == CSmPlayer::ESpawnStatus::NotSpawned){
  1252.  
  1253. Player.ArmorMax = MathLib::Max(S_ArmorMax, 1) * 100;
  1254.  
  1255. Player.AmmoGain = MathLib::Clamp(S_AmmoGain, 0., 10.);
  1256.  
  1257. SetPlayerClan(Player, 1);
  1258.  
  1259. ChangePlayerState(Player, True);
  1260.  
  1261.  
  1262. SetPlayerWeapon(Player, GetWeapon(), GetAutoSwitchWeapon(GetWeapon()));
  1263.  
  1264. SpawnPlayer(Player, 1, Player.ArmorMax, MapLandmarks_PlayerSpawn[MathLib::Rand(0, MapLandmarks_PlayerSpawn.count-1)].PlayerSpawn, Now);
  1265.  
  1266. }
  1267.  
  1268. }
  1269.  
  1270. }
  1271.  
  1272.  
  1273.  
  1274.  
  1275. // Set player weapon
  1276.  
  1277. Void SetPlayerWeapon(CSmPlayer _Player) {
  1278.  
  1279. if (_Player.SpawnStatus != CSmPlayer::ESpawnStatus::Spawned) {
  1280.  
  1281. declare Weapon = GetWeapon();
  1282.  
  1283. This.SetPlayerWeapon(_Player, Weapon, GetAutoSwitchWeapon(Weapon));
  1284.  
  1285.  
  1286.  
  1287. // Set weapon depending values
  1288.  
  1289. declare Integer AmmoMax;
  1290.  
  1291. declare Real Accuracy;
  1292.  
  1293. switch (Weapon) {
  1294.  
  1295. case CSmMode::EWeapon::Rocket: {
  1296.  
  1297. AmmoMax = 4;
  1298.  
  1299. Accuracy = 1.0;
  1300.  
  1301. }
  1302.  
  1303. case CSmMode::EWeapon::Laser: {
  1304.  
  1305. AmmoMax = 1;
  1306.  
  1307. Accuracy = 1.0;
  1308.  
  1309. }
  1310.  
  1311. case CSmMode::EWeapon::Nucleus: {
  1312.  
  1313. AmmoMax = 2;
  1314.  
  1315. Accuracy = 1.0;
  1316.  
  1317. }
  1318.  
  1319. case CSmMode::EWeapon::Arrow: {
  1320.  
  1321. AmmoMax = 3;
  1322.  
  1323. Accuracy = 1.0;
  1324.  
  1325. }
  1326.  
  1327. default: {
  1328.  
  1329. AmmoMax = 1;
  1330.  
  1331. Accuracy = 1.0;
  1332.  
  1333. }
  1334.  
  1335. }
  1336.  
  1337. This.SetPlayerAmmoMax(_Player, Weapon, MathLib::NearestInteger(AmmoMax*S_AmmoMax));
  1338.  
  1339. if (_Player.Driver != Null) {
  1340.  
  1341. _Player.Driver.Accuracy = S_Accuracy;
  1342.  
  1343. }
  1344.  
  1345. }
  1346.  
  1347. }
  1348.  
  1349.  
  1350.  
  1351. Void UnspawnPlayers(){
  1352.  
  1353. foreach (Player in Players) {
  1354.  
  1355. if (Player.SpawnStatus == CSmPlayer::ESpawnStatus::Spawned) {
  1356.  
  1357. UnspawnPlayer(Player);
  1358.  
  1359. }
  1360.  
  1361. }
  1362.  
  1363. }
  1364.  
  1365.  
  1366.  
  1367. Real SendHitDistanceMessage(CSmModeEvent _Event) {
  1368.  
  1369. if (_Event.Type != CSmModeEvent::EType::OnHit) return -1.; // Wrong event type
  1370.  
  1371. if (_Event.Shooter == Null || _Event.Victim == Null || _Event.Shooter == _Event.Victim) return -1.; // Invalid players
  1372.  
  1373. // Get distance
  1374.  
  1375. declare Distance = MathLib::Distance(_Event.Shooter.Position, _Event.Victim.Position);
  1376.  
  1377. Distance = MathLib::NearestInteger(Distance * 10) / 10.0;
  1378.  
  1379.  
  1380.  
  1381. // Save longest hit
  1382.  
  1383. /*
  1384.  
  1385. if (Distance > G_LongestHitDist) {
  1386.  
  1387. G_LongestHitDist = Distance;
  1388.  
  1389. G_LongestHitName = _Event.Shooter.Name;
  1390.  
  1391. SetFooterStats(Null);
  1392.  
  1393. }
  1394.  
  1395. */
  1396.  
  1397. declare UI <=> UIManager.GetUI(_Event.Shooter);
  1398.  
  1399. if (UI == Null) return -1.;
  1400.  
  1401.  
  1402.  
  1403. // Send message
  1404.  
  1405. UI.SendNotice(TextLib::Compose(_("$s$i$o$af0%1m hit!"), TextLib::ToText(Distance)),
  1406.  
  1407. CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default,
  1408.  
  1409. CUIConfig::EUISound::Silence, 0);
  1410.  
  1411. return Distance;
  1412.  
  1413. }
  1414.  
  1415.  
  1416.  
  1417.  
  1418. Void DoKillStreakAnnounce(){
  1419.  
  1420. SoundLayerSecond.ManialinkPage = """""";
  1421.  
  1422. if(KillStreak == 1){
  1423.  
  1424. SoundLayerSecond.ManialinkPage = """<manialink version="3">
  1425.  
  1426. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1ERzJaT3VlRl9pUHc/Maniaplanet/Double_Kill.ogg"/> </manialink>""";
  1427.  
  1428. foreach(Player in Players){
  1429.  
  1430. declare UI <=> UIManager.GetUI(Player);
  1431.  
  1432. UI.SendNotice(TextLib::Compose(_("$f00Double Kill!")), CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
  1433.  
  1434. }
  1435.  
  1436. } else if(KillStreak == 2){
  1437.  
  1438. SoundLayerSecond.ManialinkPage = """<manialink version="3">
  1439.  
  1440. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1EU3RRQkgyNW1sYWs/Maniaplanet/MultiKill.ogg"/> </manialink>""";
  1441.  
  1442. foreach(Player in Players){
  1443.  
  1444. declare UI <=> UIManager.GetUI(Player);
  1445.  
  1446. UI.SendNotice(TextLib::Compose(_("$f00Multi Kill!")), CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
  1447.  
  1448. }
  1449.  
  1450. } else if(KillStreak == 3){
  1451.  
  1452. SoundLayerSecond.ManialinkPage = """<manialink version="3">
  1453.  
  1454. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1ERWFWa1MzOUVQVFE/Maniaplanet/MegaKill.ogg"/> </manialink>""";
  1455.  
  1456. foreach(Player in Players){
  1457.  
  1458. declare UI <=> UIManager.GetUI(Player);
  1459.  
  1460. UI.SendNotice(TextLib::Compose(_("$f00Mega Kill!")), CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
  1461.  
  1462. }
  1463.  
  1464. } else if(KillStreak == 4){
  1465.  
  1466. SoundLayerSecond.ManialinkPage = """<manialink version="3">
  1467.  
  1468. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1EQjA2N3dzUjBHLVk/Maniaplanet/UltraKill.ogg"/> </manialink>""";
  1469.  
  1470. foreach(Player in Players){
  1471.  
  1472. declare UI <=> UIManager.GetUI(Player);
  1473.  
  1474. UI.SendNotice(TextLib::Compose(_("$f00Ultra Kill!")), CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
  1475.  
  1476. }
  1477.  
  1478. } else if(KillStreak > 5){
  1479.  
  1480. SoundLayerSecond.ManialinkPage = """<manialink version="3">
  1481.  
  1482. <audio looping="0" hidden="1" play="1" data="https://drive.google.com/open?id=0Bw00jpwwut1Eek9kQk1Wb3EyZXM/Maniaplanet/MonsterKill_F.ogg"/> </manialink>""";
  1483.  
  1484. foreach(Player in Players){
  1485.  
  1486. declare UI <=> UIManager.GetUI(Player);
  1487.  
  1488. UI.SendNotice(TextLib::Compose(_("$f00Monster Kill!")), CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
  1489.  
  1490. }
  1491.  
  1492. }
  1493.  
  1494. }
  1495.  
  1496.  
  1497.  
  1498. Void MatchInfo(Boolean show){
  1499.  
  1500. if(show){
  1501.  
  1502. MatchInfo.ManialinkPage = """
  1503.  
  1504. <frame posn="158 -76 0">
  1505.  
  1506. <label posn="0 0 1" halign="right" style="TextButtonNav" text="{{{_("$s$i$o$af0$oKills")}}} : {{{Score}}}/{{{BotPlayers.count}}}" />
  1507.  
  1508. </frame>
  1509.  
  1510. <frame posn="158 -72 0">
  1511.  
  1512. <label posn="0 0 1" halign="right" style="TextButtonNav" text="{{{_("$s$i$o$af0$oRound")}}} : {{{Round}}}/{{{MaxRounds}}}" />
  1513.  
  1514. </frame>
  1515.  
  1516. <quad posn="165 -80 0" halign= "right" sizen="49 13" bgcolor="FFFA" image="https://dl.dropboxusercontent.com/u/39375802/ATA/logoann.png"/>
  1517.  
  1518. """;
  1519.  
  1520. } else {
  1521.  
  1522. MatchInfo.ManialinkPage = "";
  1523.  
  1524. }
  1525.  
  1526. }
  1527.  
  1528.  
  1529.  
  1530. Void CheckSettings(){
  1531.  
  1532. UIManager.UIAll.ScoreTableVisibility = CUIConfig::EVisibility::Normal;
  1533.  
  1534. if (MapLandmarks_BotPath.count == 0){
  1535.  
  1536. declare Msg = TextLib::Compose(_("This map doesn't have bot spawns. Skipping..."));
  1537.  
  1538. Message::SendBigMessage(Msg, 1000, 3, CUIConfig::EUISound::EndRound, 0);
  1539.  
  1540. sleep(5000);
  1541.  
  1542. GamePhase = "error";
  1543.  
  1544. MatchEndRequested = True;
  1545.  
  1546. } else {
  1547.  
  1548. if(Players.count == 0){
  1549.  
  1550. sleep(1000);
  1551.  
  1552. declare Msg = TextLib::Compose(_("No Players"));
  1553.  
  1554. Message::SendBigMessage(Msg, 1000, 3, CUIConfig::EUISound::Silence, 0);
  1555.  
  1556. } else if (Players.count > 10){
  1557.  
  1558. sleep(1000);
  1559.  
  1560. declare Msg = TextLib::Compose(_("Too much players. Max players script-forced to 10."));
  1561.  
  1562. Message::SendBigMessage(Msg, 1000, 3, CUIConfig::EUISound::Silence, 0);
  1563.  
  1564. } else {
  1565.  
  1566. GamePhase = "newRound";
  1567.  
  1568. }
  1569.  
  1570. }
  1571.  
  1572. }
  1573.  
  1574.  
  1575.  
  1576. Void TimerSound(){
  1577.  
  1578. if((EndTime - Now) == 30000){
  1579.  
  1580. PlaySound("30sec", -1);
  1581.  
  1582. }
  1583.  
  1584. if((EndTime - Now) == 10000){
  1585.  
  1586. PlaySound("cd", 10);
  1587.  
  1588. }
  1589.  
  1590. if((EndTime - Now) == 9000){
  1591.  
  1592. PlaySound("cd", 9);
  1593.  
  1594. }
  1595.  
  1596. if((EndTime - Now) == 8000){
  1597.  
  1598. PlaySound("cd", 8);
  1599.  
  1600. }
  1601.  
  1602. if((EndTime - Now) == 7000){
  1603.  
  1604. PlaySound("cd", 7);
  1605.  
  1606. }
  1607.  
  1608. if((EndTime - Now) == 6000){
  1609.  
  1610. PlaySound("cd", 6);
  1611.  
  1612. }
  1613.  
  1614. if((EndTime - Now) == 5000){
  1615.  
  1616. PlaySound("cd", 5);
  1617.  
  1618. }
  1619.  
  1620. if((EndTime - Now) == 4000){
  1621.  
  1622. PlaySound("cd", 4);
  1623.  
  1624. }
  1625.  
  1626. if((EndTime - Now) == 3000){
  1627.  
  1628. PlaySound("cd", 3);
  1629.  
  1630. }
  1631.  
  1632. if((EndTime - Now) == 2000){
  1633.  
  1634. PlaySound("cd", 2);
  1635.  
  1636. }
  1637.  
  1638. if((EndTime - Now) == 1000){
  1639.  
  1640. PlaySound("cd", 1);
  1641.  
  1642. }
  1643.  
  1644. }
  1645.  
  1646.  
  1647.  
  1648. Void ShowLayerTeam(Boolean show) {
  1649.  
  1650. if(show){
  1651.  
  1652. if(Now > _LatestUITickLayerTeam + UITickPeriod){
  1653.  
  1654. _LatestUITickLayerTeam = Now;
  1655.  
  1656. _LayerTeam.ManialinkPage = """
  1657.  
  1658. <frame posn="-159 88 0">
  1659.  
  1660. <label posn="0 0 0" halign="left" style="TextButtonBig" text="{{{_("$s$i$o$af0Players alive")}}} : {{{ ClansNbPlayersAlive[1]}}}" />
  1661.  
  1662. </frame>
  1663.  
  1664. """;
  1665.  
  1666. declare Integer[Integer] NumberOfLines = [1=>0];
  1667.  
  1668. declare Text[Integer] TextOfPlayers = [1=>""];
  1669.  
  1670. foreach (Player in Players) {
  1671.  
  1672. if(Player.CurrentClan == 1){
  1673.  
  1674. if(NumberOfLines[Player.CurrentClan] < 20 && _PlayerManialinkLines.existskey(Player.Id)) {
  1675.  
  1676. TextOfPlayers[Player.CurrentClan] ^= _PlayerManialinkLines[Player.Id];
  1677.  
  1678. NumberOfLines[Player.CurrentClan] += 1;
  1679.  
  1680. }
  1681.  
  1682. }
  1683.  
  1684. }
  1685.  
  1686. _LayerTeam.ManialinkPage ^= """<playerlist posn="-160 84" halign="left" style="" substyle="Small" lines="20" columns="1" static="true">{{{TextOfPlayers[1]}}}</playerlist>""";
  1687.  
  1688. }
  1689.  
  1690. } else {
  1691.  
  1692. if(_LayerTeam.ManialinkPage != ""){
  1693.  
  1694. _LayerTeam.ManialinkPage = "";
  1695.  
  1696. }
  1697.  
  1698. }
  1699.  
  1700. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement