Ir para conteúdo

Featured Replies

Postado

Boa tarde.

 

Estou elaborando a The inquisition quest, porem não estou conseguindo acertar o script..

 

Eu preciso que sacrifique 3 itens em 3 altares diferentes e ao clicar no tumulo (alavanca) os 3 itens sumam e sumone o boss (The Count), porem quero que o player ganhe storage para que nao funcione novamente com ele..

 

Meu script esta sumonando 3 BOSSES e nao está verificando os 3 itens, se tiver so 1 ele some e sumona 1, se tiver 3 ele some e sumona 3...

 

Preciso de ajuda quem puder +REP

 

Aqui vai o codigo...

 

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local removals = -- Local dos altares --
	{
        {x = 32777, y = 31982, z = 9, stackpos = 255},
        {x = 32779, y = 31977, z = 9, stackpos = 255},
        {x = 32781, y = 31982, z = 9, stackpos = 255}
    }
   
ret = false
if getPlayerStorageValue(cid, 92224) == 24 then   
	for i = 1, #removals do
		local amuletos = getThingfromPos(removals[i])
		if amuletos.itemid == 2199 then
			doRemoveItem(getThingfromPos(removals[i]).uid, 1)
			Wave1()
		else
			ret = true
		end
	end
		if ret then 
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You need to put the amulets in the altars.")
		end	
else
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You aren't a member of the inquisition.")
end
    return TRUE
end
function Wave1()
       
doSendMagicEffect(getCreaturePosition(doCreateMonster('the count', {x = 32780, y = 31980, z = 9})), CONST_ME_TELEPORT) -- local e nome do monstro que sera sumonado --
	
	
end

 

 

1857372462_Semttulo.thumb.png.edd243761e9ccf49b91c3c432614043a.png

 

@EddyHavoc

@Vodkart

 

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

Resolvido por Vodkart

Ir para solução
  • Respostas 14
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • function doRemoveItensInPos(items, pos) -- function by vodka local items = type(items) == "table" and items or {items} for i = 1, table.maxn(items) do doRemoveItem(getThingFromPos({x=pos.

  • Everson Miranda
    Everson Miranda

    Deu error @Vodkart

  • é esse bb code bugando todo os códigos.   testa ai   https://pastebin.com/raw/GiCq1izE

Posted Images

Postado
function doRemoveItensInPos(items, pos) -- function by vodka
local items = type(items) == "table" and items or {items}  
      for i = 1, table.maxn(items) do 
    doRemoveItem(getThingFromPos({x=pos.x,y=pos.y,z=pos.z,stackpos=1}).uid)
  end
  return nil
end
function getItemsInPos(items, pos) -- function by vodka
         for i = 1,#items do
            local stack = getTileItemById(pos, items[1])
                  if stack.uid > 0 and math.max(1, stack.type) >= items[2] and i == #items then
                    return true
                 end
         end
return false
end
function Wave1() -- vc que fez essa função
doSendMagicEffect(getCreaturePosition(doCreateMonster('the count', {x = 32780, y = 31980, z = 9})), CONST_ME_TELEPORT) -- local e nome do monstro que sera sumonado --		
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local t = {
	{items = {{2199,1}}, pos = {x = 32777, y = 31982, z = 9}},
	{items = {{2199,1}}, pos = {x = 32779, y = 31977, z = 9}},
	{items = {{2199,1}}, pos = {x = 32781, y = 31982, z = 9}}
}
if getPlayerStorageValue(cid, 875487) > 0  then
doPlayerSendCancel(cid, "voce ja fez esta quest.") return true
end
if getPlayerStorageValue(cid, 92224) == 24 then
	for _, w in ipairs(t) do
		if not getItemsInPos(w.items, w.pos) then
		doPlayerSendCancel(cid, "You need to put the amulets in the altars.") return true
		end
	end   
	for _, v in ipairs(t) do
		doRemoveItensInPos(v.items, v.pos)
	end
	 setPlayerStorageValue(cid, 875487, 1)
	Wave1()	
else
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You aren't a member of the inquisition.")
end
    return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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