NB

Spell Ou Talkaction De Invuneravel

Por nbb147, 15 de mar. de 2012 em Scripts

tibia
script
otserv
18
3.2k
nbb147N
15 de março de 2012 às 22:42

Tipo do script: spell ou talkaction

Protocolo (versão do Tibia): 850

Servidor utilizado: tfs

Nível de experiência: mediano

Adicionais/Informações: como o nome ja diz eu quero que deer vunerabilidade ao player que usar, quando o player disser vunerable e fica invuneravel a qualquer tipow de dano.

xFkyxX
17 de março de 2012 às 23:27

pra sempre?

ZmovirZ
17 de março de 2012 às 23:36

@EDIT POSTEI NO TOPICO ERRAOD

Editado Março 18 por Zmovir

xFkyxX
17 de março de 2012 às 23:43

@UP

oq faz o spell?

VincV
18 de março de 2012 às 13:31

bom pelo que eu vi o script do zmovir n dexa ivunerave,então vo posta o meu

va em creaturescript/script crie um arquivo lua renomeio para imoratl.lua e cole isto dentro

---config
storage = 757575 --caso formuda o storage mude na talkaction tbm
st = 76765 --storage de time
players = true --ivuneravel a attacks de players true or false
creature = true --ivurenavel a attack de monstros true or false


function onStatsChange(cid, attacker, type, combat, value)
 if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, st) >= os.time then
    if type == STATSCHANGE_HEALTHLOSS then
if players == true and isPlayer(attacker) then
return false
end
if creature == true and  not isPlayer(attacker) then
return false
end
else
return true
end
end
end

feche, abra login.lua e coloque antes do ultimo end

 

registerCreatureEvent(cid, "imortal")

 

va em creaturescript.xml e coloque esta tag

 

<event type="statschange" name="imortal" event="script" value="imortal.lua"/>

 

agora vá em talkaction/script crie um arquivo lua nomeio imortal.lua e cole isto dentro(confugure comforme o que se quiser)

 

--config
storage = 75757 -- storage, se for mudar mude no creaturescript tbm
storagetime = 76765 --storage de tempo
lv = 1 --level nessesario para usar
money = 0 --dinheiro que gasta ao usar
mana = 0 --mana gasta ao usar
t = false --tem tempo de duração ture or false
time = 10 --tempo que dura em minutos,caso acima estaja como true

function onSay(cid, words, param, channel)
value = time* 1000*60+os.time()

if string.lower(param) == "on" or param == "" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
doPlayerSendTextMessage(cid, 1, "voce ja esta ivuneravel")
return true
end

if getPlayerLevel >= lv then
if doPlayerRemoveMoney(cid, money) then
if getCreatureMana(cid) >= mana and doCreatureAddMana(cid, mana) then
if t == true then setPlayerStorageValue(cid, storage, 2) setPlayerStorageValue(cid, storagetime, value)
else
setPlayerStorageValue(cid, storage, 1)
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem mana suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem dinheiro o suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem level suficiente")
end
elseif strig.lower(param) == "off" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
setPlayerStorageVlaue(cid, storage, 0)
return true
else
doPlayerSendTextMessage(cid, 1, "voce n esta com ivunerabilidade ativada")
end
else
doPlayerSendTextMessage(cid, 1, "parametro incorreto,os parametros validos são on e off")
end
return TRUE
end

 

se n funcionar ou quiser alguma alteração é so fala

 

--edit--

post avia bugado,se copio antes,copie novamente

Editado Março 18 por lordbug99

ZmovirZ
18 de março de 2012 às 19:53

mals ai eu postei no topico errado

25 de março de 2012 às 10:36

Zmovir, não é a primeira vez que você fica comentendo floods desse tipo.

Alertado em 10%.

 

Cuidado amigo.

1 mês depois...
nbb147N
06 de abril de 2012 às 13:05

cara tem como vc mudar pra so uma vocaçao usar? e tambem pra nao gastar dinheiro gastar apenas mana e soul?

VincV
06 de abril de 2012 às 14:06

pra n gastar dinheiro é so deixar 0(zero),pra vocs aki

 

 --config
storage = 75757 -- storage, se for mudar mude no creaturescript tbm
storagetime = 76765 --storage de tempo
lv = 1 --level nessesario para usar
money = 0 --dinheiro que gasta ao usar
mana = 0 --mana gasta ao usar
t = false --tem tempo de duração ture or false
time = 10 --tempo que dura em minutos,caso acima estaja como true
vocs = {1, 2, 5, 6 } --vocs que usam(no caso mages)

function onSay(cid, words, param, channel)
value = time* 1000*60+os.time()

if string.lower(param) == "on" or param == "" then
if isInArray(vocs, getPlayerVocation(cid) ) then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
doPlayerSendTextMessage(cid, 1, "voce ja esta ivuneravel")
return true
end

if getPlayerLevel >= lv then
if getPlayerMoney(cid) >= money  or money <= 0 then
if getCreatureMana(cid) >= mana and doCreatureAddMana(cid, mana) or mana <= 0 then
if t == true then
setPlayerStorageValue(cid, storage, 2)
setPlayerStorageValue(cid, storagetime, value)
doPlayerRemoveMoney(cid, money)
else
setPlayerStorageValue(cid, storage, 1)
doPlayerRemoveMoney(cid, money)
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem mana suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem dinheiro o suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem level suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "sua vocação n pode usar essa magia")
end
elseif strig.lower(param) == "off" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
setPlayerStorageVlaue(cid, storage, 0)
return true
else
doPlayerSendTextMessage(cid, 1, "voce n esta com ivunerabilidade ativada")
end
else
doPlayerSendTextMessage(cid, 1, "parametro incorreto,os parametros validos são on e off")
end
return TRUE
end

[/spoiker]

nbb147N
06 de abril de 2012 às 22:15

mais o efeito onde eu coloco??

VincV
07 de abril de 2012 às 20:33

vish nem coloquei mais facinho

 

--config
storage = 75757-- storage, se for mudar mude no creaturescript tbm 
storagetime = 76765 --storage de tempo lv = 1 --level nessesario para usar
money = 0 --dinheiro que gasta ao usar
mana = 0 --mana gasta ao usar
t = false --tem tempo de duração ture or false
time = 10 --tempo que dura em minutos,caso acima estaja como true
vocs = {1, 2, 5, 6 } --vocs que usam(no caso mages)
type = 33 --efeito
function onSay(cid, words, param, channel)
pos = getPlayerPosition(cid)
value = time* 1000*60+os.time()
if string.lower(param) == "on" or param == "" then
if isInArray(vocs, getPlayerVocation(cid) )
then if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then doPlayerSendTextMessage(cid, 1, "voce ja esta ivuneravel")
return true
end
if getPlayerLevel >= lv then if getPlayerMoney(cid) >= money  or money <= 0 then
if getCreatureMana(cid) >= mana and doCreatureAddMana(cid, mana) or mana <= 0 then
if t == true then
setPlayerStorageValue(cid, storage, 2)  
setPlayerStorageValue(cid, storagetime, value)
doPlayerRemoveMoney(cid, money)
doSendMagicEffect(pos, type)

else
doSendMagicEffect(pos, type)
setPlayerStorageValue(cid, storage, 1)
doPlayerRemoveMoney(cid, money)
doSendMagicEffect(pos, type)
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem mana suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem dinheiro o suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem level suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "sua vocação n pode usar essa magia")
end
elseif strig.lower(param) == "off" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then setPlayerStorageVlaue(cid, storage, 0)
return true
else doPlayerSendTextMessage(cid, 1, "voce n esta com ivunerabilidade ativada")
end
else
doPlayerSendTextMessage(cid, 1, "parametro incorreto,os parametros validos são on e off")
end
return TRUE 
end

se quise um efeito que fique soltando sempara até acaba so fala que eu faço,mais por hoje é só

nbb147N
07 de abril de 2012 às 23:28

ae cara deu uns erros:

 

[07/04/2012 23:18:02] luaAddOutfitCondition(). Condition not found

[07/04/2012 23:18:16] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/susanoo.lua)

[07/04/2012 23:18:19] data/talkactions/scripts/susanoo.lua:16: ')' expected near 'then'

[07/04/2012 23:18:27] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/efect.lua)

[07/04/2012 23:18:30] data/creaturescripts/scripts/efect.lua:21: 'end' expected (to close 'function' at line 4) near '<eof>'

[07/04/2012 23:18:35] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/susanoo.lua)

[07/04/2012 23:18:39] data/creaturescripts/scripts/susanoo.lua:9: ')' expected near 'then'

 

sim mais uma coisa eu queria saber se e pra colocar a parte do creaturescript.

Editado Abril 7 por nbb147

VincV
08 de abril de 2012 às 11:45
--config
storage = 75757 -- storage, se for mudar mude no creaturescript tbm
storagetime = 76765 --storage de tempo
lv = 1 --level nessesario para usar
money = 0 --dinheiro que gasta ao usar
mana = 0 --mana gasta ao usar
t = false --tem tempo de duração ture or false
time = 10 --tempo que dura em minutos,caso acima estaja como true
type = 35 --efeito

function onSay(cid, words, param, channel)
value = time* 1000*60+os.time()
pos = getCreaturerPos(cid)

if string.lower(param) == "on" or param == "" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
doPlayerSendTextMessage(cid, 1, "voce ja esta ivuneravel")
return true
end

if getPlayerLevel >= lv then
if doPlayerRemoveMoney(cid, money) then
if getCreatureMana(cid) >= mana and doCreatureAddMana(cid, mana) then
if t == true then
setPlayerStorageValue(cid, storage, 2)
setPlayerStorageValue(cid, storagetime, value)
doSendMagicEffect(pos, type)
else
setPlayerStorageValue(cid, storage, 1)
doSendMagicEffect(pos, type)
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem mana suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem dinheiro o suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem level suficiente")
end
elseif strig.lower(param) == "off" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
setPlayerStorageVlaue(cid, storage, 0)
return true
else
doPlayerSendTextMessage(cid, 1, "voce n esta com ivunerabilidade ativada")
end
else
doPlayerSendTextMessage(cid, 1, "parametro incorreto,os parametros validos são on e off")
end
return TRUE
end

nbb147N
08 de abril de 2012 às 15:11

ta dando erro :

 

[08/04/2012 15:02:05] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/susanoo.lua)

[08/04/2012 15:02:08] data/talkactions/scripts/susanoo.lua:15: ')' expected near 'then'

[08/04/2012 15:02:14] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/efect.lua)

[08/04/2012 15:02:17] data/creaturescripts/scripts/efect.lua:21: 'end' expected (to close 'function' at line 4) near '<eof>'

VincV
08 de abril de 2012 às 16:37

tenta assim, n achei o erro mais modfiquei uma linha

--config
storage = 75757 -- storage, se for mudar mude no creaturescript tbm
storagetime = 76765 --storage de tempo
lv = 1 --level nessesario para usar
money = 0 --dinheiro que gasta ao usar
mana = 0 --mana gasta ao usar
t = false --tem tempo de duração ture or false
time = 10 --tempo que dura em minutos,caso acima estaja como true
type = 35 --efeito

function onSay(cid, words, param, channel)
value = time* 1000*60+os.time()
pos = getCreaturerPos(cid)

if param == "on" or param == " " then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
doPlayerSendTextMessage(cid, 1, "voce ja esta ivuneravel")
return true
end

if getPlayerLevel >= lv then
if doPlayerRemoveMoney(cid, money) then
if getCreatureMana(cid) >= mana and doCreatureAddMana(cid, mana) then
if t == true then
setPlayerStorageValue(cid, storage, 2)
setPlayerStorageValue(cid, storagetime, value)
doSendMagicEffect(pos, type)
else
setPlayerStorageValue(cid, storage, 1)
doSendMagicEffect(pos, type)
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem mana suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem dinheiro o suficiente")
end
else
doPlayerSendTextMessage(cid, 1, "voce n tem level suficiente")
end
elseif strig.lower(param) == "off" then
if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, storagetime) >= os.time then
setPlayerStorageVlaue(cid, storage, 0)
return true
else
doPlayerSendTextMessage(cid, 1, "voce n esta com ivunerabilidade ativada")
end
else
doPlayerSendTextMessage(cid, 1, "parametro incorreto,os parametros validos são on e off")
end
return TRUE
end

o outro(creaturescript) tava faltamdo um end uhsauhsasauhsau

---config
storage = 757575 --caso formuda o storage mude na talkaction tbm
st = 76765 --storage de time
players = true --ivuneravel a attacks de players true or false
creature = true --ivurenavel a attack de monstros true or false


function onStatsChange(cid, attacker, type, combat, value)
	 if getPlayerStorageValue(cid, storage) == 1 or (getPlayerStorageValue(cid, storage) == 2 and getPlayerStorageValue(cid, st) >= os.time then
	    if type == STATSCHANGE_HEALTHLOSS then
if players == true and isPlayer(attacker) then
return false
end
if creature == true and  not isPlayer(attacker) then
return false
end
else
return true
end
end
end
end