Unknown Heal
Introdução
Eu tava criando essa script pra participa da oms, mais não deu tempo de coloca então ta aqui.
Coloquei o nome de unknown heal porque eu não conseguir pensa em um nome pra ela. ¬¬
O que a script faz :
-Se algum monstro ou player tiver te atacando o dano se transforma em curar.
por exemplo se você toma um dano de 100 quando a magia tiver ativa esse dano de 100 vai se transforma em life
pode ser configurado.
Vamos la. xD
creaturescript: unknownheal.lua:
-- Do not remove the credits -- -- [CREATURESCRIPT] Unknown Heal -- -- developed by Rigby -- -- Especially for the Xtibia.com -- function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then local vida = (value) -- não mecha nisso local retira = 1 -- 1 vai absorve o life todo , 2 vai obsorve metade do life if (getPlayerStorageValue(cid, 54654644) == 1) then doCreatureAddHealth(cid, (vida / retira)) doSendAnimatedText(getCreaturePosition(cid), "+"..(vida / retira).."!", 25) return false end end return true end function onLogin(cid) doPlayerSetStorageValue(cid, 54654644, -1) return true end
<event type="Login" name="unknownheal" event="script" value="unknownheal.lua"/> <event type="StatsChange" name="unknownheal2" event="script" value="unknownheal.lua"/>
registerCreatureEvent(cid, "unknownheal")
-- Do not remove the credits -- -- [SPELL] Unknown Heal -- -- developed by Rigby -- -- Especially for the Xtibia.com -- local tempo = 5 -- quanto tempo a magia vai durar local timer = 5 -- quantos segundos em segundo vai pode usa a magia -- obs:so vai começa a conta quando a magia tiver terminado local effect = 28 -- efeito da magia local storage = 1231234343 local storagemag = 54654644 -- não mecha function onCastSpell(cid, var) if getPlayerStorageValue(cid, storagemag) == -1 then if getPlayerStorageValue(cid, storage) < os.time () then setPlayerStorageValue(cid, storagemag, 1) doSendMagicEffect(getThingPos(cid), 28) setPlayerStorageValue(cid, storage, os.time () + tempo + timer) addEvent(termina, tempo*1000, cid) else doPlayerSendCancel(cid, "Voce so pode usar esse magia daqui a "..getPlayerStorageValue(cid, storage) - os.time ().." segundos.") end else doPlayerSendCancel(cid, "Voce ja ta usando a magia.") end return true end function termina(cid) setPlayerStorageValue(cid, storagemag, -1) doSendMagicEffect(getThingPos(cid), 29) end end
<instant name="Unknownheal" words="unknown heal" lvl="1" mana="0" prem="0" range="10" blockwalls="0" exhaustion="0" needlearn="0" event="script" value="unknownheal.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="0"/> </instant>
Bug Ageitado funcionando 100%