Ir para conteúdo
  • Cadastre-se

(Resolvido)Spell que da looktype por determinado tempo


Ir para solução Resolvido por Storm,

Posts Recomendados

Eu to com uma script de uma spells e eu queria que quando o player usasse ela em outro player ele desse uma LookType por x segundos

 

qual variavel eu poderia inserir na minha spells?

Link para o post
Compartilhar em outros sites

@Jociel

function onCastSpell(cid, var)

local target = getCreatureTarget(cid)
local outfit = { lookType = 10 } -- ID da looktype
local time = 10 -- Segundos que a outfit durará

      if target then
         doSetCreatureOutfit(target, outfit, time * 1000)
         return true
      end
end

 

Link para o post
Compartilhar em outros sites

@Sttorm 

Eu botei mais a magia nao pegou e nao consta nenhum erro na distro se possivel bota ai pra mim

function onCastSpell(cid, var)

local pos = getCreaturePosition(cid)
local target = getCreatureTarget(cid)
local targetpos = getCreaturePosition(target)
local tsuku ={x = 103, y = 1780, z = 7}
local alvo = {x = 103, y = 1777, z = 7}
local from1,to1 = {x=97, y=1773, z=7},{x=109, y=1785, z=7}
local from2,to2 = {x=979, y=911, z=7},{x=994, y=918, z=7}
local from3,to3 = {x=557, y=1029, z=6},{x=573, y=1044, z=6}

if isInRange(pos, from1, to1) then
doPlayerSendCancel(cid, "Você ja esta !")
return FALSE
end

if isInRange(pos, from2, to2) or isInRange(pos, from3, to3) then
doPlayerSendCancel(cid, "Você nao pode usar !")
return FALSE
end

if getTileInfo(getThingPos(cid)).pvp then
doPlayerSendCancel(cid, "Você nao pode aqui!")
return FALSE
end

if exhaustion.check(cid, 13132) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 13132) .. " segundos para usar novamente.")
return FALSE
end

local function Teleport_Player(cid)
doTeleportThing(cid, pos)
end

local function Teleport_Target(target)
doCreatureSetNoMove(target, 0)
doTeleportThing(target, targetpos)
end


local mob_player = getTopCreature({x=x, y=y, z=from1.z}).uid
if mob_player ~= 0 and isPlayer(mob_player) then
doTeleportThing(cid, pos)
end
end
end
end


local function Teleport_Target_Emergency()
for x = from1.x, to1.x do
for y = from1.y, to1.y do
end
end

if isPlayer(target) then
exhaustion.set(cid, 13132, 20)
doSendMagicEffect(alvo, 182)
doCreatureSay(cid, "...!", TALKTYPE_MONSTER)
addEvent(Teleport_Player, 15000, cid)
addEvent(Teleport_Target, 15000, target)
addEvent(Teleport_Player_Emergency, 20000)
addEvent(Teleport_Target_Emergency, 20000)
end

 

Editado por Jociel (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

@Jociel

local tempo = 60
local outfit = {lookType = 320, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}

function onCastSpell(cid, var)

local pos = getCreaturePosition(cid)
local target = getCreatureTarget(cid)
local targetpos = getCreaturePosition(target)
local tsuku ={x = 103, y = 1780, z = 7}
local alvo = {x = 103, y = 1777, z = 7}
local from1,to1 = {x=97, y=1773, z=7},{x=109, y=1785, z=7}
local from2,to2 = {x=979, y=911, z=7},{x=994, y=918, z=7}
local from3,to3 = {x=557, y=1029, z=6},{x=573, y=1044, z=6}

if isInRange(pos, from1, to1) then
doPlayerSendCancel(cid, "Você ja esta !")
return FALSE
end

if isInRange(pos, from2, to2) or isInRange(pos, from3, to3) then
doPlayerSendCancel(cid, "Você nao pode usar !")
return FALSE
end

if getTileInfo(getThingPos(cid)).pvp then
doPlayerSendCancel(cid, "Você nao pode aqui!")
return FALSE
end

if exhaustion.check(cid, 13132) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 13132) .. " segundos para usar novamente.")
return FALSE
end

local function Teleport_Player(cid)
doTeleportThing(cid, pos)
end

local function Teleport_Target(target)
doCreatureSetNoMove(target, 0)
doTeleportThing(target, targetpos)
end


local function Teleport_Player_Emergency()
for x = from1.x, to1.x do
for y = from1.y, to1.y do
local mob_player = getTopCreature({x=x, y=y, z=from1.z}).uid
if mob_player ~= 0 and isPlayer(mob_player) then
doTeleportThing(cid, pos)
end
end
end
end


local function Teleport_Target_Emergency()
for x = from1.x, to1.x do
for y = from1.y, to1.y do
local mob_target = getTopCreature({x=x, y=y, z=from1.z}).uid
if mob_target ~= 0 and isPlayer(mob_target) then
doCreatureSetNoMove(target, 0)
doTeleportThing(target, targetpos)
end
end
end
end

if isPlayer(target) then
exhaustion.set(cid, 13132, 20)
doSetCreatureOutfit(target, outfit, tempo * 1000)
doCreatureSetNoMove(target, 1)
doTeleportThing(cid,tsuku)
doTeleportThing(target,alvo)
doSendMagicEffect(alvo, 182)
doCreatureSay(cid, "...!", TALKTYPE_MONSTER)
addEvent(Teleport_Player, 15000, cid)
addEvent(Teleport_Target, 15000, target)
addEvent(Teleport_Player_Emergency, 20000)
addEvent(Teleport_Target_Emergency, 20000)
else
doPlayerSendCancel(cid, "Use apenas em players.")
end
end

 

Link para o post
Compartilhar em outros sites
  • 8 months later...

@Sttorm  Tudo bem ?  e no meu caso:  tenho looktype dos outfits do tibia correndo, citizen , wizard , beserk etc...  gostaria de fazer 1 utani gran hur ou utani hur , onde todos use a mesma magia seja utani hur ou utani gran hur. mas os looktype temporario durante a spell seja diferente para cada um  exemplo: looktype 5 to 10    looktype 11 to 16,  obs: uso tfs 1.0+

 

teria como me ajudar?

Em 27/05/2018 em 09:43, Storm disse:

@Jociel


function onCastSpell(cid, var)

local target = getCreatureTarget(cid)
local outfit = { lookType = 10 } -- ID da looktype
local time = 10 -- Segundos que a outfit durará

      if target then
         doSetCreatureOutfit(target, outfit, time * 1000)
         return true
      end
end

 

 

 

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo