Ir para conteúdo
  • Cadastre-se

Healling Spell usando SoulPoints


Posts Recomendados

gs4k8Hm.png

 

Esse foi um dos meus primeiros scripts, é uma spell  (adaptada por emersonsss) de cura instantânea que utiliza Soul Points para curar o druid.

Se ele não tiver soul points e invocar a magia, a força da natureza pega a energia da vida dele e acaba não curando, o deixando no prejuízo.

 

function onCastSpell(cid, var)
if isDruid(cid) then
                if getPlayerSoul(cid) >= 100 then
                        local maxh = getCreatureMaxHealth(cid)
                doCreatureAddHealth(cid, maxh)         
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
                doPlayerAddSoul(cid, -100)
                doPlayerSendTextMessage(cid, 22, 'You used your soul successfully!')
        else
                doPlayerSendCancel(cid, "You dont have 100 soul.")
end
        else
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_POFF)
                doPlayerSendTextMessage(cid, 21, 'You are not druid, as punishment, the ancient gods will punish you removing you life.')
                doPlayerSendTextMessage(cid, 21, 'Dont try this again!')
                doCreatureAddHealth(cid, -5)
end    
return true
end

 

Em forma de comando:

 

Em data/talkactions/scripts, copie um arquivo, renomeie para druidprotection e adicione o script

function onSay(cid, words, param, channel)      
        if isDruid(cid) then
                if getPlayerSoul(cid) >= 100 then
                        local maxh = getCreatureMaxHealth(cid)
                doCreatureAddHealth(cid, maxh)         
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
                doPlayerAddSoul(cid, -100)
                doPlayerSendTextMessage(cid, 22, 'You used your soul successfully!')
        else
                doPlayerSendCancel(cid, "You dont have 100 soul.")
end
        else
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_POFF)
                doPlayerSendTextMessage(cid, 21, 'You are not druid, as punishment, the ancient gods will punish you removing you life.')
                doPlayerSendTextMessage(cid, 21, 'Dont try this again!')
                doCreatureAddHealth(cid, -5)
end    
        return true
end


Em data/talkactions/talkactions.xml adicione a tag:

    <talkaction words="!druidprotection" event="script" value="druidprotection.lua"/>

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo