Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spells/scripts/especiais/uchihagaeshi.lua
- local config = {
- storage = 3482101,
- cooldown = 20,
- effect1 = 29 --- efeito que sai qnd usa a spell
- }
- function onCastSpell(cid, var)
- if getPlayerStorageValue(cid, config.storage) == 1 then
- doPlayerSendCancel(cid, "Your skill is already active.")
- return false
- end
- if os.time() - getPlayerStorageValue(cid, 55694) >= config.cooldown then
- setPlayerStorageValue(cid, 55694, os.time())
- doSendMagicEffect(getCreaturePosition(cid), config.effect1)
- setPlayerStorageValue(cid, config.storage, 1)
- doPlayerSendTextMessage(cid, 27, "You activated your skill, the next damage will be reflected.")
- else
- doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55694))).." seconds.")
- return false
- end
- return true
- end
- spells.xml
- <instant name="testeTK" words="naruto3" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/uchihagaeshi.lua">
- </instant>
- creaturescripts.xml:
- <event type="statschange" name="uchihagaeshi" event="script" value="uchihagaeshi.lua"/>
- creaturescripts\scripts\uchihagaeshi.lua:
- local config = {
- storage = 3482101,
- effect1 = 17, --- efeito que sai ao dar reflect
- effect2 = 29 -- efeito que aparece na pessoa que levou reflect
- }
- function onStatsChange(cid, attacker, type, combat, value)
- if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then
- if getPlayerStorageValue(cid,config.storage) == 1 and isCreature(attacker) then
- doSendAnimatedText(getCreaturePosition(attacker),"-"..value, 215)
- doCreatureAddHealth(attacker, -value, true)
- doCreatureSay(cid,"Uchihagaeshi!", 19)
- doSendMagicEffect(getCreaturePosition(cid), config.effect1)
- doSendMagicEffect(getCreaturePosition(attacker), config.effect2)
- setPlayerStorageValue(cid,config.storage, 0)
- return false
- end
- end
- return true
- end
- creaturescripts\scripts\login.lua:
- ---------- UCHIHAGAESHI ----------------
- registerCreatureEvent(cid, "uchihagaeshi")
- if getPlayerStorageValue(cid, 3482101) ~= 0 then
- setPlayerStorageValue(cid, 3482101, 0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement