Advertisement
Guest User

Greek Diplomacy

a guest
Jul 24th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 19.73 KB | None | 0 0
  1. library Diplomacy initializer init
  2.  
  3. globals
  4.     //
  5.     private constant real DISPLAY_TIME = 10.
  6.     private constant integer PENDING_TIME = 15
  7.     private constant real Give_Gold_Tax = 0.1
  8.     private constant real Give_Wood_Tax = 0.1
  9.    
  10.     integer AllyLimit = 1 // You can change this through outside triggers.
  11.     //
  12.     private timer array Timer
  13.     private boolean array PendingOffer
  14.     private integer array Offering
  15.     private integer array Recieving
  16.     private string array Faction
  17.     private force Active = CreateForce()
  18.     private hashtable hash = InitHashtable()
  19.     private player cmd_p
  20.     private integer array AllyCount //Should I cound the allies in the beginning? What happens if full?
  21.    
  22.     private sound s_Offer
  23.     private sound s_Peace
  24.     private sound s_War
  25.     private sound s_Ally
  26. endglobals
  27.  
  28.  
  29.  
  30. private function SetWords takes nothing returns nothing
  31.     local string s = StringCase(GetEventPlayerChatString(), false)
  32.     local string array word
  33.     local integer i = 1
  34.     local integer j = 0
  35.     set i = 0
  36.     loop
  37.         exitwhen i > StringLength(s)
  38.         if (SubString(s,i, i+1) == " ") then
  39.             set j = j + 1
  40.         else
  41.             set word[j] = word[j] + SubString(s,i,i+1)
  42.         endif
  43.         set i = i + 1
  44.     endloop
  45.     if word[1] == "dark" or word[1] == "light" then
  46.         set word[1] = word[1] + " " + word[2]
  47.         set i = 2
  48.         loop
  49.             exitwhen word[i+1] == null
  50.             set word[i] = word[i+1]
  51.             set i = i + 1
  52.         endloop
  53.     endif
  54.     set cmd_p = Player(LoadInteger(hash, 0, StringHash(word[1])))
  55.     if (cmd_p == Player(0) and word[1] != "1" and word[1] != "red" and word[1] != "sparta") then
  56.         set cmd_p = null
  57.     endif
  58.    
  59. endfunction
  60.  
  61. private function DisplayFaction takes string factions returns string
  62.     local integer i = 0
  63.     local integer j = 0
  64.     local string s = SubString(factions, 0, StringLength(factions)-1)
  65.     loop
  66.         exitwhen i > StringLength(s)
  67.         if (SubString(s, i, i+1) == " ") then
  68.             set j = i
  69.         endif
  70.         set i = i + 1
  71.     endloop
  72.     if (j > 1) then
  73.         set s = SubString(s, 0, j-1) + " and " + SubString(s, j+1, StringLength(s))
  74.     endif
  75.     return s
  76. endfunction
  77.  
  78. //******************************//
  79. //            Offers            //
  80. //******************************//
  81.  
  82. private function DisplayExpiredMsg takes nothing returns nothing
  83.    
  84. endfunction
  85.  
  86. private function RemoveOffer takes integer f returns nothing
  87.     call PauseTimer(Timer[f])
  88.     call DestroyTimer(Timer[f])
  89.     set PendingOffer[f] = false
  90. endfunction
  91.  
  92. private function OfferExpires takes nothing returns nothing
  93.     local integer tID = LoadInteger(hash, GetHandleId(GetExpiredTimer()), 0)
  94.     call RemoveOffer(tID)
  95.     if (tID <= 144) then
  96.         call DisplayTimedTextToPlayer(Player(Offering[tID]), 0,0, DISPLAY_TIME, "Your Peace offer to " + Faction[Recieving[tID]] + " has expired.")
  97.         call DisplayTimedTextToPlayer(Player(Recieving[tID]), 0,0, DISPLAY_TIME, Faction[Offering[tID]] + "'s Peace offer has expired.\n")
  98.         //set msg_n[PenDexPlayer_1[i]] = msg_n[PenDexPlayer_1[i]] + " " + Faction[PenDexPlayer_2[i]] + ","
  99.     else
  100.         call DisplayTimedTextToPlayer(Player(Offering[tID]), 0,0, DISPLAY_TIME, "Your Alliance offer to " + Faction[Recieving[tID]] + " has expired.")
  101.         call DisplayTimedTextToPlayer(Player(Recieving[tID]), 0,0, DISPLAY_TIME, Faction[Offering[tID]] + "'s Alliance offer has expired.\n")
  102.         //set msg_a[PenDexPlayer_1[i]] = msg_a[PenDexPlayer_1[i]] + " " + Faction[PenDexPlayer_2[i]] + ","
  103.     endif
  104. endfunction
  105.  
  106. private function MakeOffer takes integer f, integer pID_1, integer pID_2 returns nothing
  107.     set Timer[f] = CreateTimer()
  108.     set PendingOffer[f] = true
  109.     call TimerStart(Timer[f], 5, false, function OfferExpires)
  110.     call SaveInteger(hash, GetHandleId(Timer[f]), 0, f)
  111.     set Offering[f] = pID_1
  112.     set Recieving[f] = pID_2
  113. endfunction
  114.  
  115. //********************************//
  116. //            Triggers            //
  117. //********************************//
  118.  
  119. private function Reveal takes nothing returns boolean
  120.     local integer cmd_pID
  121.     local player p
  122.     local string s = ""
  123.     local string s1 = ""
  124.     local string s2 = ""
  125.     local string s3 = ""
  126.     local integer i = 0
  127.     call SetWords()
  128.     set cmd_pID = GetPlayerId(cmd_p)
  129.     if (cmd_p != null and IsPlayerInForce(cmd_p, Active) == true) then
  130.         set s = Faction[cmd_pID] + "\n"
  131.         loop
  132.             exitwhen i > 11
  133.             set p = Player(i)
  134.             if (IsPlayerInForce(p, Active)) then
  135.                 if (IsPlayerAlly(cmd_p,p) == true and GetPlayerAlliance(p, cmd_p, ALLIANCE_SHARED_VISION) == true and cmd_p != p) then
  136.                     set s1 = s1 + " " + Faction[i] + ","
  137.                 elseif (IsPlayerAlly(cmd_p, p) == true and GetPlayerAlliance(cmd_p, p, ALLIANCE_SHARED_VISION) == false) then
  138.                     set s2 = s2 + " " + Faction[i] + ","
  139.                 elseif (IsPlayerEnemy(cmd_p, p)) then
  140.                     set s3 = s3 + " " + Faction[i] + ","
  141.                 endif
  142.             endif
  143.             set i = i + 1
  144.         endloop
  145.         if (StringLength(s1) > 0) then
  146.             set s1 = "Allied:" + DisplayFaction(s1) + ".\n"
  147.         endif
  148.         if (StringLength(s2) > 0) then
  149.             set s2 = "Neutral:" + DisplayFaction(s2) + ".\n"
  150.         endif
  151.         if (StringLength(s3) > 0) then
  152.             set s3 = "Hostile:" + DisplayFaction(s3) + "."
  153.         endif
  154.         call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, DISPLAY_TIME, s+s1+s2+s3)
  155.     endif
  156.     return false
  157. endfunction
  158.  
  159. private function War takes nothing returns boolean
  160.     local integer i = 13
  161.     local player p = GetTriggerPlayer()
  162.     local integer pID = GetPlayerId(p)
  163.     local player p_i
  164.     local integer cmd_pID
  165.     local string msg = ""
  166.     call SetWords()
  167.     if (cmd_p != null) then
  168.         set cmd_pID = GetPlayerId(cmd_p)
  169.         if (cmd_pID < 12) then
  170.             set i = cmd_pID
  171.         elseif (cmd_pID == 12) then
  172.             set i = 0
  173.         endif
  174.         loop
  175.             exitwhen i > 11
  176.             set p_i = Player(i)
  177.             if (IsPlayerAlly(p, p_i) == true and p != p_i) then
  178.                 call SetPlayerAllianceStateBJ(p, p_i, bj_ALLIANCE_UNALLIED)
  179.                 call SetPlayerAllianceStateBJ(p_i, p, bj_ALLIANCE_UNALLIED)
  180.                 if (PendingOffer[(pID+1)*12+(i+1)-12] == true) then
  181.                     call RemoveOffer((pID+1)*12+(i+1)-12)
  182.                 endif
  183.                 if (PendingOffer[(i+1)*12+(pID+1)-12] == true) then
  184.                     call RemoveOffer((i+1)*12+(pID+1)-12)
  185.                 endif
  186.                 if (PendingOffer[144+(pID+1)*12+(i+1)-12] == true) then
  187.                     call RemoveOffer(144+(pID+1)*12+(i+1)-12)
  188.                 endif
  189.                 if (PendingOffer[144+(i+1)*12+(pID+1)-12] == true) then
  190.                     call RemoveOffer(144+(i+1)*12+(pID+1)-12)
  191.                 endif
  192.                 if (GetLocalPlayer() == p_i) then
  193.                     call StopSound(s_War, false, false)
  194.                     call StartSound(s_War)
  195.                 endif
  196.                 set msg = msg + " " + Faction[i] + ","
  197.             endif
  198.             if (cmd_pID != 12) then
  199.                 set i = 12
  200.             else
  201.                 set i = i + 1
  202.             endif
  203.         endloop
  204.         if (StringLength(msg) > 0) then
  205.             if (GetLocalPlayer() == p) then
  206.                 call StopSound(s_War, false, false)
  207.                 call StartSound(s_War)
  208.             endif
  209.             set msg = Faction[pID] + " declares War on" + DisplayFaction(msg) + "."
  210.             call DisplayTimedTextToPlayer(GetLocalPlayer(), 0,0, DISPLAY_TIME, msg)
  211.         endif
  212.     endif
  213.     return false
  214. endfunction
  215.  
  216. private function Peace takes nothing returns boolean
  217.     local integer i = 13
  218.     local integer x
  219.     local player p1 = GetTriggerPlayer()
  220.     local player p_i
  221.     local integer pID_1 = GetPlayerId(p1)
  222.     local integer f1
  223.     local integer f2
  224.     local string msg1 = ""
  225.     local string msg2 = ""
  226.     call SetWords()
  227.     if (cmd_p != null) then
  228.         set x = GetPlayerId(cmd_p)
  229.         if (x < 12) then
  230.             set i = x
  231.         elseif (x == 12) then
  232.             set i = 0
  233.         endif
  234.     endif
  235.     loop
  236.         exitwhen i > 11
  237.         set f1 = (pID_1+1)*12+(i+1)-12
  238.         set f2 = (i+1)*12+(pID_1+1)-12
  239.         set p_i = Player(i)
  240.        
  241.         // Accept Peace
  242.         if (PendingOffer[f2] == true) then
  243.             call RemoveOffer(f2)
  244.             call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, DISPLAY_TIME, Faction[i] + " and " + Faction[pID_1] + " are now neutral towards each other.")
  245.             call SetPlayerAllianceStateBJ( p_i, p1, bj_ALLIANCE_NEUTRAL)
  246.             call SetPlayerAllianceStateBJ( p1, p_i, bj_ALLIANCE_NEUTRAL)
  247.         // Offer Peace
  248.         elseif (IsPlayerEnemy(p1, p_i) == true and IsPlayerInForce(p_i, Active) == true and PendingOffer[f1] == false) then
  249.             call MakeOffer(f1, pID_1, i)
  250.             set msg1 = msg1 + " " + Faction[i] + ","
  251.             call DisplayTimedTextToPlayer(p_i, 0,0, DISPLAY_TIME, Faction[pID_1] + " has offered you Peace.")
  252.             if (GetLocalPlayer() == p_i) then
  253.                 call StopSound(s_Peace, false, false)
  254.                 call StartSound(s_Peace)
  255.             endif
  256.         // End Alliance into Neutral
  257.         elseif (x < 12 and IsPlayerAlly(p1, p_i) == true and GetPlayerAlliance(p1, p_i, ALLIANCE_SHARED_VISION) == true and p1 != p_i) then
  258.             call DisplayTimedTextToPlayer(GetLocalPlayer(), 0,0, DISPLAY_TIME, Faction[pID_1] + " has ended the alliance with " + Faction[i] + ".")
  259.             call SetPlayerAllianceStateBJ( p_i, p1, bj_ALLIANCE_NEUTRAL)
  260.             call SetPlayerAllianceStateBJ( p1, p_i, bj_ALLIANCE_NEUTRAL)
  261.             if (GetLocalPlayer() == p1 or GetLocalPlayer() == p_i) then
  262.                 call StopSound(s_Peace, false, false)
  263.                 call StartSound(s_Peace)
  264.             endif
  265.         // Withdraw Peace Offer
  266.         elseif (PendingOffer[f1] == true) then
  267.             call RemoveOffer(f1)
  268.             set msg2 = msg2 + " " + Faction[i] + ","
  269.             call DisplayTimedTextToPlayer(p_i, 0,0, DISPLAY_TIME, Faction[pID_1] + " has withdrawn the peace offer.")
  270.         endif
  271.         if (x < 12) then
  272.             set i = 12
  273.         else
  274.             set i = i + 1
  275.         endif
  276.     endloop
  277.     if (StringLength(msg1) > 0) then
  278.         set msg1 = "You offered" + DisplayFaction(msg1) + " Peace."
  279.         call DisplayTimedTextToPlayer(p1, 0,0, DISPLAY_TIME, msg1)
  280.     endif
  281.     if (StringLength(msg2) > 0) then
  282.         set msg2 = "You are no longer offering" + DisplayFaction(msg2) + " Peace."
  283.         call DisplayTimedTextToPlayer(p1, 0,0, DISPLAY_TIME, msg2)
  284.     endif
  285.     return false
  286. endfunction
  287.  
  288. private function Ally takes nothing returns boolean
  289.     local player p = GetTriggerPlayer()
  290.     local integer pID = GetPlayerId(p)
  291.     local integer cmd_pID
  292.     local integer f1
  293.     local integer f2
  294.     call SetWords()
  295.    
  296.     if (cmd_p != null and IsPlayerInForce(cmd_p, Active) == true and cmd_p != p) then
  297.         set cmd_pID = GetPlayerId(cmd_p)
  298.         set f1 = 144 + (pID+1)*12+(cmd_pID+1)-12
  299.         set f2 = 144 + (cmd_pID+1)*12+(pID+1)-12
  300.        
  301.         // Accept Alliance
  302.         if (PendingOffer[f2] == true) then
  303.             if (AllyCount[pID] < AllyLimit) then
  304.                 set AllyCount[pID] = AllyCount[pID] + 1
  305.                 set AllyCount[cmd_pID] = AllyCount[cmd_pID] + 1
  306.                 call RemoveOffer(f2)
  307.                 // Remove Pending Neutral Offers
  308.                 if (PendingOffer[f1-144] == true) then
  309.                     call RemoveOffer(f1-144)
  310.                 endif
  311.                 if (PendingOffer[f2-144] == true) then
  312.                     call RemoveOffer(f2-144)
  313.                 endif
  314.                 call DisplayTimedTextToPlayer(GetLocalPlayer(), 0,0, DISPLAY_TIME, Faction[cmd_pID] + " and " + Faction[pID] + " have formed an Alliance!")
  315.                 call SetPlayerAllianceStateBJ(cmd_p, p, bj_ALLIANCE_ALLIED_VISION)
  316.                 call SetPlayerAllianceStateBJ(p, cmd_p, bj_ALLIANCE_ALLIED_VISION)
  317.                 if (GetLocalPlayer() == cmd_p or GetLocalPlayer() == p) then
  318.                     call StopSound(s_Ally, false, false)
  319.                     call StartSound(s_Ally)
  320.                 endif
  321.             else
  322.                 call DisplayTimedTextToPlayer(p, 0,0, DISPLAY_TIME, "Ally limit reached. Unally someone to be able to Ally " + Faction[cmd_pID] + ".")
  323.             endif
  324.         // Offer Alliance
  325.         elseif (GetPlayerAlliance(cmd_p, p, ALLIANCE_SHARED_VISION) == false and PendingOffer[f1] == false) then  
  326.             if (AllyCount[pID] < AllyLimit) then
  327.                 call MakeOffer(f1, pID, cmd_pID)
  328.                 call DisplayTimedTextToPlayer(cmd_p, 0,0, DISPLAY_TIME, Faction[pID] + " has offered you an Alliance.\n")
  329.                 call DisplayTimedTextToPlayer(p, 0,0, DISPLAY_TIME, "You offered " + Faction[cmd_pID] + " an Alliance.\n")
  330.                     if (GetLocalPlayer() == cmd_p) then
  331.                     call StopSound(s_Ally, false, false)
  332.                     call StartSound(s_Ally)
  333.                 endif
  334.             else
  335.                 call DisplayTimedTextToPlayer(p, 0,0, DISPLAY_TIME, "Ally limit reached. Unally someone to be able to Ally " + Faction[cmd_pID] + ".")
  336.             endif
  337.             // Withdraw Offer
  338.         elseif (PendingOffer[f1] == true) then
  339.             call RemoveOffer(f1)
  340.             call DisplayTimedTextToPlayer(p, 0,0, DISPLAY_TIME, Faction[pID] + " has withdrawn the Alliance offer.")
  341.             call DisplayTimedTextToPlayer(p, 0,0, DISPLAY_TIME, "You are no longer offering " + Faction[cmd_pID] + " an Alliance.")
  342.         endif
  343.  
  344.     endif
  345.     return false
  346. endfunction
  347.  
  348. private function Give takes nothing returns boolean
  349.     return false
  350. endfunction
  351.  
  352. private function Help takes nothing returns boolean
  353.     local string msg = "Diplomacy Commands:\n-reveal # or -r # \n-ally # or -alliance # \n-war # or -unally # \n-neutral # or -na # or -peace #\n"
  354.     call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, DISPLAY_TIME, msg)
  355.     return false
  356. endfunction
  357.  
  358. private function Leaves takes nothing returns boolean
  359.     call ForceRemovePlayer(Active, GetTriggerPlayer())
  360.     return false
  361. endfunction
  362.  
  363. //===========================================================================
  364. private function init takes nothing returns nothing
  365.     local trigger array t
  366.     local integer i = 0
  367.     loop
  368.         exitwhen i > 5
  369.             set t[i] = CreateTrigger()
  370.         set i = i + 1
  371.     endloop
  372.     set i = 0
  373.     loop
  374.         exitwhen i > 11
  375.         // if player playing and not computer
  376.             call ForceAddPlayer(Active, Player(i))
  377.             call TriggerRegisterPlayerChatEvent(t[0], Player(i), "-reveal", false)
  378.             call TriggerRegisterPlayerChatEvent(t[0], Player(i), "-r", false)
  379.             call TriggerRegisterPlayerChatEvent(t[1], Player(i), "-war", false)  
  380.             call TriggerRegisterPlayerChatEvent(t[1], Player(i), "-unally", false)
  381.             call TriggerRegisterPlayerChatEvent(t[2], Player(i), "-na", false)  
  382.             call TriggerRegisterPlayerChatEvent(t[2], Player(i), "-neutral", false)  
  383.             call TriggerRegisterPlayerChatEvent(t[2], Player(i), "-peace", false)
  384.             call TriggerRegisterPlayerChatEvent(t[3], Player(i), "-ally", false)
  385.             call TriggerRegisterPlayerChatEvent(t[3], Player(i), "-alliance", false)
  386.             call TriggerRegisterPlayerChatEvent(t[4], Player(i), "-diplomacy", false)
  387.             call TriggerRegisterPlayerChatEvent(t[4], Player(i), "-d", false)
  388.             call TriggerRegisterPlayerEventLeave(t[5], Player(i))
  389.         //endif
  390.         set i = i + 1
  391.     endloop    
  392.     call TriggerAddCondition( t[0], Condition( function Reveal ))
  393.     call TriggerAddCondition( t[1], Condition( function War ))
  394.     call TriggerAddCondition( t[2], Condition( function Peace ))
  395.     call TriggerAddCondition( t[3], Condition( function Ally ))
  396.     call TriggerAddCondition( t[4], Condition( function Help ))
  397.     call TriggerAddCondition( t[5], Condition( function Leaves ))
  398.     set i = 0
  399.     loop
  400.         exitwhen t[i] == null
  401.         set t[i] = null
  402.         set i = i + 1
  403.     endloop
  404.    
  405.     set s_Offer = gg_snd_PEACE
  406.     set s_Peace = gg_snd_PEACE
  407.     set s_War = gg_snd_WAR
  408.     set s_Ally = gg_snd_ALLY
  409.    
  410.     set Faction[0] = "|c00FF0303Sparta|r"
  411.     set Faction[1] = "|c000042FFAthens|r"
  412.     set Faction[2] = "|c001CE6B9Argos|r"
  413.     set Faction[3] = "|c00540081Thebes|r"
  414.     set Faction[4] = "|c00FFFC01Epirus|r"
  415.     set Faction[5] = "|c00fEBA0EMacedon|r"
  416.     set Faction[6] = "|c0020C000Thessaly|r"
  417.     set Faction[7] = "|c00E55BB0Crete|r"
  418.     set Faction[8] = "|c00959697Persia|r"
  419.     set Faction[9] = "|c007EBFF1Thrace|r"
  420.     set Faction[10] = "|c00106246Rhodes|r"
  421.     set Faction[11] = "|c004E2A04Troy|r"
  422.    
  423.     // Player 0
  424.     call SaveInteger(hash,0, StringHash("red"),0)
  425.     call SaveInteger(hash,0, StringHash("sparta"),0)
  426.     call SaveInteger(hash,0, StringHash("1"),0)
  427.     // Player 1
  428.     call SaveInteger(hash,0, StringHash("blue"),1)
  429.     call SaveInteger(hash,0, StringHash("athens"),1)
  430.     call SaveInteger(hash,0, StringHash("2"),1)
  431.     // Player 2
  432.     call SaveInteger(hash,0, StringHash("teal"),2)
  433.     call SaveInteger(hash,0, StringHash("argos"),2)
  434.     call SaveInteger(hash,0, StringHash("3"),2)
  435.     // Player 3
  436.     call SaveInteger(hash,0, StringHash("purple"),3)
  437.     call SaveInteger(hash,0, StringHash("thebes"),3)
  438.     call SaveInteger(hash,0, StringHash("4"),3)
  439.     // Player 4
  440.     call SaveInteger(hash,0, StringHash("yellow"),4)
  441.     call SaveInteger(hash,0, StringHash("epirus"),4)
  442.     call SaveInteger(hash,0, StringHash("5"), 4)
  443.     // Player 5
  444.     call SaveInteger(hash,0, StringHash("orange"),5)
  445.     call SaveInteger(hash,0, StringHash("epirus"),5)
  446.     call SaveInteger(hash,0, StringHash("6"),5)
  447.     // Player 6
  448.     call SaveInteger(hash,0, StringHash("green"),6)
  449.     call SaveInteger(hash,0, StringHash("thessaly"),6)
  450.     call SaveInteger(hash,0, StringHash("7"), 6)
  451.     // Player 7
  452.     call SaveInteger(hash,0, StringHash("pink"),7)
  453.     call SaveInteger(hash,0, StringHash("crete"),7)
  454.     call SaveInteger(hash,0, StringHash("8"),7)
  455.     // Player 8
  456.     call SaveInteger(hash,0, StringHash("gray"),8)
  457.     call SaveInteger(hash,0, StringHash("grey"),8)
  458.     call SaveInteger(hash,0, StringHash("persia"),8)
  459.     call SaveInteger(hash,0, StringHash("9"),8)
  460.     // Player 9
  461.     call SaveInteger(hash,0, StringHash("light blue"),9)
  462.     call SaveInteger(hash,0, StringHash("lightblue"),9)
  463.     call SaveInteger(hash,0, StringHash("lb"),9)
  464.     call SaveInteger(hash,0, StringHash("thrace"),9)
  465.     call SaveInteger(hash,0, StringHash("10"),9)
  466.     // Player 10
  467.     call SaveInteger(hash,0, StringHash("dark green"),10)
  468.     call SaveInteger(hash,0, StringHash("darkgreen"),10)
  469.     call SaveInteger(hash,0, StringHash("dg"),10)
  470.     call SaveInteger(hash,0, StringHash("rhodes"),10)
  471.     call SaveInteger(hash,0, StringHash("11"),10)
  472.     // Player 11
  473.     call SaveInteger(hash,0, StringHash("brown"),11)
  474.     call SaveInteger(hash,0, StringHash("troy"),11)
  475.     call SaveInteger(hash,0, StringHash("12"),11)
  476.     // All Players
  477.     call SaveInteger(hash,0, StringHash("all"),12)
  478.     // Gold
  479.     call SaveInteger(hash,0, StringHash("gold"),14)
  480.     call SaveInteger(hash,0, StringHash("g"),14)
  481.     // Lumber
  482.     call SaveInteger(hash,0, StringHash("lumber"),15)
  483.     call SaveInteger(hash,0, StringHash("l"),15)
  484.     call SaveInteger(hash,0, StringHash("wood"),15)
  485.     call SaveInteger(hash,0, StringHash("w"),15)
  486.    
  487. endfunction
  488.  
  489. endlibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement