Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.04 KB | None | 0 0
  1. --[[
  2.  * File destinado aos Exausted, separado por tables.
  3. ]]--
  4.  
  5. -- Atk = porcentagem do dano. 100 = dano original da fórmula, 70 = 30% menor do que o dano original da fórmula. Se colocar 0, só irá tirar 1 de dano
  6. -- "heal" funciona igual o atk, só muda nome pra informar que muda a cura
  7. spellsInfo =
  8. {
  9. ["air ball"] = {atk = 120},
  10. ["air barrier"] = {atk = 70, slowPercent = 30, slowTempo = 1000, duracao = 5000},
  11. ["air bomb"] = {atk = 840, segundosParaExplosao = 3},
  12. ["air boost"] = {segundos = 30},
  13. ["air burst"] = {atk = 120},
  14. ["air deflection"] = {atk = 200},
  15. ["air doom"] = {atk = 156},
  16. ["air fan"] = {atk = 130},
  17. ["air force"] = {atk = 430},
  18. ["air gust"] = {atk = 125},
  19. ["air gale"] = {atk = 345},
  20. ["air hurricane"] = {atk = 140},
  21. ["air icywind"] = {atk = 200, frozzenTime = 2000},
  22. ["air jail"] = {segundos = 4},
  23. ["air suffocation"] = {atk = 35, segundos = 3},
  24. ["air jump"] = {duracao = 5000},
  25. ["air run"] = {duracao = 30000},
  26. ["air stormcall"] = {atk = 100},
  27. ["air tempest"] = {atk = 110},
  28. ["air tornado"] = {atk = 200, segundos = 2},
  29. ["air trap"] = {segundos = 15},
  30. ["air vortex"] = {atk = 100},
  31. ["air windblast"] = {atk = 84},
  32. ["air windstorm"] = {atk = 100},
  33. ["air wings"] = {atk = 125},
  34. ["earth arena"] = {duracao = 8000},
  35. ["earth aura"] = {atk = 51, duracao = 4000},
  36. ["earth armor"] = {duracao = 10000},
  37. ["earth cataclysm"] = {atk = 350},
  38. ["earth collapse"] = {atk = 250},
  39. ["earth control"] = {atk = 115},
  40. ["earth crush"] = {atk = 110},
  41. ["earth curse"] = {atk = 650},
  42. ["earth fists"] = {atk = 132},
  43. ["earth growth"] = {atk = 290},
  44. ["earth ingrain"] = {heal = 100, segundos = 7},
  45. ["earth jump"] = {duracao = 5000},
  46. ["earth fury"] = {atk = 144},
  47. ["earth lavaball"] = {atk = 100},
  48. ["earth leech"] = {atk = 300},
  49. ["earth metalwall"] = {atk = 100},
  50. ["earth petrify"] = {atk = 260, segundos = 4},
  51. ["earth pull"] = {atk = 350},
  52. ["earth punch"] = {atk = 195},
  53. ["earth quake"] = {atk = 104},
  54. ["earth rock"] = {atk = 170},
  55. ["earth smash"] = {atk = 182},
  56. ["earth storm"] = {atk = 60},
  57. ["earth track"] = {segundos = 30},
  58. ["earth wall"] = {segundos = 10},
  59. ["fire blast"] = {atk = 130},
  60. ["fire bolt"] = {atk = 126},
  61. ["fire bomb"] = {atk = 180},
  62. ["fire cannon"] = {atk = 100},
  63. ["fire conflagration"] = {atk = 120},
  64. ["fire clock"] = {atk = 37},
  65. ["fire discharge"] = {atk = 100},
  66. ["fire explosion"] = {atk = 200},
  67. ["fire impulse"] = {segundos = 30},
  68. ["fire kick"] = {atk = 300},
  69. ["fire jump"] = {duracao = 5000},
  70. ["fire lightning"] = {atk = 455},
  71. ["fire meteor"] = {atk = 100},
  72. ["fire overload"] = {atk = 96},
  73. ["fire res"] = {segundos = 60},
  74. ["fire skyfall"] = {atk = 230},
  75. ["fire star"] = {atk = 60},
  76. ["fire striker"] = {atk = 130},
  77. ["fire thunderbolt"] = {atk = 145},
  78. ["fire thunderstorm"] = {atk = 350},
  79. ["fire voltage"] = {segundos = 60},
  80. ["fire wave"] = {atk = 220},
  81. ["fire whip"] = {atk = 115},
  82. ["fire wrath"] = {segundos = 2},
  83. ["water blizzard"] = {atk = 100},
  84. ["water bloodbending"] = {atk = 100},
  85. ["water bloodcontrol"] = {atk = 95},
  86. ["water bubbles"] = {atk = 90, bolhas = 5},
  87. ["water cannon"] = {atk = 125},
  88. ["water clock"] = {atk = 200},
  89. ["water dragon"] = {atk = 192, chanceFrozzen = 35},
  90. ["water explosion"] = {atk = 100},
  91. ["water heal"] = {heal = 300},
  92. ["water flow"] = {atk = 100},
  93. ["water jump"] = {duracao = 5000},
  94. ["water sheal"] = {heal = 300},
  95. ["water icebeam"] = {atk = 150, frozzenTime = 2000, frozzenChance = 70},
  96. ["water icebolt"] = {atk = 300, frozzenTime = 3000},
  97. ["water icegolem"] = {segundos = 60},
  98. ["water icespikes"] = {atk = 215},
  99. ["water protect"] = {duracao = 4000},
  100. ["water punch"] = {atk = 240, slowPercent = 50, slowTempo = 3000},
  101. ["water rain"] = {atk = 110},
  102. ["water regen"] = {segundos = 60, quantia = 50},
  103. ["water sregen"] = {segundos = 60, quantia = 55},
  104. ["water res"] = {segundos = 60},
  105. ["water shards"] = {atk = 30},
  106. ["water surf"] = {segundos = 30},
  107. ["water tsunami"] = {atk = 165},
  108. ["water wave"] = {atk = 115},
  109. ["water whip"] = {atk = 123}
  110. }
  111.  
  112.  
  113.  
  114.  
  115.  earthExausted = {
  116.   arena = 45,
  117.   armor = 70,
  118.   lavaball = 60,
  119.   metalwall = 90,
  120.   wall = 1,
  121.   control = 30,
  122.   crush = 3,
  123.   cataclysm = 45,
  124.   collapse = 10,
  125.   curse = 30,
  126.   growth = 9,
  127.   ingrain = 40,
  128.   jump = 12,
  129.   fury = 14,
  130.   petrify = 30,
  131.   pull = 4,
  132.   punch = 4,
  133.   push = 2,
  134.   quake = 45,
  135.   rock = 3,
  136.   aura = 45,
  137.   fists = 15,
  138.   recover = 2,
  139.   storm = 45,
  140.   smash = 7,
  141.   spikes = 5,
  142.   leech = 3,
  143.   track = 30,
  144.   searcher = 5
  145. }
  146.  
  147.  
  148. fireExausted = {
  149.   whip = 2,
  150.   recover = 2,
  151.   lightning = 8,
  152.   thunderbolt = 12,
  153.   explosion = 25,
  154.   thunderstorm = 30,
  155.   wave = 3,
  156.   blast = 2,
  157.   bolt = 10,
  158.   jump = 12,
  159.   skyfall = 10,
  160.   star = 25,
  161.   impulse = 30,
  162.   focus = 60,
  163.   meteor = 45,
  164.   bomb = 20,
  165.   overload = 30,
  166.   wrath = 20,
  167.   cannon = 8,
  168.   striker = 45,
  169.   discharge = 60,
  170.   conflagration = 90,
  171.   res = 60,
  172.   voltage = 120,
  173.   kick = 3,
  174.   clock = 20,
  175.   searcher = 5
  176. }
  177.  
  178.  
  179.  waterExausted = {
  180.   whip = 2,
  181.   recover = 2,
  182.   explosion = 2,
  183.   heal = 3,
  184.   iceSpikes = 15,
  185.   clock = 45,
  186.   blizzard = 60,
  187.   bloodBending = 90,
  188.   icebolt = 20,
  189.   jump = 12,
  190.   wave = 3,
  191.   fang = 1,
  192.   cannon = 8,
  193.   regen = 45,
  194.   mregen = 15,
  195.   flow = 30,
  196.   iceBeam = 10,
  197.   iceGolem = 120,
  198.   surf = 30,
  199.   punch = 6,
  200.   bloodControl = 45,
  201.   dragon = 25,
  202.   rain = 45,
  203.   protect = 65,
  204.   tsunami = 45,
  205.   res = 60,
  206.   bubbles = 12,
  207.   searcher = 5,
  208.   shards = 12
  209. }
  210.  
  211.  
  212.  airExausted = {
  213.   recover = 2,
  214.   run = 40,
  215.   ball = 1,
  216.   burst = 2,
  217.   force = 4,
  218.   windstorm = 45,
  219.   barrier = 40,
  220.   bomb = 30,
  221.   gust = 6,
  222.   fan = 30,
  223.   wings = 14,
  224.   icywind = 20,
  225.   gale = 15,
  226.   jump = 12,
  227.   jail = 35,
  228.   suffocation = 35,
  229.   boost = 30,
  230.   hurricane = 13,
  231.   trap = 12,
  232.   doom = 45,
  233.   stormcall = 45,
  234.   vortex = 60,
  235.   deflection = 90,
  236.   searcher = 5,
  237.   tornado = 20,
  238.   tempest = 25,
  239.   windblast = 20
  240. }
  241.  
  242. function blockPlayerUseMagic(cid, time)
  243.   return setPlayerStorageValue(cid, "playerBlockMagic", os.time()+time)
  244. end
  245.  
  246. function getPlayerBlockMagic(cid)
  247.   return getPlayerStorageValue(cid, "playerBlockMagic") > os.time()
  248. end
  249.  
  250. --[[function getPlayerExaust(cid, element, spellName)
  251.   if isMonster(cid) then
  252.     return true
  253.   end
  254.  
  255.   local storageString, strError = "exausted"..element..spellName, nil
  256.   local currentTime, delayTime = os.time(), getPlayerStorageValue(cid, storageString)
  257.  
  258.   if delayTime >= currentTime then
  259.     local stringTime = getSecsString(delayTime-currentTime)
  260.     local tableTime = getTimeInString(delayTime)
  261.  
  262.     if tonumber(tableTime.second) >= 1 then
  263.       strError = getLangString(cid, "You need wait "..stringTime.." to use this fold again.", "Você precisa esperar "..stringTime.." para usar essa dobra novamente.")
  264.     else
  265.       strError = getLangString(cid, "You need wait a few moments to use this fold again.", "Você precisa esperar alguns instantes para usar essa dobra novamente.")
  266.     end
  267.  
  268.     doPlayerSendCancelEf(cid, strError)
  269.     return false
  270.   end
  271.   return true
  272. end]]--
  273.  
  274.  
  275. function doPlayerAddExaust(cid, element, spellName, time)
  276.   if isMonster(cid) then
  277.     return true
  278.   end
  279.  
  280.  --[[ if getPlayerSkullType(cid) > 3 then
  281.     if time == 0 then
  282.       time = 1
  283.     end
  284.     time = time*2
  285.   end]]
  286.  
  287.   if getPlayerStorageValue(cid, "timeInEffectCdReduction") > os.time() then
  288.     if time >= 5 then
  289.       time = math.ceil(time-(time*0.3))
  290.     end
  291.   end
  292.  
  293.   if getPlayerStorageValue(cid, 13403) == 1 then
  294.     if time >= 5 then
  295.       time = math.ceil(time-(time*0.08))
  296.     end
  297.   end
  298.  
  299.   if time == nil then
  300.     print("problem with spellExausted name "..spellName.." in element "..element)
  301.     doPlayerSendCancelEf(cid, "Error with this spell, report to gameMaster.")
  302.     sendBlueMessage(cid, "Error with this spell, report to gameMaster." )
  303.     return false
  304.   elseif time == 0 then
  305.     sendCDToClient(cid, element, spellName, 1)
  306.     return true
  307.   end
  308.  
  309.   if not getPlayerExaust(cid, element, spellName) then
  310.     return false
  311.   end
  312.  
  313.   sendCDToClient(cid, element, spellName, time)
  314.   setPlayerStorageValue(cid, "exausted"..element..spellName, os.time()+time)
  315.   return true
  316. end
  317.  
  318.  
  319. function canUseWaterSpell(cid, countWater, distance, onlyAmbient)
  320.   local fullPouchId = 4864
  321.   local emptyPouchId = 4863
  322.  
  323.   if isMonster(cid) then
  324.     return true
  325.   end
  326.  
  327.   if getPlayerCanUseAmbientWater(cid, distance) == true then
  328.     doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, getLangString(cid, "Using ambient water.", "Usando água ambiente."))
  329.     return true
  330.   end
  331.  
  332.   if onlyAmbient == true then
  333.     doPlayerSendCancelEf(cid, getLangString(cid, "This fold requires a lot of water, only ambient water.", "Essa dobra requer uma grande quantidade de água, apenas água ambiente."))
  334.     return false
  335.   end
  336.  
  337. --  local waterPouch, pouchWater = getPlayerSlotItem(cid, 10), nil
  338.   local waterPouch, pouchWater = getPlayerItemById(cid, true, 4864), nil
  339.  
  340.   if waterPouch.uid > 0 then
  341.     pouchWater = getItemAttribute(waterPouch.uid, "water")
  342.   end
  343.  
  344.   if pouchWater == nil then
  345.     if waterPouch.uid > 0 and (waterPouch.itemid == fullPouchId or waterPouch.itemid == emptyPouchId) then
  346.       doItemSetAttribute(waterPouch.uid, "water", 0)
  347.     end
  348.     doPlayerSendCancelEf(cid, getLangString(cid, "To use this fold you need a water source.", "Para usar essa dobra, você precisa de uma fonte de água."))
  349.     return false
  350.   end
  351.   local waterPouchCount = getPlayerItemCount(cid, 4864)
  352.   if waterPouch.itemid == fullPouchId then
  353.     if pouchWater < countWater then
  354.       setWaterOnPounchPlayer(cid, 0, waterPouch)
  355.       doPlayerSendCancel(cid, getLangString(cid, "The water we had was not enough to fold and was discarded.", "Essa água não serve para essa dobra, portanto, ela foi descartada."))
  356.       doDecayItem(doCreateItem(2017, getCreaturePosition(cid)))
  357.       return false
  358.     elseif pouchWater == countWater then
  359.       setWaterOnPounchPlayer(cid, 0, waterPouch)
  360.         if waterPouchCount <= 1 then
  361.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getLangString(cid, "Using water pounch, your water pouch dried.", "Usando water pouch, acabou a água."))
  362.         else
  363.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getLangString(cid, "One water pouch dried, you now have "..(waterPouchCount-1).." more.", "Um water pouch secou, você tem mais "..(waterPouchCount-1).."."))
  364.         end
  365.       return true
  366.     else
  367.       setWaterOnPounchPlayer(cid, pouchWater-countWater, waterPouch)
  368.         if waterPouchCount <= 1 then
  369.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getLangString(cid, "Using last water pounch ("..pouchWater.."%).", "Usando último water pouch ("..pouchWater.."%)."))
  370.         else
  371.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, getLangString(cid, "Using one ("..pouchWater.."%) of "..waterPouchCount.." water pounchs.", "Usando um ("..pouchWater.."%) de "..waterPouchCount.." water pouchs."))
  372.         end
  373.       return true
  374.     end
  375.   else
  376.     doPlayerSendCancelEf(cid, getLangString(cid, "To use this fold you need a water source.", "Para usar essa dobra, você precisa de uma fonte de água."))
  377.     return false
  378.   end
  379. end
  380.  
  381. function getSpellCancels(cid, spellName, isFury)
  382.   if isMonster(cid) then
  383.     return false
  384.   end
  385.  
  386.   if getCreatureNoMove(cid) or exhaustion.check(cid, "airtrapped") then
  387.     doPlayerSendCancelEf(cid, getLangString(cid, "You are unable to bend now.", "Você não pode dobrar agora."))  
  388.     return true
  389.   end
  390.   if getPlayerStorageValue(cid, "playerCantDown") == 1 and not isFury then
  391.     doPlayerSendCancelEf(cid, getLangString(cid, "You are unable to bend flying.", "Você não pode dobrar voando."))  
  392.     return true
  393.   end
  394.   if spellName == "earth" or spellName == "fire" then
  395.     --if getPlayerInWater(cid) == true then
  396.       --doPlayerSendCancelEf(cid, getLangString(cid, "You can't use this bend on water.", "Você não pode usar essa dobra na água."))
  397.       --return true
  398.     --end
  399.     if getPlayerStorageValue(cid, "playerOnAir") == 1 then
  400.       doPlayerSendCancelEf(cid, getLangString(cid, "You can't use this bend on air.", "Você não pode usar essa dobra no ar."))
  401.       return true
  402.     end
  403.     return false
  404.  
  405.   elseif spellName == "fire" then
  406.     --if getPlayerInWater(cid) == true then
  407.       --doPlayerSendCancelEf(cid, getLangString(cid, "You can't use this bend on water.", "Você não pode usar essa dobra na água."))
  408.       --return true
  409.     --end
  410.     return false
  411.  
  412.   elseif spellName == "water" then
  413.     if getPlayerStorageValue(cid, "playerOnAir") == 1 then
  414.       doPlayerSendCancelEf(cid, getLangString(cid, "You can't use this bend on air.", "Você não pode usar essa dobra no ar."))
  415.       return true
  416.     end
  417.     return false
  418.   elseif spellName == "air" then
  419.     return false
  420.   end
  421. end
  422.  
  423. function setPlayerOverPower(cid, element, time)
  424.   setPlayerStorageValue(cid, element.."overPower", os.time()+time)
  425. end
  426.  
  427. function getPlayerOverPower(cid, element, disable, animatedText)
  428.   if isMonster(cid) then
  429.     return false
  430.   end
  431.  
  432.   local time = getPlayerStorageValue(cid, element.."overPower")
  433.   if disable == true then
  434.     setPlayerStorageValue(cid, element.."overPower", 0)
  435.   end
  436.   if os.time() < time then
  437.     if animatedText == true then
  438.       doSendAnimatedText(getThingPos(cid), "Focused!", COLOR_DARKRED)
  439.     end
  440.     return true
  441.   else
  442.     return false
  443.   end
  444. end
  445.  
  446. function setPlayerStuned(cid, time)
  447.   if time == nil or time == 0 or time == false then
  448.     setPlayerStorageValue(cid, "playerHasStun", 0)
  449.   else
  450.     setPlayerStorageValue(cid, "playerHasStun", os.time()+time)
  451.   end
  452. end
  453.  
  454. function getPlayerHasStun(cid)
  455.   if getPlayerStorageValue(cid, "playerHasStun") >= os.time() then
  456.     if math.random(1, 6) ~= 6 then
  457.       doSendAnimatedText(getThingPos(cid), "Miss!", COLOR_WHITE)
  458.       return true
  459.     else
  460.       return false
  461.     end
  462.   else
  463.     return false
  464.   end
  465. end
  466.  
  467. function cleanAllCds(cid, element)
  468.   local tableElement = {
  469.   ["fire"] = fireSpells,
  470.   ["water"] = waterSpells,
  471.   ["earth"] = earthSpells,
  472.   ["air"] = airSpells
  473.   }
  474.  
  475.   if tableElement[element] ~= nil then
  476.     for x = 1, #tableElement[element] do
  477.       setPlayerStorageValue(cid, "exausted"..tableElement[element][x], -1)
  478.     end
  479.     sendAllCdToClient(cid, element)
  480.     return true
  481.   end
  482.   return false
  483. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement