Tudo que Wakon postou
-
(Resolvido)[PEDIDO] Add storage
Teste novamente, errei uma variável.
-
(Resolvido)[PEDIDO] Add storage
Testa ai: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local storage = 23844 -- Storage do player ao comprar para ter acesso ao evento. local gstorage = 34577 -- Storage global do evento. local done = 'Here you are, thank you for your business.' function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local msg = msg:lower(); if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'tickets') then if getGlobalStorageValue(gstorage) < 20 then npcHandler:say('I sell tickets for the event.', cid) talkState[talkUser] = 1 else npcHandler:say('There are no more tickets.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'blue') then if talkState[talkUser] == 1 then npcHandler:say('Did you bring me the 20 crystal coins?', cid) talkState[talkUser] = 2 end elseif msgcontains(msg, 'green') then if talkState[talkUser] == 1 then npcHandler:say('Did you bring me the 20 crystal coins?', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'yes') then if talkState[talkUser] == 2 then if doPlayerRemoveItem(cid, 2160, 20) == TRUE then npcHandler:say(done, cid) setPlayerStorageValue(cid, storage, 1) else npcHandler:say("You do not have 20 crystal coins.") end end elseif msgcontains(msg, 'no') then if talkState[talkUser] = 2 then npcHandler:say("Okay...") talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)[PEDIDO] Add storage
Você pode fazer o seguinte: elseif msgcontains(msg, 'team red') then if getPlayerItemCount(cid ,2160) >= 20 then npcHandler:say('Did you bring me the 20 crystal coins?', cid) npcHandler.topic[cid] = 1 else npcHandler:say('I need a {20 crystal coins}. Please come back when you have them.', cid) npcHandler.topic[cid] = 0 end elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then npcHandler.topic[cid] = 0 if getPlayerItemCount(cid,2160) >= 20 then if doPlayerRemoveItem(cid,2160, 20) == TRUE then if getGlobalStorageValue(34577) < 20 then npcHandler:say(done, cid) else return doPlayerSendCancel(cid, "Os tickets esgotaram.") end else npcHandler:say(item, cid) end
-
(Resolvido)[PEDIDO] Add storage
Já vem no servidor amigo, você só precisa citar um valor nela '-'. setGlobalStorageValue(35000, getGlobalStorageValue(35000) +1) ou, setGlobalStorageValue(35001, getGlobalStorageValue(35001) +1) ou, setGlobalStorageValue(35002, getGlobalStorageValue(35002) +1) e assim vai.
-
(Resolvido)[PEDIDO] Add storage
Qual exatamente sua dúvida sobre a storage global?
-
(Resolvido)[PEDIDO] Add storage
Que nada, global storage é como nome diz, uma storage global como se fosse a de player mesmo. Você pode altera-la pela database e ela reseta após reiniciar o servidor ou você pode colocar pra ela virar 0 quando acabar o evento. Exemplo com valores do script que passei: setGlobalStorageValue(35000, getGlobalStorageValue(35000) +1) -- Irá deixar a storage global (35000) no valor atual dela + um, se o valor for 1, vai ficar 2, e assim vai. if getGlobalStorageValue(35000) >= 20 then -- Se a storage global (35000) for maior ou igual a 20, então irá retornar o script com a mensagem. return doPlayerSendCancel(cid, "Os tickets esgotaram.") end
-
Script de reset em portas
Em "Data/actions/scripts" crie resetdoor.lua e cole: local t = { minResets = 20 } function onUse(cid, item, topos) if getPlayerReset(cid) >= t.minResets then pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid,22,'Você precisa ficar na frente da porta para passar.') doSendMagicEffect(topos,13) end doTeleportThing(cid,pos) doSendMagicEffect(topos,12) else doPlayerSendCancel(cid, "Você precisa de "..t.minResets.." resets para passar.") end return true end Em "Data/actions" abra o actions.xml e cole a TAG: <action uniqueid="actionID_desejada" event="script" value="resetdoor.lua"/> Coloque a actionID desejada e depois coloque ela na porta desejada. Se der algum erro ou tiver alguma dúvida, me avise .
-
(Resolvido)[PEDIDO] Add storage
Da pra tu colocar uma global storage, tipo: setGlobalStorageValue(storage_desejada, getGlobalStorageValue(storage_desejada) +1) Ai na verificação do método de comprar você coloca: if getGlobalStorageValue(storage_desejada) >= 20 then return doPlayerSendCancel(cid, "Os tickets esgotaram.") end
-
(Resolvido)[PEDIDO] Add storage
Você pode usar essa função no script que compra o ticket: setPlayerStorageValue(cid, storage_value, 1) No mesmo local em que adiciona o item ao player. Sobre as outras funções você pode usar um movement onStepIn: local t = { tp = { x = 32338, y = 32225, z = 7 }, -- Local onde irá levar. storage = {23844, 1} -- Storage desejada e valor {value, key}. } function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, t.storage[1]) == t.storage[2] then doTeleportThing(cid, t.tp) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, "Você não tem acesso a essa área.") doTeleportThing(cid, fromPosition) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end return true end TAG: <movevent event="StepIn" actionid="actionID_desejada" script="nome_do_script.lua" /> Pra tirar a storage ao entrar em um TP é bem simples. local t = { tp = { x = 32338, y = 32225, z = 7 }, -- Local onde irá levar. storage = {23844, -1} -- Storage desejada e valor {value, key}. } function onStepIn(cid, item, position, fromPosition) setPlayerStorageValue(cid, t.storage[1], t.storage[2]) doTeleportThing(cid, t.tp) return true end TAG: <movevent event="StepIn" actionid="actionID_desejada" script="nome_do_script.lua" />
-
(Resolvido)[PEDIDO] Add storage
Tu quer que ele tenha acesso com o ticket ou ganhe storage ao usar o ticket?
-
(Resolvido)[Pedido] Magia vip
Coloque nos script's delas.
-
Script de reset em portas
Sem o seu sistema de reset fica difícil né amigo?
- Sprites Digicerb
-
Creature Event Heelp
Colocou tudo corretamente? As tag's que você me passou estão corretas, porém as que você colocou no servidor provavelmente está com event type="onpreparedeath". Tente instalar novamente.
-
Creature Event Heelp
Está faltando um end para fechar a função na linha 6, no script login.lua. Sobre os outros dois, o servidor não está encontrando uma função onPrepareDeath nos scripts citados nas tags, poste eles para eu avaliar.
-
(Resolvido)[Resolvido]Qual o id dessa wand?
Se eu não me engano, esse item nem é registrado na maioria dos servidores 8.60. Abre o items.xml na pasta "Data/items" e registre: <item id="12318" article="a" name="replica of the sceptre"> <attribute key="weight" value="1400" /> </item> Só editar ao seu gosto.
-
(Resolvido)[Resolvido]Qual o id dessa wand?
O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → OTServ Geral" Para: "OTServ → Suporte OTServ → Suporte de OTServ Geral"
-
(Resolvido)[Pedido] Script (Mensagem)
Valeu pela dica .
-
(Resolvido)[Pedido] Script (Mensagem)
Se a sua dúvida foi sanada, marque a melhor resposta para o tópico ficar como resolvido.
-
VPS URGENTEMENTE
O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Suporte OTServ → Suporte de OTServ Geral" Para: "OTServ → Suporte OTServ → Suporte de Infraestrutura"
-
[SHOW OFF] Pokemon Legendary
O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Mapping → Show Off" Para: "OTServ → WebSites → Show Off"
-
(Resolvido)[Pedido] Script (Mensagem)
Editei o script, tente novamente.
-
(Resolvido)[Pedido] Script (Mensagem)
Em "Data/movements/scripts" crie msg.lua e cole: local mensagens = { [[ SUA MENSAGEM AQUI ]] } function onStepIn(cid) doPlayerSendTextMessage(cid, 25, mensagens[table.maxn(mensagens)]) return true end Em "Data/movements" abra movements.xml e cole: <movevent type="StepIn" actionid="14855" event="script" value="msg.lua"/> Coloque a actionID no tile desejado e configure a mensagem, caso tenha algum problema, me avise .
-
ajuda erro com website para poketibia
Está faltando a tabela news, não manjo dessa parte mais tenta executar isso na database: CREATE TABLE IF NOT EXISTS `news` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(150) DEFAULT '', `body` text, `time` int(11) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 Para executar é só selecionar a database, clicar em SQL e depois em executar.
-
(Resolvido)[Pedido] Magia vip
Você tem que colocar no script da spell amigo e não no spells.xml... Em "Data/spells/scripts" abra o script da spell desejada e faça o que te falei.