srunobantana
Member
- Joined
- Oct 24, 2021
- Messages
- 42
- Reaction score
- 19
How I want the spell to behave: When the player uses this ability, they will begin a transformation process. As they evolve, a unique aura will be added with each new form, reflecting Goku's growing power. Additionally, their Magic Level will increase by +5 with each transformation, demonstrating their rise to power. However, each transformation will intensify mana consumption. If the player does not have enough mana, the transformation will be canceled, and they will return to their original form, as Goku was before using the buff, without any additional consequences.
By Google translation
Current code: It only includes the transformation process.
By Google translation
Current code: It only includes the transformation process.
LUA:
local transformations = {918, 916, 915, 914, 913} -- Looktypes de cada transformação de Goku (Super Saiyan até Super Saiyan God)
local speeches = {
"HAAAAA... HEEEEEE... HAAAAAAA!!!", -- Super Saiyan
"HAAAAAAAAA!!!", -- Super Saiyan 2
"HAAAAA... hEEE... HAAAAA... HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!", -- Super Saiyan 3
"Super Saiyan 4!!!", -- Super Saiyan 4
"GOD!!!" -- Super Saiyan God
}
local delay = 3000 -- Delay de 3 segundos entre cada transformação (em milissegundos)
local effects = {10, 11, 12, 13, 14} -- Efeitos visuais para adicionar no início de cada transformação
local epic_message = "O poder de Goku está se intensificando!" -- Mensagem épica (pode ser opcional)
local buff_duration = 10000 -- Duração da última transformação (10 segundos)
function onCastSpell(cid, var)
-- Verifica se o jogador é válido
if isPlayer(cid) then
local initialOutfit = getCreatureOutfit(cid) -- Salva o looktype inicial do jogador
-- Envia a mensagem épica para o jogador
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, epic_message)
-- Inicia o processo de transformação
for i = 1, #transformations do
-- Adiciona efeito visual de transformação
addEvent(function()
doSendMagicEffect(getCreaturePosition(cid), effects[i])
end, delay * (i - 1))
-- Adiciona a fala de transformação com efeito de magia
addEvent(function()
-- Adiciona a fala com o efeito de magia (em cor laranja e tipo mágico)
doCreatureSay(cid, speeches[i], TALKTYPE_MONSTER_SAY) -- Goku grita com efeito mágico
doCreatureChangeOutfit(cid, {lookType = transformations[i]}) -- Muda o looktype para a transformação
end, delay * (i - 1))
-- Se for a última transformação, colocamos uma fala mais épica e definimos o tempo de duração da transformação final
if i == #transformations then
addEvent(function()
doSendMagicEffect(getCreaturePosition(cid), effects[i]) -- Efeito final da transformação
doCreatureSay(cid, "Agora, meu poder está além de tudo o que você já viu! Prepare-se!", TALKTYPE_MONSTER_SAY) -- Fala épica
-- Define o tempo da transformação final (10 segundos)
addEvent(function()
-- Restaura o looktype original após o tempo de 10 segundos
doCreatureChangeOutfit(cid, {lookType = initialOutfit.lookType}) -- Retorna ao looktype original
end, buff_duration) -- O buff dura 10 segundos
end, delay * i)
end
end
end
return true
end