Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

alguem poderia me dizer por qual motivos um volta a acender e o outro nao? sendo que os 2 scripts sao iguais? só muda action e pos?
e tb o fogo azul nao me teleport quando piso nele após deixar na ordem certa das lavancas
Segue script das 2 lavancas e do fogo azul


Fogo que nao acende
function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32313, y=31976, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(getTileItemById(p, 1946).uid, 1945)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42993 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42993 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end

fogo que acende

function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32313, y=31975, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(getTileItemById(p, 1946).uid, 1945)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42994 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42994 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end


fogo azul

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    switch1 = {x=32310, y=31975, z=13, stackpos=1}
    switch2 = {x=32310, y=31976, z=13, stackpos=1}
    switch3 = {x=32312, y=31975, z=13, stackpos=1}
    switch4 = {x=32312, y=31976, z=13, stackpos=1}
 
    switch5 = {x=32314, y=31975, z=13, stackpos=1}
    switch6 = {x=32314, y=31976, z=13, stackpos=1}
 
    getswitch1 = getThingfromPos(switch1)
    getswitch2 = getThingfromPos(switch2)
    getswitch3 = getThingfromPos(switch3)
    getswitch4 = getThingfromPos(switch4)
 
    getswitch5 = getThingfromPos(switch5)
    getswitch6 = getThingfromPos(switch6)
 if isPlayer(cid) then
    if  getswitch1.itemid == 1946 and getswitch2.itemid == 1946 and getswitch3.itemid == 1946 and getswitch4.itemid == 1946 and getswitch5.itemid == 1945 and getswitch6.itemid == 1945 then
        doTeleportThing(cid, {x=32261, y=31856, z=15})
        doSendMagicEffect(pos, 6)
        doSendMagicEffect(getThingPos(cid), 12)
        setPlayerStorageValue(cid,32997,1)
        setPlayerStorageValue(cid, 100089, 1)
 
    else
        doTeleportThing(cid, {x=32311, y=31977, z=13})
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.")
        end
 
    end
    return 0
end

Screenshot_3.jpg

Editado por bpm91 (veja o histórico de edições)

Resolvido por Bolletox

Ir para solução
  • Respostas 10
  • Visualizações 692
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @bpm91 Veja se agora vai, eu coloquei todos os scripts dos camps em 1 script apenas. Creio que agora vai funcionar.   Crie 1 script só chamado bansheeQuest.lua e coloque isso dentro:  

  • @bpm91 Veja ai se vai function onStepIn(cid, item, frompos, item2, topos) playerpos = getPlayerPosition(cid) novapos2 = {x = 32216, y = 31833, z = 15} novapos3 = {x = 32217, y = 318

  • @bpm91 Acho que é isso local positionCurrent = {x=32268, y=31856, z=15} -- Posicao para onde o player vai se estiver correto a sequencia local positionFail = {x=32184, y=31940, z=14} -- Posicao qu

Posted Images

Postado

Teste ai pra ver se vai, caso nao for explique um pouco melhor como funciona o script pra eu pensar de outro jeito.

 

Script do fogo apagado

function onUse(cid, item, fromPosition, itemEx, toPosition)

	--FOGO OFF
	local gatepos = {x=32313, y=31976, z=13, stackpos=1} --Pos do Campfire que nao acende
	local getgate = getThingfromPos(gatepos)
	local time = 300 -- 60 = 1min -- Time para acender denovo
	local f = function(p)
		doTransformItem(getTileItemById(p, 1946).uid, 1945)
		doCreateItem(1423,1,gatepos)
	end

	if item.itemid == 1945 and item.uid == 43995 and getTileItemById(gatepos, 1423).uid > 0 then
	doRemoveItem(getTileItemById(gatepos, 1423).uid)
	doCreateItem(1421, gatepos)
	doTransformItem(item.uid, item.itemid+1)
	e = addEvent(f, time * 1000, fromPosition)

	else if item.itemid == 1946 and item.uid == 43995 and getTileItemById(gatepos, 1421).uid > 0 then
		doRemoveItem(getTileItemById(gatepos, 1421).uid)
		doCreateItem(1423, gatepos)
		doTransformItem(item.uid,item.itemid-1)
		stopEvent(e)
		e = 0
	end
	end
	return 1
	end

Script do fogo aceso

function onUse(cid, item, fromPosition, itemEx, toPosition)
	--FOGO ON
	local gatepos = {x=32313, y=31975, z=13, stackpos=1} --Pos do Campfire que Acende
	local getgate = getThingfromPos(gatepos)
	local time = 300 -- 60 = 1min -- Time para acender denovo
	local f = function(p)
		doTransformItem(getTileItemById(p, 1946).uid, 1945)
		doCreateItem(1423,1,gatepos)
	end

	if item.itemid == 1945 and item.uid == 43994 and getTileItemById(gatepos, 1423).uid > 0 then
	doRemoveItem(getTileItemById(gatepos, 1423).uid)
	doCreateItem(1421, gatepos)
	doTransformItem(item.uid, item.itemid+1)
	e = addEvent(f, time * 1000, fromPosition)

	else if item.itemid == 1946 and item.uid == 43994 and getTileItemById(gatepos, 1421).uid > 0 then
		doRemoveItem(getTileItemById(gatepos, 1421).uid)
		doCreateItem(1423, gatepos)
		doTransformItem(item.uid,item.itemid-1)
		stopEvent(e)
		e = 0
	end
	end
	return 1
	end

Script Fogo Azul


function onStepIn(cid, item, fromPosition, toPosition)

local positionCurrent = {x=160, y=54, z=7} -- Posicao para onde o player vai se estiver correto a sequencia
local positionFail = {x=160,y=54,z=7} -- Posicao que o player vai se estiver errada a combinacao

--#--Posicões das alavancas--#--

switch1 = {x=32310, y=31975, z=13, stackpos=1}
switch2 = {x=32310, y=31976, z=13, stackpos=1}
switch3 = {x=32312, y=31975, z=13, stackpos=1}
switch4 = {x=32312, y=31976, z=13, stackpos=1}

switch5 = {x=32314, y=31975, z=13, stackpos=1}
switch6 = {x=32314, y=31976, z=13, stackpos=1}

getswitch1 = getThingfromPos(switch1)
getswitch2 = getThingfromPos(switch2)
getswitch3 = getThingfromPos(switch3)
getswitch4 = getThingfromPos(switch4)

getswitch5 = getThingfromPos(switch5)
getswitch6 = getThingfromPos(switch6)

--#--------------------------#--
   
 if isPlayer(cid) then
    if  getswitch1.itemid == 1946 and getswitch2.itemid == 1946 and getswitch3.itemid == 1946 and getswitch4.itemid == 1946 and getswitch5.itemid == 1945 and getswitch6.itemid == 1945 then
        doTeleportThing(cid, positionCurrent)
        doSendMagicEffect(getThingPos(cid), 12)
        setPlayerStorageValue(cid,10004,1)
        setPlayerStorageValue(cid, 10004, 1)
 
    else
        doTeleportThing(cid, positionFail)
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.")
        end
 
    end
    return 0
end

 

Editado por Bolletox (veja o histórico de edições)

Postado
  • Autor

@Bolletox é o selo 2 da missão da banshee, a pessoa precisa deixar os 6 fogos em ordem correta pra que possa passar pelo fogo azul e ganhar o storage do selo 2

Os campos de fogo eu fiz eles porém quando a alavanca volta ao normal o fogo nao se acende de novo "bugando a alavanca" porque ela só irá funcionar de novo se caso ele virar fogo e o script irá reconhecer o id

Screenshot_1.jpg

os 2 scripts que vc mandou nao funcionou.
todos os fogos vermelhos ficam acesos, então eu preciso apagar 4 deles, porém eles tem tempo para acender novamente, então os 4 primeiros < "da direita não acendem novamente"
não sei porque mas deveria ascender... os 2 ultimos >> ascendem porém a alavanca nao se move, ou vice e versa, fazendo com que bug e trave a alavanca sem, poder mover novamente.
então mesmo com a ordem correta, o fogo azul nao está me teleportando.

irei postar os 6 campos de fire 

Campfire 1\/\/\/\/\/

function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32309, y=31975, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(item.uid,item.itemid+1)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42998 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42998 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end

camp fire 2\/\//\\/

function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32309, y=31976, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(item.uid,item.itemid+1)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42997 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42997 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end

camp 3

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32311, y=31975, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(item.uid,item.itemid+1)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42996 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42996 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end

 

camp 4 
function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32311, y=31976, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(item.uid,item.itemid+1)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42995 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42995 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end

camp 5 

function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32313, y=31975, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(item.uid,item.itemid+1)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42994 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42994 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end


camp 6

function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=32313, y=31976, z=13, stackpos=1}
getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min 
local f = function(p)
    doTransformItem(item.uid,item.itemid+1)
    doCreateItem(1423,1,gatepos)
end
 
if item.uid == 42993 and item.itemid == 1945 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421,1,gatepos)
doTransformItem(item.uid,1946)
e = addEvent(f, time * 1000, fromPosition)
 
elseif item.uid == 42993 and item.itemid == 1946 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423,1,gatepos)
doTransformItem(item.uid,1945)
stopEvent(e)
e = 0
end
return 1
end

 

dai elas ficam assim, e a alavanca trava =/

Screenshot_1.jpg

Postado

@bpm91 Veja se agora vai, eu coloquei todos os scripts dos camps em 1 script apenas. Creio que agora vai funcionar.

 

Crie 1 script só chamado bansheeQuest.lua e coloque isso dentro:

 

