SHARE
TWEET

Green Vs Blue Logic - Public

Sampai Aug 1st, 2018 (edited) 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OnFirstLoad()
  2. {
  3.  Game.PrintMessage("Logic Loaded");
  4.  Game.PrintMessage("Logic by Sampai (Sysyfus#5343)");
  5.  Game.PrintMessage("/commonvd 900");
  6.  Game.PrintMessage("/fogmodee 1 20 5");
  7.  VariableInt.Set("greenteampoints", 0);
  8.  VariableInt.Set("blueteampoints", 0);
  9.  VariableBool.Set("gameover", true);
  10.  VariableBool.Set("greenwin", false);
  11.  VariableBool.Set("bluewin", false);
  12.  VariableBool.Set("victorymessagesent", false);
  13.  VariableInt.Set("timer", 0);
  14.  VariableInt.Set("numtitans", 0);
  15.  VariableBool.Set("splitmode", true);
  16.  VariableBool.Set("bosson", true);
  17.  VariableBool.Set("bossalive", false);
  18.  VariableBool.Set("healthmode", true);
  19. }
  20.  
  21. OnRoundStart()
  22. {
  23.  VariableInt.Set("greenteampoints", 0);
  24.  VariableInt.Set("blueteampoints", 0);
  25.  VariableBool.Set("gameover", true);
  26.  VariableBool.Set("greenwin", false);
  27.  VariableBool.Set("bluewin", false);
  28.  VariableBool.Set("victorymessagesent", false);
  29.  VariableInt.Set("timer", 0);
  30.  VariableInt.Set("numtitans", 0);
  31.  VariableBool.Set("splitmode", true);
  32.  VariableBool.Set("bosson", true);
  33.  VariableBool.Set("bossalive", false);
  34.  VariableBool.Set("healthmode", true);
  35.  
  36. }
  37.  
  38. OnUpdate()
  39. {
  40.  VariableInt.Set("numtitans", 0);
  41.  ForeachTitan("titan")
  42.  {
  43.   VariableInt.Add("numtitans", 1);
  44.   If(Float.GreaterThan(VariableTitan("titan").GetSize(), 4.99))
  45.   {
  46.    VariableBool.Set("bossalive", true);
  47.   }
  48.  }
  49.  
  50.  If(Bool.Equals(VariableBool("gameover"), false))
  51.  {
  52.   VariableInt.Add("timer", 1);
  53.   VariableInt.Set("timermod", VariableInt("timer"));
  54.   VariableInt.Modulo("timermod", 10);
  55.   If(Int.Equals(VariableInt("timermod"), 0))
  56.   {
  57.    If(Int.LessThan(VariableInt("numtitans"), 9))
  58.    {
  59.     VariableFloat.SetRandom("titsize", 1.6, 4.0);
  60.     VariableInt.SetRandom("tittypepercent", 0, 101);
  61.     VariableInt.Set("tittype", 4);
  62.     If(Int.LessThan(VariableInt("tittypepercent"), 95));
  63.     {
  64.      VariableInt.Set("tittype", 0);
  65.     }
  66.     If(Int.LessThan(VariableInt("tittypepercent"), 45));
  67.     {
  68.      VariableInt.Set("tittype", 2);
  69.     }
  70.     If(Int.LessThan(VariableInt("tittypepercent"), 30));
  71.     {
  72.      VariableInt.Set("tittype", 1);
  73.     }
  74.     VariableFloat.Set("tithealth", 0.0);
  75.     If(Bool.Equals(VariableBool("healthmode"), true))
  76.     {
  77.      VariableFloat.Set("tithealth", VariableFloat("titsize"));
  78.      VariableFloat.Multiply("tithealth", 212.5);
  79.      VariableFloat.Add("tithealth", 150.0);
  80.     }
  81.     VariableFloat.SetRandom("titxposspawn", -1480.0, -520.0);
  82.     VariableFloat.SetRandom("titzposspawn", -480.0, 480.0);
  83.     Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxposspawn"), 175.0, VariableFloat("titzposspawn"));
  84.     VariableFloat.Multiply("titxposspawn", -1.0);
  85.     VariableFloat.Multiply("titzposspawn", -1.0);
  86.     Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxposspawn"), 175.0, VariableFloat("titzposspawn"));
  87.    }
  88.   }
  89.  
  90.   VariableInt.Set("timermod", VariableInt("timer"));
  91.   VariableInt.Modulo("timermod", 600);
  92.   If(Int.Equals(VariableInt("timermod"), 0))
  93.   {
  94.    If(Bool.Equals(VariableBool("bosson"), true))
  95.    {
  96.     If(Bool.Equals(VariableBool("bossalive"), false))
  97.     {
  98.      VariableFloat.SetRandom("titsize", 5.0, 7.5);
  99.      VariableInt.SetRandom("tittypepercent", 0, 101);
  100.      VariableInt.Set("tittype", 4);
  101.      If(Int.LessThan(VariableInt("tittypepercent"), 50));
  102.      {
  103.       VariableInt.Set("tittype", 2);
  104.      }
  105.      If(Int.LessThan(VariableInt("tittypepercent"), 35));
  106.      {
  107.       VariableInt.Set("tittype", 1);
  108.      }
  109.      If(Int.LessThan(VariableInt("tittypepercent"), 5));
  110.      {
  111.       VariableInt.Set("tittype", 0);
  112.       VariableFloat.SetRandom("titsize", 7.5, 10.0);
  113.      }
  114.      VariableFloat.Set("tithealth", VariableFloat("titsize"));
  115.      VariableFloat.Multiply("tithealth", 2000.0);
  116.      VariableFloat.SetRandom("titxposspawn", -1480.0, -520.0);
  117.      VariableFloat.SetRandom("titzposspawn", -480.0, 480.0);
  118.      Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxposspawn"), 175.0, VariableFloat("titzposspawn"));
  119.      VariableFloat.Multiply("titxposspawn", -1.0);
  120.      VariableFloat.Multiply("titzposspawn", -1.0);
  121.      Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxposspawn"), 175.0, VariableFloat("titzposspawn"));
  122.     }
  123.    }
  124.   }
  125.   VariableInt.Set("timermod", VariableInt("timer"));
  126.   VariableInt.Modulo("timermod", 30);
  127.   If(Int.Equals(VariableInt("timermod"), 0))
  128.   {
  129.    VariableString.Set("score", "T:");
  130.    VariableString.Append("score", VariableInt("timer").ConvertToString());
  131.    VariableString.Append("score", "  B:");
  132.    VariableString.Append("score", VariableInt("blueteampoints").ConvertToString());
  133.    VariableString.Append("score", "  G:");
  134.    VariableString.Append("score", VariableInt("greenteampoints").ConvertToString());
  135.    Game.PrintMessage(VariableString("score"));
  136.   }
  137.  }
  138.  
  139.  If(Bool.Equals(VariableBool("gameover"), true))
  140.  {
  141.   If(Bool.Equals(VariableBool("victorymessagesent"), false))
  142.   {
  143.    If(Bool.Equals(VariableBool("greenwin"), true))
  144.    {
  145.     VariableString.Set("time", "Time: ");
  146.     VariableString.Append("time", VariableInt("timer").ConvertToString());
  147.     VariableString.Set("greenpoints", "Green Team: ");
  148.     VariableString.Append("greenpoints", VariableInt("greenteampoints").ConvertToString());
  149.     VariableString.Set("bluepoints", "Blue Team: ");
  150.     VariableString.Append("bluepoints", VariableInt("blueteampoints").ConvertToString());
  151.     Game.PrintMessage("<size=20>Green Team has won!</size>");
  152.     Game.PrintMessage(VariableString("time"));
  153.     Game.PrintMessage(VariableString("greenpoints"));
  154.     Game.PrintMessage(VariableString("bluepoints"));
  155.     VariableBool.Set("victorymessagesent", true);
  156.    }
  157.    If(Bool.Equals(VariableBool("bluewin"), true))
  158.    {
  159.     VariableString.Set("time", "Time: ");
  160.     VariableString.Append("time", VariableInt("timer").ConvertToString());
  161.     VariableString.Set("greenpoints", "Green Team: ");
  162.     VariableString.Append("greenpoints", VariableInt("greenteampoints").ConvertToString());
  163.     VariableString.Set("bluepoints", "Blue Team: ");
  164.     VariableString.Append("bluepoints", VariableInt("blueteampoints").ConvertToString());
  165.     Game.PrintMessage("<size=20>Blue Team has won!</size>");
  166.     Game.PrintMessage(VariableString("time"));
  167.     Game.PrintMessage(VariableString("bluepoints"));
  168.     Game.PrintMessage(VariableString("greenpoints"));
  169.     VariableBool.Set("victorymessagesent", true);
  170.    }
  171.   }
  172.  }
  173. }
  174.  
  175. OnChatInput("input")
  176. {
  177.  If(String.Equals(VariableString("input"), "/gamereset"))
  178.  {
  179.   VariableInt.Set("greenteampoints", 0);
  180.   VariableInt.Set("blueteampoints", 0);
  181.   VariableBool.Set("gameover", true);
  182.   VariableBool.Set("greenwin", false);
  183.   VariableBool.Set("bluewin", false);
  184.   VariableBool.Set("victorymessagesent", false);
  185.   VariableInt.Set("timer", 0);
  186.   Game.PrintMessage("<size=20>Game<size=1>_____</size>Reset!</size>");
  187.  }
  188.  
  189.  If(String.Equals(VariableString("input"), "/gamestart"))
  190.  {
  191.   VariableBool.Set("gameover", false);
  192.   Game.PrintMessage("<size=20>Start!</size>");
  193.  }
  194.  
  195.  If(String.Equals(VariableString("input"), "/gamepause"))
  196.  {
  197.   VariableBool.Set("gameover", true);
  198.   Game.PrintMessage("<size=20>Game<size=1>_____</size>Paused!</size>");
  199.  }
  200.  
  201.  If(String.Equals(VariableString("input"), "/gamescore"))
  202.  {
  203.   VariableString.Set("score", "T:");
  204.   VariableString.Append("score", VariableInt("timer").ConvertToString());
  205.   VariableString.Append("score", "  B:");
  206.   VariableString.Append("score", VariableInt("blueteampoints").ConvertToString());
  207.   VariableString.Append("score", "  G:");
  208.   VariableString.Append("score", VariableInt("greenteampoints").ConvertToString());
  209.   Game.PrintMessage(VariableString("score"));
  210.  }
  211.  
  212.  If(String.Equals(VariableString("input"), "/splitmode"))
  213.  {
  214.   If(Bool.Equals(VariableBool("splitmode"), false));
  215.   {
  216.    VariableBool.Set("splitmodecheck", true);
  217.   }
  218.   If(Bool.Equals(VariableBool("splitmode"), true));
  219.   {
  220.    VariableBool.Set("splitmodecheck", false);
  221.   }
  222.   If(Bool.Equals(VariableBool("splitmodecheck"), false));
  223.   {
  224.    VariableBool.Set("splitmode", false);
  225.    Game.PrintMessage("<size=20>Titan<size=1>_____</size>Split<size=1>_____</size>Mode<size=1>_____</size>Off!</size>");
  226.   }
  227.   If(Bool.Equals(VariableBool("splitmodecheck"), true));
  228.   {
  229.    VariableBool.Set("splitmode", true);
  230.    Game.PrintMessage("<size=20>Titan<size=1>_____</size>Split<size=1>_____</size>Mode<size=1>_____</size>On!</size>");
  231.   }
  232.  }
  233.  
  234.  If(String.Equals(VariableString("input"), "/healthmode"))
  235.  {
  236.   If(Bool.Equals(VariableBool("healthmode"), false));
  237.   {
  238.    VariableBool.Set("healthmodecheck", true);
  239.   }
  240.   If(Bool.Equals(VariableBool("healthmode"), true));
  241.   {
  242.    VariableBool.Set("healthmodecheck", false);
  243.   }
  244.   If(Bool.Equals(VariableBool("healthmodecheck"), false));
  245.   {
  246.    VariableBool.Set("healthmode", false);
  247.    Game.PrintMessage("<size=20>Titan<size=1>_____</size>Health<size=1>_____</size>Mode<size=1>_____</size>Off!</size>");
  248.   }
  249.   If(Bool.Equals(VariableBool("healthmodecheck"), true));
  250.   {
  251.    VariableBool.Set("healthmode", true);
  252.    Game.PrintMessage("<size=20>Titan<size=1>_____</size>Health<size=1>_____</size>Mode<size=1>_____</size>On!</size>");
  253.   }
  254.  }
  255.  
  256.  If(String.Equals(VariableString("input"), "/gamerules"))
  257.  {
  258.   Game.PrintMessage("<size=20>Game Rules:</size>");
  259.   Game.PrintMessage("There<size=1>___</size>are<size=1>___</size>two<size=1>___</size>teams:<size=1>___</size>Green<size=1>___</size>and<size=1>___</size>Blue");
  260.   Game.PrintMessage("Each<size=1>___</size>team<size=1>___</size>is<size=1>___</size>to<size=1>___</size>remain<size=1>___</size>in<size=1>___</size>their<size=1>___</size>own<size=1>___</size>arena");
  261.   Game.PrintMessage("Killing<size=1>___</size>a<size=1>___</size>titan<size=1>___</size>scores<size=1>___</size>a<size=1>___</size>team<size=1>___</size>1<size=1>___</size>point");
  262.   Game.PrintMessage(" and<size=1>___</size>transfers<size=1>___</size>that<size=1>___</size>titan<size=1>___</size>to<size=1>___</size>the<size=1>___</size>enemy<size=1>___</size>arena");
  263.   Game.PrintMessage("Killing<size=1>___</size>a<size=1>___</size>boss<size=1>___</size>titan<size=1>___</size>scores<size=1>___</size>points<size=1>___</size>based<size=1>___</size>on<size=1>___</size>size");
  264.   Game.PrintMessage(" and<size=1>___</size>spawns<size=1>___</size>2<size=1>___</size>titans<size=1>___</size>of<size=1>___</size>half<size=1>___</size>size<size=1>___</size>in<size=1>___</size>the<size=1>___</size>enemy<size=1>___</size>arena");
  265.   If(Bool.Equals(VariableBool("splitmode"), true))
  266.   {
  267.    Game.PrintMessage("Titan<size=1>___</size>Split<size=1>___</size>Mode<size=1>___</size>is<size=1>___</size>ON");
  268.   }
  269.   If(Bool.Equals(VariableBool("healthmode"), true))
  270.   {
  271.    Game.PrintMessage("Titan<size=1>___</size>Health<size=1>___</size>Mode<size=1>___</size>is<size=1>___</size>ON");
  272.   }
  273.   Game.PrintMessage("The<size=1>___</size>first<size=1>___</size>team<size=1>___</size>to<size=1>___</size>reach<size=1>___</size>50<size=1>___</size>points<size=1>___</size>wins!");
  274.  }
  275. }
  276.  
  277. OnTitanDie("myTitan", "myPlayer")
  278. {
  279.  If(Float.GreaterThan(VariableTitan("myTitan").GetSize(), 4.99))
  280.  {
  281.   VariableBool.Set("bossalive", false);
  282.  }
  283.  If(Bool.Equals(VariableBool("gameover"), false))
  284.  {
  285.   VariableFloat.Set("titxpos", VariableTitan("myTitan").GetPositionX());
  286.   VariableFloat.Set("titsize", VariableTitan("myTitan").GetSize());
  287.   If(Float.LessThan(VariableFloat("titxpos"), 0.0))
  288.   {
  289.    If(Float.LessThan(VariableFloat("titsize"), 4.00001))
  290.    {
  291.     VariableInt.Add("greenteampoints", 1);
  292.     Game.PrintMessage("Green Team has scored a point!");
  293.    }
  294.    If(Float.GreaterThan(VariableFloat("titsize"), 4.0))
  295.    {
  296.     VariableInt.Add("greenteampoints", VariableFloat("titsize").ConvertToInt());
  297.     VariableString.Set("message", "Green Team has scored ");
  298.     VariableInt.Set("sizepoints", VariableFloat("titsize").ConvertToInt());
  299.     VariableString.Append("message", VariableInt("sizepoints").ConvertToString());
  300.     VariableString.Append("message", " points!");
  301.     Game.PrintMessage(VariableString("message"));
  302.    }
  303.    If(Int.GreaterThan(VariableInt("greenteampoints"), 49))
  304.    {
  305.     VariableBool.Set("greenwin", true);
  306.     VariableBool.Set("gameover", true);
  307.    }
  308.   }
  309.   If(Float.GreaterThan(VariableFloat("titxpos"), 0.0))
  310.   {
  311.    If(Float.LessThan(VariableFloat("titsize"), 4.00001))
  312.    {
  313.     VariableInt.Add("blueteampoints", 1);
  314.     Game.PrintMessage("Blue Team has scored a point!");
  315.    }
  316.    If(Float.GreaterThan(VariableFloat("titsize"), 4.0))
  317.    {
  318.     VariableInt.Add("blueteampoints", VariableFloat("titsize").ConvertToInt());
  319.     VariableString.Set("message", "Blue Team has scored ");
  320.     VariableInt.Set("sizepoints", VariableFloat("titsize").ConvertToInt());
  321.     VariableString.Append("message", VariableInt("sizepoints").ConvertToString());
  322.     VariableString.Append("message", " points!");
  323.     Game.PrintMessage(VariableString("message"));
  324.    }
  325.    If(Int.GreaterThan(VariableInt("blueteampoints"), 49))
  326.    {
  327.     VariableBool.Set("bluewin", true);
  328.     VariableBool.Set("gameover", true);
  329.    }
  330.   }
  331.   VariableFloat.Set("titzpos", VariableTitan("myTitan").GetPositionZ());
  332.   VariableFloat.Set("titypos", VariableTitan("myTitan").GetPositionY());
  333.   VariableFloat.Multiply("titxpos", -1.0);
  334.   VariableFloat.Multiply("titzpos", -1.0);
  335.   VariableInt.Set("tittype", VariableTitan("myTitan").GetType());
  336.   VariableFloat.Set("tithealth", 0.0);
  337.   If(Bool.Equals(VariableBool("healthmode"), true))
  338.   {
  339.    VariableFloat.Set("tithealth", VariableFloat("titsize"));
  340.    VariableFloat.Multiply("tithealth", 212.5);
  341.    VariableFloat.Add("tithealth", 150.0);
  342.   }
  343.   If(Float.GreaterThan(VariableFloat("titsize"), 1.999))
  344.   {
  345.    If(Float.LessThan(VariableFloat("titsize"), 4.00001))
  346.    {
  347.     If(Int.LessThan(VariableInt("numtitans"), 20))
  348.     {
  349.      Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxpos"), VariableFloat("titypos"), VariableFloat("titzpos"));
  350.      Game.PrintMessage("Titan transferred!");
  351.     }
  352.    }
  353.    If(Float.GreaterThan(VariableFloat("titsize"), 4.0))
  354.    {
  355.     VariableFloat.Multiply("titsize", 0.45);
  356.     VariableFloat.Set("spawnhealth", 0.0);
  357.     If(Bool.Equals(VariableBool("healthmode"), true))
  358.     {
  359.      VariableFloat.Set("tithealth", VariableFloat("titsize"));
  360.      VariableFloat.Multiply("tithealth", 212.5);
  361.      VariableFloat.Add("tithealth", 150.0);
  362.     }
  363.     If(Float.GreaterThan(VariableFloat("titsize"), 4.0))
  364.     {
  365.      VariableFloat.Set("tithealth", VariableFloat("titsize"));
  366.      VariableFloat.Multiply("tithealth", 2000.0);
  367.     }
  368.     VariableFloat.Add("titzpos", 10.0);
  369.     Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxpos"), VariableFloat("titypos"), VariableFloat("titzpos"));
  370.     VariableFloat.Subtract("titzpos", 20.0);
  371.     Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("titxpos"), VariableFloat("titypos"), VariableFloat("titzpos"));
  372.     Game.PrintMessage("Two titans transferred!");
  373.    }
  374.   }
  375.  }
  376.  If(Bool.Equals(VariableBool("splitmode"), true));
  377.  {
  378.   VariableFloat.Set("titsize",VariableTitan("myTitan").GetSize());
  379.   VariableInt.Set("tittype", VariableTitan("myTitan").GetType());
  380.   If(Float.GreaterThan(VariableFloat("titsize"), 1.589))
  381.   {
  382.    If(Int.LessThan(VariableInt("numtitans"), 20))
  383.    {
  384.     If(Float.LessThan(VariableFloat("titsize"), 6.34))
  385.     {
  386.      VariableFloat.Multiply("titsize", 0.63);
  387.      VariableFloat.Set("spawnhealth", 0.0);
  388.      If(Bool.Equals(VariableBool("healthmode"), true))
  389.      {
  390.       VariableFloat.Set("tithealth", VariableFloat("titsize"));
  391.       VariableFloat.Multiply("tithealth", 212.5);
  392.       VariableFloat.Add("tithealth", 150.0);
  393.      }
  394.      VariableFloat.Set("posX",VariableTitan("myTitan").GetPositionX());
  395.      VariableFloat.Set("posY",VariableTitan("myTitan").GetPositionY());
  396.      VariableFloat.Set("posZ",VariableTitan("myTitan").GetPositionZ());
  397.      VariableFloat.Add("posX", 5.0);
  398.      Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("posX"), VariableFloat("posY"), VariableFloat("posZ"));
  399.      VariableFloat.Subtract("posX", 10.0);
  400.      Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("posX"), VariableFloat("posY"), VariableFloat("posZ"));
  401.     }
  402.    }
  403.    If(Float.GreaterThan(VariableFloat("titsize"), 6.339))
  404.    {
  405.     VariableFloat.Multiply("titsize", 0.63);
  406.     VariableFloat.Set("tithealth", VariableFloat("titsize"));
  407.     VariableFloat.Multiply("tithealth", 2000.0);
  408.     VariableFloat.Set("posX",VariableTitan("myTitan").GetPositionX());
  409.     VariableFloat.Set("posY",VariableTitan("myTitan").GetPositionY());
  410.     VariableFloat.Set("posZ",VariableTitan("myTitan").GetPositionZ());
  411.     VariableFloat.Add("posX", 5.0);
  412.     Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("posX"), VariableFloat("posY"), VariableFloat("posZ"));
  413.     VariableFloat.Subtract("posX", 10.0);
  414.     Titan.SpawnTitanAt(VariableInt("tittype"), VariableFloat("titsize"), VariableFloat("tithealth").ConvertToInt(), 1, VariableFloat("posX"), VariableFloat("posY"), VariableFloat("posZ"));
  415.    }
  416.   }
  417.  }
  418. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top