Parabens, Acabei De Testa Aki, não deu Nenhum Error
REP+
- Forums
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Sistema De Transformaçao
info
Group: Herói
Joined: 25/10/11
Posts: 2.2k
Reputation: +862
Gender: Masculino
Tibia Character: Sociopata

info
Group: Lorde
Joined: 17/01/09
Posts: 2.1k
Reputation: +395
Tibia Character: Adra Sata

bem pensado.
já vi um parecido,que utilizava spells em vez de talkaction.
parabéns, está evoluindo.
Um belo script, mas preciso de uma ajuda extra para implementar esse sistema de transformação em meu servidor 8,0.
Eu não consigo editá-lo, se possivel e não incomodo eu gostaria muito de sua ajuda.
REP + desde já !
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

Claro que eu te ajudo mais o scripts foi realizado para facil ediçao e não tem segredo e super facil.
info
Group: Campones
Joined: 01/12/11
Posts: 18
Reputation: +2
Tibia Character: BuK

Gostaria que se possível, teria como pra no lugar do Look Type, colocar Outfits diferentes para cada Sex.. Exemplo Se for Male Outfit = 1, se For Female Outfit=2...
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

Opa nao tem problema
function onSay(cid, words, param)
local transf = {
["Morte"] = {level = 1, type = "(Dark)", health = 2222, addlevel = 10, looktypemale = 300, spell = exori, addmana = 2000, looktypefemale = 300},
["Demon"] = {level = 1, type = "(Demonio)", health = 22622, addlevel = 20, looktypemale = 35, spell = exori, addmana = 1800, looktypefemale = 300},
["Dragon"] = {level = 1, type = "(Dragon)", health = 22622, addlevel = 20, looktypemale = 34, spell = exori, addmana = 1222, looktypefemale = 300}
}
if (param == nil or param == '' or param == 'lista' or param == 'list'or not transf[param]) then
local str = ""
str = str .. "Transformaçoes :\n\n"
for name, type in pairs(transf) do
str = str..name.."\n"
end
str = str .. ""
doShowTextDialog(cid, 1397, str)
return TRUE
end
local name = getCreatureName(cid)
local transflevel = transf[param].level
local transfhealth = transf[param].health
local transfaddlevel = transf[param].addlevel
local transftype = transf[param].type
local transflooktypem = transf[param].looktypemale
local transflooktypef = transf[param].looktypefemale
local transfspell = transf[param].spell
local transfmana = transf[param].addmana
local transfparam = transf[param]
if getPlayerLevel(cid) < transflevel then
doPlayerSendCancel(cid, "Voce precisa de "..transflevel.." de level para a transformação")
return true
end
if getPlayerStorageValue(cid, 26458) == 1 then
doPlayerSendCancel(cid, "Voce ja se transformo nao pode transformar")
return true
end
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+transfhealth)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doPlayerLearnInstantSpell(cid, transfspell)
doPlayerAddLevel(cid, transfaddlevel)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+transfmana)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doCreatureChangeOutfit(cid, {lookType = transflooktype})
db.executeQuery("UPDATE `players` SET `name` = '".. transftype.." "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";")
setPlayerStorageValue(cid, 26458, 1)
setPlayerStorageValue(cid, 26456, transflooktype)
if getPlayerSex(cid) == 0 then
doCreatureChangeOutfit(cid, {lookType = transflooktypef})
return true
end
if getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, {lookType = transflooktypem})
return true
end
return true
end
info
Group: Herói
Joined: 20/05/10
Posts: 3.4k
Reputation: +1.5k
Gender: Masculino

caotic porque não abriu só uma tabela e usou and?
exemplo:
look = {34,36} -- aqui na tabela
e trocava essas linhas todas:
if getPlayerSex(cid) == 0 then
doCreatureChangeOutfit(cid, {lookType = transflooktypef})
return true
end
if getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, {lookType = transflooktypem})
return true
end
por essa:
doCreatureChangeOutfit(cid, {lookType = getPlayerSex(cid) == 0 and look[1] or look[2]})
info
Group: Infante
Joined: 27/07/09
Posts: 1.5k
Reputation: +405
Tibia Character: Gean Riot

belo script mano, vejo que você está progredindo bastante, sucesso pra ti!
vlw até a proxima =)
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

ai Vokdart não lembrava desta possibilidade
Vlw
Em questão da tabela eu ia abrir apenas uma so que ia confundir nosso amigo resolvi abrir duas msn.
info
Group: Campones
Joined: 01/12/11
Posts: 18
Reputation: +2
Tibia Character: BuK

Vlw, muito obrigado ae, já resolveu meu problema.. REP + ![]()
Edited Junho 13 by brunouchihakiller
info
Group: Campones
Joined: 01/12/11
Posts: 18
Reputation: +2
Tibia Character: BuK

