Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. spells/scripts/especiais/uchihagaeshi.lua
  2.  
  3.  
  4.  
  5. local config = {
  6. storage = 3482101,
  7. cooldown = 20,
  8. effect1 = 29 --- efeito que sai qnd usa a spell
  9. }
  10.  
  11.  
  12. function onCastSpell(cid, var)
  13.  
  14. if getPlayerStorageValue(cid, config.storage) == 1 then
  15. doPlayerSendCancel(cid, "Your skill is already active.")
  16. return false
  17. end
  18.  
  19. if os.time() - getPlayerStorageValue(cid, 55694) >= config.cooldown then
  20. setPlayerStorageValue(cid, 55694, os.time())
  21. doSendMagicEffect(getCreaturePosition(cid), config.effect1)
  22. setPlayerStorageValue(cid, config.storage, 1)
  23. doPlayerSendTextMessage(cid, 27, "You activated your skill, the next damage will be reflected.")
  24. else
  25. doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55694))).." seconds.")
  26. return false
  27. end
  28.  
  29. return true
  30. end
  31. spells.xml
  32.  
  33.  
  34. <instant name="testeTK" words="naruto3" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/uchihagaeshi.lua">
  35. </instant>
  36.  
  37. creaturescripts.xml:
  38.  
  39.  
  40. <event type="statschange" name="uchihagaeshi" event="script" value="uchihagaeshi.lua"/>
  41. creaturescripts\scripts\uchihagaeshi.lua:
  42.  
  43.  
  44.  
  45.  
  46. local config = {
  47. storage = 3482101,
  48. effect1 = 17, --- efeito que sai ao dar reflect
  49. effect2 = 29 -- efeito que aparece na pessoa que levou reflect
  50. }
  51.  
  52. function onStatsChange(cid, attacker, type, combat, value)
  53. if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then
  54. if getPlayerStorageValue(cid,config.storage) == 1 and isCreature(attacker) then
  55. doSendAnimatedText(getCreaturePosition(attacker),"-"..value, 215)
  56. doCreatureAddHealth(attacker, -value, true)
  57. doCreatureSay(cid,"Uchihagaeshi!", 19)
  58. doSendMagicEffect(getCreaturePosition(cid), config.effect1)
  59. doSendMagicEffect(getCreaturePosition(attacker), config.effect2)
  60. setPlayerStorageValue(cid,config.storage, 0)
  61. return false
  62. end
  63. end
  64. return true
  65. end
  66. creaturescripts\scripts\login.lua:
  67.  
  68.  
  69.  
  70. ---------- UCHIHAGAESHI ----------------
  71. registerCreatureEvent(cid, "uchihagaeshi")
  72. if getPlayerStorageValue(cid, 3482101) ~= 0 then
  73. setPlayerStorageValue(cid, 3482101, 0)
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement