Tudo que zipter98 postou
-
(Resolvido)[Pedido] Recompensa Diferente
Algum erro no console? As mensagens foram enviadas?
-
(Resolvido)[Ajuda] Storage dos teleports
Sim.
-
(Resolvido)Systema !Fly [PokeTibia]
Em todos os tiles esse erro aparece? Ou só alguns?
-
(Resolvido)Systema !Fly [PokeTibia]
E onde é configurada a velocidade de fly de cada pokémon?
-
[PEDIDO] Script de tile que teleporta player ausente para o templo
local config = { time = 45, --Tempo, em minutos, parado para ser teleportado. events = {}, } function onStepIn(cid) config.events[cid] = addEvent(function() if isPlayer(cid) then doTeleportThing(cid, getTownTemplePosition(cid, getPlayerTown(cid))) end end, config.time * 60 * 1000) return true end function onStepOut(cid) stopEvent(config.events[cid]) return true end Não tenho como testar no momento. PS: É um movement. São duas tags, uma StepIn e outra StepOut; mesmos actionids, mesmos arquivos.
-
(Resolvido)[Ajuda] Storage dos teleports
Unique IDs da tabela teleports + 100 (se o UID for inferior a 14500).
-
(Resolvido)Systema !Fly [PokeTibia]
Funciona do jeito que o autor do tópico pediu.
-
(Resolvido)Systema !Fly [PokeTibia]
Desculpe, confundi a função. Código corrigido.
-
(Resolvido)Systema !Fly [PokeTibia]
<talkaction log="yes" words="!fly" event="script" value="nome_do_arquivo.lua"/> Sim.
-
(Resolvido)Systema !Fly [PokeTibia]
local configuration = { storage = 918311, fly_storage = 17000, --Storage do Fly no seu servidor. } function isWalkable(pos, creature, proj, pz)-- by Nord if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function autoWalk(cid, id) if not isCreature(cid) then if id then return db.executeQuery("UPDATE player_storage SET value = -1 WHERE key = 918311 AND player_id = "..id) end elseif getPlayerStorageValue(cid, configuration.storage) < 1 then return true end local topos = getPosByDir(getThingPos(cid), getCreatureLookDir(cid)) if topos then if getPlayerStorageValue(cid, configuration.storage) < 1 or getPlayerStorageValue(cid, configuration.fly_storage) < 1 then if getPlayerStorageValue(cid, configuration.fly_storage) < 1 then setPlayerStorageValue(cid, configuration.storage, -1) end return true elseif isWalkable(topos) then if getTileThingByPos({x = topos.x, y = topos.y, z = topos.z, stackpos = 0}).itemid == 0 then doCombatAreaHealth(cid, 0, topos, 0, 0, 0, CONST_ME_NONE) doCreateItem(11676, 1, topos) end doTeleportThing(cid, topos) else setPlayerStorageValue(cid, configuration.storage, -1) doPlayerSendTextMessage(cid, 27, "Há algum objeto à sua frente impedindo a passagem.") doPlayerSetNoMove(cid, false) return true end else doPlayerSendCancel(cid, "Sorry, not possible.") setPlayerStorageValue(cid, configuration.storage, -1) doPlayerSetNoMove(cid, false) return true end addEvent(autoWalk, 500, cid, id) end function onSay(cid, words) if getPlayerStorageValue(cid, configuration.fly_storage) < 1 then doPlayerSendCancel(cid, "Para usar este comando, você deve estar em Fly.") elseif getPlayerStorageValue(cid, configuration.storage) >= 1 then setPlayerStorageValue(cid, configuration.storage, -1) doPlayerSendTextMessage(cid, 27, "Comando !fly desativado.") doPlayerSetNoMove(cid, false) else doPlayerSendTextMessage(cid, 27, "Comando !fly ativado.") setPlayerStorageValue(cid, configuration.storage, 1) doPlayerSetNoMove(cid, true) autoWalk(cid, getPlayerGUID(cid)) end return true end Em data/actions/scripts, order.lua: Abaixo de: doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", let me get down!", 1) adicione: doPlayerSetNoMove(cid, false) Escrevi este código há mais de 1 ano, mas suponho que ainda funcione como deve.
-
[PEDIDO] script que checa quando terminar a premmium do player
onLogin e onLogout não precisam ser registrados.
- Npc
-
(Resolvido)[Pedido] Recompensa Diferente
Não se esqueça de registrar o evento em login.lua. data/creaturescripts/scripts: local config = { storage = 5820, levels = { [20] = { --[level] = { [1] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, }, [40] = { --[level] = { [1] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, }, }, } function onAdvance(cid, skill, oldLevel, newLevel) local level for prizeLevel, prizes in pairs(config.levels) do if newLevel >= prizeLevel and getPlayerStorageValue(cid, config.storage + prizeLevel) < 1 then level = prizeLevel break end end if level then local set = config.levels[level][getPlayerVocation(cid)] if set then local parcel, str = doCreateItemEx(ITEM_PARCEL), "" for i = 1, #set do if str == "" then str = "1x "..getItemNameById(set[i]) else str = str..(i == #set and " e " or ", ").."1x "..getItemNameById(set[i]) end doAddContainerItem(parcel, set[i], 1) end doPlayerSendMailByName(getCreatureName(cid), parcel, 1) setPlayerStorageValue(cid, config.storage + level, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Graças a sua determinação em atingir o level "..newLevel..", você foi premiado com "..str..". Um parcel foi enviado ao depot de sua cidade principal.") end end return true end Tag: <event type="advance" name="setPrize" event="script" value="nome_do_arquivo.lua"/>
-
Error no console
Ops. Código corrigido.
-
Alavanca Que teleporta
Você removeu o function onUse(cid) :v Era para colocar print(getPlayerGuildRank(cid)) abaixo dele, não no lugar dele. local newColor = {lookBody = 79, lookHead = 79, lookLegs = 79, lookFeet = 79} --Configure aqui a cor da roupa dos membros da guild. local pos = {x = 31427, y = 32417, z = 11} function onUse(cid) print(getPlayerGuildRank(cid)) if getPlayerGuildId(cid) > 0 then if getPlayerGuildRank(cid) == "leader" then for _, pid in pairs(getPlayersOnline()) do if getPlayerGuildId(pid) == getPlayerGuildId(cid) and pid ~= cid then newColor.lookType = getCreatureOutfit(pid).lookType doPlayerSendTextMessage(pid, 27, "Your guild leader ("..getCreatureName(cid)..") pulled you.") doTeleportThing(pid, pos) doSetCreatureOutfit(pid, newColor, -1) end end else doPlayerSendCancel(cid, "You aren't the guild leader.") end else doPlayerSendCancel(cid, "You don't have a guild.") end return true end
-
Dúvidas durante estudos.
Eu devo ser o único que começou em C++, não em C# LOL
-
(Resolvido)[Resolvido] [Pedido] Sistema de potion que heala na hora.
local potions = { --[potion_id] = percent, [12347] = 30, [12348] = 60, } function onUse(cid, item, fromPosition, itemEx, toPosition) if not isCreature(itemEx.uid) or not isSummon(itemEx.uid) then return doPlayerSendCancel(cid, "Voce so pode usar potion em Pokemon's!") elseif getCreatureMaster(itemEx.uid) ~= cid then return doPlayerSendCancel(cid, "Voce so pode usar potion em seus Pokemon's!") elseif getCreatureHealth(itemEx.uid) == getCreatureMaxHealth(itemEx.uid) then return doPlayerSendCancel(cid, "Este Pokemon esta totalmente curado.") elseif getPlayerStorageValue(cid, 52481) >= 1 then return doPlayerSendCancel(cid, "Voce nao pode usar isto em duelo.") end local health = getCreatureMaxHealth(itemEx.uid) * potions[item.itemid] / 100 doPlayerSendTextMessage(cid, 27, "Your pokemon was healed.") doSendMagicEffect(getThingPos(itemEx.uid), 172) doSendAnimatedText(getThingPos(itemEx.uid), "+"..health, math.random(1, 255)) doCreatureAddHealth(itemEx.uid, health) doRemoveItem(item.uid, 1) return true end
-
(Resolvido)[Resolvido] [Pedido] Sistema de potion que heala na hora.
Ou, se preferir: function onUse(cid, item, fromPosition, itemEx, toPosition) if not isCreature(itemEx.uid) or not isSummon(itemEx.uid) then return doPlayerSendCancel(cid, "Voce so pode usar potion em Pokemon's!") elseif getCreatureMaster(itemEx.uid) ~= cid then return doPlayerSendCancel(cid, "Voce so pode usar potion em seus Pokemon's!") elseif getCreatureHealth(itemEx.uid) == getCreatureMaxHealth(itemEx.uid) then return doPlayerSendCancel(cid, "Este Pokemon esta totalmente curado.") elseif getPlayerStorageValue(cid, 52481) >= 1 then return doPlayerSendCancel(cid, "Voce nao pode usar isto em duelo.") end doPlayerSendTextMessage(cid, 27, "Your pokemon was healed.") doSendMagicEffect(getThingPos(itemEx.uid), 172) doSendAnimatedText(getThingPos(itemEx.uid), "+"..getCreatureMaxHealth(itemEx.uid) - getCreatureHealth(itemEx.uid), math.random(1, 255)) doCreatureAddHealth(itemEx.uid, getCreatureMaxHealth(itemEx.uid) - getCreatureHealth(itemEx.uid)) doRemoveItem(item.uid, 1) return true end
-
Error no console
local addons = { [12611] = {pokemon= "Shiny Alakazam" , looktype = 1474}, --xxxx = id do item do addon --- "Dragonite" = nome do pokemon --- looktype = 1697 é o looktype do pokemon com addon } function onUse(cid, item, fromPosition, itemEx, toPosition) if addons[item.itemid] then if #getCreatureSummons(cid) > 0 then return doPlayerSendCancel(cid, "Please back your pokemon.") end local numero = addons[item.itemid].looktype local pb = getPlayerSlotItem(cid, 8).uid local pk = addons[item.itemid].pokemon if pb > 1 and getItemAttribute(pb, "poke") ~= pk then return doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.") end local attr = getItemAttribute(pb, "addon") or 0 if attr < 1 then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.") doSetItemAttribute(pb, "addon", numero) end else doPlayerSendCancel(cid, "This item isn't a addon, sorry.") end return true end
-
[Resolvido] Item com dias
Poderia dar mais detalhes sobre o segundo pedido? Por exemplo, como o jogador irá obter o cartão e o código do NPC que garante acesso a Saffari Zone. E, se possível, seu código de look também (data/creaturescripts/scripts, look.lua).
-
[Resolvido] Item com dias
Primeiro pedido: local days = 30 --Dias premium que serão adicionados. function onUse(cid, item) doPlayerSendTextMessage(cid, 27, days.." premium days added to your account.") doPlayerAddPremiumDays(cid, days) doRemoveItem(item.uid, 1) return true end O segundo, caso eu tenha acesso a meu notebook, faço amanhã.
-
Npc
Suponho que você não tenha entrado no link que enviei, então mandarei aqui mesmo o código. local mensagem = "" 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 local trophy = { ["ouro"] = {3, 5805}, --{Quantidade de items aleatórios, ID do troféu}, ["prata"] = {2, 5806}, ["bronze"] = {1, 5807}, } local items = {2154, 2156, 2158} if msgcontains(msg:lower(), "trophy") or msgcontains(msg:lower(), "trofeu") then selfSay("Acho que você pretende trocar algum troféu por gemas. Qual troféu você pretende trocar comigo: {ouro}, {prata} ou {bronze}?", cid) talkState[talkUser] = 1 return true elseif talkState[talkUser] == 1 then if trophy[msg:lower()] then selfSay("Você tem certeza que quer trocar 1 troféu de "..msg:lower().." por "..trophy[msg:lower()][1].." gema"..(trophy[msg:lower()][1] > 1 and "s" or "").." aleatória"..(trophy[msg:lower()][1] > 1 and "s" or "").."?", cid) mensagem = msg:lower() talkState[talkUser] = 2 return true else selfSay("Este troféu não existe.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg:lower(), "yes") or msgcontains(msg:lower(), "sim") and talkState[talkUser] == 2 then local trofeu = trophy[mensagem] local id = trofeu[2] if getPlayerItemCount(cid, id) > 0 then for i = 1, trofeu[1] do doPlayerAddItem(cid, items[math.random(#items)], 1) end doPlayerRemoveItem(cid, id, 1) selfSay("Obrigado, aqui estão suas gemas.", cid) talkState[talkUser] = 0 return true else selfSay("Você não possui este troféu.", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
- Npc
-
zombie event
Troque: doBroadcastMessage("EVENTO ZUMBI MENSAGEM: Um novo zumbi apareceu! Agora temos: " .. getGlobalStorageValue(config.zombieCount) .. " zumbis no evento!", MESSAGE_STATUS_CONSOLE_BLUE) por: local message = "EVENTO ZUMBI MENSAGEM: Um novo zumbi apareceu! Agora temos: %d zumbi%s no evento!" doBroadcastMessage(message:format(getGlobalStorageValue(config.zombieCount), getGlobalStorageValue(config.zombieCount) > 1 and "s" or ""), MESSAGE_STATUS_CONSOLE_BLUE)
-
Alavanca Que teleporta
A mensagem "You don't have a guild." vai aparecer quando você não estiver em uma guilda. Abaixo de: function onUse(cid) coloque: print(getPlayerGuildRank(cid)) E informe o que for imprimido no console, por favor.