script muito interessante, espero que atendam.
Action que troca outfit e absorve danos
Por markindoot, 04 de out. de 2013 em Scripts
info
Grupo: Visconde
Registrado: 11/04/12
Posts: 328
Reputação: +7
Char no Tibia: ADM MiHawk

pois é, seria melhor se fosse uma action que fizesse isso e tivesse exausted para usa-la
info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun

ss exaust é 3 minutos =D
eu tava sem oq faser e fiquei tendo umas idéias locas e me surgiu essa ai =D
info
Grupo: Marquês
Registrado: 16/06/07
Posts: 1.2k
Reputação: +377
Gênero: Masculino
Char no Tibia: Nenhum

Gostei do pedido e fiz aqui, mas fiz em spell, pra ficar mais fácil de configurar. Dei uma testada e me parece tudo certo.
creaturescripts/scripts/absorb.lua
function onLogin(cid) registerCreatureEvent(cid, "absorb") if getPlayerStorageValue(cid, 871237) > os.time() then local outfitId = 8633 -- itemid que o player irá se transformar doSetItemOutfit(cid, outfitId, duration) mayNotMove(cid, true) local left = getPlayerStorageValue(cid, 871237) - os.time() addEvent(mayNotMove, left * 1000, cid, false) end return true end function onStatsChange(cid, attacker, type, combat, value) if getPlayerStorageValue(cid, 871237) < os.time() then return true end local absorb_mana_damage = "sim" -- Absorver dano na mana? sim/não absorb_mana_damage = absorb_mana_damage:lower() == "sim" and true or false if type == 1 or (absorb_mana_damage and type == 3) then local absorbed, max_absorb = getPlayerStorageValue(cid, 871236), getPlayerStorageValue(cid, 871239) if absorbed + value <= max_absorb then doSendAnimatedText(getThingPos(cid), "Absorbed!", 35) absorbed = absorbed + value setPlayerStorageValue(cid, 871236, absorbed) return false else local damage = value - (max_absorb - absorbed) doTargetCombatHealth(attacker, cid, type, -damage, -damage, 0) doSendAnimatedText(getThingPos(cid), "Broken!", 144) setPlayerStorageValue(cid, 871237, -1) return false end end return true end
tag creaturescripts.xml
<event type="login" name="absorb2" event="script" value="absorb.lua"/> <event type="statschange" name="absorb" event="script" value="absorb.lua"/>
spells/scripts/absorb.lua
function onCastSpell(cid, var) local custom_exhaust = 30 -- Em segundos, um exhaust adicional ao exhaust do spells.xml, se for necessário. Se não quiser, coloque 0 local duration = 60 -- Em segundos, período de duração do absorb local outfitId = 8633 -- itemid que o player irá se transformar local max_absorb = 5000 -- máximo que será absorvido if getPlayerStorageValue(cid, 871238) < os.time() then setPlayerStorageValue(cid, 871236, 0) setPlayerStorageValue(cid, 871239, max_absorb) setPlayerStorageValue(cid, 871237, os.time() + duration) setPlayerStorageValue(cid, 871238, os.time() + custom_exhaust) doSetItemOutfit(cid, outfitId, duration * 1000) mayNotMove(cid, true) addEvent(mayNotMove, duration * 1000, cid, false) else doPlayerSendCancel(cid, 'You are exhausted.') doSendMagicEffect(getThingPos(cid), 2) end return true end
tag spells.xml
<instant name="Absorb!" words="absorb" lvl="10" mana="300" prem="0" range="10" blockwalls="0" exhaustion="2000" needlearn="0" event="script" value="absorb.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant>
Editado Outubro 5 por omega blueheaven
info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun

manow só nao entendi essas 2 tags<br /><br /><br /><event type="login" name="Ban" event="script" value="absorb.lua"/><br /><event type="statschange" name="Banned" event="script" value="banned.lua"/><br /><br />e também nao ta absorvendo, tpw aqui tem 2 tags e 1 creature script só<br />
info
Grupo: Marquês
Registrado: 16/06/07
Posts: 1.2k
Reputação: +377
Gênero: Masculino
Char no Tibia: Nenhum

Opa, tinha deixado as tags zoadas mesmo, erro meu. Agora ajeitei: faz o seguinte, adiciona essas tags no creaturescripts.xml e salva o código (o que tá em spoiler) como absorb.lua em creaturescripts/scripts.
info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun

não está absorvendo os danos do player
manow me ajdua ae nao ta absorvendo o dano dos players, o resto ta normal
só tenta botar tambem pra quem se congelar para absorver, não atacar players
info
Grupo: Marquês
Registrado: 16/06/07
Posts: 1.2k
Reputação: +377
Gênero: Masculino
Char no Tibia: Nenhum

Achei o erro aqui, troca as tags que eu te passei por essas:
<event type="login" name="absorb2" event="script" value="absorb.lua"/> <event type="statschange" name="absorb" event="script" value="absorb.lua"/>
info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun

info
Grupo: Marquês
Registrado: 16/06/07
Posts: 1.2k
Reputação: +377
Gênero: Masculino
Char no Tibia: Nenhum

Troca o seu absorb.lua em creaturescripts/scripts por esse aqui:
function onLogin(cid) registerCreatureEvent(cid, "absorb1") registerCreatureEvent(cid, "absorb3") if getPlayerStorageValue(cid, 871237) > os.time() then local outfitId = 8633 -- itemid que o player irá se transformar doSetItemOutfit(cid, outfitId, duration) mayNotMove(cid, true) local left = getPlayerStorageValue(cid, 871237) - os.time() addEvent(mayNotMove, left * 1000, cid, false) end return true end function onStatsChange(cid, attacker, type, combat, value) if getPlayerStorageValue(cid, 871237) < os.time() then return true end local absorb_mana_damage = "sim" -- Absorver dano na mana? sim/não absorb_mana_damage = absorb_mana_damage:lower() == "sim" and true or false if type == 1 or (absorb_mana_damage and type == 3) then local absorbed, max_absorb = getPlayerStorageValue(cid, 871236), getPlayerStorageValue(cid, 871239) if absorbed + value <= max_absorb then doSendAnimatedText(getThingPos(cid), "Absorbed!", 35) absorbed = absorbed + value setPlayerStorageValue(cid, 871236, absorbed) return false else local damage = value - (max_absorb - absorbed) doTargetCombatHealth(attacker, cid, type, -damage, -damage, 0) doSendAnimatedText(getThingPos(cid), "Broken!", 144) setPlayerStorageValue(cid, 871237, -1) return false end end return true end function onCombat(cid, target) if getPlayerStorageValue(cid, 871237) > os.time() then doPlayerSendCancel(cid, "You may not attack while absorbing damage.") return false end return true end
E adiciona essa tag no creaturescripts.xml:
<event type="combat" name="absorb3" event="script" value="absorb.lua"/>
info
Grupo: Marquês
Registrado: 16/06/07
Posts: 1.2k
Reputação: +377
Gênero: Masculino
Char no Tibia: Nenhum

Tópico movido para a seção de dúvidas e pedidos resolvidos.





info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun
Falae Galera do Xtibia
Não sei se issu seria uma Action,
vou explicar como seria:
1 player ta quase morrendo para uns outros 3 e ele diz !Absorb e na hora ele se transforma em um crystal
por 15 segundos e absorve todos os danos ( de 1 a 5000) quando alguem atacar ele, aparece um text Absorb e no Default diz assim: Voce Absorveu (tanto de dano) que o player acerta dependendo da spell, por exemplo a voodoo wand hita uns 40, se o player estiver com !absorb ativado ele vai absorver os 40 de dano e mostra no default :Voce Absorveu 40 de dano!
e subindo o text absorv até acabar o tempo.
Obs: o player terá de ficar Imovel, não se mover para nenhum sqm, ficar parado no local quando usar o comando !Absorb.
Quando acabar o tempo ele volta ao normal e pode tomar dano novamente e só poderá usar o comando em 3 minutos.
Abraço.