Ir para conteúdo

Featured Replies

  • 11 months later...
  • Respostas 21
  • Visualizações 4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 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 getPlayerS

  • o meu é 8.54 e eu testei antes de te enviar os storages pra se mudar são nessas linhas aqui, tanto no creaturescripts como na spells e no login.lua (3482101) local config = {  storage = 3482101,

  • tá refletindo qualquer dano

Posted Images

Postado
Em 03/08/2014 ás 18:28, xWhiteWolf disse:

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


Se for editar storage tem que editar em todos os scripts

Na disto não dá nenhum erro, uso a magia e não repele nada, hit, poder.

Uso tfs 1.1 8.54, preciso muito desse script :/

EDIT--

Funcionando perfeito @xWhiteWolf, mais como aumento a quantidade de hits refletidos?

Editado por diarmaint (veja o histórico de edições)

  • 2 years later...
Postado
Em 03/08/2014 em 18:28, xWhiteWolf disse:

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


Se for editar storage tem que editar em todos os scripts

Como sempre ótimo script

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo