Advertisement
Guest User

Untitled

a guest
May 29th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.76 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="xtibia.com" enabled="yes">
  3. <config name="raids_func"><![CDATA[
  4. days = {
  5. ["Monday"] = {
  6. ["21:45"] = {nome = "Pirate", pos = {fromPosition = {x=1909, y=598,z=4},toPosition = {x=1911, y=599, z=4}},m = {"1 Deadeye Devious","1 Ron the Ripper","1 Brutus Bloodbeard","1 Lethal Lissy","1 Captain Jones"}, Time = 300},
  7. ["01:00"] = {nome = "The Plasmother", pos = {fromPosition = {x=1175, y=986,z=8},toPosition = {x=1180, y=991, z=8}}, m = {"1 The Plasmother"}, Time = 300}
  8. },
  9. ["Tuesday"] = {
  10. ["10:30"] = {nome = "The old Window", pos = {fromPosition = {x=1697, y=867,z=9},toPosition = {x=1696, y=867, z=9}}, m = {"1 The old Window "}, Time = 300},
  11. ["22:00"] = {nome = "Massacre", pos = {fromPosition = {x=1149, y=1047,z=4},toPosition = {x=1150, y=1048, z=4}}, m = {"1 Massacre"}, Time = 300},
  12. ["17:39"] = {nome = "Massacre", pos = {fromPosition = {x=1435, y=1096,z=7},toPosition = {x=1436, y=1096, z=7}}, m = {"1 Massacre"}, Time = 300}
  13. },
  14. ["Wednesday"] = {
  15. ["20:30"] = {nome = "Morgaroth", pos = {fromPosition = {x=1685, y=1291,z=15},toPosition = {x=1684, y=1291, z=15}},m = {"1 Morgaroth"}, Time = 300},
  16. ["00:00"] = {nome = "Necropharus", pos = {fromPosition = {x=1932, y=1136,z=7},toPosition = {x=1931, y=1136, z=7}}, m = {"1 Necropharus"}, Time = 300}
  17. },
  18. ["Thursday"] = {
  19. ["23:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=1724, y=1428,z=9},toPosition = {x=1723, y=1428, z=9}},m = {"1 Ghazbaran"}, Time = 300},
  20. ["00:00"] = {nome = "Mr. Punish", pos = {fromPosition = {x=1238, y=1046,z=11},toPosition = {x=1240, y=1047, z=11}}, m = {"1 Mr. Punish"}, Time = 300}
  21. },
  22. ["Friday"] = {
  23. ["19:45"] = {nome = "Dracola", pos = {fromPosition = {x=1303, y=1001,z=9},toPosition = {x=1306, y=1002, z=9}},m = {"1 Dracola"}, Time = 300},
  24. ["00:00"] = {nome = "Mr. Punish", pos = {fromPosition = {x=1238, y=1046,z=11},toPosition = {x=1240, y=1047, z=11}}, m = {"1 Mr. Punish"}, Time = 300},
  25. },
  26. ["Saturday"] = {
  27. ["23:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=1724, y=1428,z=9},toPosition = {x=1725, y=1428, z=9}},m = {"1 Ghazbaran"}, Time = 300},
  28. ["19:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=1687, y=1006,z=8},toPosition = {x=1689, y=1006, z=8}}, m = {"1 Orshabaal"}, Time = 300},
  29. },
  30. ["Sunday"] = {
  31. ["21:00"] = {nome = "Ferumbras", pos = {fromPosition = {x=184, y=55,z=7},toPosition = {x=188, y=58, z=7}}, m = {"1 Ferumbras", "8 Fire Devil"}, Time =300},
  32. ["23:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1844, y=1332,z=13},toPosition = {x=1845, y=1332, z=13}}, m = {"1 Morgaroth"}, Time = 300},
  33. ["15:00"] = {nome = "Tiquandas Revenge", pos = {fromPosition = {x=1731, y=987,z=7},toPosition = {x=1751, y=999, z=7}}, m = {"2 Tiquandas Revenge"}, Time = 300}
  34. }
  35. }
  36. ]]></config>   
  37. <globalevent name="AutomaticRaids" interval="60" event="script"><![CDATA[
  38. domodlib('raids_func')
  39. function onThink(interval, lastExecution)
  40. hours = tostring(os.date("%X")):sub(1, 5)  
  41. tb = days[os.date("%A")][hours]
  42. if days[os.date("%A")] and tb then
  43. function removeCreature(tb)
  44. for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
  45. for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
  46. local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid
  47. if m ~= 0 and isMonster(m) then
  48. doRemoveCreature(m)
  49. end
  50. end
  51. end
  52. end
  53. doBroadcastMessage("The invasion of " .. tb.nome .. " started")
  54. for _,x in pairs(tb.m) do
  55. for s = 1, tonumber(x:match("%d+")) do
  56. pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z =tb.pos.fromPosition.z}
  57. doSummonCreature(x:match("%s(.+)"), pos)
  58. end
  59. end
  60. addEvent(removeCreature, tb.Time*60*1000, tb)
  61. end
  62. return true
  63. end
  64. ]]></globalevent>
  65. </mod>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement