- --[[Created by DediShot]]--
- local A_Minion = 190001
- local A_Super_minion = 190004
- local A_Nexus = 190002
- local A_DefTower = 190003
- local A_SuperBlock = 190005
- local A_Store = 190006
- local B_Minion = 190001
- local B_Super_minion = 190004
- local B_Nexus = 190002
- local B_DefTower = 190003
- local B_SuperBlock = 190005
- local B_Store = 190006
- local BEAKON = 190010
- local A,B = 1, 0 -- 0 = Allianz, 0 = Horde
- local Faction1, Faction2 = 998, 999
- local Classes =
- {
- {"Warrior", 11, 15}, -- Klasse & Spells
- {"Mage", 11, 15},
- }
- local space = 100
- local T = {Selected = {}, Que = {},QueA = {},QueB = {}, A = {Super = false, Coord = {}}, B = {Super = false, Coord = {}}}
- local Running = false
- T.A.Coord.Minion1 = {map,x,y,z,o}
- T.A.Coord.Minion2 = {map,x,y,z,o}
- T.A.Coord.Minion3 = {map,x,y,z,o}
- T.A.Coord.Minion4 = {map,x,y,z,o}
- T.B.Coord.Minion1 = {map,x,y,z,o}
- T.B.Coord.Minion2 = {map,x,y,z,o}
- T.B.Coord.Minion3 = {map,x,y,z,o}
- T.B.Coord.Minion4 = {map,x,y,z,o}
- local function Hello(pUnit, event, pPlayer)
- pUnit:GossipCreateMenu(100, pPlayer, 0)
- if(tostring(pUnit:GetTeam()) == A) then
- pUnit:GossipMenuAddItem(0, "Wartend: "..(#T.QueA), 0, 0, '', 0)
- else
- pUnit:GossipMenuAddItem(0, "Wartend: "..(#T.QueB), 0, 0, '', 0)
- end
- if(not T.Que[tostring(pPlayer)]) then
- pUnit:GossipMenuAddItem(0, "Warteschlange betreten", 4, 0, '', 0)
- else
- pUnit:GossipMenuAddItem(0, "Warteschlange verlassen", 2, 0, 'Warteschlange verlassen?', 0)
- end
- if(Running) then
- pUnit:GossipMenuAddItem(0, "Zuschauen", 3, 0, '', 0)
- end
- pUnit:GossipSendMenu(pPlayer)
- end
- local function Select(pUnit, event, pPlayer, id, intid, code)
- if(intid == 0) then
- T.Hello(pUnit, event, pPlayer)
- return
- elseif(intid == 4) then
- pUnit:GossipCreateMenu(100, pPlayer, 0)
- for i = 1, #Classes do
- pUnit:GossipMenuAddItem(0, Classes[i][1], i+space, 0, 'Bist du sicher?', 0)
- end
- pUnit:GossipMenuAddItem(7, "Zur\195\188ck..", 0, 0, '', 0)
- pUnit:GossipSendMenu(pPlayer)
- elseif(intid == 2) then
- table.remove(T.QueN, T.Que[tostring(pPlayer)])
- T.Que[tostring(pPlayer)] = nil
- pPlayer:SendBroadcastMessage("Du bist nun nichtmehr in der Warteschlange")
- elseif(intid == 3) then
- -- Spectate
- elseif(intid > space and <= space+#Classes) then
- table.insert(T.QueN, pPlayer)
- T.Que[tostring(pPlayer)] = {#T.QueN, intid-space}
- pPlayer:SendBroadcastMessage("Du wurdest der Warteschlange hinzugef\195\188gt.")
- if(not Running and #T.QueN >= 2) then
- Teleport()
- end
- end
- pPlayer:GossipComplete()
- end
- local function Teleport()
- if(#T.QueN < 2) then
- return
- end
- for i = 1, 10 do
- if(not T.QueN[i] or type(T.QueN[i]) ~= "userdata" or not T.QueN[i]:GetName()) then
- table.remove(T.QueN, i)
- Teleport()
- return
- end
- end
- for i = 1, 10 do
- local x,y,z,o = T.QueN[i]:GetLocation()
- local map = T.QueN[i]:GetMapId()
- T.["Loc "..i] = {map,x,y,z,o}
- end
- T.QueN[1]:Teleport(map, x, y, z, o) -- Teleport player 1
- T.QueN[2]:Teleport(map, x, y, z, o) -- teleport player 2
- -- (10 min = 600 sec = 600000 ms)
- T.Event = CreateLuaEvent(function() End(tostring(T[1]), tostring(T[2])) end, 600000, 1)
- Running = true
- end
- function End(str1, str2)
- T[1]:Teleport(T.Loc1[1], T.Loc1[2], T.Loc1[3], T.Loc1[4], T.Loc1[5]) -- Teleport player 1 back
- T[2]:Teleport(T.Loc2[1], T.Loc2[2], T.Loc2[3], T.Loc2[4], T.Loc2[5]) -- Teleport player 2 back
- table.remove(T, 1)
- table.remove(T, 1)
- T.Que[str1] = nil
- T.Que[str2] = nil
- Running = false
- T.Teleport()
- end
- local function SpawnMinions()
- for _,Tbl in pairs(T.A.Coord) do
- PerformIngameSpawn(1, A_Minion, Tbl[1], Tbl[2], Tbl[3], Tbl[4], Tbl[5], faction, 0, equip1, equip2, equip3, instanceid, 0)
- end
- for _,Tbl in pairs(T.B.Coord) do
- PerformIngameSpawn(1, B_Minion, Tbl[1], Tbl[2], Tbl[3], Tbl[4], Tbl[5], faction, 0, equip1, equip2, equip3, instanceid, 0)
- end
- end
- local function SuperMinions(Team, pUnit)
- pUnit:Despawn(0, 60000)
- Team.Super = true
- CreateLuaEvent(function() Team.Super = false end, 60000, 1)
- end
- local function EndGame(Winner)
- if(Winner == A or Winner == B) then
- Announce(A, "Team A gewinnt!", nil)
- Announce(B, "Team B gewinnt!", nil)
- else
- Announce(A, "Verloren!", nil)
- Announce(B, "Verloren!", nil)
- end
- end
- local function Announce(team, message, Broad)
- if(Broad == true or Broad == nil) then
- for _,player in ipairs(team) do
- player:SendBroadcastMessage(message)
- end
- end
- if(Broad == false or Broad == nil) then
- for _,player in ipairs(team) do
- player:AreaTriggerMessage(message)
- end
- end
- end
- local Entry = 12345
- RegisterUnitGossipEvent(Entry, 1, Hello)
- RegisterUnitGossipEvent(Entry, 2, Select)
- RegisterUnitEvent(A_Nexus, 1, function() Announce(A, "Der Nexus wird angegriffen!", true) end)
- RegisterUnitEvent(A_Nexus, 4, function() EndGame(A) end)
- RegisterUnitEvent(B_Nexus, 1, function() Announce(B, "Der Nexus wird angegriffen!", true) end)
- RegisterUnitEvent(B_Nexus, 4, function() EndGame(B) end)
- RegisterUnitEvent(A_SuperBlock, 4, function(pUnit) SuperMinions(T.A,pUnit) end)
- RegisterUnitEvent(B_SuperBlock, 4, function(pUnit) SuperMinions(T.B,pUnit) end)
League of Legends Script Preview