Parabens, Acabei De Testa Aki, não deu Nenhum Error
REP+
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Sistema De Transformaçao
info
Grupo: Herói
Registrado: 25/10/11
Posts: 2.2k
Reputação: +862
Gênero: Masculino
Char no Tibia: Sociopata

info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: 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
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: 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
Grupo: Campones
Registrado: 01/12/11
Posts: 18
Reputação: +2
Char no Tibia: 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
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: 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
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: 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
Grupo: Infante
Registrado: 27/07/09
Posts: 1.5k
Reputação: +405
Char no Tibia: Gean Riot

belo script mano, vejo que você está progredindo bastante, sucesso pra ti!
vlw até a proxima =)
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: 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
Grupo: Campones
Registrado: 01/12/11
Posts: 18
Reputação: +2
Char no Tibia: BuK

Vlw, muito obrigado ae, já resolveu meu problema.. REP + ![]()
Editado Junho 13 por brunouchihakiller
info
Grupo: Campones
Registrado: 01/12/11
Posts: 18
Reputação: +2
Char no Tibia: BuK

Nao teria como configurar essa talkaction para também dar vocação (ou trocar a vocation) ? Ai sim ficaria perfeito.
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: 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
Editado Junho 14 por caotic
info
Grupo: Campones
Registrado: 19/06/12
Posts: 3
Reputação: 0
Char no Tibia: Kina Rushador

@Muito Bom Mano
REP+---------------------------------------------------------------
info
Grupo: Campones
Registrado: 14/12/10
Posts: 63
Reputação: +10
Char no Tibia: 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
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: 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.
Editado Junho 8 por caotic