Postado Abril 30, 2019 6 anos 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"/>
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.