Bem, eu não encontrei aqui no xtibia um tutorial de um script de transform que não buga o outfit, então eu irei postar aqui o meu.
Começando, crie um arquivo .lua e renomeie como transformar e coloque em data/spells/scripts
Dentro dele, coloque isso:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 86400000)
addOutfitCondition(condition, 0, 71, 0, 0, 0, 0)
setCombatCondition(combat, condition)
ext = 1000
function onCastSpell(cid, var)
-- Transformar
if getPlayerVocation(cid) == 400 then
if getPlayerLevel(cid) >= 50 then
doPlayerSetVocation(cid,401)
doSetOutfit(cid,"79")
addEvent(tran,ext,cid)
doSendMagicEffect(getPlayerPosition(cid), 8)
else
doPlayerSendCancel(cid, "You need level 50 to the next transform.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
elseif getPlayerVocation(cid) == 401 then
if getPlayerLevel(cid) >= 100 then
doPlayerSetVocation(cid,402)
doSetOutfit(cid,"97")
addEvent(tran,ext,cid)
doSendMagicEffect(getPlayerPosition(cid), 17)
else
doPlayerSendCancel(cid, "You need level 100 to the next transform.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doPlayerSendCancel(cid, "Voce nao pode se transformar.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
end
Legenda:
Vermelho: Vocation antes de se transformar.
Laranja: Nivel para se transformar
Azul escuro: Vocation depois de se transformar.
Azul claro: Outfit da transformação.
Verde claro: Efeito da transformação.
No spells.xml, adicione a tag:
<instant name="Transformar" words="transformar" aggressive="0" params="1" lvl="1" maglv="0" mana="0" soul="0" exhaustion="1" prem="0" enabled="1" script="transformar.lua"></instant>
Agora, criei um arquivo .lua e renomeie para reverter, e então coloque em data/spells/scripts
Dentro dele, coloque:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 86400000)
addOutfitCondition(condition, 0, 71, 0, 0, 0, 0)
setCombatCondition(combat, condition)
ext = 1000
function onCastSpell(cid, var)
-- Reverter
if getPlayerVocation(cid) == 401 then
doPlayerSetVocation(cid,400)
doSetOutfit(cid,"14")
addEvent(tran,ext,cid)
doSendMagicEffect(getPlayerPosition(cid), 8)
else
doPlayerSendCancel(cid, "You can not revert.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
elseif getPlayerVocation(cid) == 402 then
doPlayerSetVocation(cid,401)
doSetOutfit(cid,"79")
addEvent(tran,ext,cid)
doSendMagicEffect(getPlayerPosition(cid), 8)
else
doPlayerSendCancel(cid, "You can not revert.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doPlayerSendCancel(cid, "Voce nao pode reverter.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
end
Legenda:
Vermelho: Vocation da transform
Azul Escuro: Vocation que ele vai virar depois de reverter.
Azul claro: Outfit de quando ela dá reverter. Se o personagem vai do outfit 75 para o 80 no transformar desse nível, você coloca o número 75.
Verde claro: Efeito de quando o personagem reverte.
Agora, no spells.xml adicione a tag:
<instant name="Reverter" words="reverter" aggressive="0" params="1" lvl="1" maglv="0" mana="0" soul="0" exhaustion="1" prem="0" enabled="1" script="reverter.lua"></instant>
Créditos:
A spell "transform" que eu usei como base, de um autor desconhecido, não me lembro onde peguei, me desculpe.
Bem, é isso. []'s ^^