Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. function onUse(cid, item, frompos, item2, topos)
  2. local config = {storages = {st0 = 65528 ,st1 = 65535, st2 = 65534, st3 = 65533, st4 = 65532, st5 = 65531, st6 = 65530, st7 = 65529}, --Tem que ser a mesma da magia.lua
  3. soul = 50,
  4. message_soul = 'You do not have 50 soul points.',
  5. mp = (getCreatureMaxMana(cid) * 0.15), --- Mana---
  6. hp = (getCreatureMaxHealth(cid) * 0.20), ---Health ---
  7. duration = 30, ---Segundos---
  8. intervalo = 2, ---Intervalo das healada---
  9. magic = 28, --- magic effect que manda---
  10. message_2x = 'You are already taking effect from this item.',
  11. outfits = {
  12. [1] = {name = "Hazus",
  13. lookAddon = 0,
  14. lookType = 262,
  15. lookHead = 114,
  16. lookTypeEx = 0,
  17. lookLegs = 114,
  18. lookBody = 114,
  19. lookFeet = 114,
  20. },
  21. [2] = {name = "Kazard",
  22. lookAddon = 0,
  23. lookType = 194,
  24. lookHead = 114,
  25. lookTypeEx = 0,
  26. lookLegs = 114,
  27. lookBody = 114,
  28. lookFeet = 114,
  29. },
  30. [3] = {name = "Chronos",
  31. lookAddon = 0,
  32. lookType = 251,
  33. lookHead = 114,
  34. lookTypeEx = 0,
  35. lookLegs = 114,
  36. lookBody = 114,
  37. lookFeet = 114,
  38. },
  39. [4] = {name = "Royalty",
  40. lookAddon = 0,
  41. lookType = 309,
  42. lookHead = 114,
  43. lookTypeEx = 0,
  44. lookLegs = 114,
  45. lookBody = 114,
  46. lookFeet = 114,
  47. },
  48. },
  49. }
  50. s = math.random(1,4)
  51. local outfit_use = config.outfits[s]
  52. if getPlayerSoul(cid) >= config.soul then
  53. if getPlayerStorageValue(cid, config.storages.st7) == -1 then
  54. doPlayerAddSoul(cid, (config.soul * (-1)))
  55. local er = (config.duration / config.intervalo)
  56. function heal(cid)
  57. if isPlayer(cid) then
  58. doCreatureAddHealth(cid, config.hp)
  59. doCreatureAddMana(cid, config.mp)
  60. doSendMagicEffect(getCreaturePosition(cid), config.magic)
  61. if er >= 1 then
  62. addEvent(heal, (config.intervalo * 1000), cid)
  63. end
  64. er = er - 1
  65. end
  66. end
  67. local player_outfit_magia = getCreatureOutfit(cid)
  68. doPlayerSetStorageValue(cid, config.storages.st0, player_outfit_magia.lookAddon)
  69. doPlayerSetStorageValue(cid, config.storages.st1, player_outfit_magia.lookType)
  70. doPlayerSetStorageValue(cid, config.storages.st2, player_outfit_magia.lookHead)
  71. doPlayerSetStorageValue(cid, config.storages.st3, player_outfit_magia.lookTypeEx)
  72. doPlayerSetStorageValue(cid, config.storages.st4, player_outfit_magia.lookLegs)
  73. doPlayerSetStorageValue(cid, config.storages.st5, player_outfit_magia.lookBody)
  74. doPlayerSetStorageValue(cid, config.storages.st6, player_outfit_magia.lookFeet)
  75. doPlayerSay(cid, "MUAHAHAHA!", TALKTYPE_ORANGE_1)
  76. doRemoveItem(item.uid,1)
  77. doPlayerSendTextMessage(cid,20, "His body went into metamorphosis and now you've turned into a guardian of Olympus ("..outfit_use.name..").")
  78. er = er - 1
  79. doPlayerSetStorageValue(cid, config.storages.st7, 1)
  80. function outfit(cid)
  81. if isPlayer(cid) then
  82. doCreatureChangeOutfit(cid, player_outfit_magia)
  83. doPlayerSetStorageValue(cid, config.storages.st7, -1)
  84. end
  85. end
  86. table.remove(outfit_use, name)
  87. doCreatureChangeOutfit(cid, outfit_use)
  88. doCreatureAddHealth(cid, config.hp)
  89. doCreatureAddMana(cid, config.mp)
  90. doSendMagicEffect(getCreaturePosition(cid), config.magic)
  91. heal(cid)
  92. addEvent(outfit, (((config.duration) * 1000) + 2), cid)
  93. else
  94. doPlayerSendCancel(cid, config.message_2x)
  95. end
  96. else
  97. doPlayerSendCancel(cid, config.message_soul)
  98. end
  99. return true
  100. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement