Advertisement
Guest User

CCLVBI POS

a guest
Sep 25th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 23.24 KB | None | 0 0
  1. //==================================================================================================
  2. //
  3. // Generated Map Script
  4. //
  5. // Name:   Just Another StarCraft II Map
  6. //
  7. //==================================================================================================
  8. include "TriggerLibs/NativeLib"
  9.  
  10. //--------------------------------------------------------------------------------------------------
  11. // Library Initialization
  12. //--------------------------------------------------------------------------------------------------
  13. void InitLibs () {
  14.     libNtve_InitLib();
  15. }
  16.  
  17. //--------------------------------------------------------------------------------------------------
  18. // Global Variables
  19. //--------------------------------------------------------------------------------------------------
  20. bank[16] gv_bank;
  21. int[46] gv_cKCode;
  22.  
  23. void InitGlobals () {
  24. }
  25.  
  26. //--------------------------------------------------------------------------------------------------
  27. // Global Function Declarations
  28. //--------------------------------------------------------------------------------------------------
  29. int gf_FindLatestVBIDatafromPlayers (playergroup lp_pPlayerGroup, string lp_pKey, string lp_pSection);
  30. void gf_StoreVBIDataCCLtoBank (bank lp_pBank, string lp_pKey, string lp_pSection, string lp_pString, int lp_pRevision, int lp_pDay, int lp_pMonth, int lp_pYear);
  31. string gf_RetrieveVBIDataCLLforPlayerfromBank (int lp_pPlayer, bank lp_pBank, string lp_pKey, string lp_pSection);
  32. string gf_ExtractSourceofString (string lp_pString);
  33. int gf_ExtractDateofString (string lp_pString);
  34. int gf_FindDateOffsetfromString (string lp_pString);
  35. bool gf_CheckDateofString (string lp_pString);
  36. string gf_PublishString (string lp_pString, int lp_pRevision, int lp_pDay, int lp_pMonth, int lp_pYear);
  37. int gf_ConvertDatetoString (int lp_pRevision, int lp_pDay, int lp_pMonth, int lp_pYear);
  38. string gf_UnlockString (string lp_pString);
  39. int gf_FindChecksumOffsetfromString (string lp_pString);
  40. bool gf_VerifyString (string lp_pString);
  41. string gf_LockString (string lp_pString);
  42. int gf_GenerateChecksum (string lp_pString);
  43. int gf_GetCharacterPositionCodeModifer (int lp_positionValue);
  44. int gf_GetCharacterCaseCodeModifier (string lp_character);
  45. int gf_GetCharacterCodeDefined (string lp_character);
  46. int gf_GetCharacterCodeGenerator (string lp_character);
  47. void gf_CharacterCodeGenerator (int lp_pSeed, int lp_pCharacterKeyAmount, int lp_pMinValue, int lp_pMaxValue);
  48.  
  49. //--------------------------------------------------------------------------------------------------
  50. // Trigger Variables
  51. //--------------------------------------------------------------------------------------------------
  52. trigger gt_QuickDemo;
  53. trigger gt_SampleVerification;
  54. trigger gt_SampleEncoding;
  55. trigger gt_UsingCharacterCodeGenerator;
  56.  
  57. //--------------------------------------------------------------------------------------------------
  58. // Global Functions
  59. //--------------------------------------------------------------------------------------------------
  60. int gf_FindLatestVBIDatafromPlayers (playergroup lp_pPlayerGroup, string lp_pKey, string lp_pSection) {
  61.     playergroup autoFE700F9E_g;
  62.     int autoFE700F9E_p;
  63.  
  64.     // Variable Declarations
  65.     int lv_playerloop;
  66.     int[16] lv_vbidate;
  67.     int lv_latestvbidate;
  68.     int lv_latestplayer;
  69.     bank[16] lv_playerbank;
  70.  
  71.     // Variable Initialization
  72.  
  73.     // Implementation
  74.     autoFE700F9E_g = PlayerGroupAll();
  75.     autoFE700F9E_p = 1;
  76.     for ( ; autoFE700F9E_p <= PlayerGroupCount(autoFE700F9E_g) ; autoFE700F9E_p += BoolToInt(lv_playerloop == PlayerGroupPlayer(autoFE700F9E_g, autoFE700F9E_p)) ) {
  77.         lv_playerloop = PlayerGroupPlayer(autoFE700F9E_g, autoFE700F9E_p);
  78.         lv_playerbank[lv_playerloop] = gv_bank[lv_playerloop];
  79.         lv_vbidate[lv_playerloop] = gf_ExtractDateofString(gf_UnlockString(BankValueGetAsString(lv_playerbank[lv_playerloop], lp_pSection, lp_pKey)));
  80.         if ((lv_latestvbidate < lv_vbidate[lv_playerloop])) {
  81.             lv_latestvbidate = lv_vbidate[lv_playerloop];
  82.             lv_latestplayer = lv_playerloop;
  83.         }
  84.         else {
  85.         }
  86.     }
  87.     return lv_latestplayer;
  88. }
  89.  
  90. void gf_StoreVBIDataCCLtoBank (bank lp_pBank, string lp_pKey, string lp_pSection, string lp_pString, int lp_pRevision, int lp_pDay, int lp_pMonth, int lp_pYear) {
  91.     // Implementation
  92.     BankValueSetFromString(lp_pBank, lp_pSection, lp_pKey, gf_LockString(gf_PublishString(lp_pString, lp_pRevision, lp_pDay, lp_pMonth, lp_pYear)));
  93. }
  94.  
  95. string gf_RetrieveVBIDataCLLforPlayerfromBank (int lp_pPlayer, bank lp_pBank, string lp_pKey, string lp_pSection) {
  96.     // Implementation
  97.     return gf_UnlockString(BankValueGetAsString(lp_pBank, lp_pSection, lp_pKey));
  98. }
  99.  
  100. string gf_ExtractSourceofString (string lp_pString) {
  101.     // Implementation
  102.     if ((gf_CheckDateofString(lp_pString) == true)) {
  103.         return StringSub(lp_pString, (gf_FindDateOffsetfromString(lp_pString) + 1), StringLength(lp_pString));
  104.     }
  105.     else {
  106.         return lp_pString;
  107.     }
  108. }
  109.  
  110. int gf_ExtractDateofString (string lp_pString) {
  111.     // Implementation
  112.     if ((gf_CheckDateofString(lp_pString) == true)) {
  113.         return StringToInt(StringSub(lp_pString, 1, (gf_FindDateOffsetfromString(lp_pString) - 1)));
  114.     }
  115.     else {
  116.         return 0;
  117.     }
  118. }
  119.  
  120. int gf_FindDateOffsetfromString (string lp_pString) {
  121.     // Variable Declarations
  122.     int lv_x;
  123.  
  124.     // Variable Initialization
  125.  
  126.     // Implementation
  127.     if ((StringSub(lp_pString, 8, 8) == "@")) {
  128.         return 8;
  129.     }
  130.     else {
  131.         return 9;
  132.     }
  133. }
  134.  
  135. bool gf_CheckDateofString (string lp_pString) {
  136.     // Implementation
  137.     if (((StringSub(lp_pString, 9, 9) == "@") || (StringSub(lp_pString, 8, 8) == "@"))) {
  138.         return true;
  139.     }
  140.     else {
  141.         return false;
  142.     }
  143. }
  144.  
  145. string gf_PublishString (string lp_pString, int lp_pRevision, int lp_pDay, int lp_pMonth, int lp_pYear) {
  146.     // Implementation
  147.     return (IntToString(gf_ConvertDatetoString(lp_pRevision, lp_pDay, lp_pMonth, lp_pYear)) + "@" + lp_pString);
  148. }
  149.  
  150. int gf_ConvertDatetoString (int lp_pRevision, int lp_pDay, int lp_pMonth, int lp_pYear) {
  151.     // Implementation
  152.     return ((lp_pRevision * 1) + (lp_pDay * 100) + (lp_pMonth * 10000) + (lp_pYear * 1000000));
  153. }
  154.  
  155. string gf_UnlockString (string lp_pString) {
  156.     // Implementation
  157.     if ((gf_VerifyString(lp_pString) == true)) {
  158.         return StringSub(lp_pString, 1, gf_FindChecksumOffsetfromString(lp_pString));
  159.     }
  160.     else {
  161.         return "VERIFICATION FAILED!";
  162.     }
  163. }
  164.  
  165. int gf_FindChecksumOffsetfromString (string lp_pString) {
  166.     // Variable Declarations
  167.     int lv_x;
  168.  
  169.     // Variable Initialization
  170.     lv_x = StringLength(lp_pString);
  171.  
  172.     // Implementation
  173.     while ((StringSub(lp_pString, lv_x, lv_x) != "#") && (lv_x != 1)) {
  174.         lv_x -= 1;
  175.     }
  176.     lv_x -= 1;
  177.     return lv_x;
  178. }
  179.  
  180. bool gf_VerifyString (string lp_pString) {
  181.     // Variable Declarations
  182.     int lv_x;
  183.  
  184.     // Variable Initialization
  185.     lv_x = StringLength(lp_pString);
  186.  
  187.     // Implementation
  188.     while ((StringSub(lp_pString, lv_x, lv_x) != "#") && (lv_x != 1)) {
  189.         lv_x -= 1;
  190.     }
  191.     lv_x -= 1;
  192.     if ((lv_x == 0)) {
  193.         return false;
  194.     }
  195.     else {
  196.     }
  197.     if ((gf_GenerateChecksum(StringSub(lp_pString, 1, lv_x)) == StringToInt(StringSub(lp_pString, (lv_x + 2), StringLength(lp_pString))))) {
  198.         return true;
  199.     }
  200.     else {
  201.         return false;
  202.     }
  203. }
  204.  
  205. string gf_LockString (string lp_pString) {
  206.     // Implementation
  207.     return (lp_pString + "#" + IntToString(gf_GenerateChecksum(lp_pString)));
  208. }
  209.  
  210. int gf_GenerateChecksum (string lp_pString) {
  211.     // Variable Declarations
  212.     int lv_checksum;
  213.  
  214.     // Variable Initialization
  215.  
  216.     // Implementation
  217.     IntLoopBegin(1, StringLength(lp_pString));
  218.     for ( ; !IntLoopDone() ; IntLoopStep() ) {
  219.         lv_checksum += (gf_GetCharacterCodeGenerator(StringSub(lp_pString, IntLoopCurrent(), IntLoopCurrent())) * gf_GetCharacterCaseCodeModifier(StringSub(lp_pString, IntLoopCurrent(), IntLoopCurrent())));
  220.         lv_checksum += gf_GetCharacterPositionCodeModifer(IntLoopCurrent());
  221.     }
  222.     IntLoopEnd();
  223.     lv_checksum = AbsI(lv_checksum);
  224.     return lv_checksum;
  225. }
  226.  
  227. int gf_GetCharacterPositionCodeModifer (int lp_positionValue) {
  228.     // Variable Declarations
  229.     const int lv_divisor = 9;
  230.  
  231.     // Variable Initialization
  232.  
  233.     // Implementation
  234.     if ((ModI(lp_positionValue, 2) == 1)) {
  235.         return (ModI(lp_positionValue, lv_divisor) * 2);
  236.     }
  237.     else {
  238.         return (ModI(lp_positionValue, lv_divisor) * -1);
  239.     }
  240. }
  241.  
  242. int gf_GetCharacterCaseCodeModifier (string lp_character) {
  243.     // Implementation
  244.     if ((StringCase(lp_character, true) == lp_character)) {
  245.         return -1;
  246.     }
  247.     else {
  248.         return 1;
  249.     }
  250. }
  251.  
  252. int gf_GetCharacterCodeDefined (string lp_character) {
  253.     string autoB7CEDCC9_val;
  254.  
  255.     // Implementation
  256.     autoB7CEDCC9_val = StringCase(lp_character, true);
  257.     if (autoB7CEDCC9_val == ".") {
  258.         return -15;
  259.     }
  260.     else if (autoB7CEDCC9_val == "?") {
  261.         return -8;
  262.     }
  263.     else if (autoB7CEDCC9_val == "!") {
  264.         return -5;
  265.     }
  266.     else if (autoB7CEDCC9_val == "0") {
  267.         return -4;
  268.     }
  269.     else if (autoB7CEDCC9_val == "1") {
  270.         return 2;
  271.     }
  272.     else if (autoB7CEDCC9_val == "2") {
  273.         return 5;
  274.     }
  275.     else if (autoB7CEDCC9_val == "3") {
  276.         return 6;
  277.     }
  278.     else if (autoB7CEDCC9_val == "4") {
  279.         return 3;
  280.     }
  281.     else if (autoB7CEDCC9_val == "5") {
  282.         return -2;
  283.     }
  284.     else if (autoB7CEDCC9_val == "6") {
  285.         return 3;
  286.     }
  287.     else if (autoB7CEDCC9_val == "7") {
  288.         return 2;
  289.     }
  290.     else if (autoB7CEDCC9_val == "8") {
  291.         return 1;
  292.     }
  293.     else if (autoB7CEDCC9_val == "9") {
  294.         return -3;
  295.     }
  296.     else if (autoB7CEDCC9_val == "A") {
  297.         return -2;
  298.     }
  299.     else if (autoB7CEDCC9_val == "B") {
  300.         return -1;
  301.     }
  302.     else if (autoB7CEDCC9_val == "C") {
  303.         return 3;
  304.     }
  305.     else if (autoB7CEDCC9_val == "D") {
  306.         return 2;
  307.     }
  308.     else if (autoB7CEDCC9_val == "E") {
  309.         return 1;
  310.     }
  311.     else if (autoB7CEDCC9_val == "F") {
  312.         return -1;
  313.     }
  314.     else if (autoB7CEDCC9_val == "G") {
  315.         return -2;
  316.     }
  317.     else if (autoB7CEDCC9_val == "H") {
  318.         return -3;
  319.     }
  320.     else if (autoB7CEDCC9_val == "I") {
  321.         return 1;
  322.     }
  323.     else if (autoB7CEDCC9_val == "J") {
  324.         return 2;
  325.     }
  326.     else if (autoB7CEDCC9_val == "K") {
  327.         return 3;
  328.     }
  329.     else if (autoB7CEDCC9_val == "L") {
  330.         return 1;
  331.     }
  332.     else if (autoB7CEDCC9_val == "M") {
  333.         return 2;
  334.     }
  335.     else if (autoB7CEDCC9_val == "N") {
  336.         return 3;
  337.     }
  338.     else if (autoB7CEDCC9_val == "O") {
  339.         return -3;
  340.     }
  341.     else if (autoB7CEDCC9_val == "P") {
  342.         return -2;
  343.     }
  344.     else if (autoB7CEDCC9_val == "L") {
  345.         return -1;
  346.     }
  347.     else if (autoB7CEDCC9_val == "M") {
  348.         return 1;
  349.     }
  350.     else if (autoB7CEDCC9_val == "N") {
  351.         return 2;
  352.     }
  353.     else if (autoB7CEDCC9_val == "O") {
  354.         return 3;
  355.     }
  356.     else if (autoB7CEDCC9_val == "P") {
  357.         return -1;
  358.     }
  359.     else if (autoB7CEDCC9_val == "Q") {
  360.         return -2;
  361.     }
  362.     else if (autoB7CEDCC9_val == "R") {
  363.         return -3;
  364.     }
  365.     else if (autoB7CEDCC9_val == "S") {
  366.         return 1;
  367.     }
  368.     else if (autoB7CEDCC9_val == "T") {
  369.         return 2;
  370.     }
  371.     else if (autoB7CEDCC9_val == "U") {
  372.         return 3;
  373.     }
  374.     else if (autoB7CEDCC9_val == "V") {
  375.         return -1;
  376.     }
  377.     else if (autoB7CEDCC9_val == "W") {
  378.         return -2;
  379.     }
  380.     else if (autoB7CEDCC9_val == "X") {
  381.         return -3;
  382.     }
  383.     else if (autoB7CEDCC9_val == "Y") {
  384.         return 1;
  385.     }
  386.     else if (autoB7CEDCC9_val == "Z") {
  387.         return 2;
  388.     }
  389.     else {
  390.         return -2;
  391.     }
  392. }
  393.  
  394. int gf_GetCharacterCodeGenerator (string lp_character) {
  395.     string autoFFB3713E_val;
  396.  
  397.     // Implementation
  398.     autoFFB3713E_val = StringCase(lp_character, true);
  399.     if (autoFFB3713E_val == "0") {
  400.         return gv_cKCode[1];
  401.     }
  402.     else if (autoFFB3713E_val == "1") {
  403.         return gv_cKCode[2];
  404.     }
  405.     else if (autoFFB3713E_val == "2") {
  406.         return gv_cKCode[3];
  407.     }
  408.     else if (autoFFB3713E_val == "3") {
  409.         return gv_cKCode[4];
  410.     }
  411.     else if (autoFFB3713E_val == "4") {
  412.         return gv_cKCode[5];
  413.     }
  414.     else if (autoFFB3713E_val == "5") {
  415.         return gv_cKCode[6];
  416.     }
  417.     else if (autoFFB3713E_val == "6") {
  418.         return gv_cKCode[7];
  419.     }
  420.     else if (autoFFB3713E_val == "7") {
  421.         return gv_cKCode[8];
  422.     }
  423.     else if (autoFFB3713E_val == "8") {
  424.         return gv_cKCode[9];
  425.     }
  426.     else if (autoFFB3713E_val == "9") {
  427.         return gv_cKCode[10];
  428.     }
  429.     else if (autoFFB3713E_val == "A") {
  430.         return gv_cKCode[11];
  431.     }
  432.     else if (autoFFB3713E_val == "B") {
  433.         return gv_cKCode[12];
  434.     }
  435.     else if (autoFFB3713E_val == "C") {
  436.         return gv_cKCode[13];
  437.     }
  438.     else if (autoFFB3713E_val == "D") {
  439.         return gv_cKCode[14];
  440.     }
  441.     else if (autoFFB3713E_val == "E") {
  442.         return gv_cKCode[15];
  443.     }
  444.     else if (autoFFB3713E_val == "F") {
  445.         return gv_cKCode[16];
  446.     }
  447.     else if (autoFFB3713E_val == "G") {
  448.         return gv_cKCode[17];
  449.     }
  450.     else if (autoFFB3713E_val == "H") {
  451.         return gv_cKCode[18];
  452.     }
  453.     else if (autoFFB3713E_val == "I") {
  454.         return gv_cKCode[19];
  455.     }
  456.     else if (autoFFB3713E_val == "J") {
  457.         return gv_cKCode[20];
  458.     }
  459.     else if (autoFFB3713E_val == "K") {
  460.         return gv_cKCode[21];
  461.     }
  462.     else if (autoFFB3713E_val == "L") {
  463.         return gv_cKCode[22];
  464.     }
  465.     else if (autoFFB3713E_val == "M") {
  466.         return gv_cKCode[23];
  467.     }
  468.     else if (autoFFB3713E_val == "N") {
  469.         return gv_cKCode[24];
  470.     }
  471.     else if (autoFFB3713E_val == "O") {
  472.         return gv_cKCode[25];
  473.     }
  474.     else if (autoFFB3713E_val == "P") {
  475.         return gv_cKCode[26];
  476.     }
  477.     else if (autoFFB3713E_val == "L") {
  478.         return gv_cKCode[27];
  479.     }
  480.     else if (autoFFB3713E_val == "M") {
  481.         return gv_cKCode[28];
  482.     }
  483.     else if (autoFFB3713E_val == "N") {
  484.         return gv_cKCode[29];
  485.     }
  486.     else if (autoFFB3713E_val == "O") {
  487.         return gv_cKCode[30];
  488.     }
  489.     else if (autoFFB3713E_val == "P") {
  490.         return gv_cKCode[31];
  491.     }
  492.     else if (autoFFB3713E_val == "Q") {
  493.         return gv_cKCode[32];
  494.     }
  495.     else if (autoFFB3713E_val == "R") {
  496.         return gv_cKCode[33];
  497.     }
  498.     else if (autoFFB3713E_val == "S") {
  499.         return gv_cKCode[34];
  500.     }
  501.     else if (autoFFB3713E_val == "T") {
  502.         return gv_cKCode[35];
  503.     }
  504.     else if (autoFFB3713E_val == "U") {
  505.         return gv_cKCode[36];
  506.     }
  507.     else if (autoFFB3713E_val == "V") {
  508.         return gv_cKCode[37];
  509.     }
  510.     else if (autoFFB3713E_val == "W") {
  511.         return gv_cKCode[38];
  512.     }
  513.     else if (autoFFB3713E_val == "X") {
  514.         return gv_cKCode[39];
  515.     }
  516.     else if (autoFFB3713E_val == "Y") {
  517.         return gv_cKCode[40];
  518.     }
  519.     else if (autoFFB3713E_val == "Z") {
  520.         return gv_cKCode[41];
  521.     }
  522.     else if (autoFFB3713E_val == ".") {
  523.         return gv_cKCode[42];
  524.     }
  525.     else if (autoFFB3713E_val == "?") {
  526.         return gv_cKCode[43];
  527.     }
  528.     else if (autoFFB3713E_val == "!") {
  529.         return gv_cKCode[44];
  530.     }
  531.     else if (autoFFB3713E_val == " ") {
  532.         return gv_cKCode[45];
  533.     }
  534.     else {
  535.         return gv_cKCode[0];
  536.     }
  537. }
  538.  
  539. void gf_CharacterCodeGenerator (int lp_pSeed, int lp_pCharacterKeyAmount, int lp_pMinValue, int lp_pMaxValue) {
  540.     // Implementation
  541.     GameSetSeedLocked(true);
  542.     GameSetSeed(lp_pSeed);
  543.     IntLoopBegin(0, lp_pCharacterKeyAmount);
  544.     for ( ; !IntLoopDone() ; IntLoopStep() ) {
  545.         gv_cKCode[IntLoopCurrent()] = RandomInt(lp_pMinValue, lp_pMaxValue);
  546.     }
  547.     IntLoopEnd();
  548.     GameSetSeedLocked(false);
  549. }
  550.  
  551. //--------------------------------------------------------------------------------------------------
  552. // Trigger: Quick Demo
  553. //--------------------------------------------------------------------------------------------------
  554. bool gt_QuickDemo_Func (bool testConds, bool runActions) {
  555.     // Actions
  556.     if (!runActions) {
  557.         return true;
  558.     }
  559.  
  560.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("Pause the game (F10/Pause) if the text is progressing too fast."));
  561.     Wait(2.0, c_timeReal);
  562.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("ORIGINAL: " + "Hello world!")));
  563.     Wait(2.0, c_timeReal);
  564.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("PUBLISHED (Nov 5, 2013 rev 2): " + gf_PublishString("Hello world!", 2, 5, 11, 13))));
  565.     Wait(2.0, c_timeReal);
  566.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("LOCKED: " + gf_LockString(gf_PublishString("Hello world!", 2, 5, 11, 13)))));
  567.     Wait(2.0, c_timeReal);
  568.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("UNLOCKED: " + gf_UnlockString(gf_LockString(gf_PublishString("Hello world!", 2, 5, 11, 13))))));
  569.     Wait(2.0, c_timeReal);
  570.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("DATE EXTRACT: " + IntToString(gf_ExtractDateofString(gf_UnlockString(gf_LockString(gf_PublishString("Hello world!", 2, 5, 11, 13))))))));
  571.     Wait(2.0, c_timeReal);
  572.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("SOURCE EXTRACT: " + gf_ExtractSourceofString(gf_UnlockString(gf_LockString(gf_PublishString("Hello world!", 2, 5, 11, 13)))))));
  573.     Wait(2.0, c_timeReal);
  574.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("!EXAMPLE OF DATE COMPARISON!"));
  575.     Wait(2.0, c_timeReal);
  576.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(gf_PublishString("NEWER THAN THAT (Sept 20, 2013, rev 4)", 4, 20, 9, 13)));
  577.     Wait(2.0, c_timeReal);
  578.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(gf_PublishString("REALLY OLD (Feb 1, 2002, rev 33)", 33, 1, 2, 2)));
  579.     Wait(2.0, c_timeReal);
  580.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(gf_PublishString("NEWER THAN THIS (Sept 20, 2013, rev 3)", 3, 20, 9, 13)));
  581.     Wait(2.0, c_timeReal);
  582.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("!NEWEST & OLDEST!"));
  583.     Wait(2.0, c_timeReal);
  584.     if ((gf_ExtractDateofString(gf_PublishString("NEWER THAN THAT (Sept 20, 2013, rev 4)", 4, 20, 9, 13)) > gf_ExtractDateofString(gf_PublishString("NEWER THAN THIS (Sept 20, 2013, rev 3)", 3, 20, 9, 13)))) {
  585.         UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("NEWER THAN THAT is newest"));
  586.     }
  587.     else {
  588.         UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("Something went wrong! Error."));
  589.     }
  590.     Wait(2.0, c_timeReal);
  591.     if ((gf_ExtractDateofString(gf_PublishString("REALLY OLD (Feb 1, 2002, rev 33)", 33, 1, 2, 2)) > gf_ExtractDateofString(gf_PublishString("NEWER THAN THIS (Sept 20, 2013, rev 3)", 3, 20, 9, 13)))) {
  592.         UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("Something went wrong! Error."));
  593.     }
  594.     else {
  595.         UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("REALLY OLD is oldest"));
  596.     }
  597.     Wait(2.0, c_timeReal);
  598.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/0F4B5A02"));
  599.     return true;
  600. }
  601.  
  602. //--------------------------------------------------------------------------------------------------
  603. void gt_QuickDemo_Init () {
  604.     gt_QuickDemo = TriggerCreate("gt_QuickDemo_Func");
  605.     TriggerAddEventChatMessage(gt_QuickDemo, c_playerAny, "-demo", true);
  606. }
  607.  
  608. //--------------------------------------------------------------------------------------------------
  609. // Trigger: Sample Verification
  610. //--------------------------------------------------------------------------------------------------
  611. bool gt_SampleVerification_Func (bool testConds, bool runActions) {
  612.     // Conditions
  613.     if (testConds) {
  614.         if (!((EventChatMessage(false) != "-demo"))) {
  615.             return false;
  616.         }
  617.     }
  618.  
  619.     // Actions
  620.     if (!runActions) {
  621.         return true;
  622.     }
  623.  
  624.     if ((gf_VerifyString(EventChatMessage(false)) == true)) {
  625.         UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/9E5F9E5B"));
  626.     }
  627.     else {
  628.         UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/AA88D3BA"));
  629.     }
  630.     return true;
  631. }
  632.  
  633. //--------------------------------------------------------------------------------------------------
  634. void gt_SampleVerification_Init () {
  635.     gt_SampleVerification = TriggerCreate("gt_SampleVerification_Func");
  636.     TriggerAddEventChatMessage(gt_SampleVerification, c_playerAny, "", false);
  637. }
  638.  
  639. //--------------------------------------------------------------------------------------------------
  640. // Trigger: Sample Encoding
  641. //--------------------------------------------------------------------------------------------------
  642. bool gt_SampleEncoding_Func (bool testConds, bool runActions) {
  643.     // Conditions
  644.     if (testConds) {
  645.         if (!((EventChatMessage(false) != "-demo"))) {
  646.             return false;
  647.         }
  648.     }
  649.  
  650.     // Actions
  651.     if (!runActions) {
  652.         return true;
  653.     }
  654.  
  655.     UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(("ENCODER: " + gf_LockString(EventChatMessage(false)))));
  656.     return true;
  657. }
  658.  
  659. //--------------------------------------------------------------------------------------------------
  660. void gt_SampleEncoding_Init () {
  661.     gt_SampleEncoding = TriggerCreate("gt_SampleEncoding_Func");
  662.     TriggerAddEventChatMessage(gt_SampleEncoding, c_playerAny, "", false);
  663. }
  664.  
  665. //--------------------------------------------------------------------------------------------------
  666. // Trigger: Using Character Code Generator
  667. //--------------------------------------------------------------------------------------------------
  668. bool gt_UsingCharacterCodeGenerator_Func (bool testConds, bool runActions) {
  669.     // Actions
  670.     if (!runActions) {
  671.         return true;
  672.     }
  673.  
  674.     gf_CharacterCodeGenerator(10293847, 45, -25, 25);
  675.     return true;
  676. }
  677.  
  678. //--------------------------------------------------------------------------------------------------
  679. void gt_UsingCharacterCodeGenerator_Init () {
  680.     gt_UsingCharacterCodeGenerator = TriggerCreate("gt_UsingCharacterCodeGenerator_Func");
  681.     TriggerAddEventMapInit(gt_UsingCharacterCodeGenerator);
  682. }
  683.  
  684. //--------------------------------------------------------------------------------------------------
  685. // Trigger Initialization
  686. //--------------------------------------------------------------------------------------------------
  687. void InitTriggers () {
  688.     gt_QuickDemo_Init();
  689.     gt_SampleVerification_Init();
  690.     gt_SampleEncoding_Init();
  691.     gt_UsingCharacterCodeGenerator_Init();
  692. }
  693.  
  694. //--------------------------------------------------------------------------------------------------
  695. // Map Initialization
  696. //--------------------------------------------------------------------------------------------------
  697. void InitMap () {
  698.     InitLibs();
  699.     InitGlobals();
  700.     InitTriggers();
  701. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement