Broland

Untitled

Nov 24th, 2013
3,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.62 KB | None | 0 0
  1. --[[
  2. Script: minimapTimers v0.3  (3.14 LoL patch)
  3.  
  4. Author: SurfaceS
  5. Updated by TEAM DEKLAND
  6. ]]
  7. do
  8.     --[[      GLOBAL      ]]
  9.     monsters = {
  10.         summonerRift = {
  11.             {   -- baron
  12.                 name = "baron",
  13.                 spawn = 900,
  14.                 respawn = 420,
  15.                 advise = true,
  16.                 camps = {
  17.                     {
  18.                         pos = { x = 4600, y = 60, z = 10250 },
  19.                         name = "monsterCamp_12",
  20.                         creeps = { { { name = "Worm12.1.1" }, }, },
  21.                         team = TEAM_NEUTRAL,
  22.                     },
  23.                 },
  24.             },
  25.             {   -- dragon
  26.                 name = "dragon",
  27.                 spawn = 150,
  28.                 respawn = 360,
  29.                 advise = true,
  30.                 camps = {
  31.                     {
  32.                         pos = { x = 9459, y = 60, z = 4193 },
  33.                         name = "monsterCamp_6",
  34.                         creeps = { { { name = "Dragon6.1.1" }, }, },
  35.                         team = TEAM_NEUTRAL,
  36.                     },
  37.                 },
  38.             },
  39.             {   -- blue
  40.                 name = "blue",
  41.                 spawn = 115,
  42.                 respawn = 300,
  43.                 advise = true,
  44.                 camps = {
  45.                     {
  46.                         pos = { x = 3632, y = 60, z = 7600 },
  47.                         name = "monsterCamp_1",
  48.                         creeps = { { { name = "AncientGolem1.1.1" }, { name = "YoungLizard1.1.2" }, { name = "YoungLizard1.1.3" }, }, },
  49.                         team = TEAM_BLUE,
  50.                     },
  51.                     {
  52.                         pos = { x = 10386, y = 60, z = 6811 },
  53.                         name = "monsterCamp_7",
  54.                         creeps = { { { name = "AncientGolem7.1.1" }, { name = "YoungLizard7.1.2" }, { name = "YoungLizard7.1.3" }, }, },
  55.                         team = TEAM_RED,
  56.                     },
  57.                 },
  58.             },
  59.             {   -- red
  60.                 name = "red",
  61.                 spawn = 115,
  62.                 respawn = 300,
  63.                 advise = true,
  64.                 camps = {
  65.                     {
  66.                         pos = { x = 7455, y = 60, z = 3890 },
  67.                         name = "monsterCamp_4",
  68.                         creeps = { { { name = "LizardElder4.1.1" }, { name = "YoungLizard4.1.2" }, { name = "YoungLizard4.1.3" }, }, },
  69.                         team = TEAM_BLUE,
  70.                     },
  71.                     {
  72.                         pos = { x = 6504, y = 60, z = 10584 },
  73.                         name = "monsterCamp_10",
  74.                         creeps = { { { name = "LizardElder10.1.1" }, { name = "YoungLizard10.1.2" }, { name = "YoungLizard10.1.3" }, }, },
  75.                         team = TEAM_RED,
  76.                     },
  77.                 },
  78.             },
  79.             {   -- wolves
  80.                 name = "wolves",
  81.                 spawn = 115,
  82.                 respawn = 50,
  83.                 advise = false,
  84.                 camps = {
  85.                     {
  86.                         name = "monsterCamp_2",
  87.                         creeps = { { { name = "GiantWolf2.1.3" }, { name = "wolf2.1.1" }, { name = "wolf2.1.2" }, }, },
  88.                         team = TEAM_BLUE,
  89.                     },
  90.                     {
  91.                         name = "monsterCamp_8",
  92.                         creeps = { { { name = "GiantWolf8.1.3" }, { name = "wolf8.1.1" }, { name = "wolf8.1.2" }, }, },
  93.                         team = TEAM_RED,
  94.                     },
  95.                 },
  96.             },
  97.             {   -- wraiths
  98.                 name = "wraiths",
  99.                 spawn = 115,
  100.                 respawn = 50,
  101.                 advise = false,
  102.                 camps = {
  103.                     {
  104.                         name = "monsterCamp_3",
  105.                         creeps = { { { name = "Wraith3.1.3" }, { name = "LesserWraith3.1.1" }, { name = "LesserWraith3.1.2" }, { name = "LesserWraith3.1.4" }, }, },
  106.                         team = TEAM_BLUE,
  107.                     },
  108.                     {
  109.                         name = "monsterCamp_9",
  110.                         creeps = { { { name = "Wraith9.1.3" }, { name = "LesserWraith9.1.1" }, { name = "LesserWraith9.1.2" }, { name = "LesserWraith9.1.4" }, }, },
  111.                         team = TEAM_RED,
  112.                     },
  113.                 },
  114.             },
  115.             {   -- GreatWraiths
  116.                 name = "GreatWraiths",
  117.                 spawn = 115,
  118.                 respawn = 50,
  119.                 advise = false,
  120.                 camps = {
  121.                     {
  122.                         name = "monsterCamp_13",
  123.                         creeps = { { { name = "GreatWraith13.1.1" }, }, },
  124.                         team = TEAM_BLUE,
  125.                     },
  126.                     {
  127.                         name = "monsterCamp_14",
  128.                         creeps = { { { name = "GreatWraith14.1.1" }, }, },
  129.                         team = TEAM_RED,
  130.                     },
  131.                 },
  132.             },
  133.             {   -- Golems
  134.                 name = "Golems",
  135.                 spawn = 115,
  136.                 respawn = 50,
  137.                 advise = false,
  138.                 camps = {
  139.                     {
  140.                         name = "monsterCamp_5",
  141.                         creeps = { { { name = "Golem5.1.2" }, { name = "SmallGolem5.1.1" }, }, },
  142.                         team = TEAM_BLUE,
  143.                     },
  144.                     {
  145.                         name = "monsterCamp_11",
  146.                         creeps = { { { name = "Golem11.1.2" }, { name = "SmallGolem11.1.1" }, }, },
  147.                         team = TEAM_RED,
  148.                     },
  149.                 },
  150.             },
  151.         },
  152.         twistedTreeline = {
  153.             {   -- Wraith
  154.                 name = "Wraith",
  155.                 spawn = 100,
  156.                 respawn = 50,
  157.                 advise = false,
  158.                 camps = {
  159.                     {
  160.                         --pos = { x = 4414, y = 60, z = 5774 },
  161.                         name = "monsterCamp_1",
  162.                         creeps = {
  163.                             { { name = "TT_NWraith1.1.1" }, { name = "TT_NWraith21.1.2" }, { name = "TT_NWraith21.1.3" }, },
  164.                         },
  165.                         team = TEAM_BLUE,
  166.                     },
  167.                     {
  168.                         --pos = { x = 11008, y = 60, z = 5775 },
  169.                         name = "monsterCamp_4",
  170.                         creeps = {
  171.                             { { name = "TT_NWraith4.1.1" }, { name = "TT_NWraith24.1.2" }, { name = "TT_NWraith24.1.3" }, },
  172.                         },
  173.                         team = TEAM_RED,
  174.                     },
  175.                 },
  176.             },
  177.             {   -- Golems
  178.                 name = "Golems",
  179.                 respawn = 50,
  180.                 spawn = 100,
  181.                 advise = false,
  182.                 camps = {
  183.                     {
  184.                         --pos = { x = 5088, y = 60, z = 8065 },
  185.                         name = "monsterCamp_2",
  186.                         creeps = {
  187.                             { { name = "TT_NGolem2.1.1" }, { name = "TT_NGolem22.1.2" } },
  188.                         },
  189.                         team = TEAM_BLUE,
  190.                     },
  191.                     {
  192.                         --pos = { x = 10341, y = 60, z = 8084 },
  193.                         name = "monsterCamp_5",
  194.                         creeps = {
  195.                             { { name = "TT_NGolem5.1.1" }, { name = "TT_NGolem25.1.2" } },
  196.                         },
  197.                         team = TEAM_RED,
  198.                     },
  199.                 },
  200.             },
  201.             {   -- Wolves
  202.                 name = "Wolves",
  203.                 respawn = 50,
  204.                 spawn = 100,
  205.                 advise = false,
  206.                 camps = {
  207.                     {
  208.                         --pos = { x = 6148, y = 60, z = 5993 },
  209.                         name = "monsterCamp_3",
  210.                         creeps = { { { name = "TT_NWolf3.1.1" }, { name = "TT_NWolf23.1.2" }, { name = "TT_NWolf23.1.3" } }, },
  211.                         team = TEAM_BLUE,
  212.                     },
  213.                     {
  214.                         --pos = { x = 9239, y = 60, z = 6022 },
  215.                         name = "monsterCamp_6",
  216.                         creeps = { { { name = "TT_NWolf6.1.1" }, { name = "TT_NWolf26.1.2" }, { name = "TT_NWolf26.1.3" } }, },
  217.                         team = TEAM_RED,
  218.                     },
  219.                 },
  220.             },
  221.             {   -- Heal
  222.                 name = "Heal",
  223.                 spawn = 115,
  224.                 respawn = 90,
  225.                 advise = true,
  226.                 camps = {
  227.                     {
  228.                         pos = { x = 7711, y = 60, z = 6722 },
  229.                         name = "monsterCamp_7",
  230.                         creeps = { { { name = "TT_Relic7.1.1" }, }, },
  231.                         team = TEAM_NEUTRAL,
  232.                     },
  233.                 },
  234.             },
  235.             {   -- Vilemaw
  236.                 name = "Vilemaw",
  237.                 spawn = 600,
  238.                 respawn = 300,
  239.                 advise = true,
  240.                 camps = {
  241.                     {
  242.                         pos = { x = 7711, y = 60, z = 10080 },
  243.                         name = "monsterCamp_8",
  244.                         creeps = { { { name = "TT_Spiderboss8.1.1" }, }, },
  245.                         team = TEAM_NEUTRAL,
  246.                     },
  247.                 },
  248.             },
  249.         },
  250.         crystalScar = {},
  251.         provingGrounds = {
  252.             {   -- Heal
  253.                 name = "Heal",
  254.                 spawn = 190,
  255.                 respawn = 40,
  256.                 advise = false,
  257.                 camps = {
  258.                     {
  259.                         pos = { x = 8922, y = 60, z = 7868 },
  260.                         name = "monsterCamp_1",
  261.                         creeps = { { { name = "OdinShieldRelic1.1.1" }, }, },
  262.                         team = TEAM_NEUTRAL,
  263.                     },
  264.                     {
  265.                         pos = { x = 7473, y = 60, z = 6617 },
  266.                         name = "monsterCamp_2",
  267.                         creeps = { { { name = "OdinShieldRelic2.1.1" }, }, },
  268.                         team = TEAM_NEUTRAL,
  269.                     },
  270.                     {
  271.                         pos = { x = 5929, y = 60, z = 5190 },
  272.                         name = "monsterCamp_3",
  273.                         creeps = { { { name = "OdinShieldRelic3.1.1" }, }, },
  274.                         team = TEAM_NEUTRAL,
  275.                     },
  276.                     {
  277.                         pos = { x = 4751, y = 60, z = 3901 },
  278.                         name = "monsterCamp_4",
  279.                         creeps = { { { name = "OdinShieldRelic4.1.1" }, }, },
  280.                         team = TEAM_NEUTRAL,
  281.                     },
  282.                 },
  283.             },
  284.         },
  285.         howlingAbyss = {
  286.             {   -- Heal
  287.                 name = "Heal",
  288.                 spawn = 190,
  289.                 respawn = 40,
  290.                 advise = false,
  291.                 camps = {
  292.                     {
  293.                         pos = { x = 8922, y = 60, z = 7868 },
  294.                         name = "monsterCamp_1",
  295.                         creeps = { { { name = "HA_AP_HealthRelic1.1.1" }, }, },
  296.                         team = TEAM_NEUTRAL,
  297.                     },
  298.                     {
  299.                         pos = { x = 7473, y = 60, z = 6617 },
  300.                         name = "monsterCamp_2",
  301.                         creeps = { { { name = "HA_AP_HealthRelic2.1.1" }, }, },
  302.                         team = TEAM_NEUTRAL,
  303.                     },
  304.                     {
  305.                         pos = { x = 5929, y = 60, z = 5190 },
  306.                         name = "monsterCamp_3",
  307.                         creeps = { { { name = "HA_AP_HealthRelic3.1.1" }, }, },
  308.                         team = TEAM_NEUTRAL,
  309.                     },
  310.                     {
  311.                         pos = { x = 4751, y = 60, z = 3901 },
  312.                         name = "monsterCamp_4",
  313.                         creeps = { { { name = "HA_AP_HealthRelic4.1.1" }, }, },
  314.                         team = TEAM_NEUTRAL,
  315.                     },
  316.                 },
  317.             },
  318.         },
  319.     }
  320.  
  321.     altars = {
  322.         summonerRift = {},
  323.         twistedTreeline = {
  324.             {
  325.                 name = "Left Altar",
  326.                 spawn = 180,
  327.                 respawn = 85,
  328.                 advise = true,
  329.                 objectName = "TT_Buffplat_L",
  330.                 locked = false,
  331.                 lockNames = {"TT_Lock_Blue_L.troy", "TT_Lock_Purple_L.troy", "TT_Lock_Neutral_L.troy", },
  332.                 unlockNames = {"TT_Unlock_Blue_L.troy", "TT_Unlock_purple_L.troy", "TT_Unlock_Neutral_L.troy", },
  333.             },
  334.             {
  335.                 name = "Right Altar",
  336.                 spawn = 180,
  337.                 respawn = 85,
  338.                 advise = true,
  339.                 objectName = "TT_Buffplat_R",
  340.                 locked = false,
  341.                 lockNames = {"TT_Lock_Blue_R.troy", "TT_Lock_Purple_R.troy", "TT_Lock_Neutral_R.troy", },
  342.                 unlockNames = {"TT_Unlock_Blue_R.troy", "TT_Unlock_purple_R.troy", "TT_Unlock_Neutral_R.troy", },
  343.             },
  344.         },
  345.         crystalScar = {},
  346.         provingGrounds = {},
  347.         howlingAbyss = {},
  348.     }
  349.  
  350.     relics = {
  351.         summonerRift = {},
  352.         twistedTreeline = {},
  353.         crystalScar = {
  354.             {
  355.                 pos = { x = 5500, y = 60, z = 6500 },
  356.                 name = "Relic",
  357.                 team = TEAM_BLUE,
  358.                 spawn = 180,
  359.                 respawn = 180,
  360.                 advise = true,
  361.                 locked = false,
  362.                 precenceObject = (player.team == TEAM_BLUE and "Odin_Prism_Green.troy" or "Odin_Prism_Red.troy"),
  363.             },
  364.             {
  365.                 pos = { x = 7550, y = 60, z = 6500 },
  366.                 name = "Relic",
  367.                 team = TEAM_RED,
  368.                 spawn = 180,
  369.                 respawn = 180,
  370.                 advise = true,
  371.                 locked = false,
  372.                 precenceObject = (player.team == TEAM_RED and "Odin_Prism_Green.troy" or "Odin_Prism_Red.troy"),
  373.             },
  374.         },
  375.         provingGrounds = {},
  376.         howlingAbyss = {},
  377.     }
  378.  
  379.     heals = {
  380.         summonerRift = {},
  381.         twistedTreeline = {},
  382.         provingGrounds = {},
  383.         crystalScar = {
  384.             {
  385.                 name = "Heal",
  386.                 objectName = "OdinShieldRelic",
  387.                 respawn = 30,
  388.                 objects = {},
  389.             },
  390.         },
  391.         howlingAbyss = {},
  392.     }
  393.  
  394.     inhibitors = {}
  395.  
  396.     function addCampCreepAltar(object)
  397.         if object ~= nil and object.name ~= nil then
  398.             if object.name == "Order_Inhibit_Gem.troy" or object.name == "Chaos_Inhibit_Gem.troy" then
  399.                 table.insert(inhibitors, { object = object, destroyed = false, lefttime = 0, x = object.x, y = object.y, z = object.z, minimap = GetMinimap(object), textTick = 0 })
  400.                 return
  401.             elseif object.name == "Order_Inhibit_Crystal_Shatter.troy" or object.name == "Chaos_Inhibit_Crystal_Shatter.troy" then
  402.                 for i,inhibitor in pairs(inhibitors) do
  403.                     if GetDistance(inhibitor, object) < 200 then
  404.                         local tick = GetTickCount()
  405.                         inhibitor.dtime = tick
  406.                         inhibitor.rtime = tick + 300000
  407.                         inhibitor.ltime = 300000
  408.                         inhibitor.destroyed = true
  409.                     end
  410.                 end
  411.                 return
  412.             end
  413.             for i,monster in pairs(monsters[mapName]) do
  414.                 for j,camp in pairs(monster.camps) do
  415.                     if camp.name == object.name then
  416.                         camp.object = object
  417.                         return
  418.                     end
  419.                     if object.type == "obj_AI_Minion" then
  420.                         for k,creepPack in ipairs(camp.creeps) do
  421.                             for l,creep in ipairs(creepPack) do
  422.                                 if object.name == creep.name then
  423.                                     creep.object = object
  424.                                     return
  425.                                 end
  426.                             end
  427.                         end
  428.                     end
  429.                 end
  430.             end
  431.             for i,altar in pairs(altars[mapName]) do
  432.                 if altar.objectName == object.name then
  433.                     altar.object = object
  434.                     altar.textTick = 0
  435.                     altar.minimap = GetMinimap(object)
  436.                 end
  437.                 if altar.locked then
  438.                     for j,lockName in pairs(altar.unlockNames) do
  439.                         if lockName == object.name then
  440.                             altar.locked = false
  441.                             return
  442.                         end
  443.                     end
  444.                 else
  445.                     for j,lockName in pairs(altar.lockNames) do
  446.                         if lockName == object.name then
  447.                             altar.drawColor = 0
  448.                             altar.drawText = ""
  449.                             altar.locked = true
  450.                             altar.advised = false
  451.                             altar.advisedBefore = false
  452.                             return
  453.                         end
  454.                     end
  455.                 end
  456.             end
  457.             for i,relic in pairs(relics[mapName]) do
  458.                 if relic.precenceObject == object.name then
  459.                     relic.object = object
  460.                     relic.textTick = 0
  461.                     relic.locked = false
  462.                     return
  463.                 end
  464.             end
  465.             for i,heal in pairs(heals[mapName]) do
  466.                 if heal.objectName == object.name then
  467.                     for j,healObject in pairs(heal.objects) do
  468.                         if (GetDistance(healObject, object) < 50) then
  469.                             healObject.object = object
  470.                             healObject.found = true
  471.                             healObject.locked = false
  472.                             return
  473.                         end
  474.                     end
  475.                     local k = #heal.objects + 1
  476.                     heals[mapName][i].objects[k] = {found = true, locked = false, object = object, x = object.x, y = object.y, z = object.z, minimap = GetMinimap(object), textTick = 0,}
  477.                     return
  478.                 end
  479.             end
  480.         end
  481.     end
  482.  
  483.     function removeCreep(object)
  484.         if object ~= nil and object.type == "obj_AI_Minion" and object.name ~= nil then
  485.             for i,monster in pairs(monsters[mapName]) do
  486.                 for j,camp in pairs(monster.camps) do
  487.                     for k,creepPack in ipairs(camp.creeps) do
  488.                         for l,creep in ipairs(creepPack) do
  489.                             if object.name == creep.name then
  490.                                 creep.object = nil
  491.                                 return
  492.                             end
  493.                         end
  494.                     end
  495.                 end
  496.             end
  497.         end
  498.     end
  499.  
  500.     function OnLoad()
  501.         mapName = GetGame().map.shortName
  502.         if monsters[mapName] == nil then
  503.             mapName = nil
  504.             monsters = nil
  505.             addCampCreepAltar = nil
  506.             removeCreep = nil
  507.             addAltarObject = nil
  508.             return
  509.         else
  510.             startTick = GetGame().tick
  511.             -- CONFIG
  512.             MMTConfig = scriptConfig("Timers 0.2", "minimapTimers")
  513.             MMTConfig:addParam("pingOnRespawn", "Ping on respawn", SCRIPT_PARAM_ONOFF, true) -- ping location on respawn
  514.             MMTConfig:addParam("pingOnRespawnBefore", "Ping before respawn", SCRIPT_PARAM_ONOFF, true) -- ping location before respawn
  515.             MMTConfig:addParam("textOnRespawn", "Chat on respawn", SCRIPT_PARAM_ONOFF, true) -- print chat text on respawn
  516.             MMTConfig:addParam("textOnRespawnBefore", "Chat before respawn", SCRIPT_PARAM_ONOFF, true) -- print chat text before respawn
  517.             MMTConfig:addParam("adviceEnemyMonsters", "Advice enemy monster", SCRIPT_PARAM_ONOFF, true) -- advice enemy monster, or just our monsters
  518.             MMTConfig:addParam("adviceBefore", "Advice Time", SCRIPT_PARAM_SLICE, 20, 1, 40, 0) -- time in second to advice before monster respawn
  519.             MMTConfig:addParam("textOnMap", "Text on map", SCRIPT_PARAM_ONOFF, true) -- time in second on map
  520.             for i,monster in pairs(monsters[mapName]) do
  521.                 monster.isSeen = false
  522.                 for j,camp in pairs(monster.camps) do
  523.                     camp.enemyTeam = (camp.team == TEAM_ENEMY)
  524.                     camp.textTick = 0
  525.                     camp.status = 0
  526.                     camp.drawText = ""
  527.                     camp.drawColor = 0xFF00FF00
  528.                 end
  529.             end
  530.             for i = 1, objManager.maxObjects do
  531.                 local object = objManager:getObject(i)
  532.                 if object ~= nil then
  533.                     addCampCreepAltar(object)
  534.                 end
  535.             end
  536.             AddCreateObjCallback(addCampCreepAltar)
  537.             AddDeleteObjCallback(removeCreep)
  538.         end
  539.     end
  540.     function OnTick()
  541.         if GetGame().isOver then return end
  542.         local GameTime = (GetTickCount()-startTick) / 1000
  543.         local monsterCount = 0
  544.         for i,monster in pairs(monsters[mapName]) do
  545.             for j,camp in pairs(monster.camps) do
  546.                 local campStatus = 0
  547.                 for k,creepPack in ipairs(camp.creeps) do
  548.                     for l,creep in ipairs(creepPack) do
  549.                         if creep.object ~= nil and creep.object.valid and creep.object.dead == false then
  550.                             if l == 1 then
  551.                                 campStatus = 1
  552.                             elseif campStatus ~= 1 then
  553.                                 campStatus = 2
  554.                             end
  555.                         end
  556.                     end
  557.                 end
  558.                 --[[  Not used until camp.showOnMinimap work
  559.                 if (camp.object and camp.object.showOnMinimap == 1) then
  560.                 -- camp is here
  561.                 if campStatus == 0 then campStatus = 3 end
  562.                 elseif camp.status == 3 then                        -- empty not seen when killed
  563.                 campStatus = 5
  564.                 elseif campStatus == 0 and (camp.status == 1 or camp.status == 2) then
  565.                 campStatus = 4
  566.                 camp.deathTick = tick
  567.                 end
  568.                 ]]
  569.                 -- temp fix until camp.showOnMinimap work
  570.                 -- not so good
  571.                 if camp.object ~= nil and camp.object.valid then
  572.                     camp.minimap = GetMinimap(camp.object)
  573.                     if campStatus == 0 then
  574.                         if (camp.status == 1 or camp.status == 2) then
  575.                             campStatus = 4
  576.                             camp.advisedBefore = false
  577.                             camp.advised = false
  578.                             camp.respawnTime = math.ceil(GameTime) + monster.respawn
  579.                             camp.respawnText = (camp.enemyTeam and "Enemy " or "")..monster.name.." respawn at "..TimerText(camp.respawnTime)
  580.                         elseif (camp.status == 4) then
  581.                             campStatus = 4
  582.                         else
  583.                             campStatus = 3
  584.                         end
  585.                     end
  586.                 elseif camp.pos ~= nil then
  587.                     camp.minimap = GetMinimap(camp.pos)
  588.                     if (GameTime < monster.spawn) then
  589.                         campStatus = 4
  590.                         camp.advisedBefore = true
  591.                         camp.advised = true
  592.                         camp.respawnTime = monster.spawn
  593.                         camp.respawnText = (camp.enemyTeam and "Enemy " or "")..monster.name.." spawn at "..TimerText(camp.respawnTime)
  594.                     end
  595.                 end
  596.                 if camp.status ~= campStatus or campStatus == 4 then
  597.                     if campStatus ~= 0 then
  598.                         if monster.isSeen == false then monster.isSeen = true end
  599.                         camp.status = campStatus
  600.                     end
  601.                     if camp.status == 1 then                -- ready
  602.                         camp.drawText = "ready"
  603.                         camp.drawColor = 0xFF00FF00
  604.                     elseif camp.status == 2 then            -- ready, master creeps dead
  605.                         camp.drawText = "stolen"
  606.                         camp.drawColor = 0xFFFF0000
  607.                     elseif camp.status == 3 then            -- ready, not creeps shown
  608.                         camp.drawText = "   ?"
  609.                         camp.drawColor = 0xFF00FF00
  610.                     elseif camp.status == 4 then            -- empty from creeps kill
  611.                         local secondLeft = math.ceil(math.max(0, camp.respawnTime - GameTime))
  612.                         if monster.advise == true and (MMTConfig.adviceEnemyMonsters == true or camp.enemyTeam == false) then
  613.                             if secondLeft == 0 and camp.advised == false then
  614.                                 camp.advised = true
  615.                                 if MMTConfig.textOnRespawn then PrintChat("<font color='#00FFCC'>"..(camp.enemyTeam and "Enemy " or "")..monster.name.."</font><font color='#FFAA00'> has respawned</font>") end
  616.                                 if MMTConfig.pingOnRespawn then PingSignal(PING_FALLBACK,camp.object.x,camp.object.y,camp.object.z,2) end
  617.                             elseif secondLeft <= MMTConfig.adviceBefore and camp.advisedBefore == false then
  618.                                 camp.advisedBefore = true
  619.                                 if MMTConfig.textOnRespawnBefore then PrintChat("<font color='#00FFCC'>"..(camp.enemyTeam and "Enemy " or "")..monster.name.."</font><font color='#FFAA00'> will respawn in </font><font color='#00FFCC'>"..secondLeft.." sec</font>") end
  620.                                 if MMTConfig.pingOnRespawnBefore then PingSignal(PING_FALLBACK,camp.object.x,camp.object.y,camp.object.z,2) end
  621.                             end
  622.                         end
  623.                         -- temp fix until camp.showOnMinimap work
  624.                         if secondLeft == 0 then
  625.                             camp.status = 0
  626.                         end
  627.                         camp.drawText = " "..TimerText(secondLeft)
  628.                         camp.drawColor = 0xFFFFFF00
  629.                     elseif camp.status == 5 then            -- camp found empty (not using yet)
  630.                         camp.drawText = "   -"
  631.                         camp.drawColor = 0xFFFF0000
  632.                     end
  633.                 end
  634.                 -- shift click
  635.                 if IsKeyDown(16) and camp.status == 4 then
  636.                     camp.drawText = " "..(camp.respawnTime ~= nil and TimerText(camp.respawnTime) or "")
  637.                     camp.textUnder = (CursorIsUnder(camp.minimap.x - 9, camp.minimap.y - 5, 20, 8))
  638.                 else
  639.                     camp.textUnder = false
  640.                 end
  641.                 if MMTConfig.textOnMap and camp.status == 4 and camp.object and camp.object.valid and camp.textTick < GetTickCount() and camp.floatText ~= camp.drawText then
  642.                     camp.floatText = camp.drawText
  643.                     camp.textTick = GetTickCount() + 1000
  644.                     PrintFloatText(camp.object,6,camp.floatText)
  645.                 end
  646.             end
  647.         end
  648.  
  649.         -- altars
  650.         for i,altar in pairs(altars[mapName]) do
  651.             if altar.object and altar.object.valid then
  652.                 if altar.locked then
  653.                     if GameTime < altar.spawn then
  654.                         altar.secondLeft = math.ceil(math.max(0, altar.spawn - GameTime))
  655.                     else
  656.                         local tmpTime = ((altar.object.mana > 39600) and (altar.object.mana - 39900) / 20100 or (39600 - altar.object.mana) / 20100)
  657.                         altar.secondLeft = math.ceil(math.max(0, tmpTime * altar.respawn))
  658.                     end
  659.                     altar.unlockTime = math.ceil(GameTime + altar.secondLeft)
  660.                     altar.unlockText = altar.name.." unlock at "..TimerText(altar.unlockTime)
  661.                     altar.drawColor = 0xFFFFFF00
  662.                     if altar.advise == true then
  663.                         if altar.secondLeft == 0 and altar.advised == false then
  664.                             altar.advised = true
  665.                             if MMTConfig.textOnRespawn then PrintChat("<font color='#00FFCC'>"..altar.name.."</font><font color='#FFAA00'> is unlocked</font>") end
  666.                             if MMTConfig.pingOnRespawn then PingSignal(PING_FALLBACK,altar.object.x,altar.object.y,altar.object.z,2) end
  667.                         elseif altar.secondLeft <= MMTConfig.adviceBefore and altar.advisedBefore == false then
  668.                             altar.advisedBefore = true
  669.                             if MMTConfig.textOnRespawnBefore then PrintChat("<font color='#00FFCC'>"..altar.name.."</font><font color='#FFAA00'> will unlock in </font><font color='#00FFCC'>"..altar.secondLeft.." sec</font>") end
  670.                             if MMTConfig.pingOnRespawnBefore then PingSignal(PING_FALLBACK,altar.object.x,altar.object.y,altar.object.z,2) end
  671.                         end
  672.                     end
  673.                     -- shift click
  674.                     if IsKeyDown(16) then
  675.                         altar.drawText = " "..(altar.unlockTime ~= nil and TimerText(altar.unlockTime) or "")
  676.                         altar.textUnder = (CursorIsUnder(altar.minimap.x - 9, altar.minimap.y - 5, 20, 8))
  677.                     else
  678.                         altar.drawText = " "..(altar.secondLeft ~= nil and TimerText(altar.secondLeft) or "")
  679.                         altar.textUnder = false
  680.                     end
  681.                     if MMTConfig.textOnMap and altar.object and altar.object.valid and altar.textTick < GetTickCount() and altar.floatText ~= altar.drawText then
  682.                         altar.floatText = altar.drawText
  683.                         altar.textTick = GetTickCount() + 1000
  684.                         PrintFloatText(altar.object,6,altar.floatText)
  685.                     end
  686.                 end
  687.             end
  688.         end
  689.  
  690.         -- relics
  691.         for i,relic in pairs(relics[mapName]) do
  692.             if (not relic.locked and (not relic.object or not relic.object.valid or relic.dead)) then
  693.                 if GameTime < relic.spawn then
  694.                     relic.unlockTime = relic.spawn - GameTime
  695.                 else
  696.                     relic.unlockTime = math.ceil(GameTime + relic.respawn)
  697.                 end
  698.                 relic.advised = false
  699.                 relic.advisedBefore = false
  700.                 relic.drawText = ""
  701.                 relic.unlockText = relic.name.." respawn at "..TimerText(relic.unlockTime)
  702.                 relic.drawColor = 4288610048
  703.                 --FF9EFF00
  704.                 relic.minimap = GetMinimap(relic.pos)
  705.                 relic.locked = true
  706.             end
  707.             if relic.locked then
  708.                 relic.secondLeft = math.ceil(math.max(0, relic.unlockTime - GameTime))
  709.                 if relic.advise == true then
  710.                     if relic.secondLeft == 0 and relic.advised == false then
  711.                         relic.advised = true
  712.                         if MMTConfig.textOnRespawn then PrintChat("<font color='#00FFCC'>"..relic.name.."</font><font color='#FFAA00'> has respawned</font>") end
  713.                         if MMTConfig.pingOnRespawn then PingSignal(PING_FALLBACK,relic.pos.x,relic.pos.y,relic.pos.z,2) end
  714.                     elseif relic.secondLeft <= MMTConfig.adviceBefore and relic.advisedBefore == false then
  715.                         relic.advisedBefore = true
  716.                         if MMTConfig.textOnRespawnBefore then PrintChat("<font color='#00FFCC'>"..relic.name.."</font><font color='#FFAA00'> will respawn in </font><font color='#00FFCC'>"..relic.secondLeft.." sec</font>") end
  717.                         if MMTConfig.pingOnRespawnBefore then PingSignal(PING_FALLBACK,relic.pos.x,relic.pos.y,relic.pos.z,2) end
  718.                     end
  719.                 end
  720.                 -- shift click
  721.                 if IsKeyDown(16) then
  722.                     relic.drawText = " "..(relic.unlockTime ~= nil and TimerText(relic.unlockTime) or "")
  723.                     relic.textUnder = (CursorIsUnder(relic.minimap.x - 9, relic.minimap.y - 5, 20, 8))
  724.                 else
  725.                     relic.drawText = " "..(relic.secondLeft ~= nil and TimerText(relic.secondLeft) or "")
  726.                     relic.textUnder = false
  727.                 end
  728.             end
  729.         end
  730.  
  731.         for i,heal in pairs(heals[mapName]) do
  732.             for j,healObject in pairs(heal.objects) do
  733.                 if (not healObject.locked and healObject.found and (not healObject.object or not healObject.object.valid or healObject.object.dead)) then
  734.                     healObject.drawColor = 0xFF00FF04
  735.                     healObject.unlockTime = math.ceil(GameTime + heal.respawn)
  736.                     healObject.drawText = ""
  737.                     healObject.found = false
  738.                     healObject.locked = true
  739.                 end
  740.                 if healObject.locked then
  741.                     -- shift click
  742.                     local secondLeft = math.ceil(math.max(0, healObject.unlockTime - GameTime))
  743.                     if IsKeyDown(16) then
  744.                         healObject.drawText = " "..(healObject.unlockTime ~= nil and TimerText(healObject.unlockTime) or "")
  745.                         healObject.textUnder = (CursorIsUnder(healObject.minimap.x - 9, healObject.minimap.y - 5, 20, 8))
  746.                     else
  747.                         healObject.drawText = " "..(secondLeft ~= nil and TimerText(secondLeft) or "")
  748.                         healObject.textUnder = false
  749.                     end
  750.                     if secondLeft == 0 then healObject.locked = false end
  751.                 end
  752.             end
  753.         end
  754.         -- inhib
  755.         for i,inhibitor in pairs(inhibitors) do
  756.             if inhibitor.destroyed then
  757.                 local tick = GetTickCount()
  758.                 if inhibitor.rtime < tick then
  759.                     inhibitor.destroyed = false
  760.                 else
  761.                     inhibitor.ltime = (inhibitor.rtime - GetTickCount()) / 1000;
  762.                     inhibitor.drawText = TimerText(inhibitor.ltime)
  763.                     --inhibitor.drawText = (IsKeyDown(16) and TimerText(inhibitor.rtime) or TimerText(inhibitor.rtime))
  764.                     if MMTConfig.textOnMap and inhibitor.textTick < tick then
  765.                         inhibitor.textTick = tick + 1000
  766.                         PrintFloatText(inhibitor.object,6,inhibitor.drawText)
  767.                     end
  768.                 end
  769.             end
  770.         end
  771.     end
  772.  
  773.     function OnDraw()
  774.         if GetGame().isOver then return end
  775.         for i,monster in pairs(monsters[mapName]) do
  776.             if monster.isSeen == true then
  777.                 for j,camp in pairs(monster.camps) do
  778.                     if camp.status == 2 then
  779.                         DrawText("X",16,camp.minimap.x - 4, camp.minimap.y - 5, camp.drawColor)
  780.                     elseif camp.status == 4 then
  781.                         DrawText(camp.drawText,16,camp.minimap.x - 9, camp.minimap.y - 5, camp.drawColor)
  782.                     end
  783.                 end
  784.             end
  785.         end
  786.         for i,altar in pairs(altars[mapName]) do
  787.             if altar.locked then
  788.                 DrawText(altar.drawText,16,altar.minimap.x - 9, altar.minimap.y - 5, altar.drawColor)
  789.             end
  790.         end
  791.         for i,relic in pairs(relics[mapName]) do
  792.             if relic.locked then
  793.                 DrawText(relic.drawText,16,relic.minimap.x - 9, relic.minimap.y - 5, relic.drawColor)
  794.             end
  795.         end
  796.         for i,heal in pairs(heals[mapName]) do
  797.             for j,healObject in pairs(heal.objects) do
  798.                 if healObject.locked then
  799.                     DrawText(healObject.drawText,16,healObject.minimap.x - 9, healObject.minimap.y - 5, healObject.drawColor)
  800.                 end
  801.             end
  802.         end
  803.         for i,inhibitor in pairs(inhibitors) do
  804.             if inhibitor.destroyed == true then
  805.                 DrawText(inhibitor.drawText,16,inhibitor.minimap.x - 9, inhibitor.minimap.y - 5, 0xFFFFFF00)
  806.             end
  807.         end
  808.     end
  809.  
  810.     function OnWndMsg(msg,key)
  811.         if msg == WM_LBUTTONDOWN and IsKeyDown(16) then
  812.             for i,monster in pairs(monsters[mapName]) do
  813.                 if monster.isSeen == true then
  814.                     if monster.iconUnder then
  815.                         monster.advise = not monster.advise
  816.                         break
  817.                     else
  818.                         for j,camp in pairs(monster.camps) do
  819.                             if camp.textUnder then
  820.                                 if camp.respawnText ~= nil then SendChat(""..camp.respawnText) end
  821.                                 break
  822.                             end
  823.                         end
  824.                     end
  825.                 end
  826.             end
  827.             for i,altar in pairs(altars[mapName]) do
  828.                 if altar.locked and altar.textUnder then
  829.                     if altar.unlockText ~= nil then SendChat(""..altar.unlockText) end
  830.                     break
  831.                 end
  832.             end
  833.         end
  834.     end
  835. end
Advertisement
Add Comment
Please, Sign In to add comment