Advertisement
Guest User

code

a guest
Oct 22nd, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. function onUse(cid, item, frompos, item2, topos)
  2.  
  3. --Config-->
  4. local RemovePos = {fromx = 1153, fromy = 737, fromz = 10, tox = 1173, toy = 755, toz = 10}
  5. local function RemoveMonstersInArea(area)
  6. for x = area.fromx, area.tox do
  7. for y = area.fromy, area.toy do
  8. for z = area.fromz, area.toz do
  9. monsterpos = {x=x,y=y,z=z,stackpos=253}
  10. monster = getThingFromPos(monsterpos)
  11. if isMonster(monster.uid) == true then
  12. doRemoveCreature(monster.uid)
  13. end end end end end
  14. local config = {
  15. statue_pos = {x=1164, y=746, z=10},
  16. portal_quest01_pos = {x=1164, y=755, z=10, stackpos = 2},
  17. portal_quest02_pos = {x=1165, y=757, z=9, stackpos = 2},
  18. boss = "Azerus"
  19. }
  20. --End Config-->
  21.  
  22. function Potwory1()
  23. if math.random (1,8) == 4 then
  24. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  25. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  26. doSummonCreature('Rat', {x = config.statue_pos.x, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  27. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  28. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  29. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  30. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  31. addEvent(Potwory2, 30 * 1000)
  32. else
  33. doSummonCreature('Rat', {x = config.statue_pos.x, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  34. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  35. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  36. doSummonCreature('Rat', {x = config.statue_pos.x, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  37. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  38. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  39. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  40. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  41. addEvent(Potwory2, 30 * 1000)
  42. end
  43. end
  44.  
  45. function Potwory2()
  46. doSummonCreature('Azerus3', {x = config.statue_pos.x-1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  47. doSummonCreature('Rat', {x = config.statue_pos.x, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  48. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  49. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  50. addEvent(Potwory3, 35 * 1000)
  51. end
  52.  
  53. function Potwory3()
  54. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  55. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  56. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  57. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  58. addEvent(Potwory4, 40 * 1000)
  59. end
  60.  
  61. function Potwory4()
  62. doSummonCreature('Rat', {x = config.statue_pos.x, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  63. doSummonCreature('Rat', {x = config.statue_pos.x+1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  64. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y+1, z = config.statue_pos.z, stackpos = 253})
  65. doSummonCreature('Rat', {x = config.statue_pos.x, y = config.statue_pos.y-1, z = config.statue_pos.z, stackpos = 253})
  66. doSummonCreature('Rat', {x = config.statue_pos.x-1, y = config.statue_pos.y, z = config.statue_pos.z, stackpos = 253})
  67. addEvent(NewPortal, 90 * 1000)
  68. end
  69.  
  70. function NewPortal()
  71. addEvent(RemoveAll, 60 * 1000)
  72.  
  73. end
  74.  
  75. function RemoveAll()
  76. doRemoveItem(getThingfromPos(config.portal_quest01_pos).uid,1)
  77. doRemoveItem(getThingfromPos(config.portal_quest02_pos).uid,1)
  78. end
  79.  
  80. RemoveMonstersInArea(RemovePos)
  81.  
  82. if item.uid == 11223 and getThingfromPos(config.portal_quest01_pos).itemid ~= 9772 then
  83. doCreateItem(9772,1,config.portal_quest01_pos)
  84. doCreateItem(9772,1,config.portal_quest02_pos)
  85. addEvent(Potwory1, 0)
  86. else
  87. doPlayerSendTextMessage(cid,22,"Sorry, not possible.")
  88. end
  89. return TRUE
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement