1. --[[Created by DediShot]]--
  2. local A_Minion = 190001
  3. local A_Super_minion = 190004
  4. local A_Nexus = 190002
  5. local A_DefTower = 190003
  6. local A_SuperBlock = 190005
  7. local A_Store = 190006
  8. local B_Minion = 190001
  9. local B_Super_minion = 190004
  10. local B_Nexus = 190002
  11. local B_DefTower = 190003
  12. local B_SuperBlock = 190005
  13. local B_Store = 190006
  14. local BEAKON = 190010
  15. local A,B = 1, 0 -- 0 = Allianz, 0 = Horde
  16. local Faction1, Faction2 = 998, 999
  17. local Classes =
  18. {
  19. {"Warrior", 11, 15}, -- Klasse & Spells
  20. {"Mage", 11, 15},
  21. }
  22. local space = 100
  23. local T = {Selected = {}, Que = {},QueA = {},QueB = {}, A = {Super = false, Coord = {}}, B = {Super = false, Coord = {}}}
  24. local Running = false
  25. T.A.Coord.Minion1 = {map,x,y,z,o}
  26. T.A.Coord.Minion2 = {map,x,y,z,o}
  27. T.A.Coord.Minion3 = {map,x,y,z,o}
  28. T.A.Coord.Minion4 = {map,x,y,z,o}
  29. T.B.Coord.Minion1 = {map,x,y,z,o}
  30. T.B.Coord.Minion2 = {map,x,y,z,o}
  31. T.B.Coord.Minion3 = {map,x,y,z,o}
  32. T.B.Coord.Minion4 = {map,x,y,z,o}
  33. local function Hello(pUnit, event, pPlayer)
  34. pUnit:GossipCreateMenu(100, pPlayer, 0)
  35. if(tostring(pUnit:GetTeam()) == A) then
  36. pUnit:GossipMenuAddItem(0, "Wartend: "..(#T.QueA), 0, 0, '', 0)
  37. else
  38. pUnit:GossipMenuAddItem(0, "Wartend: "..(#T.QueB), 0, 0, '', 0)
  39. end
  40. if(not T.Que[tostring(pPlayer)]) then
  41. pUnit:GossipMenuAddItem(0, "Warteschlange betreten", 4, 0, '', 0)
  42. else
  43. pUnit:GossipMenuAddItem(0, "Warteschlange verlassen", 2, 0, 'Warteschlange verlassen?', 0)
  44. end
  45. if(Running) then
  46. pUnit:GossipMenuAddItem(0, "Zuschauen", 3, 0, '', 0)
  47. end
  48. pUnit:GossipSendMenu(pPlayer)
  49. end
  50. local function Select(pUnit, event, pPlayer, id, intid, code)
  51. if(intid == 0) then
  52. T.Hello(pUnit, event, pPlayer)
  53. return
  54. elseif(intid == 4) then
  55. pUnit:GossipCreateMenu(100, pPlayer, 0)
  56. for i = 1, #Classes do
  57. pUnit:GossipMenuAddItem(0, Classes[i][1], i+space, 0, 'Bist du sicher?', 0)
  58. end
  59. pUnit:GossipMenuAddItem(7, "Zur\195\188ck..", 0, 0, '', 0)
  60. pUnit:GossipSendMenu(pPlayer)
  61. elseif(intid == 2) then
  62. table.remove(T.QueN, T.Que[tostring(pPlayer)])
  63. T.Que[tostring(pPlayer)] = nil
  64. pPlayer:SendBroadcastMessage("Du bist nun nichtmehr in der Warteschlange")
  65. elseif(intid == 3) then
  66. -- Spectate
  67. elseif(intid > space and <= space+#Classes) then
  68. table.insert(T.QueN, pPlayer)
  69. T.Que[tostring(pPlayer)] = {#T.QueN, intid-space}
  70. pPlayer:SendBroadcastMessage("Du wurdest der Warteschlange hinzugef\195\188gt.")
  71. if(not Running and #T.QueN >= 2) then
  72. Teleport()
  73. end
  74. end
  75. pPlayer:GossipComplete()
  76. end
  77. local function Teleport()
  78. if(#T.QueN < 2) then
  79. return
  80. end
  81. for i = 1, 10 do
  82. if(not T.QueN[i] or type(T.QueN[i]) ~= "userdata" or not T.QueN[i]:GetName()) then
  83. table.remove(T.QueN, i)
  84. Teleport()
  85. return
  86. end
  87. end
  88. for i = 1, 10 do
  89. local x,y,z,o = T.QueN[i]:GetLocation()
  90. local map = T.QueN[i]:GetMapId()
  91. T.["Loc "..i] = {map,x,y,z,o}
  92. end
  93. T.QueN[1]:Teleport(map, x, y, z, o) -- Teleport player 1
  94. T.QueN[2]:Teleport(map, x, y, z, o) -- teleport player 2
  95. -- (10 min = 600 sec = 600000 ms)
  96. T.Event = CreateLuaEvent(function() End(tostring(T[1]), tostring(T[2])) end, 600000, 1)
  97. Running = true
  98. end
  99. function End(str1, str2)
  100. T[1]:Teleport(T.Loc1[1], T.Loc1[2], T.Loc1[3], T.Loc1[4], T.Loc1[5]) -- Teleport player 1 back
  101. T[2]:Teleport(T.Loc2[1], T.Loc2[2], T.Loc2[3], T.Loc2[4], T.Loc2[5]) -- Teleport player 2 back
  102. table.remove(T, 1)
  103. table.remove(T, 1)
  104. T.Que[str1] = nil
  105. T.Que[str2] = nil
  106. Running = false
  107. T.Teleport()
  108. end
  109. local function SpawnMinions()
  110. for _,Tbl in pairs(T.A.Coord) do
  111. PerformIngameSpawn(1, A_Minion, Tbl[1], Tbl[2], Tbl[3], Tbl[4], Tbl[5], faction, 0, equip1, equip2, equip3, instanceid, 0)
  112. end
  113. for _,Tbl in pairs(T.B.Coord) do
  114. PerformIngameSpawn(1, B_Minion, Tbl[1], Tbl[2], Tbl[3], Tbl[4], Tbl[5], faction, 0, equip1, equip2, equip3, instanceid, 0)
  115. end
  116. end
  117. local function SuperMinions(Team, pUnit)
  118. pUnit:Despawn(0, 60000)
  119. Team.Super = true
  120. CreateLuaEvent(function() Team.Super = false end, 60000, 1)
  121. end
  122. local function EndGame(Winner)
  123. if(Winner == A or Winner == B) then
  124. Announce(A, "Team A gewinnt!", nil)
  125. Announce(B, "Team B gewinnt!", nil)
  126. else
  127. Announce(A, "Verloren!", nil)
  128. Announce(B, "Verloren!", nil)
  129. end
  130. end
  131. local function Announce(team, message, Broad)
  132. if(Broad == true or Broad == nil) then
  133. for _,player in ipairs(team) do
  134. player:SendBroadcastMessage(message)
  135. end
  136. end
  137. if(Broad == false or Broad == nil) then
  138. for _,player in ipairs(team) do
  139. player:AreaTriggerMessage(message)
  140. end
  141. end
  142. end
  143. local Entry = 12345
  144. RegisterUnitGossipEvent(Entry, 1, Hello)
  145. RegisterUnitGossipEvent(Entry, 2, Select)
  146. RegisterUnitEvent(A_Nexus, 1, function() Announce(A, "Der Nexus wird angegriffen!", true) end)
  147. RegisterUnitEvent(A_Nexus, 4, function() EndGame(A) end)
  148. RegisterUnitEvent(B_Nexus, 1, function() Announce(B, "Der Nexus wird angegriffen!", true) end)
  149. RegisterUnitEvent(B_Nexus, 4, function() EndGame(B) end)
  150. RegisterUnitEvent(A_SuperBlock, 4, function(pUnit) SuperMinions(T.A,pUnit) end)
  151. RegisterUnitEvent(B_SuperBlock, 4, function(pUnit) SuperMinions(T.B,pUnit) end)

League of Legends Script Preview