Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.07 KB | None | 0 0
  1. local t, player = {
  2.    
  3. pedestals = {
  4.        
  5. {x=2779, y=1316, z=2}, 
  6. {x=2780, y=1316, z=2}
  7.     },
  8.    
  9. newPos = {
  10.        
  11. {x=2758, y=1335, z=3},
  12. {x=2756, y=1337, z=3}
  13.     },
  14.    
  15. area = {
  16.        
  17. fromX = 2752, toX = 1327,
  18. fromY = 2772, toY = 1342,
  19.        
  20. z = 3
  21.     },
  22.    
  23. storageDone = 4767,
  24. level = 120
  25. },
  26. {0, 0}
  27.  
  28.  
  29.  
  30. function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
  31.    
  32. local creaturesList = {}
  33.    
  34. for x = -radiusx, radiusx do
  35.        
  36. for y = -radiusy, radiusy do
  37.            
  38. if not (x == 0 and y == 0) then
  39.                
  40. creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
  41.    
  42. if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
  43.  
  44. table.insert(creaturesList, creature.uid)
  45.                
  46. end
  47.            
  48. end
  49.        
  50. end
  51.    
  52. end
  53.  
  54.    
  55. local creature = getTopCreature(position)
  56.    
  57. if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
  58.        
  59. if not(table.find(creaturesList, creature.uid)) then
  60.            
  61. table.insert(creaturesList, creature.uid)
  62.        
  63. end
  64.    
  65. end
  66.    
  67. return creaturesList
  68. end
  69.  
  70. function Wave1()
  71.        
  72. doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 2768, y = 1335, z = 3})), CONST_ME_TELEPORT)
  73.    
  74. doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 2768, y = 1339, z = 3})), CONST_ME_TELEPORT)
  75.    
  76. addEvent(Wave2, 30 * 1000)
  77. end
  78.  
  79. function Wave2()
  80.        
  81. doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 2768, y = 1334, z = 3})), CONST_ME_TELEPORT)
  82.    
  83. doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x = 2768, y = 1339, z = 3})), CONST_ME_TELEPORT)
  84.    
  85. addEvent(Wave3, 35 * 1000)
  86. end
  87.  
  88. function Wave3()
  89.        
  90. doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 2768, y = 1334, z = 3})), CONST_ME_TELEPORT)
  91.    
  92. doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 2768, y = 1339, z = 3})), CONST_ME_TELEPORT)
  93.    
  94. addEvent(Wave4, 40 * 1000)
  95. end
  96.  
  97. function Wave4()
  98.        
  99. doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 2768, y = 1334, z = 3})), CONST_ME_TELEPORT)
  100.    
  101. doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 2768, y = 1339, z = 3})), CONST_ME_TELEPORT)
  102.    
  103. addEvent(Wave5, 40 * 1000)
  104. end
  105.  
  106. function Wave5()
  107.        
  108. doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 2768, y = 1334, z = 3})), CONST_ME_TELEPORT)
  109.    
  110. addEvent(Wave6, 40 * 1000)
  111. end
  112.  
  113. function Wave6()
  114.        
  115. doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 2768, y = 1334, z = 3})), CONST_ME_TELEPORT)
  116.    
  117. doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 2768, y = 1339, z = 3})), CONST_ME_TELEPORT)
  118.        
  119. doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 2768, y = 1338, z = 3})), CONST_ME_TELEPORT)
  120.    
  121. addEvent(Wave7, 40 * 1000)
  122. end
  123.  
  124. function Wave7()
  125.    
  126. doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 2768, y = 1339, z = 3})), CONST_ME_TELEPORT)
  127.  
  128. end
  129.  
  130.  
  131.  
  132. function onUse(cid, item, fromPosition, itemEx, toPosition)
  133.    
  134. local failed = false
  135.    
  136. for i = 1, #t.pedestals do
  137.        
  138. player[i] = getTopCreature(t.pedestals[i]).uid
  139.        
  140. if(not(player[i] > 0 and isPlayer(player[i]) == TRUE and getPlayerStorageValue(player[i], t.storageDone) < 1 and getPlayerLevel(player[i]) >= t.level)) then
  141.            
  142. failed = true
  143.            
  144. break
  145.        
  146. end
  147.    
  148. end
  149.    
  150. if not failed then
  151.        
  152. if #getCreaturesInRange({x=2762, y=1338,z=3}, 10, 9, FALSE, TRUE) > 0 then
  153.            
  154. doPlayerSendTextMessage(cid,25, "Aguarde, há pessoas na arena agora.")
  155.            
  156. return true
  157.        
  158. end
  159.        
  160. for i = 1, #player do
  161.            
  162. doTeleportThing(player[i], t.newPos[i])
  163.        
  164. end
  165.        
  166. Wave1()
  167.        
  168. doTransformItem(item.uid, 1946)
  169.    
  170. else
  171.        
  172. doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
  173.    
  174. end
  175.    
  176. return true
  177.  
  178. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement