Advertisement
Guest User

Skyrim Lookalike mod menu base MW2

a guest
Feb 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 25.44 KB | None | 0 0
  1. #include maps\mp\gametypes\_hud_util;
  2. #include maps\mp\_utility;
  3. #include common_scripts\utility;
  4.  
  5. init()
  6. {
  7.     precacheString(&"MP_CHALLENGE_COMPLETED");
  8.     precacheString(&"MP_SUICIDE");
  9.     shaders = strTok("hudsoftline,cardicon_prestige10_02,cardicon_prestige10", ",");
  10.     for(i=0;i<shaders.size;i++)
  11.     precacheShader(shaders[i]);
  12.     for(i=1;i<=11;i++)
  13.     precacheShader("rank_prestige"+i);
  14.     level thread createPerkMap();
  15.     level thread onPlayerConnect();
  16. }
  17. createPerkMap()
  18. {
  19.     level.perkMap = [];
  20.  
  21.     level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
  22.     level.perkMap["specialty_quieter"] = "specialty_deadsilence";
  23.     level.perkMap["specialty_localjammer"] = "specialty_scrambler";
  24.     level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
  25.     level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
  26. }
  27. ch_getProgress( refString )
  28. {
  29.     return self getPlayerData( "challengeProgress", refString );
  30. }
  31. ch_getState( refString )
  32. {
  33.     return self getPlayerData( "challengeState", refString );
  34. }
  35. ch_setProgress( refString, value )
  36. {
  37.     self setPlayerData( "challengeProgress", refString, value );
  38. }
  39. ch_setState( refString, value )
  40. {
  41.     self setPlayerData( "challengeState", refString, value );
  42. }
  43. onPlayerConnect()
  44. {
  45.     for(;;)
  46.     {
  47.         level waittill( "connected", player );
  48.  
  49.         if ( !isDefined( player.pers["postGameChallenges"] ) )
  50.             player.pers["postGameChallenges"] = 0;
  51.  
  52.         player thread onPlayerSpawned();
  53.         player thread initMissionData();
  54.     }
  55. }
  56. onPlayerSpawned()
  57. {
  58.     self endon( "disconnect" );
  59.     for(;;)
  60.     {
  61.         self waittill( "spawned_player" );
  62.         self thread welcomeMsg();
  63.         self thread iniMenu();
  64.         self thread notifyMenu();
  65.         self thread doButtons();
  66.         self iPrintln("Press [{+actionslot 1}] To Get The Skyrim Menu!");
  67.         self freezeControls(false);
  68.         self.menuOpen = 0;
  69.         self.subOpen = 0;
  70.         self.curs = 0;
  71.         self.curs2 = 0;
  72.     }
  73. }
  74. welcomeMsg()
  75. {
  76.     hmb = spawnstruct();
  77.     hmb.iconName = "cardicon_prestige10_02";
  78.     hmb.titleText = "Skyrim Menu Base";
  79.     hmb.notifyText = "Made By Restxrt";
  80.     hmb.notifyText2 = "YT.com/RestxrtModz";
  81.     hmb.glowColor = (1,1,1);
  82.     self thread maps\mp\gametypes\_hud_message::notifyMessage( hmb );
  83. }
  84. createShader(point, rPoint, pos1, pos2, x, y, width, height, elem, color, alpha, foreground, sort, e1, e2, e3)
  85. {
  86.     shader = newClientHudElem(self);
  87.     shader.alignX = point;
  88.     shader.alignY = rPoint;
  89.     shader.vertAlign = pos1;
  90.     shader.horzAlign = pos2;
  91.     shader.x = x;
  92.     shader.y = y;
  93.     shader.sort = sort;
  94.     shader.color = color;
  95.     shader.alpha = alpha;
  96.     if(isDefined(foreground))
  97.         shader.foreground = foreground;
  98.     shader setShader(elem, width, height);
  99.     self thread destroyOnEvents(shader, e1, e2, e3);
  100.     return shader;
  101. }
  102. notifyMenu()
  103. {
  104.     self endon("death");
  105.     self endon("disconnect");
  106.     while(1)
  107.     {
  108.         self waittill("buttonPress", button);
  109.         if(button == "Up"&&!self.menuOpen)
  110.         {
  111.             self.shader["first"] = createShader("center", "center", "center", "center", -300, 0, 150, 900, "black", (0,0,0), 0, false, 1, "death");
  112.             self.shader["second"] = createShader("center", "center", "center", "center", -100, 0, 150, 900, "black", (0,0,0), 0, false, 1, "death");
  113.             self.shader["line1"] = createShader("center", "center", "center", "center", -373, 0, 1, 500, "hudsoftline", (1,1,1), 0, true, 1, "death");
  114.             self.shader["line2"] = createShader("center", "center", "center", "center", -227, 0, 1, 500, "hudsoftline", (1,1,1), 0, true, 1, "death");
  115.             self.shader["line3"] = createShader("center", "center", "center", "center", -173, 0, 1, 500, "hudsoftline", (1,1,1), 0, true, 1, "death");
  116.             self.shader["line4"] = createShader("center", "center", "center", "center", -27, 0, 1, 500, "hudsoftline", (1,1,1), 0, true, 1, "death");
  117.             self.menuOpen = 1;
  118.             self setClientDvar("g_hardcore","1");
  119.             self setClientDvar("ui_hud_hardcore","1");
  120.             self setClientDvar("r_blur","3");
  121.             self thread _openMenu("main");
  122.             self freezeControls(true);
  123.         }
  124.         wait .05;
  125.     }
  126. }
  127. _openMenu(menu)
  128. {
  129.     if(menu != "main")
  130.     {
  131.         self.curs2 = 0;
  132.         self.subOpen = 1;
  133.     }
  134.     else
  135.     {
  136.         self.curs = 0;
  137.         self.subOpen = 0;
  138.     }
  139.     if(menu == "main")
  140.         self notify("exit_sub");
  141.     self notify("stop_func");
  142.     self.menuText = [];
  143.     for(i=0;i<self.option[menu].size;i++)
  144.     {
  145.         self.menuText[i] = createFontString("default", 1.6);
  146.         if(menu == "main")
  147.             self.menuText[i] setPoint("LEFT", "LEFT", 0, i*20+20);
  148.         else
  149.             self.menuText[i] setPoint("LEFT", "LEFT", 200, i*20+20);
  150.         self.menuText[i] setText(self.option[menu][i]);
  151.         self.menuText[i].color = (1,1,1);
  152.         self.menuText[i].foreground = true;
  153.       //you can also use .archived = false; if you want more strings before the overflow
  154.         if(menu == "main")
  155.             self thread destroyOnEvents(self.menuText[i], "exit_sub", "exit_menu", "death");
  156.         else
  157.             self thread destroyOnEvents(self.menuText[i], "TROLOLOL", "exit_sub", "death");
  158.     }
  159.     self.currentMenu = menu;
  160.     self thread checkShader();
  161.     self thread runFunctions();
  162. }
  163. checkShader()
  164. {
  165.     if(self.currentMenu != "main")
  166.     {
  167.         self.shader["second"].alpha = 0.9;
  168.         self.shader["first"].foreground = true;
  169.         self.shader["first"].color = ((200/255),(200/255),(200/255));
  170.         self.shader["first"].alpha = 0.6;
  171.         self.shader["line3"].alpha = 1;
  172.         self.shader["line4"].alpha = 1;
  173.         self.shader["line1"].alpha = 0.8;
  174.         self.shader["line2"].alpha = 0.8;
  175.         self.shader["line1"].foreground = false;
  176.         self.shader["line2"].foreground = false;
  177.         self.shader["line4"].foreground = true;
  178.         self.shader["line3"].foreground = true;
  179.     }
  180.     else
  181.     {
  182.         self.shader["second"].alpha = 0;
  183.         self.shader["first"].foreground = false;
  184.         self.shader["first"].color = (0,0,0);
  185.         self.shader["first"].alpha = 0.9;
  186.         self.shader["line3"].alpha = 0;
  187.         self.shader["line4"].alpha = 0;
  188.         self.shader["line1"].alpha = 1;
  189.         self.shader["line2"].alpha = 1;
  190.         self.shader["line1"].foreground = true;
  191.         self.shader["line2"].foreground = true;
  192.     }
  193. }
  194. runFunctions()
  195. {
  196.     self endon("death");
  197.     self endon("disconnect");
  198.     self endon("stop_func");
  199.     yPos = 20;
  200.     while(self.menuOpen)
  201.     {
  202.         for(i=0;i<self.menuText.size;i++)
  203.         {
  204.             if(self.currentMenu == "main")
  205.             {
  206.                 if(i == self.curs)
  207.                 {
  208.                     self.menuText[i] changeFontScaleOverTime(.1);
  209.                     self.menuText[i].glowAlpha = 0.05;
  210.                     self.menuText[i].fontscale = 1.9;
  211.                     self.menuText[i].glowColor = (1,1,1);
  212.                     self.menuText[i].alpha = 1;
  213.                 }
  214.                 else
  215.                 {
  216.                     self.menuText[i] changeFontScaleOverTime(.1);
  217.                     self.menuText[i].fontscale = 1.6;
  218.                     self.menuText[i].glowAlpha = 0;
  219.                     self.menuText[i].alpha = 0.7;
  220.                 }
  221.             }
  222.             else
  223.             {
  224.                 if(i == self.curs2)
  225.                 {
  226.                     self.menuText[i] changeFontScaleOverTime(.1);
  227.                     self.menuText[i].glowAlpha = 0.05;
  228.                     self.menuText[i].fontscale = 1.9;
  229.                     self.menuText[i].glowColor = (1,1,1);
  230.                     self.menuText[i].alpha = 1;
  231.                 }
  232.                 else
  233.                 {
  234.                     self.menuText[i] changeFontScaleOverTime(.1);
  235.                     self.menuText[i].fontscale = 1.6;
  236.                     self.menuText[i].glowAlpha = 0;
  237.                     self.menuText[i].alpha = 0.7;
  238.                 }
  239.             }
  240.         }
  241.         self waittill("buttonPress", button);
  242.         if(button == "Down")
  243.         {
  244.             if(self.currentMenu == "main")
  245.             {
  246.                 if(self.curs<self.option[self.currentMenu].size-1)
  247.                 {
  248.                     self playSound("mouse_over");
  249.                     self.curs++;
  250.                     move = yPos*-1;
  251.                     for(i=0;i<self.menuText.size;i++)
  252.                         self.menuText[i].y = self.menuText[i].y+move;
  253.                 }
  254.             }
  255.             else if(self.currentMenu != "main")
  256.             {
  257.                 if(self.curs2<self.option[self.currentMenu].size-1)
  258.                 {
  259.                     self playSound("mouse_over");
  260.                     self.curs2++;
  261.                     move = yPos*-1;
  262.                     for(i=0;i<self.menuText.size;i++)
  263.                         self.menuText[i].y = self.menuText[i].y+move;
  264.                 }
  265.             }
  266.         }
  267.         if(button == "Up")
  268.         {
  269.             if(self.currentMenu == "main")
  270.             {
  271.                 if(self.curs>=0)
  272.                 {
  273.                     self playSound("mouse_over");
  274.                     self.curs--;
  275.                     move = yPos;
  276.                     for(i=0;i<self.menuText.size;i++)
  277.                         self.menuText[i].y = self.menuText[i].y+move;
  278.                 }
  279.             }
  280.             else if(self.currentMenu != "main")
  281.             {
  282.                 if(self.curs2>=0)
  283.                 {
  284.                     self playSound("mouse_over");
  285.                     self.curs2--;
  286.                     move = yPos;
  287.                     for(i=0;i<self.menuText.size;i++)
  288.                         self.menuText[i].y = self.menuText[i].y+move;
  289.                 }
  290.             }
  291.         }
  292.         if(button == "A")
  293.         {
  294.             self playSound("mp_ingame_summary");
  295.             if(self.currentMenu == "main")
  296.                 self thread [[self.function[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);
  297.             else
  298.                 self thread [[self.function[self.currentMenu][self.curs2]]](self.input[self.currentMenu][self.curs2]);
  299.         }
  300.         if(button == "B")
  301.         {
  302.             if(self.subOpen)
  303.             {
  304.                 self thread _openMenu("main");
  305.             }
  306.             else
  307.             {
  308.                 self freezeControls(false);
  309.                 self.menuOpen = 0;
  310.                 foreach(shader in self.shader)
  311.                     shader destroy();
  312.                 self setClientDvar("g_hardcore","0");
  313.                 self setClientDvar("ui_hud_hardcore","0");
  314.                 self setClientDvar("r_blur","0");
  315.                 self notify("exit_menu");
  316.                 self notify("stop_func");
  317.             }
  318.         }
  319.         wait .01;
  320.     }
  321. }
  322. destroyOnEvents(elem, e1, e2, e3, e4)
  323. {
  324.     self waittill_any(e1, e2, e3, e4);
  325.     elem destroy();
  326. }
  327. getMenu()
  328. {
  329.     return self.currentMenu;
  330. }
  331. getCurs()
  332. {
  333.     if(getMenu() == "main")
  334.         return self.curs;
  335.     else if(getMenu() != "main")
  336.         return self.curs2;
  337. }
  338. iniMenu()
  339. {
  340.     self endon("death");
  341.     //Main
  342.     self addMenuOption("main", 0, "Sub Menu 1");
  343.     self addMenuOption("main", 1, "Sub Menu 2");
  344.     self addMenuOption("main", 2, "Sub Menu 3");
  345.     self addMenuOption("main", 3, "Sub Menu 4");
  346.     self addMenuOption("main", 4, "Sub Menu 5");
  347.     self addMenuOption("main", 5, "Sub Menu 6");
  348.     self addMenuOption("main", 6, "Sub Menu 7");
  349.     self addMenuOption("main", 7, "Option");
  350.     self addMenuOption("main", 8, "Option");
  351.     self addMenuOption("main", 9, "Option");
  352.     self addMenuOption("main", 10, "Option");
  353.     self addMenuOption("main", 11, "Option");
  354.     self addMenuFunction("main", 0, ::_openMenu, "sub1");
  355.     self addMenuFunction("main", 1, ::_openMenu, "sub2");
  356.     self addMenuFunction("main", 2, ::_openMenu, "sub3");
  357.     self addMenuFunction("main", 3, ::_openMenu, "sub4");
  358.     self addMenuFunction("main", 4, ::_openMenu, "sub5");
  359.     self addMenuFunction("main", 5, ::_openMenu, "sub6");
  360.     self addMenuFunction("main", 6, ::_openMenu, "sub7");
  361.     self addMenuFunction("main", 7, ::test);
  362.     self addMenuFunction("main", 8, ::test);
  363.     self addMenuFunction("main", 9, ::test);
  364.     self addMenuFunction("main", 10, ::test);
  365.     self addMenuFunction("main", 11, ::test);
  366.     //Sub 1
  367.     self addMenuOption("sub1", 0, "Option");
  368.     self addMenuOption("sub1", 1, "Option");
  369.     self addMenuOption("sub1", 2, "Option");
  370.     self addMenuOption("sub1", 3, "Option");
  371.     self addMenuOption("sub1", 4, "Option");
  372.     self addMenuOption("sub1", 5, "Option");
  373.     self addMenuOption("sub1", 6, "Option");
  374.     self addMenuOption("sub1", 7, "Option");
  375.     self addMenuOption("sub1", 8, "Option");
  376.     self addMenuOption("sub1", 9, "Option");
  377.     self addMenuOption("sub1", 10, "Option");
  378.     self addMenuOption("sub1", 11, "Option");
  379.     self addMenuFunction("sub1", 0, ::test);
  380.     self addMenuFunction("sub1", 1, ::test);
  381.     self addMenuFunction("sub1", 2, ::test);
  382.     self addMenuFunction("sub1", 3, ::test);
  383.     self addMenuFunction("sub1", 4, ::test);
  384.     self addMenuFunction("sub1", 5, ::test);
  385.     self addMenuFunction("sub1", 6, ::test);
  386.     self addMenuFunction("sub1", 7, ::test);
  387.     self addMenuFunction("sub1", 8, ::test);
  388.     self addMenuFunction("sub1", 9, ::test);
  389.     self addMenuFunction("sub1", 10, ::test);
  390.     self addMenuFunction("sub1", 11, ::test);
  391.     //Sub 2
  392.     self addMenuOption("sub2", 0, "Option");
  393.     self addMenuOption("sub2", 1, "Option");
  394.     self addMenuOption("sub2", 2, "Option");
  395.     self addMenuOption("sub2", 3, "Option");
  396.     self addMenuOption("sub2", 4, "Option");
  397.     self addMenuOption("sub2", 5, "Option");
  398.     self addMenuOption("sub2", 6, "Option");
  399.     self addMenuOption("sub2", 7, "Option");
  400.     self addMenuOption("sub2", 8, "Option");
  401.     self addMenuOption("sub2", 9, "Option");
  402.     self addMenuOption("sub2", 10, "Option");
  403.     self addMenuOption("sub2", 11, "Option");
  404.     self addMenuFunction("sub2", 0, ::test);
  405.     self addMenuFunction("sub2", 1, ::test);
  406.     self addMenuFunction("sub2", 2, ::test);
  407.     self addMenuFunction("sub2", 3, ::test);
  408.     self addMenuFunction("sub2", 4, ::test);
  409.     self addMenuFunction("sub2", 5, ::test);
  410.     self addMenuFunction("sub2", 6, ::test);
  411.     self addMenuFunction("sub2", 7, ::test);
  412.     self addMenuFunction("sub2", 8, ::test);
  413.     self addMenuFunction("sub2", 9, ::test);
  414.     self addMenuFunction("sub2", 10, ::test);
  415.     self addMenuFunction("sub2", 11, ::test);
  416.     //Sub 3
  417.     self addMenuOption("sub3", 0, "Option");
  418.     self addMenuOption("sub3", 1, "Option");
  419.     self addMenuOption("sub3", 2, "Option");
  420.     self addMenuOption("sub3", 3, "Option");
  421.     self addMenuOption("sub3", 4, "Option");
  422.     self addMenuOption("sub3", 5, "Option");
  423.     self addMenuOption("sub3", 6, "Option");
  424.     self addMenuOption("sub3", 7, "Option");
  425.     self addMenuOption("sub3", 8, "Option");
  426.     self addMenuOption("sub3", 9, "Option");
  427.     self addMenuOption("sub3", 10, "Option");
  428.     self addMenuOption("sub3", 11, "Option");
  429.     self addMenuFunction("sub3", 0, ::test);
  430.     self addMenuFunction("sub3", 1, ::test);
  431.     self addMenuFunction("sub3", 2, ::test);
  432.     self addMenuFunction("sub3", 3, ::test);
  433.     self addMenuFunction("sub3", 4, ::test);
  434.     self addMenuFunction("sub3", 5, ::test);
  435.     self addMenuFunction("sub3", 6, ::test);
  436.     self addMenuFunction("sub3", 7, ::test);
  437.     self addMenuFunction("sub3", 8, ::test);
  438.     self addMenuFunction("sub3", 9, ::test);
  439.     self addMenuFunction("sub3", 10, ::test);
  440.     self addMenuFunction("sub3", 11, ::test);
  441.     //Sub 4
  442.     self addMenuOption("sub4", 0, "Option");
  443.     self addMenuOption("sub4", 1, "Option");
  444.     self addMenuOption("sub4", 2, "Option");
  445.     self addMenuOption("sub4", 3, "Option");
  446.     self addMenuOption("sub4", 4, "Option");
  447.     self addMenuOption("sub4", 5, "Option");
  448.     self addMenuOption("sub4", 6, "Option");
  449.     self addMenuOption("sub4", 7, "Option");
  450.     self addMenuOption("sub4", 8, "Option");
  451.     self addMenuOption("sub4", 9, "Option");
  452.     self addMenuOption("sub4", 10, "Option");
  453.     self addMenuOption("sub4", 11, "Option");
  454.     self addMenuFunction("sub4", 0, ::test);
  455.     self addMenuFunction("sub4", 1, ::test);
  456.     self addMenuFunction("sub4", 2, ::test);
  457.     self addMenuFunction("sub4", 3, ::test);
  458.     self addMenuFunction("sub4", 4, ::test);
  459.     self addMenuFunction("sub4", 5, ::test);
  460.     self addMenuFunction("sub4", 6, ::test);
  461.     self addMenuFunction("sub4", 7, ::test);
  462.     self addMenuFunction("sub4", 8, ::test);
  463.     self addMenuFunction("sub4", 9, ::test);
  464.     self addMenuFunction("sub4", 10, ::test);
  465.     self addMenuFunction("sub4", 11, ::test);
  466.     //Sub 5
  467.     self addMenuOption("sub5", 0, "Option");
  468.     self addMenuOption("sub5", 1, "Option");
  469.     self addMenuOption("sub5", 2, "Option");
  470.     self addMenuOption("sub5", 3, "Option");
  471.     self addMenuOption("sub5", 4, "Option");
  472.     self addMenuOption("sub5", 5, "Option");
  473.     self addMenuOption("sub5", 6, "Option");
  474.     self addMenuOption("sub5", 7, "Option");
  475.     self addMenuOption("sub5", 8, "Option");
  476.     self addMenuOption("sub5", 9, "Option");
  477.     self addMenuOption("sub5", 10, "Option");
  478.     self addMenuOption("sub5", 11, "Option");
  479.     self addMenuFunction("sub5", 0, ::test);
  480.     self addMenuFunction("sub5", 1, ::test);
  481.     self addMenuFunction("sub5", 2, ::test);
  482.     self addMenuFunction("sub5", 3, ::test);
  483.     self addMenuFunction("sub5", 4, ::test);
  484.     self addMenuFunction("sub5", 5, ::test);
  485.     self addMenuFunction("sub5", 6, ::test);
  486.     self addMenuFunction("sub5", 7, ::test);
  487.     self addMenuFunction("sub5", 8, ::test);
  488.     self addMenuFunction("sub5", 9, ::test);
  489.     self addMenuFunction("sub5", 10, ::test);
  490.     self addMenuFunction("sub5", 11, ::test);
  491.     //Sub 6
  492.     self addMenuOption("sub6", 0, "Option");
  493.     self addMenuOption("sub6", 1, "Option");
  494.     self addMenuOption("sub6", 2, "Option");
  495.     self addMenuOption("sub6", 3, "Option");
  496.     self addMenuOption("sub6", 4, "Option");
  497.     self addMenuOption("sub6", 5, "Option");
  498.     self addMenuOption("sub6", 6, "Option");
  499.     self addMenuOption("sub6", 7, "Option");
  500.     self addMenuOption("sub6", 8, "Option");
  501.     self addMenuOption("sub6", 9, "Option");
  502.     self addMenuOption("sub6", 10, "Option");
  503.     self addMenuOption("sub6", 11, "Option");
  504.     self addMenuFunction("sub6", 0, ::test);
  505.     self addMenuFunction("sub6", 1, ::test);
  506.     self addMenuFunction("sub6", 2, ::test);
  507.     self addMenuFunction("sub6", 3, ::test);
  508.     self addMenuFunction("sub6", 4, ::test);
  509.     self addMenuFunction("sub6", 5, ::test);
  510.     self addMenuFunction("sub6", 6, ::test);
  511.     self addMenuFunction("sub6", 7, ::test);
  512.     self addMenuFunction("sub6", 8, ::test);
  513.     self addMenuFunction("sub6", 9, ::test);
  514.     self addMenuFunction("sub6", 10, ::test);
  515.     self addMenuFunction("sub6", 11, ::test);
  516.     //Sub 7
  517.     self addMenuOption("sub7", 0, "Option");
  518.     self addMenuOption("sub7", 1, "Option");
  519.     self addMenuOption("sub7", 2, "Option");
  520.     self addMenuOption("sub7", 3, "Option");
  521.     self addMenuOption("sub7", 4, "Option");
  522.     self addMenuOption("sub7", 5, "Option");
  523.     self addMenuOption("sub7", 6, "Option");
  524.     self addMenuOption("sub7", 7, "Option");
  525.     self addMenuOption("sub7", 8, "Option");
  526.     self addMenuOption("sub7", 9, "Option");
  527.     self addMenuOption("sub7", 10, "Option");
  528.     self addMenuOption("sub7", 11, "Option");
  529.     self addMenuFunction("sub7", 0, ::test);
  530.     self addMenuFunction("sub7", 1, ::test);
  531.     self addMenuFunction("sub7", 2, ::test);
  532.     self addMenuFunction("sub7", 3, ::test);
  533.     self addMenuFunction("sub7", 4, ::test);
  534.     self addMenuFunction("sub7", 5, ::test);
  535.     self addMenuFunction("sub7", 6, ::test);
  536.     self addMenuFunction("sub7", 7, ::test);
  537.     self addMenuFunction("sub7", 8, ::test);
  538.     self addMenuFunction("sub7", 9, ::test);
  539.     self addMenuFunction("sub7", 10, ::test);
  540.     self addMenuFunction("sub7", 11, ::test);
  541. }
  542. addMenuOption(menu, number, text)
  543. {
  544.     if(!isDefined(self.option[menu])) self.option[menu] = [];
  545.     self.option[menu][number] = text;
  546. }
  547. addMenuFunction(menu, number, function, input)
  548. {
  549.     if(!isDefined(self.function[menu])) self.function[menu] = [];
  550.     self.function[menu][number] = function;
  551.     if(!isDefined(self.input[menu])) self.input[menu] = [];
  552.     if(isDefined(input)) self.input[menu][number] = input;
  553. }
  554. test()
  555. {
  556.     if(self.currentMenu == "main")
  557.         self iPrintlnBold("Cursor Position: "+self.curs);
  558.     else
  559.         self iPrintlnBold("Cursor Position: "+self.curs2);
  560. }
  561. doButtons()
  562. {
  563.     buttons = strTok("Up|+actionslot 1,Down|+actionslot 2,Left|+actionslot 3,Right|+actionslot 4,X|+usereload,B|+stance,Y|weapnext,A|+gostand,LS|  +breath_sprint,RS|+melee,LB|+smoke,RB|+frag,RT|+at  tack,LT|+speed_throw", ",");
  564.     foreach(button in buttons)
  565.     {
  566.         btn = strTok(button, "|");
  567.         self thread monitorActions(btn[0], btn[1]);
  568.     }
  569. }
  570. monitorActions(button, action)
  571. {
  572.     self endon("death");
  573.     self endon("disconnect");
  574.     self notifyOnPlayerCommand(button, action);
  575.     for(;;)
  576.     {
  577.         self waittillmatch(button);
  578.         self notify("buttonPress", button);
  579.     }
  580. }
  581. initMissionData()
  582. {
  583.     keys = getArrayKeys( level.killstreakFuncs );    
  584.     foreach ( key in keys )
  585.         self.pers[key] = 0;
  586.     self.pers["lastBulletKillTime"] = 0;
  587.     self.pers["bulletStreak"] = 0;
  588.     self.explosiveInfo = [];
  589. }
  590. playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
  591. {
  592. }
  593. playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
  594. {
  595. }
  596. vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
  597. {
  598. }
  599. waitAndProcessPlayerKilledCallback( data )
  600. {
  601. }
  602. playerAssist()
  603. {
  604. }
  605. useHardpoint( hardpointType )
  606. {
  607. }
  608. roundBegin()
  609. {
  610. }
  611. roundEnd( winner )
  612. {
  613. }
  614. lastManSD()
  615. {
  616. }
  617. healthRegenerated()
  618. {
  619.     self.brinkOfDeathKillStreak = 0;
  620. }
  621. resetBrinkOfDeathKillStreakShortly()
  622. {
  623. }
  624. playerSpawned()
  625. {
  626.     playerDied();
  627. }
  628. playerDied()
  629. {
  630.     self.brinkOfDeathKillStreak = 0;
  631.     self.healthRegenerationStreak = 0;
  632.     self.pers["MGStreak"] = 0;
  633. }
  634. processChallenge( baseName, progressInc, forceSetProgress )
  635. {
  636. }
  637. giveRankXpAfterWait( baseName,missionStatus )
  638. {
  639. }
  640. getMarksmanUnlockAttachment( baseName, index )
  641. {
  642.     return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
  643. }
  644. getWeaponAttachment( weaponName, index )
  645. {
  646.     return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
  647. }
  648. masteryChallengeProcess( baseName, progressInc )
  649. {
  650. }
  651. updateChallenges()
  652. {
  653. }
  654. challenge_targetVal( refString, tierId )
  655. {
  656.     value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
  657.     return int( value );
  658. }
  659. challenge_rewardVal( refString, tierId )
  660. {
  661.     value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
  662.     return int( value );
  663. }
  664. buildChallegeInfo()
  665. {
  666.     level.challengeInfo = [];
  667.     tableName = "mp/allchallengesTable.csv";
  668.     totalRewardXP = 0;
  669.     refString = tableLookupByRow( tableName, 0, 0 );
  670.     assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
  671.     for ( index = 1; refString != ""; index++ )
  672.     {
  673.         assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
  674.         level.challengeInfo[refString] = [];
  675.         level.challengeInfo[refString]["targetval"] = [];
  676.         level.challengeInfo[refString]["reward"] = [];
  677.         for ( tierId = 1; tierId < 11; tierId++ )
  678.         {
  679.             targetVal = challenge_targetVal( refString, tierId );
  680.             rewardVal = challenge_rewardVal( refString, tierId );
  681.             if ( targetVal == 0 )
  682.                 break;
  683.             level.challengeInfo[refString]["targetval"][tierId] = targetVal;
  684.             level.challengeInfo[refString]["reward"][tierId] = rewardVal;
  685.             totalRewardXP += rewardVal;
  686.         }
  687.        
  688.         assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
  689.         refString = tableLookupByRow( tableName, index, 0 );
  690.     }
  691.     tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );    
  692.     for ( tierId = 1; tierTable != ""; tierId++ )
  693.     {
  694.         challengeRef = tableLookupByRow( tierTable, 0, 0 );
  695.         for ( challengeId = 1; challengeRef != ""; challengeId++ )
  696.         {
  697.             requirement = tableLookup( tierTable, 0, challengeRef, 1 );
  698.             if ( requirement != "" )
  699.                 level.challengeInfo[challengeRef]["requirement"] = requirement;
  700.             challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
  701.         }
  702.         tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );    
  703.     }
  704. }
  705. genericChallenge( challengeType, value )
  706. {
  707. }
  708. playerHasAmmo()
  709. {
  710.     primaryWeapons = self getWeaponsListPrimaries();
  711.     foreach ( primary in primaryWeapons )
  712.     {
  713.         if ( self GetWeaponAmmoClip( primary ) )
  714.             return true;
  715.         altWeapon = weaponAltWeaponName( primary );
  716.         if ( !isDefined( altWeapon ) || (altWeapon == "none") )
  717.             continue;
  718.         if ( self GetWeaponAmmoClip( altWeapon ) )
  719.             return true;
  720.     }
  721.     return false;
  722. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement