
Tudo que Nazo postou
-
[Pedido] Teleportar para o templo se tiver storage globalevent
TAG XML: <globalevent name="TPALL" time="00:00" event="script" value="tpall.lua"/> Script tpall.lua: -- by Nazo (tibiaking.com) config = { storage = 232323, -- muda pra storage que você quer storageValue = 1 -- valor necessário para ser teleportado } function onTime() players = getPlayersOnline() for _, pid in ipairs(players) do if(getPlayerStorageValue(pid,config.storage) == storageValue) then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) setPlayerStorageValue(pid, storage, -1) end end return true end Caso ocorra algum erro, por favor, me cite aqui.
-
Piso que apague item
Faça assim, quando um player morrer na arena que você disse, o corpo irá sumir, porém você precisa confirmar que ele está na arena com alguma storage, se já existir alguma storage que afirme sobre o player estar em arena, é só configurar abaixo no script: config = { storageArena = 353535, -- troca pela storage que diz que o player está na arena } function onDeath(cid, corpse, deathList) if(isPlayer(cid) and getPlayerStorageValue(cid,353535) == 1) then doRemoveItem(corpse.uid,1) end end Agora, se não houver uma storage no player quando ele está na arena, trate de criar haha
-
Storage por tempo
Testa agora: local t = { lvl = 150, Time = 15, entrada = { {x = 191, y = 425, z = 8}, }, saida = { {x = 124, y = 350, z = 9}, {x = 129, y = 350, z = 9} }, monstros = { {{x=299, y=399, z=9}, "Mega Blastoise"}, {{x=238, y=399, z=9}, "Mega Venusaur"}, {{x=206, y=403, z=9}, "Mega Absol"}, {{x=217, y=397, z=9}, "Elder Tangela"}, {{x=219, y=406, z=9}, "Elder Venusaur"}, {{x=229, y=409, z=9}, "Mega Ampharos"}, {{x=235, y=406, z=9}, "Mega Pidgeot"}, {{x=238, y=414, z=9}, "Elder Jynx"}, {{x=227, y=412, z=9}, "Elder Pidgeot"}, {{x=220, y=414, z=9}, "Elder Tentacruel"}, {{x=211, y=412, z=9}, "Mega Charizard X"}, {{x=205, y=418, z=9}, "Mega Charizard Y"}, {{x=215, y=418, z=9}, "Elder Charizard"}, {{x=223, y=420, z=9}, "Elder Pinsir"}, {{x=231, y=418, z=9}, "Elder Jynx"}, {{x=237, y=422, z=9}, "Mega Ampharos"}, {{x=202, y=426, z=9}, "Mega Blastoise"}, {{x=247, y=422, z=9}, "Underworld Rayquaza"} } } function VarAnihiPlayer(cid) if not isCreature(cid) then return LUA_ERROR end if isInRange(getPlayerPosition(cid), t.saida[1], t.saida[#t.saida]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end end function getPlayersInArea(fromPos, toPos) local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), fromPos, toPos) then table.insert(players, pid) end end return players end function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} if #getPlayersInArea(t.saida[1], t.saida[#t.saida]) > 0 then doPlayerSendCancel(cid, 'Wait, there are players doing the quest.') return true end if getPlayerStorageValue(cid, 17899) > os.time() then doPlayerSendCancel(cid, 'You need to wait 24hours to enter again.') return true end for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then doPlayerSendCancel(cid, 'Need another player or somebody else has no level '..t.lvl..'.') return true end table.insert(check, x) end for _, summon in pairs(t.monstros) do local creature = getTopCreature(summon[1]).uid if(creature > 0 and not isPlayer(creature)) then doRemoveCreature(creature) end doCleanTile(summon[1]) doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doSendMagicEffect(t.entrada[i], CONST_ME_POFF) doTeleportThing(tid, t.saida[i], false) setPlayerStorageValue(cid, 17899, os.time()+86400) addEvent(VarAnihiPlayer, t.Time*60*1000, tid) doSendMagicEffect(t.saida[i], CONST_ME_ENERGYAREA) end return true end O erro aparente era bem simples, se o momento atual do presente é o tempo "100", daqui um dia será "200", você quando salva o tempo "200" (que seria amanhã), ao checar a storage, tem que checar se "amanhã (200) é maior que o tempo atual", e sua checagem estava: if getPlayerStorageValue(cid, 17899) == 1 then Sendo que teria que ser assim: if getPlayerStorageValue(cid, 17899) > os.time() then -- se o tempo salvo na storage é maior que o tempo atual, o player ainda não pode passar pois não deu 24h
-
Como eu executo essa tag no Sqlite?
A questão, é que provavelmente tem dois players no jogo com os seguinte nicks (nick de exemplo): [VIP] Demitido do Bradesco Demitido do Bradesco Aí quando o sql tenta tirar o [vip] do nick de cima, dá erro pq já existe um char com esse nick xd
-
Como eu executo essa tag no Sqlite?
Acho que alguém tá ficando com o mesmo nome nisso, tipo, tinha prevenção contra 2 players com o mesmo nick mas um com [vip] e outro sem?
-
(Resolvido)[AJUSTE] Speed da bike
Fiz corrido, testa aí: function onUse(cid, item, fromPosition, itemEx, toPosition) local sBike = 2547 local speed = 20 -- speed que você quer extra local t = { [16689] = {article='a', name='Bike', text='', dtext='', s=9999, condition=bikeCondition}, } function BikeSpeedOn(cid,nSpeed) setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid)) doChangeSpeed(cid,getCreatureSpeed(cid)+nSpeed) end function BikeSpeedOff(cid) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,getPlayerStorageValue(cid,sBike)) end local v, r = getCreaturePosition(cid), t[item.itemid] local s = r.s local pos = {x = v.x, y = v.y, z = v.z} if r then if getPlayerStorageValue(cid, 25000) == 5 then return end if getPlayerStorageValue(cid, 23000) == 5 then return end if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.") return true end if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then doPlayerSendCancel("Não está no slot correto") return true end if getPlayerStorageValue(cid, s) <= 0 then doCreatureSay(cid, r.text, 19) setPlayerStorageValue(cid, s, 1) BikeSpeedOn(cid,speed) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2293, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) ---Female else doSetCreatureOutfit(cid, {lookType = 2292, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) --- Male end elseif getPlayerStorageValue(cid, s) == 1 then doCreatureSay(cid, r.dtext, 19) setPlayerStorageValue(cid, s, 0) BikeSpeedOff(cid) return doRemoveCondition(cid, CONDITION_OUTFIT) else return doPlayerSendCancel(cid, 'You can\'t do this.') end else return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.') end end
-
Bug No personagem na hora de morrer
Mostre o conteúdo do seu creaturescripts.xml, @douglasfamil1.
-
[Action] ativar efeito com alavanca
Nem li o código, segundo ele já funciona, ué, só passei pra alavanca.
-
Lavanca que remove parede temporariamente 1.2
Teste isso: -- by Nazo (tibiaking.com) config = { time = 30, -- tempo em segundos } function addStone(itemid,pos) doCreateItem(itemid,1,pos) end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1945 then local stonePosition = Position(601, 1413, 12) local stoneItem = Tile(stonePosition):getItemById(1201) if stoneItem then stoneItem:remove() addEvent(addStone, time*1000, 1201, stonePosition) stonePosition:sendMagicEffect(CONST_ME_EXPLOSIONAREA) item:transform(1946) end end return true end
-
[Action] ativar efeito com alavanca
Tente isso: function onUse(player, item, fromPosition, target, toPosition) for _, name in ipairs(getOnlinePlayers()) do local cid = getPlayerByName(name) if getPlayerGroupId(cid) < 4 then doSendAnimatedText(getPlayerPosition(cid), "2x EXP", 251) doSendMagicEffect(getPlayerPosition(cid), 27) doSendMagicEffect(getPlayerPosition(cid), 30) local spot = getThingPosition(cid) doSendDistanceShoot({x = spot.x + 1, y = spot.y + 1, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x - 1, y = spot.y - 1, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x + 1, y = spot.y - 1, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x - 1, y = spot.y + 1, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x + 1, y = spot.y + 0, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x + 0, y = spot.y + 1, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x - 1, y = spot.y + 0, z = spot.z}, spot, 34) doSendDistanceShoot({x = spot.x + 0, y = spot.y - 1, z = spot.z}, spot, 34) end end return true end Adiciona uma tag de use no actions.xml e coloca o action na alavanca pelo map editor.
-
(Resolvido)[PEDIDO] UniqueID só passa com "x" storage
Em movements.xml adicione a seguinte tag: <movevent type="StepIn" actionid="9914" event="script" value="newbietile.lua"/> Em movements/scripts/ crie o arquivo newbietile.lua e adicione o seguinte conteúdo: -- by Nazo (tibiaking.com) function onStepIn(cid, item, position, fromPosition) if(getPlayerStorageValue(cid,54842) == -1) then doTeleportThing(cid,fromPosition) doPlayerSendTextMessage(cid,22,"Pegue seu pokémon para passar por aqui.") end return true end Com o map editor, coloque o actionid "9914" (ou outro, caso você altere na tag XML) nos dois tiles.
-
(Resolvido)[AJUSTE] NPC de pokemon inicial
Tentei no olho aqui @tavarb, vê se funciona aí: local focus = 0 -- NÃO EDITE ISSO local talk_start = 0 -- NÃO EDITE ISSO local target = 0 -- NÃO EDITE ISSO local following = false -- NÃO EDITE ISSO local attacking = false -- NÃO EDITE ISSO local newbie = 1010101 function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) local health = 1000 local maxhealth = 1000 newbies = getPlayerStorageValue(cid,newbie) msg = string.lower(msg) newperson = getPlayerStorageValue(cid,newbie) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello, I am professor Hoa. I was once a legendary pokemon trainer, now I have switched to studies in the laboratory of Professor Oak.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, wait your turn.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'help') and newbies <= 0 then selfSay('I have a charmander, squirtle anh bulbasaur. I can give you one pokemon to help you make your journey, would you like?') talk_state = 1 elseif talk_state == 1 and newbies <= 0 then if msgcontains(msg, 'yes') then selfSay('Ok, so what pokemon you like?') talk_state_s = 2 elseif talk_state_s == 2 then if msgcontains(msg, 'bulbasaur') then addPokeToPlayer(cid, "Bulbasaur", 0, nil, "poke") doPlayerAddItem(cid, 2394, 16) doPlayerAddItem(cid, 2391, 4) doPlayerAddItem(cid, 2393, 1) doPlayerAddItem(cid, 12348, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Bulbasaur, ") selfSay("Here is your Bulbasaur and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'charmander') then local description = "Contains a Charmander." local poke1 = "This is Charmander's pokeball. HP = ["..health.."/"..maxhealth.."]" addPokeToPlayer(cid, "Charmander", 0, nil, "poke") doPlayerAddItem(cid, 2394, 14) doPlayerAddItem(cid, 2391, 2) doPlayerAddItem(cid, 12347, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Charmander, ") selfSay("Here is your Charmander and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'squirtle') then local description = "Contains a Squirtle." local poke1 = "This is Squirtle's pokeball. HP = ["..health.."/"..maxhealth.."]" addPokeToPlayer(cid, "Squirtle", 0, nil, "poke") doPlayerAddItem(cid, 2394, 18) doPlayerAddItem(cid, 2391, 6) doPlayerAddItem(cid, 2392, 1) doPlayerAddItem(cid, 12346, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Squirtle, ") selfSay("Here is your Squirtle and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 else selfSay("Tell me what pokemon you like?") end elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") talk_state = 0 elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 2 then selfSay('Good bye!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Bye...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) >= 2 then selfSay('Good bye then.') focus = 0 end end end
-
(Resolvido)[PEDIDO] NPC que troca itens por dias premium
Aqui, meu chapa: config = { item = 2145, -- id do diamond min = 7 } 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'TROCAR') or msgcontains(msg, 'trocar')) then npcHandler:say("Quantos diamonds você deseja trocar por dias premium?", cid) talkState[cid] = 1 elseif talkState[cid] == 1 then msg = tonumber(msg) if(doPlayerRemoveItem(cid,config.item,msg) and isNumber(msg) and msg >= config.min)then doPlayerAddPremiumDays(cid, msg) str = "Agora você possui mais " .. msg .. " dia(s) premium." else str = "Você não possui essa quantia, ou ofereceu menos que "..config.min.." diamonds." end npcHandler:say(str, cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Sobre o Comércio
Temo ter que discordar de você em certo ponto, ainda mais em "visivelmente e frequentemente afastados do fórum", considerando que o TK está "a bangu" devido a antiga staff que quando cuidou do fórum, deixou-o assim, morrer. Mas tem coisas que apesar de você não ter citado, são referências pra coisas que você disse, como melhorar a seção de formação de equipes, como haverá equipes formadas se após a morte que o fórum teve, a maioria dos membros não são criadores de conteúdo, que irão montar uma equipe? O comércio sobre OT sempre existiu, nem que fosse por meios exteriores como você citou, não tem sentido tratar isso como um tabu, ultimamente houveram diversas mudanças no andamento do fórum, além de claro "só comércio e etc", porém só vê a mudança quem quer, afinal, é tão difícil sair da zona de conforto, não é? Se um felizardo quer investir em sprites, o spriter é muito bem visto, mas se um programador deseja receber por um freelance ele não poderia, pois acaba com o Open do nosso Tibia? Sinto que talvez você não entenda por não ser sua área, porém são duas coisas bem próximas, de sentidos iguais, vistas de um modo diferentes por sei lá motivos nonsense, ou se você quiser um serviço sério, com atendimento privado, tem que contratar o cara para sua equipe e dar um pagamento mensal?
-
uh script 7.92
Mano, a UH é id 2273, tenta com ela, já tá até no spells.xml, o id 14454 nem existe na base que você me passou.
-
(Resolvido)[PEDIDO] NPC que troca itens por dias premium
Basicamente, @tavarb, o querido player digita quantos diamonds ele quer trocar por premmy (onde cada diamond é um dia premmy), e o npc troca pra ele
-
uh script 7.92
Acabei de testar na distro que você mandou e também funcionou, meu chapa, o erro está na hora de você substituir o script.
-
Menssagem Warning Bug
Poste o sistema inteiro, com as variáveis e explique o que você quer que aconteça, e erros que estão em eminência.
-
uh script 7.92
Manda aí, vamos ver
-
uh script 7.92
Cara, acabei de testar no exato servidor que me passou e funcionou, meu chapa: Se você substituiu o código todo, sem errar na substituição, tem que funcionar, não tem erro. @Micheel15
-
uh script 7.92
O script funcionou?
-
uh script 7.92
@Micheel15, baixei a base e notei que existe uma IH pronta, modifiquei os valores dela para que healem como uma uh usando como base, testa aí, não consegui logar no servidor aqui por algum motivo xd Tente utilizar esse código: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onGetFormulaValues(cid, level, maglevel) min = (level * 4 + maglevel * 5) * 2.3 - 25 max = (level * 5 + maglevel * 6) * 2.9 if min < 550 then min = 750 end return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) doPlayerSay(cid,"Aaaah...",16) return doCombat(cid, combat, var) end
-
Problema ao conectar database ao MySQL
Provavelmente seu phpMyAdmin não estava configurado devidamente, as vezes pode não ser simples no linux ;s Em breve postarei um tutorial sobre como instalar os pacotes necessários para abertura de um OT no linux.
-
uh script 7.92
Estranho, qual a versão do seu TFS? Eu testei o script em tempo real e funcionou
-
Menssagem Warning Bug
Testa isso aí: function onTradeAccept(cid, target, item, targetItem) if isPlayer(cid) and isPlayer(target) then if item.itemid == Points_Trade.Document_ItemID then doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "Transferencia efetuada com sucesso, você recebeu ".. DocumentPoints(item) .." premium points.") doPlayerAddPoints(target, DocumentPoints(item)) doPlayerRemovePoints(cid, DocumentPoints(item)) addEvent(doPlayerRemoveItem, 1, target, Points_Trade.Document_ItemID, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Transação efetuada com sucesso de ".. DocumentPoints(targetItem) .." premium points.") doPlayerAddPoints(cid, DocumentPoints(targetItem)) doPlayerRemovePoints(target, DocumentPoints(targetItem)) addEvent(doPlayerRemoveItem, 1, cid, Points_Trade.Document_ItemID, 1) end end return true end