Boa, Dani!
Quero ver essa evolução nos script ae. sahuasuhsahu
Por Administrador, 19 de abr. de 2015 em Actions e Talkactions
info
Grupo: Conde
Registrado: 07/04/15
Posts: 926
Reputação: +335
Gênero: Masculino

Boa, Dani!
Quero ver essa evolução nos script ae. sahuasuhsahu
info
Grupo: Visconde
Registrado: 11/08/10
Posts: 477
Reputação: +175
Gênero: Masculino

Bem legal a ideia, seria aquela última chance para o druid que ficou na hunt até gastar a última pot e no caminho de saída apareceu alguns monstros.
Uma dica pra deixar o código mais fácil para futuras edições é colocar as checagens antes, exemplo
function onSay(cid, words, param, channel)
if not isDruid(cid) then
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!')
return doCreatureAddHealth(cid, -5)
end
if getPlayerSoul(cid) < 100 then
return doPlayerSendCancel(cid, "You dont have 100 soul.")
end
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!')
return true
end
Isso também evita que o código se pareça com esse
function onSay(cid, words, param, channel) if if if if if else end else end else end else end else end end
Para scripts pequenos não faz muita diferença, mas em scripts grandes isso ajuda bastante.
info
Grupo: Administrador
Registrado: 08/07/05
Posts: 5.8k
Reputação: +1.4k
Gênero: Outro
Druid Protection (Soul)
O que o script faz: Um druid, qualquer level, está morrendo, mas sua mana acabou e suas potions se esgotaram. Ele pode usar a proteção dos antigos druidas para encher sua vida, lhe custando 100 de alma (soul.) Se outra vocação pedir a proteção dos druidas, a mesma será punida.
Créditos: Daaniel (Luan me ajudou com 2 funções)
Obs: É meu primeiro script, como estou aprendendo, gostaria da sugestão de alguém que sabe.
Após o druid usar o comando !druidprotection:
Caso o player não for druid, acontecerá:
SCRIPT
Em data/talkactions/scripts, copie um arquivo, renomeie para druidprotection e adicione o script (PasteBin):
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 endEm data/talkactions/talkactions.xml adicione a tag:
Em forma de spell por: Emersonssss
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