Spoiler
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local campfireOn = 1423 -- ID do CampFire Aceso
    local campfireOff = 1421 -- ID do CampFire Apagado
    local time = 300 -- 60 = 1min -- Tempo para acender denovo
 
    local campfires =
    {
 
    -- [UNIQUEID DA ALAVANCA] = {pos = {POSITION DOS FOGOS}}
        [42998] = {pos = {x=32309,y=31975,z=13,stackpos=1}}, -- CAMP 1
        [42997] = {pos = {x=32309,y=31976,z=13,stackpos=1}}, -- CAMP 2
        [42996] = {pos = {x=32311,y=31975,z=13,stackpos=1}}, -- CAMP 3
        [42995] = {pos = {x=32311,y=31976,z=13,stackpos=1}}, -- CAMP 4
        [42994] = {pos = {x=32313,y=31975,z=13,stackpos=1}}, -- CAMP 5
        [42993] = {pos = {x=32313,y=31976,z=13,stackpos=1}} -- CAMP 6
 
    }
 
    local f = function(p)
        local alavancaID = getTileItemById(p, 1946).uid
        if (alavancaID > 0) then
            doTransformItem(getTileItemById(p, 1946).uid, 1945)
            doCreateItem(campfireOn, campfires[item.uid].pos)
        end
    end
    
    
    if item.itemid == 1946 and campfires[item.uid] and getTileItemById(campfires[item.uid].pos, campfireOff).uid > 0 then
 
        doRemoveItem(getTileItemById(campfires[item.uid].pos, campfireOff).uid)
        doCreateItem(campfireOn, campfires[item.uid].pos)
        doTransformItem(item.uid, item.itemid-1)
        stopEvent(e)
    
    else if item.itemid == 1945 and campfires[item.uid] and getTileItemById(campfires[item.uid].pos, campfireOn).uid > 0 then
        doRemoveItem(getTileItemById(campfires[item.uid].pos, campfireOn).uid)
        doCreateItem(campfireOff, campfires[item.uid].pos)
        doTransformItem(item.uid, item.itemid+1)
        local e = addEvent(f, time * 1000, fromPosition)
    end
    end
    return 1
    end



 

 

No XML cole isso lá:

 

Spoiler
<action uniqueid="42998;42997;42996;42995;42994;42993" script="bansheeQuest.lua"/>

 

Em moveevents crie script chamado fogoAzul.lua:

 

Spoiler
function onStepIn(cid, item, fromPosition, toPosition)
 
local positionCurrent = {x=32261, y=31856, z=15} -- Posicao para onde o player vai se estiver correto a sequencia
local positionFail = {x=32311, y=31977, z=13} -- Posicao que o player vai se estiver errada a combinacao
 
--#--Posicões das alavancas--#--
 
switch1 = {x=32310, y=31975, z=13, stackpos=1}
switch2 = {x=32310, y=31976, z=13, stackpos=1}
switch3 = {x=32312, y=31975, z=13, stackpos=1}
switch4 = {x=32312, y=31976, z=13, stackpos=1}
 
switch5 = {x=32314, y=31975, z=13, stackpos=1}
switch6 = {x=32314, y=31976, z=13, stackpos=1}
 
getswitch1 = getThingfromPos(switch1)
getswitch2 = getThingfromPos(switch2)
getswitch3 = getThingfromPos(switch3)
getswitch4 = getThingfromPos(switch4)
 
getswitch5 = getThingfromPos(switch5)
getswitch6 = getThingfromPos(switch6)
 
--#--------------------------#--
 
if isPlayer(cid) then
if getswitch1.itemid == 1946 and getswitch2.itemid == 1946 and getswitch3.itemid == 1946 and getswitch4.itemid == 1946 and getswitch5.itemid == 1945 and getswitch6.itemid == 1945 then
doTeleportThing(cid, positionCurrent)
doSendMagicEffect(getThingPos(cid), 12)
setPlayerStorageValue(cid,10004,1)
setPlayerStorageValue(cid, 10004, 1)
 
else
doTeleportThing(cid, positionFail)
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.")
end
 
end
return 0
end

 

XML em moveevents coloque este:

 

Spoiler
<movevent type="StepIn" actionid="6666" event="script" value="fogoAzul.lua"/>

 

Postado
  • Autor

beleza irei fazer

mano deu certo, muuuuuito obrigado <3

nessa linha que vc fez
if item.itemid == 1946 and campfires[item.uid] and getTileItemById(campfires[item.uid].pos, campfireOff).uid > 0 then
 
        doRemoveItem(getTileItemById(campfires[item.uid].pos, campfireOff).uid)
        doCreateItem(campfireOn, campfires[item.uid].pos)
        doTransformItem(item.uid, item.itemid-1)
        stopEvent(e)

posso adicionar do setPlayerStorageValue(cid,10004,1)? pra pessoa ganhar storage pra proxima missao?

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo