Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- I HATE YOUR WARDS (PATCH 3.14)
- modified by mwow1
- -- ALL CREDITS TO TRUS --
- ]]
- local blackColor = 4278190080
- local purpleColor = 4294902015
- local greenColor = 4278255360
- local yellowColor = 4294967040
- local vangaColor = 4294967295
- local aquaColor = ARGB(255,102, 205, 170)
- function OnBugSplat()
- Serialization.saveTable({wards = placedWards}, SCRIPT_PATH .. 'Common/HiddenWards_BugSplat.lua')
- end
- function OnRecvPacket(p)
- if p.header == 49 then
- p.pos = 1
- local deaddid = p:DecodeF()
- local killerid = p:DecodeF()
- for networkID, ward in pairs(placedWards) do
- if ward and deaddid and networkID == deaddid and ward.vanga == 1 and (GetTickCount() - ward.spawnTime) > 200 then
- placedWards[networkID] = nil
- elseif ward and deaddid and networkID == deaddid and ward.vanga == 2 and killerid == 0 then
- placedWards[networkID] = nil
- end
- end
- end
- if p.header == 0xB5 then
- p.pos = 12
- local wardtype2 = p:Decode1()
- p.pos = 1
- local creatorID = p:DecodeF()
- p.pos = p.pos + 20
- local creatorID2 = p:DecodeF()
- p.pos = 37
- local objectID = p:DecodeF()
- local objectX = p:DecodeF()
- local objectY = p:DecodeF()
- local objectZ = p:DecodeF()
- local objectX2 = p:DecodeF()
- local objectY2 = p:DecodeF()
- local objectZ2 = p:DecodeF()
- p:DecodeF()
- local warddet = p:Decode1()
- p.pos = p.pos + 4
- local warddet2 = p:Decode1()
- p.pos = 13
- local wardtype = p:Decode1()
- --[[ 161 - Sight Ward
- 8 - Vision ward
- 229 - Sight Stone
- 48 - teemo shroom]]
- local visionColor
- if wardtype==8 or wardtype2==0x7E then return end -- Dont show pinks
- local objectID = DwordToFloat(AddNum(FloatToDword(objectID), 2))
- local creatorchamp = objManager:GetObjectByNetworkId(creatorID)
- local duration
- local range
- if creatorchamp and creatorchamp.team == myHero.team and WardsHater.ownteam == false then return end
- visionColor = (wardtype == 229 and yellowColor or greenColor)
- if (warddet == 0x3E or (warddet == 0x3F and wardtype == 0x3F)) and WardsHater.addedobj == false then ---objects
- if wardtype == 0x30 and wardtype2 == 0xD0 and creatorchamp.charName == "Teemo" then
- duration = 600000 range = 200 -- shroom
- elseif (wardtype == 0x09 and wardtype2 == 0x5B and creatorchamp.charName == "Nidalee" ) or (wardtype == 62 and wardtype2 == 0xB0 and creatorchamp.charName == "Caitlyn" ) then
- duration = 240000 range = 100 -- Nidalee trap / cait
- elseif (wardtype == 0x02 and wardtype2 == 0x68 and creatorchamp.charName == "Shaco" ) then
- duration = 60000 range = 100 -- Shaco
- else return
- end
- placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = range, color = yellowColor, spawnTime = GetTickCount(), duration = duration, vanga = 2}
- end
- if warddet == 0x3F and warddet2 == 0x33 and wardtype ~= 12 and wardtype ~= 48 then --wards 116 | wardtype 48 -> riven E
- if wardtype2 == 0x6E then
- placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = aquaColor, spawnTime = GetTickCount(), duration = 60000, vanga = 1 } -- WARDING TOTEM
- elseif wardtype2 == 0x2E then
- placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = aquaColor, spawnTime = GetTickCount(), duration = 120000, vanga = 1 } -- GREATER TOTEM
- elseif wardtype2 == 0xAE then
- placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = aquaColor, spawnTime = GetTickCount(), duration = 180000, vanga = 1 } -- GREATER STEALTH TOTEM
- elseif wardtype2 == 0xEE then
- placedWards[objectID] = {x = objectX2, y = objectY2, z = objectZ2, visionRange = 1100, color = greenColor, spawnTime = GetTickCount(), duration = 180000, vanga = 1 } -- WRIGGLES LANTERN
- else
- 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 }
- end
- end
- end
- p.pos = 1
- end
- function OnLoad()
- lastvanga = 0
- local loadedTable, error = Serialization.loadTable(SCRIPT_PATH .. 'Common/IHateWards_cache.lua')
- if not error and loadedTable.saveTime <= GetInGameTimer() then
- placedWards = loadedTable.placedWards
- else
- placedWards = {}
- end
- WardsHater = scriptConfig("I hate your Wards", "IHYW")
- WardsHater:addParam("addedobj", "Display wards only", SCRIPT_PARAM_ONOFF, false)
- WardsHater:addParam("ownteam", "Display own team objects(testing purpose)", SCRIPT_PARAM_ONOFF, false)
- WardsHater:addParam("vangamode", "I THINK WARD IS HERE!", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("F4"))
- PrintChat(" >> I hate your Wards 1.12")
- end
- function OnUnload()
- Serialization.saveTable({placedWards = placedWards, saveTime = GetInGameTimer()}, SCRIPT_PATH .. 'Common/IHateWards_cache.lua')
- end
- function OnWndMsg(msg,key)
- if WardsHater.vangamode and lastvanga < GetTickCount() then
- for networkID, ward in pairs(placedWards) do
- if ward and GetDistance(ward,mousePos)<100 and ward.vanga == 3 then
- placedWards[networkID] = nil
- return
- end
- end
- placedWards[GetTickCount()] = {x = mousePos.x, y = myHero.y, z = mousePos.z, visionRange = 1100, color = vangaColor, spawnTime = GetTickCount(), duration = 180000, vanga = 3}
- lastvanga = GetTickCount() + 1000
- end
- end
- function OnDraw()
- for networkID, ward in pairs(placedWards) do
- if (GetTickCount() - ward.spawnTime) > ward.duration then
- placedWards[networkID] = nil
- else
- local minimapPosition = GetMinimap(ward)
- DrawTextWithBorder('.', 60, minimapPosition.x - 3, minimapPosition.y - 43, ward.color, blackColor)
- local x, y, onScreen = get2DFrom3D(ward.x, ward.y, ward.z)
- DrawTextWithBorder(TimerText((ward.duration - (GetTickCount() - ward.spawnTime)) / 1000), 20, x - 15, y - 11, ward.color, blackColor)
- DrawCircle(ward.x, ward.y, ward.z, 90, ward.color)
- if IsKeyDown(16) then
- DrawCircle(ward.x, ward.y, ward.z, ward.visionRange, ward.color)
- end
- end
- end
- end
- function DrawTextWithBorder(textToDraw, textSize, x, y, textColor, backgroundColor)
- DrawText(textToDraw, textSize, x + 1, y, backgroundColor)
- DrawText(textToDraw, textSize, x - 1, y, backgroundColor)
- DrawText(textToDraw, textSize, x, y - 1, backgroundColor)
- DrawText(textToDraw, textSize, x, y + 1, backgroundColor)
- DrawText(textToDraw, textSize, x , y, textColor)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement