Advertisement
mwow

I Hate Your Wards 3.14

Nov 25th, 2013
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.39 KB | None | 0 0
  1. --[[
  2.     I HATE YOUR WARDS (PATCH 3.14)
  3.     modified by mwow1
  4.     -- ALL CREDITS TO TRUS --
  5. ]]
  6.  
  7. local blackColor  = 4278190080
  8. local purpleColor = 4294902015
  9. local greenColor  = 4278255360
  10. local yellowColor = 4294967040
  11. local vangaColor = 4294967295
  12. local aquaColor = ARGB(255,102, 205, 170)
  13.  
  14.  
  15. function OnBugSplat()
  16.     Serialization.saveTable({wards = placedWards}, SCRIPT_PATH .. 'Common/HiddenWards_BugSplat.lua')
  17. end
  18.  
  19. function OnRecvPacket(p)
  20.     if p.header == 49 then
  21.         p.pos = 1
  22.         local deaddid = p:DecodeF()
  23.         local killerid = p:DecodeF()
  24.         for networkID, ward in pairs(placedWards) do
  25.             if ward and deaddid and networkID == deaddid and ward.vanga == 1 and (GetTickCount() - ward.spawnTime) > 200 then
  26.                 placedWards[networkID] = nil
  27.             elseif ward and deaddid and networkID == deaddid and ward.vanga == 2 and killerid == 0 then
  28.                 placedWards[networkID] = nil
  29.             end
  30.         end
  31.     end
  32.    
  33.     if p.header == 0xB5 then
  34.        
  35.         p.pos = 12
  36.  
  37.         local wardtype2 = p:Decode1()
  38.         p.pos = 1
  39.         local creatorID = p:DecodeF()
  40.         p.pos = p.pos + 20
  41.         local creatorID2 = p:DecodeF()
  42.         p.pos = 37
  43.         local objectID = p:DecodeF()
  44.         local objectX = p:DecodeF()
  45.         local objectY = p:DecodeF()
  46.         local objectZ = p:DecodeF()
  47.         local objectX2 = p:DecodeF()
  48.         local objectY2 = p:DecodeF()
  49.         local objectZ2 = p:DecodeF()
  50.         p:DecodeF()
  51.         local warddet = p:Decode1()
  52.         p.pos = p.pos + 4
  53.         local warddet2 = p:Decode1()
  54.         p.pos = 13
  55.         local wardtype = p:Decode1()
  56.         --[[ 161 - Sight Ward
  57.             8 - Vision ward
  58.             229 - Sight Stone
  59.             48 - teemo shroom]]
  60.         local visionColor
  61.  
  62.         if wardtype==8 or wardtype2==0x7E then return end -- Dont show pinks
  63.  
  64.         local objectID = DwordToFloat(AddNum(FloatToDword(objectID), 2))
  65.         local creatorchamp = objManager:GetObjectByNetworkId(creatorID)
  66.         local duration
  67.         local range
  68.         if creatorchamp and creatorchamp.team == myHero.team and WardsHater.ownteam == false then return end
  69.        
  70.         visionColor = (wardtype == 229 and yellowColor or greenColor)
  71.        
  72.         if (warddet == 0x3E or (warddet == 0x3F and wardtype == 0x3F)) and WardsHater.addedobj == false then ---objects
  73.             if wardtype == 0x30 and wardtype2 == 0xD0 and creatorchamp.charName == "Teemo" then
  74.                 duration = 600000 range = 200 -- shroom
  75.             elseif (wardtype == 0x09 and wardtype2 == 0x5B  and creatorchamp.charName == "Nidalee" ) or (wardtype == 62 and wardtype2 == 0xB0  and creatorchamp.charName == "Caitlyn" ) then
  76.                 duration = 240000 range = 100 -- Nidalee trap / cait
  77.             elseif (wardtype == 0x02 and wardtype2 == 0x68  and creatorchamp.charName == "Shaco" ) then
  78.  
  79.                 duration = 60000 range = 100 -- Shaco
  80.             else return
  81.             end
  82.            
  83.             placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = range, color = yellowColor, spawnTime = GetTickCount(), duration = duration, vanga = 2}
  84.         end
  85.        
  86.         if warddet == 0x3F and warddet2 == 0x33 and wardtype ~= 12 and wardtype ~= 48 then --wards 116 | wardtype 48 -> riven E
  87.             if wardtype2 == 0x6E then
  88.                 placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = aquaColor, spawnTime = GetTickCount(), duration = 60000, vanga = 1 } -- WARDING TOTEM
  89.             elseif wardtype2 == 0x2E then
  90.                 placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = aquaColor, spawnTime = GetTickCount(), duration = 120000, vanga = 1 }    -- GREATER TOTEM
  91.             elseif wardtype2 == 0xAE then
  92.                 placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = aquaColor, spawnTime = GetTickCount(), duration = 180000, vanga = 1 }    -- GREATER STEALTH TOTEM
  93.             elseif wardtype2 == 0xEE then
  94.                 placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = greenColor, spawnTime = GetTickCount(), duration = 180000, vanga = 1 }   -- WRIGGLES LANTERN
  95.             else
  96.                 placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = visionColor, spawnTime = GetTickCount(), duration = ((wardtype2 == 0xB4 or wardtype2 == 0x6E) and 60000) or 180000, vanga = 1 }
  97.             end
  98.         end
  99.     end
  100.     p.pos = 1
  101. end
  102.  
  103. function OnLoad()
  104.     lastvanga = 0
  105.     local loadedTable, error = Serialization.loadTable(SCRIPT_PATH .. 'Common/IHateWards_cache.lua')
  106.     if not error and loadedTable.saveTime <= GetInGameTimer() then
  107.         placedWards = loadedTable.placedWards
  108.     else
  109.         placedWards = {}
  110.     end
  111.     WardsHater = scriptConfig("I hate your Wards", "IHYW")
  112.     WardsHater:addParam("addedobj", "Display wards only", SCRIPT_PARAM_ONOFF, false)
  113.     WardsHater:addParam("ownteam", "Display own team objects(testing purpose)", SCRIPT_PARAM_ONOFF, false)
  114.     WardsHater:addParam("vangamode", "I THINK WARD IS HERE!", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("F4"))
  115.     PrintChat(" >> I hate your Wards 1.12")
  116. end
  117.  
  118.  
  119. function OnUnload()
  120.     Serialization.saveTable({placedWards = placedWards, saveTime = GetInGameTimer()}, SCRIPT_PATH .. 'Common/IHateWards_cache.lua')
  121. end
  122.  
  123. function OnWndMsg(msg,key)
  124.     if WardsHater.vangamode and lastvanga < GetTickCount() then
  125.         for networkID, ward in pairs(placedWards) do
  126.             if ward and GetDistance(ward,mousePos)<100 and ward.vanga == 3 then
  127.                 placedWards[networkID] = nil
  128.                 return
  129.             end
  130.         end
  131.         placedWards[GetTickCount()] = {x = mousePos.x, y = myHero.y, z = mousePos.z, visionRange = 1100, color = vangaColor, spawnTime = GetTickCount(), duration = 180000, vanga = 3}
  132.         lastvanga = GetTickCount() + 1000
  133.     end
  134. end
  135.  
  136. function OnDraw()
  137.     for networkID, ward in pairs(placedWards) do
  138.         if (GetTickCount() - ward.spawnTime) > ward.duration then
  139.             placedWards[networkID] = nil
  140.         else
  141.             local minimapPosition = GetMinimap(ward)
  142.             DrawTextWithBorder('.', 60, minimapPosition.x - 3, minimapPosition.y - 43, ward.color, blackColor)
  143.  
  144.             local x, y, onScreen = get2DFrom3D(ward.x, ward.y, ward.z)
  145.             DrawTextWithBorder(TimerText((ward.duration - (GetTickCount() - ward.spawnTime)) / 1000), 20, x - 15, y - 11, ward.color, blackColor)
  146.  
  147.             DrawCircle(ward.x, ward.y, ward.z, 90, ward.color)
  148.             if IsKeyDown(16) then
  149.                 DrawCircle(ward.x, ward.y, ward.z, ward.visionRange, ward.color)
  150.             end
  151.         end
  152.     end
  153. end
  154.  
  155. function DrawTextWithBorder(textToDraw, textSize, x, y, textColor, backgroundColor)
  156.     DrawText(textToDraw, textSize, x + 1, y, backgroundColor)
  157.     DrawText(textToDraw, textSize, x - 1, y, backgroundColor)
  158.     DrawText(textToDraw, textSize, x, y - 1, backgroundColor)
  159.     DrawText(textToDraw, textSize, x, y + 1, backgroundColor)
  160.     DrawText(textToDraw, textSize, x , y, textColor)
  161. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement