o efeito e constante(infinito)?
[8.54] Pedido Efeito Na Vocation
By Raidou, 12 de set. de 2012 in Scripts
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou

Sim.Mais dai se ele troka de vocation.
E a nova vocation for uma da que eu botei,no script,ele muda o efeito.
E se a proxima vocation n tiver no script,ela n fica com efeito nenhum
Edited Setembro 12 by Raidou
info
Group: Lorde
Joined: 22/07/12
Posts: 2.2k
Reputation: +453
Tibia Character: Kissy

Você quer direto ou so as vezes?
info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou

Eu quero.Assim.
Vou dar um exemplo.
Eu sou vocaçao goku de dragon ball
Dai eu falo transformar.
Ele muda de vocation,e outfit.Entao quero que quando ele ficar nakela tal vocation,ele de um efeito.Que eu botarei o ID.
obs:Quero,que de pra por,varias vocations.com efeito neste script.
Obrigado.
info
Group: Conde
Joined: 04/08/12
Posts: 762
Reputation: +80

Como o outfit é próprio da vocação use esse script:
(Autor desconhecido, encontrei em meu ot):
Em data/creaturescripts/scripts crie um arquivo.lua nomeie para voceff e adicione:
function onLogin(cid)
registerCreatureEvent(cid, "EffectOutLogin")
registerCreatureEvent(cid, "OutfitEffects")
return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons})
end
local events = {}
function onOutfit(cid, old, current)
local effect = {
[138] = 40, [130] = 40, -- mage
[270] = 27,[273] = 27, -- jester
[156] = 61,[152] = 61, -- assassin
[147] = 44,[143] = 44, -- barbarian
[148] = 45,[144] = 45, -- druid
[157] = 68,[153] = 68, -- beggar
[149] = 36,[145] = 36, -- wizard
[279] = 17,[278] = 17, -- brotherwood
[137] = 39,[129] = 39, -- hunter
[141] = 66,[133] = 66, -- summoner
[142] = 34,[134] = 34, -- warrior
[155] = 31,[151] = 31, -- pirate
[158] = 46,[154] = 46, -- shaman
[288] = 6,[289] = 6, -- demonhunter
[139] = 7,[131] = 7 -- knight
}
local o,c= effect[old.lookType],effect[current.lookType]
if getPlayerAccess(cid) > 2 then return true
elseif (not o or not c or old.lookAddons <= 3 and o) then stopEvent(events[getPlayerGUID(cid)]) end
if current.lookAddons <= 3 and c then
function WalkEffect(cid, c, pos)
if not isCreature(cid) then return LUA_ERROR end
if c then frompos = getThingPos(cid)
if frompos.x ~= pos.x or frompos.y ~= pos.y or frompos.z ~= pos.z then doSendMagicEffect(frompos, c) end
events[getPlayerGUID(cid)] = addEvent(WalkEffect, 100, cid, c, frompos)
end return true end
WalkEffect(cid, c, {x=0, y=0, z=0}) end
return true
end
-Vermelho: numero da outfit e efeito (z).
Em creaturescripts.xml adicione:
<event type="login" name="EffectOutLogin" event="script" value="voceff.lua"/>
info
Group: Marquês
Joined: 22/07/12
Posts: 1.1k
Reputation: +400
Gender: Masculino
Tibia Character: Luck Oake

Ou use esse aqui que é direto no talkactions, caso o do Newtonnowtwen não for o que deseja.
-- Script by LuckOake
local tempo = 1 -- De quanto em quantos segundos sairá o efeito
local voc_ef = { -- Vocation ID / efeito
[1] = 10,
[2] = 10,
[3] = 10
}
local voc_table = voc_ef[getPlayerVocation(cid)]
function efeito(cid)
for i = 1, #voc_ef do
if getPlayerVocation(cid) ~= i then return true
end
end
doSendMagicEffect(getCreaturePos(cid), voc_table)
addEvent(efeito, tempo*1000, cid)
end
function onSay(cid, words)
efeito(cid)
return true
end
Use a tag que desejar. Não garanto que funciona, mas tente ai.
Edited Setembro 12 by LuckOake
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

Na ultima configuração se deixa sem virgula
Cria um arquivo lua chamado efeito.
local vocs = {
["Sorcerer"] = {effect = 12},
["Paladin"] = {effect = 13}
}
function onThink(cid, interval)
local voc = getPlayerVocationName(cid)
if vocs[voc] then
local efeito = vocs[voc].effect
doSendMagicEffect(getCreaturePosition(cid), efeito)
return true
end
return true
end
tag:
<event type="think" name="efe" event="script" value="efeito.lua"/>
Registra no login.lua
registerCreatureEvent(cid, "efe")
info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou

Amigo,eu nao consigui por pra funcionar olha como o meu ficou.
function onLogin(cid)
registerCreatureEvent(cid, "EffectOutLogin")
registerCreatureEvent(cid, "OutfitEffects")
return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons})
end
local events = {}
function onOutfit(cid, old, current)
local effect = {
[68] = 14, [67] = 14, -- mage
[270] = 27,[273] = 27 -- jester
}
local o,c= effect[old.lookType],effect[current.lookType]
if getPlayerAccess(cid) > 2 then return true
elseif (not o or not c or old.lookAddons <= 3 and o) then stopEvent(events[getPlayerGUID(cid)]) end
if current.lookAddons <= 3 and c then
function WalkEffect(cid, c, pos)
if not isCreature(cid) then return LUA_ERROR end
if c then frompos = getThingPos(cid)
if frompos.x ~= pos.x or frompos.y ~= pos.y or frompos.z ~= pos.z then doSendMagicEffect(frompos, c) end
events[getPlayerGUID(cid)] = addEvent(WalkEffect, 100, cid, c, frompos)
end return true end
WalkEffect(cid, c, {x=0, y=0, z=0}) end
return true
end
Se tiver algum por vocation em ves de outfit,fica melhor obrigado.
@Caotic
Nao tem como por,pra por o ID da vocation,em ves do nome?
@LuckOake
Como eu ponho ele no talkaction?
Edited Setembro 12 by Raidou
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

Ta feito
local vocs = {
[1] = {effect = 12},
[2] = {effect = 12},
[4] = {effect = 12},
[3] = {effect = 12},
[5] = {effect = 12},
[6] = {effect = 12},
[7] = {effect = 12},
[8] = {effect = 12},
[9] = {effect = 12},
[10] = {effect = 12},
[11] = {effect = 13}
}
function onThink(cid, interval)
local voc = getPlayerVocation(cid)
if vocs[voc] then
local efeito = vocs[voc].effect
doSendMagicEffect(getCreaturePosition(cid), efeito)
return true
end
return true
end
info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou

Vou testar aki,ja edito.
@Edit
Desculpe amigo,nao funcionou.
Edited Setembro 12 by Raidou
info
Group: Infante
Joined: 04/03/11
Posts: 1.6k
Reputation: +393
Tibia Character: No Have

Acabei de testar e funcionou.
Deixa eu ver como você pos
info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou

Eu botei assim:
local vocs = {
[7] = {effect = 14},
[6] = {effect = 13},
[5] = {effect = 14}
}
function onThink(cid, interval)
local voc = getPlayerVocation(cid)
if vocs[voc] then
local efeito = vocs[voc].effect
doSendMagicEffect(getCreaturePosition(cid), efeito)
return true
end
return true
end
Ae fiz que, usa a mesma tag do caotic e a tag do onlogin
local pos = getCreaturePosition(cid) function onThink(cid, interval) if getPlayerVocation(cid) == 2 then doSendMagicEffect(pos, 29) elseif getPlayerVocation(cid) == 5 then doSendMagicEffect(pos, 65) end return true end
só é ir copiando o
elseif getPlayerVocation(cid) == 5 then
doSendMagicEffect(pos, 65)
e colando antes do end, o == 5 é a vocation id e o 65 é o id do efeito
Edited Setembro 12 by Snowsz
info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou

Ae fiz que, usa a mesma tag do caotic e a tag do onlogin
local pos = getCreaturePosition(cid) function onThink(cid, interval) if getPlayerVocation(cid) == 2 then doSendMagicEffect(pos, 29) elseif getPlayerVocation(cid) == 5 then doSendMagicEffect(pos, 65) end return true end
só é ir copiando o
elseif getPlayerVocation(cid) == 5 then
doSendMagicEffect(pos, 65)
e colando antes do end, o == 5 é a vocation id e o 65 é o id do efeito
Quando eu adicionei este script.Ele nem transforma e nem reverte mais ![]()






info
Group: Banidos
Joined: 30/07/12
Posts: 279
Reputation: +16
Tibia Character: Raidou
Olá galerinha do Xtibia,hoje estou aqui para pedir um script,que provavelmente irá ficar na pasta creaturescripts.Bom agora leiam abaixo o que eu quero que o script Faça...
-Quero que quando o player se transforma nakela vocation,ele fike soltando um efeito(configurável.),e so saia,quando o player virar outra vocation,que eu n por para dar efeito.
O que quero que esteja no Script?
-Parte do script,para mim configurar,tal vocations,com tal ID de efeito.
Muito Obrigado,pela atençao.