Nao teria como configurar essa talkaction para também dar vocação (ou trocar a vocation) ? Ai sim ficaria perfeito.
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

Prontinho coloquei vocaçao e so alterar a vocaçao pelo voc = e o id da voc~çao.
function onSay(cid, words, param)
local transf = {
["Morte"] = {level = 1, type = "(Dark)", health = 2222, addlevel = 10, looktypemale = 300, spell = exori, addmana = 2000, looktypefemale = 300, voc = 10},
["Demon"] = {level = 1, type = "(Demonio)", health = 22622, addlevel = 20, looktypemale = 35, spell = exori, addmana = 1800, looktypefemale = 300, voc = 6},
["Dragon"] = {level = 1, type = "(Dragon)", health = 22622, addlevel = 20, looktypemale = 34, spell = exori, addmana = 1222, looktypefemale = 300, voc = 8}
}
if (param == nil or param == '' or param == 'lista' or param == 'list'or not transf[param]) then
local str = ""
str = str .. "Transformaçoes :\n\n"
for name, type in pairs(transf) do
str = str..name.."\n"
end
str = str .. ""
doShowTextDialog(cid, 1397, str)
return TRUE
end
local name = getCreatureName(cid)
local transflevel = transf[param].level
local transfvoc = transf[param].voc
local transfhealth = transf[param].health
local transfaddlevel = transf[param].addlevel
local transftype = transf[param].type
local transflooktypem = transf[param].looktypemale
local transflooktypef = transf[param].looktypefemale
local transfspell = transf[param].spell
local transfmana = transf[param].addmana
local transfparam = transf[param]
if getPlayerLevel(cid) < transflevel then
doPlayerSendCancel(cid, "Voce precisa de "..transflevel.." de level para a transformação")
return true
end
if getPlayerStorageValue(cid, 26458) == 1 then
doPlayerSendCancel(cid, "Voce ja se transformo nao pode transformar")
return true
end
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+transfhealth)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doPlayerLearnInstantSpell(cid, transfspell)
doPlayerAddLevel(cid, transfaddlevel)
doPlayerSetVocation(cid, transfvoc)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+transfmana)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doCreatureChangeOutfit(cid, {lookType = transflooktype})
db.executeQuery("UPDATE `players` SET `name` = '".. transftype.." "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";")
setPlayerStorageValue(cid, 26458, 1)
setPlayerStorageValue(cid, 26456, transflooktype)
if getPlayerSex(cid) == 0 then
doCreatureChangeOutfit(cid, {lookType = transflooktypef})
return true
end
if getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, {lookType = transflooktypem})
return true
end
return true
end
Edited Junho 14 by caotic
info
Group: Campones
Joined: 19/06/12
Posts: 3
Reputation: 0
Tibia Character: Kina Rushador

@Muito Bom Mano
REP+---------------------------------------------------------------
info
Group: Campones
Joined: 14/12/10
Posts: 63
Reputation: +10
Tibia Character: Naoteinteressa

Cara poderia me ajudar ? tipo, eu queria esse script mais com duração, ex: eu uso o /transf Dragon, ai transforma em dragon por 10 minutos, dps volta o outfit e nome normal, tem como fazer isso?




info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have
Ao player dizer a talk ele se transforma ele ganha skills(health,mana e level) ganha looktype(Que fica permanente ao player ou seja mesma que ele mude o outfit ele continuara com o looktype da transformaçao) ganha spell e modificaçao no nome do tipo de transformaçao ele exemplo ((Dragon) Caotic) sendo que so pode usar apenas uma vez.
Resumidando tudo e uma sub-vocation.
Para instalo va em talkactions/scripts e crie um arquivo LUA chamado transf e coloque este script dentro:
Coloque esta tag em talkations.xml
Agora vá em CreatureScripts/scripts e crie um arquivo LUA chamado transf e coloque isto
Agora va em creaturescripts/creaturescripts.xml e coloque esta tag:
Registre o evento colocando isto em creaturescripts/scripts/ abra login.lua e coloque antes do ultimo Return:
Para transformar so dizer /transf(e o nome da transformaçao)
Se quiser ver a lista /transf(lista ou list ou qualquer outra palavra desde que nao seja alguma transformaçao)
Vamos apreder a adicionar novas transformaçoes:
["Morte"] = {level = 1, type = "(Dark)",health = 2222, addlevel = 10, looktype = 300, spell = exori, addmana = 2000},
Atençao deixe sem virgula o a ultima linha de configuraça
O looktype e permanete e sendo que a transformaçao so pode ser usado apenas uma vez uma estrategia e subir de level e fazer a transformaçao mais tarde para ganhar uma Creature.
O script tem uma storage ou seja se voce quiser fazer uma verificaçao da transformaçao para ganhar um item ou apenas aquela transformaçao passar na porta entre outros.
Edited Junho 8 by caotic