Advertisement
Guest User

zxcxzc

a guest
Oct 22nd, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 23.58 KB | None | 0 0
  1. #include "zcommon.acs"
  2.  
  3. struct partyMember
  4. {
  5.     //stats
  6.     int hp;
  7.     int cur_hp;
  8.     int cur_energy;
  9.     int cur_adre;
  10.     int energy;
  11.     int adre;
  12.    
  13.     int str_stat;
  14.     int str_scale;
  15.     int dex_stat;
  16.     int dex_scale;
  17.     int int_stat;
  18.     int int_scale;
  19.     int fth_stat;
  20.     int fth_scale;
  21.     int vit_stat;
  22.     int vit_scale;
  23.    
  24.     str class;
  25.     str role;
  26.     str name;
  27. }
  28.  
  29. global partyMember p1;
  30. global partyMember p2;
  31. global partyMember p3;
  32. global partyMember p4;
  33.  
  34. script "init_party" ENTER //initialize all this because the compiler doesnt like it doing it in global scope
  35. {
  36.     SetUserCVarString(0, "pname", "");
  37.    
  38.     p1.cur_hp = 0;
  39.     p2.cur_hp = 0;
  40.     p3.cur_hp = 0;
  41.     p4.cur_hp = 0;
  42.    
  43.     p1.hp = 0;
  44.     p2.hp = 0;
  45.     p3.hp = 0;
  46.     p4.hp = 0;
  47.    
  48.     p1.energy = 0;
  49.     p2.energy = 0;
  50.     p3.energy = 0;
  51.     p4.energy = 0;
  52.  
  53.     p1.cur_energy = 0;
  54.     p2.cur_energy = 0;
  55.     p3.cur_energy = 0;
  56.     p4.cur_energy = 0;
  57.    
  58.     p1.adre = 0;
  59.     p2.adre = 0;
  60.     p3.adre = 0;
  61.     p4.adre = 0;
  62.    
  63.     p1.cur_adre = 0;
  64.     p2.cur_adre = 0;
  65.     p3.cur_adre = 0;
  66.     p4.cur_adre = 0;
  67.    
  68.     p1.str_stat = 0;
  69.     p2.str_stat = 0;
  70.     p3.str_stat = 0;
  71.     p4.str_stat = 0;
  72.    
  73.     p1.dex_stat = 0;
  74.     p2.dex_stat = 0;
  75.     p3.dex_stat = 0;
  76.     p4.dex_stat = 0;
  77.    
  78.     p1.int_stat = 0;
  79.     p2.int_stat = 0;
  80.     p3.int_stat = 0;
  81.     p4.int_stat = 0;
  82.    
  83.     p1.fth_stat = 0;
  84.     p2.fth_stat = 0;
  85.     p3.fth_stat = 0;
  86.     p4.fth_stat = 0;
  87.    
  88.     p1.vit_stat = 0;
  89.     p2.vit_stat = 0;
  90.     p3.vit_stat = 0;
  91.     p4.vit_stat = 0;
  92.    
  93.     p1.str_scale = 0;
  94.     p2.str_scale = 0;
  95.     p3.str_scale = 0;
  96.     p4.str_scale = 0;
  97.    
  98.     p1.dex_scale = 0;
  99.     p2.dex_scale = 0;
  100.     p3.dex_scale = 0;
  101.     p4.dex_scale = 0;
  102.    
  103.     p1.int_scale = 0;
  104.     p2.int_scale = 0;
  105.     p3.int_scale = 0;
  106.     p4.int_scale = 0;
  107.    
  108.     p1.fth_scale = 0;
  109.     p2.fth_scale = 0;
  110.     p3.fth_scale = 0;
  111.     p4.fth_scale = 0;
  112.    
  113.     p1.vit_scale = 0;
  114.     p2.vit_scale = 0;
  115.     p3.vit_scale = 0;
  116.     p4.vit_scale = 0;
  117.    
  118.     p1.class = "";
  119.     p2.class = "";
  120.     p3.class = "";
  121.     p4.class = "";
  122.    
  123.     p1.role = "";
  124.     p2.role = "";
  125.     p3.role = "";
  126.     p4.role = "";
  127.    
  128.     p1.name = "";
  129.     p2.name = "";
  130.     p3.name = "";
  131.     p4.name = "";
  132. }
  133.  
  134. script "name_input" (int cur_pmember)
  135. {
  136.     bool ExitName = false;
  137.     do
  138.     {
  139.         int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
  140.         if(buttons & BT_USE)
  141.         {
  142.             switch(cur_pmember)
  143.             {
  144.                 case 0:
  145.                     p1.name = GetUserCVarString(0, "pname");
  146.                     break;
  147.                 case 1:
  148.                     p2.name = GetUserCVarString(0, "pname");
  149.                     break;
  150.                 case 2:
  151.                     p3.name = GetUserCVarString(0, "pname");
  152.                     break;
  153.                 case 3:
  154.                     p4.name = GetUserCVarString(0, "pname");
  155.                     break;
  156.             }
  157.             delay(4);
  158.             ACS_NamedExecute("init_main", 0);
  159.             terminate;
  160.         }
  161.         HudMessage(s:"PRESS USE TO FINISH"; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.6, 0.03);
  162.         HudMessage(s:"Press \140 and type in pname followed by your party member's name inside \"quotation marks\" then press Enter"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.13, 0.03);
  163.         HudMessage(s:"Example: \140 pname \"test name\""; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.18, 0.03);
  164.         delay(1);
  165.     } while(!ExitName);
  166.     FadeTo(0,0,0,0.0,0.0);
  167. }
  168.  
  169. script "class_slots" (int cur_slot, int role)
  170. {
  171.     bool ExitRosterClass = false;
  172.     int MenuCount = 4, CurSel = 0;
  173.     str MenuOptionsTank[4] = {"Berserker", "Tactician", "Warrior", "Back"};
  174.     str MenuOptionsDPS[4] = {"Man At Arms", "Mage", "Duelist", "Back"};
  175.     str MenuOptionsHealer[4] = {"Priest", "Druid", "Sage", "Back"};
  176.     int j;
  177.     int oldbuttons = 0;
  178.     do
  179.     {
  180.         int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
  181.         if((buttons & BT_FORWARD)  && (oldbuttons != buttons))
  182.             CurSel--;  
  183.         else if((buttons & BT_BACK)  && (oldbuttons != buttons))
  184.             CurSel++;
  185.         else if((buttons & BT_USE)  && (oldbuttons != buttons))
  186.         {
  187.             switch(role)
  188.             {
  189.                 case 0:
  190.                     switch(cur_slot)
  191.                     {
  192.                         case 0:
  193.                             switch(CurSel)
  194.                             {
  195.                                 case 0:
  196.                                 {
  197.                                     p1.class = MenuOptionsTank[0];
  198.                                     delay(4);
  199.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  200.                                     terminate;
  201.                                 }
  202.                                 case 1:
  203.                                 {
  204.                                     p1.class = MenuOptionsTank[1];
  205.                                     delay(4);
  206.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  207.                                     terminate;
  208.                                 }
  209.                                 case 2:
  210.                                 {
  211.                                     p1.class = MenuOptionsTank[2];
  212.                                     delay(4);
  213.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  214.                                     terminate;
  215.                                 }
  216.                                 case 3:
  217.                                 {
  218.                                     delay(4);
  219.                                     ACS_NamedExecute("init_main", 0);
  220.                                     terminate;
  221.                                 }
  222.                             }
  223.                             break;
  224.                         case 1:
  225.                             switch(CurSel)
  226.                             {
  227.                                 case 0:
  228.                                 {
  229.                                     p2.class = MenuOptionsTank[0];
  230.                                     delay(4);
  231.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  232.                                     terminate;
  233.                                 }
  234.                                 case 1:
  235.                                 {
  236.                                     p2.class = MenuOptionsTank[1];
  237.                                     delay(4);
  238.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  239.                                     terminate;
  240.                                 }
  241.                                 case 2:
  242.                                 {
  243.                                     p2.class = MenuOptionsTank[2];
  244.                                     delay(4);
  245.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  246.                                     terminate;
  247.                                 }
  248.                                 case 3:
  249.                                 {
  250.                                     delay(4);
  251.                                     ACS_NamedExecute("init_main", 0);
  252.                                     terminate;
  253.                                 }
  254.                             }
  255.                             break;
  256.                         case 2:
  257.                             switch(CurSel)
  258.                             {
  259.                                 case 0:
  260.                                 {
  261.                                     p3.class = MenuOptionsTank[0];
  262.                                     delay(4);
  263.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  264.                                     terminate;
  265.                                 }
  266.                                 case 1:
  267.                                 {
  268.                                     p3.class = MenuOptionsTank[1];
  269.                                     delay(4);
  270.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  271.                                     terminate;
  272.                                 }
  273.                                 case 2:
  274.                                 {
  275.                                     p3.class = MenuOptionsTank[2];
  276.                                     delay(4);
  277.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  278.                                     terminate;
  279.                                 }
  280.                                 case 3:
  281.                                 {
  282.                                     delay(4);
  283.                                     ACS_NamedExecute("init_main", 0);
  284.                                     terminate;
  285.                                 }
  286.                             }
  287.                             break;
  288.                         case 3:
  289.                             switch(CurSel)
  290.                             {
  291.                                 case 0:
  292.                                 {
  293.                                     p4.class = MenuOptionsTank[0];
  294.                                     delay(4);
  295.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  296.                                     terminate;
  297.                                 }
  298.                                 case 1:
  299.                                 {
  300.                                     p4.class = MenuOptionsTank[1];
  301.                                     delay(4);
  302.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  303.                                     terminate;
  304.                                 }
  305.                                 case 2:
  306.                                 {
  307.                                     p4.class = MenuOptionsTank[2];
  308.                                     delay(4);
  309.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  310.                                     terminate;
  311.                                 }
  312.                                 case 3:
  313.                                 {
  314.                                     delay(4);
  315.                                     ACS_NamedExecute("init_main", 0);
  316.                                     terminate;
  317.                                 }
  318.                             }
  319.                             break;
  320.                     }
  321.                     break;
  322.                 case 1:
  323.                     switch(cur_slot)
  324.                     {
  325.                         case 0:
  326.                             switch(CurSel)
  327.                             {
  328.                                 case 0:
  329.                                 {
  330.                                     p1.class = MenuOptionsDPS[0];
  331.                                     delay(4);
  332.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  333.                                     terminate;
  334.                                 }
  335.                                 case 1:
  336.                                 {
  337.                                     p1.class = MenuOptionsDPS[1];
  338.                                     delay(4);
  339.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  340.                                     terminate;
  341.                                 }
  342.                                 case 2:
  343.                                 {
  344.                                     p1.class = MenuOptionsDPS[2];
  345.                                     delay(4);
  346.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  347.                                     terminate;
  348.                                 }
  349.                                 case 3:
  350.                                 {
  351.                                     delay(4);
  352.                                     ACS_NamedExecute("init_main", 0);
  353.                                     terminate;
  354.                                 }
  355.                             }
  356.                             break;
  357.                         case 1:
  358.                             switch(CurSel)
  359.                             {
  360.                                 case 0:
  361.                                 {
  362.                                     p2.class = MenuOptionsDPS[0];
  363.                                     delay(4);
  364.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  365.                                     terminate;
  366.                                 }
  367.                                 case 1:
  368.                                 {
  369.                                     p2.class = MenuOptionsDPS[1];
  370.                                     delay(4);
  371.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  372.                                     terminate;
  373.                                 }
  374.                                 case 2:
  375.                                 {
  376.                                     p2.class = MenuOptionsDPS[2];
  377.                                     delay(4);
  378.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  379.                                     terminate;
  380.                                 }
  381.                                 case 3:
  382.                                 {
  383.                                     delay(4);
  384.                                     ACS_NamedExecute("init_main", 0);
  385.                                     terminate;
  386.                                 }
  387.                             }
  388.                             break;
  389.                         case 2:
  390.                             switch(CurSel)
  391.                             {
  392.                                 case 0:
  393.                                 {
  394.                                     p3.class = MenuOptionsDPS[0];
  395.                                     delay(4);
  396.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  397.                                     terminate;
  398.                                 }
  399.                                 case 1:
  400.                                 {
  401.                                     p3.class = MenuOptionsDPS[1];
  402.                                     delay(4);
  403.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  404.                                     terminate;
  405.                                 }
  406.                                 case 2:
  407.                                 {
  408.                                     p3.class = MenuOptionsDPS[2];
  409.                                     delay(4);
  410.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  411.                                     terminate;
  412.                                 }
  413.                                 case 3:
  414.                                 {
  415.                                     delay(4);
  416.                                     ACS_NamedExecute("init_main", 0);
  417.                                     terminate;
  418.                                 }
  419.                             }
  420.                             break;
  421.                         case 3:
  422.                             switch(CurSel)
  423.                             {
  424.                                 case 0:
  425.                                 {
  426.                                     p4.class = MenuOptionsDPS[0];
  427.                                     delay(4);
  428.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  429.                                     terminate;
  430.                                 }
  431.                                 case 1:
  432.                                 {
  433.                                     p4.class = MenuOptionsDPS[1];
  434.                                     delay(4);
  435.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  436.                                     terminate;
  437.                                 }
  438.                                 case 2:
  439.                                 {
  440.                                     p4.class = MenuOptionsDPS[2];
  441.                                     delay(4);
  442.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  443.                                     terminate;
  444.                                 }
  445.                                 case 3:
  446.                                 {
  447.                                     delay(4);
  448.                                     ACS_NamedExecute("init_main", 0);
  449.                                     terminate;
  450.                                 }
  451.                             }
  452.                             break;
  453.                     }
  454.                     break;
  455.                 case 2:
  456.                     switch(cur_slot)
  457.                     {
  458.                         case 0:
  459.                             switch(CurSel)
  460.                             {
  461.                                 case 0:
  462.                                 {
  463.                                     p1.class = MenuOptionsHealer[0];
  464.                                     delay(4);
  465.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  466.                                     terminate;
  467.                                 }
  468.                                 case 1:
  469.                                 {
  470.                                     p1.class = MenuOptionsHealer[1];
  471.                                     delay(4);
  472.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  473.                                     terminate;
  474.                                 }
  475.                                 case 2:
  476.                                 {
  477.                                     p1.class = MenuOptionsHealer[2];
  478.                                     delay(4);
  479.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  480.                                     terminate;
  481.                                 }
  482.                                 case 3:
  483.                                 {
  484.                                     delay(4);
  485.                                     ACS_NamedExecute("init_main", 0);
  486.                                     terminate;
  487.                                 }
  488.                             }
  489.                             break;
  490.                         case 1:
  491.                             switch(CurSel)
  492.                             {
  493.                                 case 0:
  494.                                 {
  495.                                     p2.class = MenuOptionsHealer[0];
  496.                                     delay(4);
  497.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  498.                                     terminate;
  499.                                 }
  500.                                 case 1:
  501.                                 {
  502.                                     p2.class = MenuOptionsHealer[1];
  503.                                     delay(4);
  504.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  505.                                     terminate;
  506.                                 }
  507.                                 case 2:
  508.                                 {
  509.                                     p2.class = MenuOptionsHealer[2];
  510.                                     delay(4);
  511.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  512.                                     terminate;
  513.                                 }
  514.                                 case 3:
  515.                                 {
  516.                                     delay(4);
  517.                                     ACS_NamedExecute("init_main", 0);
  518.                                     terminate;
  519.                                 }
  520.                             }
  521.                             break;
  522.                         case 2:
  523.                             switch(CurSel)
  524.                             {
  525.                                 case 0:
  526.                                 {
  527.                                     p3.class = MenuOptionsHealer[0];
  528.                                     delay(4);
  529.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  530.                                     terminate;
  531.                                 }
  532.                                 case 1:
  533.                                 {
  534.                                     p3.class = MenuOptionsHealer[1];
  535.                                     delay(4);
  536.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  537.                                     terminate;
  538.                                 }
  539.                                 case 2:
  540.                                 {
  541.                                     p3.class = MenuOptionsHealer[2];
  542.                                     delay(4);
  543.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  544.                                     terminate;
  545.                                 }
  546.                                 case 3:
  547.                                 {
  548.                                     delay(4);
  549.                                     ACS_NamedExecute("init_main", 0);
  550.                                     terminate;
  551.                                 }
  552.                             }
  553.                             break;
  554.                         case 3:
  555.                         {
  556.                             switch(CurSel)
  557.                             {
  558.                                 case 0:
  559.                                 {
  560.                                     p4.class = MenuOptionsHealer[0];
  561.                                     delay(4);
  562.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  563.                                     terminate;
  564.                                 }
  565.                                 case 1:
  566.                                 {
  567.                                     p4.class = MenuOptionsHealer[1];
  568.                                     delay(4);
  569.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  570.                                     terminate;
  571.                                 }
  572.                                 case 2:
  573.                                 {
  574.                                     p4.class = MenuOptionsHealer[2];
  575.                                     delay(4);
  576.                                     ACS_NamedExecute("name_input", 0, cur_slot);
  577.                                     terminate;
  578.                                 }
  579.                                 case 3:
  580.                                 {
  581.                                     delay(4);
  582.                                     ACS_NamedExecute("init_main", 0);
  583.                                     terminate;
  584.                                 }
  585.                             }
  586.                             break;
  587.                         }
  588.                     }
  589.                     break;
  590.             }
  591.             break;
  592.         }
  593.         else
  594.             oldbuttons = 0;
  595.         if(CurSel > 3)
  596.             CurSel = 3;
  597.         if(CurSel < 0)
  598.             CurSel = 0;
  599.         HudMessage(s:"Pick a class"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.1, 0.03);
  600.         HudMessage(s:"Press F1 to check what each class does and their stats"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.15, 0.03);
  601.         HudMessage(s:"Use UP/DOWN arrow keys to select, USE to enter"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.9, 0.03);
  602.         oldbuttons = buttons;
  603.         for(j=0;j<MenuCount;j++)
  604.         {
  605.             if(role == 0)
  606.             {
  607.                 if (j == CurSel)
  608.                     HudMessage(s:MenuOptionsTank[j]; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.21+j*0.05, 0.03);
  609.                 else
  610.                     HudMessage(s:MenuOptionsTank[j]; HUDMSG_PLAIN, 0, CR_RED, 0.5, 0.21+j*0.05, 0.03);
  611.             }
  612.             else if(role == 1)
  613.             {
  614.                 if (j == CurSel)
  615.                     HudMessage(s:MenuOptionsDPS[j]; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.21+j*0.05, 0.03);
  616.                 else
  617.                     HudMessage(s:MenuOptionsDPS[j]; HUDMSG_PLAIN, 0, CR_RED, 0.5, 0.21+j*0.05, 0.03);
  618.             }
  619.             else if(role == 2)
  620.             {
  621.                 if (j == CurSel)
  622.                     HudMessage(s:MenuOptionsHealer[j]; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.21+j*0.05, 0.03);
  623.                 else
  624.                     HudMessage(s:MenuOptionsHealer[j]; HUDMSG_PLAIN, 0, CR_RED, 0.5, 0.21+j*0.05, 0.03);
  625.             }
  626.         }
  627.         delay(1);
  628.     }while(!ExitRosterClass);
  629. }
  630.  
  631. script "roster_slots" (int slot)
  632. {
  633.     bool ExitRosterSlots = false;
  634.     int MenuCount = 4, CurSel = 0;
  635.     str MenuOptions[4] = {"Tank", "DPS", "Healer", "Back"};
  636.     int j;
  637.     int oldbuttons = 0;
  638.     do
  639.     {
  640.         int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
  641.         if((buttons & BT_FORWARD)  && (oldbuttons != buttons))
  642.             CurSel--;  
  643.         else if((buttons & BT_BACK)  && (oldbuttons != buttons))
  644.             CurSel++;
  645.         else if((buttons & BT_USE)  && (oldbuttons != buttons))
  646.         {
  647.             switch(slot)
  648.             {
  649.                 case 0:
  650.                 {
  651.                     switch(CurSel)
  652.                     {
  653.                         case 0:
  654.                         {
  655.                             p1.role = "Tank";
  656.                             delay(4);
  657.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  658.                             terminate;
  659.                         }
  660.                         case 1:
  661.                         {
  662.                             p1.role = "DPS";
  663.                             delay(4);
  664.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  665.                             terminate;
  666.                         }
  667.                         case 2:
  668.                         {
  669.                             p1.role = "Healer";
  670.                             delay(4);
  671.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  672.                             terminate;
  673.                         }
  674.                         case 3:
  675.                         {
  676.                             delay(4);
  677.                             ACS_NamedExecute("init_main", 0);
  678.                             terminate;
  679.                         }
  680.                     }
  681.                     break;
  682.                 }
  683.                 case 1:
  684.                 {
  685.                     switch(CurSel)
  686.                     {
  687.                         case 0:
  688.                         {
  689.                             p2.role = "Tank";
  690.                             delay(4);
  691.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  692.                             terminate;
  693.                         }
  694.                         case 1:
  695.                         {
  696.                             p2.role = "DPS";
  697.                             delay(4);
  698.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  699.                             terminate;
  700.                         }
  701.                         case 2:
  702.                         {
  703.                             p2.role = "Healer";
  704.                             delay(4);
  705.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  706.                             terminate;
  707.                         }
  708.                         case 3:
  709.                         {
  710.                             delay(4);
  711.                             ACS_NamedExecute("init_main", 0);
  712.                             terminate;
  713.                         }
  714.                     }
  715.                     break;
  716.                 }
  717.                 case 2:
  718.                 {
  719.                     switch(CurSel)
  720.                     {
  721.                         case 0:
  722.                         {
  723.                             p3.role = "Tank";
  724.                             delay(4);
  725.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  726.                             terminate;
  727.                         }
  728.                         case 1:
  729.                         {
  730.                             p3.role = "DPS";
  731.                             delay(4);
  732.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  733.                             terminate;
  734.                         }
  735.                         case 2:
  736.                         {
  737.                             p3.role = "Healer";
  738.                             delay(4);
  739.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  740.                             terminate;
  741.                         }
  742.                         case 3:
  743.                         {
  744.                             delay(4);
  745.                             ACS_NamedExecute("init_main", 0);
  746.                             terminate;
  747.                         }
  748.                     }
  749.                     break;
  750.                 }
  751.                 case 3:
  752.                 {
  753.                     switch(CurSel)
  754.                     {
  755.                         case 0:
  756.                         {
  757.                             p4.role = "Tank";
  758.                             delay(4);
  759.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  760.                             terminate;
  761.                         }
  762.                         case 1:
  763.                         {
  764.                             p4.role = "DPS";
  765.                             delay(4);
  766.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  767.                             terminate;
  768.                         }
  769.                         case 2:
  770.                         {
  771.                             p4.role = "Healer";
  772.                             delay(4);
  773.                             ACS_NamedExecute("class_slots", 0, slot, CurSel);
  774.                             terminate;
  775.                         }
  776.                         case 3:
  777.                         {
  778.                             delay(4);
  779.                             ACS_NamedExecute("init_main", 0);
  780.                             terminate;
  781.                         }
  782.                     }
  783.                     break;
  784.                 }
  785.                 break;
  786.             }
  787.         }
  788.         else
  789.             oldbuttons = 0;
  790.         if(CurSel > 3)
  791.             CurSel = 3;
  792.         if(CurSel < 0)
  793.             CurSel = 0;
  794.         HudMessage(s:"Pick a role"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.1, 0.03);
  795.         HudMessage(s:"Use UP/DOWN arrow keys to select, USE to enter"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.9, 0.03);
  796.         oldbuttons = buttons;
  797.         for(j=0;j<MenuCount;j++)
  798.         {
  799.             if (j == CurSel)
  800.             {
  801.                 HudMessage(s:MenuOptions[j]; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.21+j*0.05, 0.03);
  802.             }
  803.             else
  804.             {
  805.                 HudMessage(s:MenuOptions[j]; HUDMSG_PLAIN, 0, CR_RED, 0.5, 0.21+j*0.05, 0.03);
  806.             }
  807.         }
  808.         delay(1);
  809.     }while(!ExitRosterSlots);
  810. }
  811.  
  812. script "init_party_stats" (void)
  813. {
  814.     if(p1.class == "Berserker")
  815.     {
  816.         p1.vit_stat = 10;
  817.         p1.hp = p1.vit_stat * 10;
  818.         p1.cur_hp = 100;
  819.         p1.energy = 20;
  820.         p1.cur_energy = 20;
  821.         p1.adre = 0;
  822.         p1.cur_adre = 0;
  823.         p1.str_stat = 10;
  824.         p1.str_scale = 5;
  825.         p1.dex_stat = 2;
  826.         p1.dex_scale = 1;
  827.         p1.int_stat = 1;
  828.         p1.int_scale = 0;
  829.         p1.fth_stat = 1;
  830.         p1.fth_scale = 0;
  831.         p1.vit_scale = 20;
  832.     }
  833.     if(p2.class == "Berserker")
  834.     {
  835.         p2.vit_stat = 10;
  836.         p2.hp = p2.vit_stat * 10;
  837.         p2.cur_hp = 100;
  838.         p2.energy = 20;
  839.         p2.cur_energy = 20;
  840.         p2.adre = 0;
  841.         p2.cur_adre = 0;
  842.         p2.str_stat = 10;
  843.         p2.str_scale = 5;
  844.         p2.dex_stat = 2;
  845.         p2.dex_scale = 1;
  846.         p2.int_stat = 1;
  847.         p2.int_scale = 0;
  848.         p2.fth_stat = 1;
  849.         p2.fth_scale = 0;
  850.         p2.vit_scale = 20;
  851.     }
  852.     if(p3.class == "Berserker")
  853.     {
  854.         p3.vit_stat = 10;
  855.         p3.hp = p3.vit_stat * 10;
  856.         p3.cur_hp = 100;
  857.         p3.energy = 20;
  858.         p3.cur_energy = 20;
  859.         p3.adre = 0;
  860.         p3.cur_adre = 0;
  861.         p3.str_stat = 10;
  862.         p3.str_scale = 5;
  863.         p3.dex_stat = 2;
  864.         p3.dex_scale = 1;
  865.         p3.int_stat = 1;
  866.         p3.int_scale = 0;
  867.         p3.fth_stat = 1;
  868.         p3.fth_scale = 0;
  869.         p3.vit_scale = 20;
  870.     }
  871.     if(p4.class == "Berserker")
  872.     {
  873.         p4.vit_stat = 10;
  874.         p4.hp = p4.vit_stat * 10;
  875.         p4.cur_hp = 100;
  876.         p4.energy = 10;
  877.         p4.cur_energy = 10;
  878.         p4.adre = 0;
  879.         p4.cur_adre = 0;
  880.         p4.str_stat = 10;
  881.         p4.str_scale = 5;
  882.         p4.dex_stat = 2;
  883.         p4.dex_scale = 1;
  884.         p4.int_stat = 1;
  885.         p4.int_scale = 0;
  886.         p4.fth_stat = 1;
  887.         p4.fth_scale = 0;
  888.         p4.vit_scale = 20;
  889.     }
  890.     if(p1.class == "Tactician")
  891.     {
  892.         p1.vit_stat = 5;
  893.         p1.hp = p1.vit_stat * 10;
  894.         p1.cur_hp = 50;
  895.         p1.energy = 20;
  896.         p1.cur_energy = 20;
  897.         p1.adre = 0;
  898.         p1.cur_adre = 0;
  899.         p1.str_stat = 5;
  900.         p1.str_scale = 2;
  901.         p1.dex_stat = 4;
  902.         p1.dex_scale = 3;
  903.         p1.int_stat = 2;
  904.         p1.int_scale = 0;
  905.         p1.fth_stat = 1;
  906.         p1.fth_scale = 0;
  907.         p1.vit_scale = 10;
  908.     }
  909.     if(p2.class == "Tactician")
  910.     {
  911.         p2.vit_stat = 5;
  912.         p2.hp = p2.vit_stat * 10;
  913.         p2.cur_hp = 50;
  914.         p2.energy = 20;
  915.         p2.cur_energy = 20;
  916.         p2.adre = 0;
  917.         p2.cur_adre = 0;
  918.         p2.str_stat = 7;
  919.         p2.str_scale = 2;
  920.         p2.dex_stat = 4;
  921.         p2.dex_scale = 3;
  922.         p2.int_stat = 2;
  923.         p2.int_scale = 0;
  924.         p2.fth_stat = 1;
  925.         p2.fth_scale = 0;
  926.         p2.vit_scale = 10;
  927.     }
  928.     if(p3.class == "Tactician")
  929.     {
  930.         p3.vit_stat = 5;
  931.         p3.hp = p3.vit_stat * 10;
  932.         p3.cur_hp = 50;
  933.         p3.energy = 20;
  934.         p3.cur_energy = 20;
  935.         p3.adre = 0;
  936.         p3.cur_adre = 0;
  937.         p3.str_stat = 5;
  938.         p3.str_scale = 2;
  939.         p3.dex_stat = 4;
  940.         p3.dex_scale = 3;
  941.         p3.int_stat = 2;
  942.         p3.int_scale = 0;
  943.         p3.fth_stat = 1;
  944.         p3.fth_scale = 0;
  945.         p3.vit_scale = 10;
  946.     }
  947.     if(p4.class == "Tactician")
  948.     {
  949.         p4.vit_stat = 5;
  950.         p4.hp = p4.vit_stat * 10;
  951.         p4.cur_hp = 50;
  952.         p4.energy = 20;
  953.         p4.cur_energy = 20;
  954.         p4.adre = 0;
  955.         p4.cur_adre = 0;
  956.         p4.str_stat = 5;
  957.         p4.str_scale = 2;
  958.         p4.dex_stat = 4;
  959.         p4.dex_scale = 3;
  960.         p4.int_stat = 2;
  961.         p4.int_scale = 0;
  962.         p4.fth_stat = 1;
  963.         p4.fth_scale = 0;
  964.         p4.vit_scale = 10;
  965.     }
  966.     if(p1.class == "Warrior")
  967.     {
  968.         p1.vit_stat = 8;
  969.         p1.hp = p1.vit_stat * 10;
  970.         p1.cur_hp = 80;
  971.         p1.energy = 20;
  972.         p1.cur_energy = 20;
  973.         p1.adre = 0;
  974.         p1.cur_adre = 0;
  975.         p1.str_stat = 8;
  976.         p1.str_scale = 3;
  977.         p1.dex_stat = 3;
  978.         p1.dex_scale = 3;
  979.         p1.int_stat = 2;
  980.         p1.int_scale = 0;
  981.         p1.fth_stat = 2;
  982.         p1.fth_scale = 0;
  983.         p1.vit_scale = 10;
  984.     }
  985.     if(p2.class == "Warrior")
  986.     {
  987.         p2.vit_stat = 8;
  988.         p2.hp = p2.vit_stat * 10;
  989.         p2.cur_hp = 80;
  990.         p2.energy = 20;
  991.         p2.cur_energy = 20;
  992.         p2.adre = 0;
  993.         p2.cur_adre = 0;
  994.         p2.str_stat = 8;
  995.         p2.str_scale = 3;
  996.         p2.dex_stat = 3;
  997.         p2.dex_scale = 3;
  998.         p2.int_stat = 2;
  999.         p2.int_scale = 0;
  1000.         p2.fth_stat = 2;
  1001.         p2.fth_scale = 0;
  1002.         p2.vit_scale = 10;
  1003.     }
  1004.     if(p3.class == "Warrior")
  1005.     {
  1006.         p3.vit_stat = 8;
  1007.         p3.hp = p3.vit_stat * 10;
  1008.         p3.cur_hp = 80;
  1009.         p3.energy = 20;
  1010.         p3.cur_energy = 20;
  1011.         p3.adre = 0;
  1012.         p3.cur_adre = 0;
  1013.         p3.str_stat = 8;
  1014.         p3.str_scale = 3;
  1015.         p3.dex_stat = 3;
  1016.         p3.dex_scale = 3;
  1017.         p3.int_stat = 2;
  1018.         p3.int_scale = 0;
  1019.         p3.fth_stat = 2;
  1020.         p3.fth_scale = 0;
  1021.         p3.vit_scale = 10;
  1022.     }
  1023.     if(p4.class == "Warrior")
  1024.     {
  1025.         p4.vit_stat = 8;
  1026.         p4.hp = p4.vit_stat * 10;
  1027.         p4.cur_hp = 80;
  1028.         p4.energy = 20;
  1029.         p4.cur_energy = 20;
  1030.         p4.adre = 0;
  1031.         p4.cur_adre = 0;
  1032.         p4.str_stat = 8;
  1033.         p4.str_scale = 3;
  1034.         p4.dex_stat = 3;
  1035.         p4.dex_scale = 3;
  1036.         p4.int_stat = 2;
  1037.         p4.int_scale = 0;
  1038.         p4.fth_stat = 2;
  1039.         p4.fth_scale = 0;
  1040.         p4.vit_scale = 10;
  1041.     }
  1042. }
  1043.  
  1044. script "init_main" (void)
  1045. {
  1046.     FadeTo(0,0,0,1.0,0.0); //fade to black
  1047.     bool ExitRoster = false;
  1048.     int MenuCount = 5, CurSel = 0;
  1049.     if(!p1.name)
  1050.     {
  1051.         p1.name = "Slot 1";
  1052.     }
  1053.     else if(p1.name == "")
  1054.     {
  1055.         p1.name = "Slot 1";
  1056.     }
  1057.     if(!p2.name)
  1058.     {
  1059.         p2.name = "Slot 2";
  1060.     }
  1061.     else if(p2.name == "")
  1062.     {
  1063.         p2.name = "Slot 2";
  1064.     }
  1065.     if(!p3.name)
  1066.     {
  1067.         p3.name = "Slot 3";
  1068.     }
  1069.     else if(p3.name == "")
  1070.     {
  1071.         p3.name = "Slot 3";
  1072.     }
  1073.     if(!p4.name)
  1074.     {
  1075.         p4.name = "Slot 4";
  1076.     }
  1077.     else if(p4.name == "")
  1078.     {
  1079.         p4.name = "Slot 4";
  1080.     }
  1081.     str MenuOptions[5] = {p1.name, p2.name, p3.name, p4.name, "Done"};
  1082.     int i;
  1083.     int oldbuttons = 0;
  1084.     do
  1085.     {
  1086.         int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
  1087.         if((buttons & BT_FORWARD)  && (oldbuttons != buttons))
  1088.         {
  1089.             CurSel--;  
  1090.         }
  1091.         else if((buttons & BT_BACK)  && (oldbuttons != buttons))
  1092.         {
  1093.             CurSel++;
  1094.         }
  1095.         else if((buttons & BT_USE)  && (oldbuttons != buttons))
  1096.         {
  1097.             if(CurSel == 4)
  1098.             {
  1099.                 if((p1.role == "") && (p2.role == "") && (p3.role == "") && (p4.role == ""))
  1100.                 {
  1101.                     HudMessage(s:"You must have at least one party member"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.03, 2.0);
  1102.                 }
  1103.                 else
  1104.                 {
  1105.                     ExitRoster = true;
  1106.                 }
  1107.             }
  1108.             else
  1109.             {  
  1110.                 delay(4);
  1111.                 ACS_NamedExecute("roster_slots", 0, CurSel);
  1112.                 terminate;
  1113.             }
  1114.         }
  1115.         else
  1116.         {
  1117.             oldbuttons = 0;
  1118.         }
  1119.         if(CurSel > 4)
  1120.         {
  1121.             CurSel = 4;
  1122.         }
  1123.         if(CurSel < 0)
  1124.         {
  1125.             CurSel = 0;
  1126.         }
  1127.         HudMessage(s:"Create your party"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.1, 0.03);
  1128.         HudMessage(s:"Use UP/DOWN arrow keys to select, USE to enter"; HUDMSG_PLAIN, 0, CR_GREEN, 0.5, 0.9, 0.03);
  1129.         for(i=0;i<MenuCount;i++)
  1130.         {
  1131.             if (i == CurSel)
  1132.             {
  1133.                 HudMessage(s:MenuOptions[i]; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.21+i*0.05, 0.03);
  1134.             }
  1135.             else
  1136.             {
  1137.                 HudMessage(s:MenuOptions[i]; HUDMSG_PLAIN, 0, CR_RED, 0.5, 0.21+i*0.05, 0.03);
  1138.             }
  1139.         }
  1140.         oldbuttons = buttons;
  1141.         delay(1);
  1142.     } while(!ExitRoster);
  1143.     ACS_NamedExecute("init_party_stats", 0);
  1144.     FadeTo(0,0,0,0.0,0.0); //fade to normal
  1145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement