Tudo que zipter98 postou
- [AJUDA] DistanceEffect
-
(Resolvido)Sistema de Cofre
Primeiramente, você deve instalar este callback no seu servidor. Depois, em data/creaturescripts/scripts: local depot = xxx --ID do depot. local items = {itemid, itemid, itemid} --Configure aqui os items que poderão ser colocados no depot. function onMoveItem(cid, item, count, toContainer, fromContainer, fromPos, toPos) if toContainer.itemid == depot then if not isInArray(items, item.itemid) then return doPlayerSendCancel(cid, "You cannot put this item here!") and false end end return true end function onLogin(cid) registerCreatureEvent(cid, "depotCash") return true end Tags: <event type="moveitem" name="depotCash" event="script" value="nome_do_arquivo.lua"/> <event type="login" name="cashLogin" event="script" value="nome_do_arquivo.lua"/>
-
(Resolvido)[AJUDA] starter.lua
Você coloca um actionid que não esteja em uso no seu servidor. Recomendo não colocar valores baixos, porque geralmente já estão em uso. Pelo menos eu costumo usar valores com 4 dígitos (por exemplo: 8901, 9583, 4850, etc). Depois, basta configurar tal(is) actionid(s) no(s) baú(s) (esta etapa é feita no RME). Um exemplo de como a tabela poderia ficar: local pokemons = { [8018] = "Torchic", [8019] = "Mudkip", [8020] = "Treecko", [8021] = "Charmander", [8022] = "Squirtle", [8023] = "Bulbasaur", }
-
Matar player com x storage não pega frag
Se possível, poste o conteúdo do arquivo referente ao frag system aqui (data/creaturescripts/scripts). E como este x player vai ser definido? Nome?
-
(Resolvido)[AJUDA] starter.lua
local pokemons = { --[actionid] = "pokemon_name", --[Actionid do baú] = "nome do pokémon", --Exemplo: --[8018] = "Torchic", } local storage = 90561 function onUse(cid, item) if pokemons[item.actionid] and getPlayerStorageValue(cid, storage) < 1 then doPlayerSendTextMessage(cid, 27, "Parabéns!! Você pegou seu Pokemon Inicial!!\nBEM-VINDO AO POKEMON LUMINISMO ENTRE NO TELEPORT") setPlayerStorageValue(cid, storage, 1) doSendMagicEffect(getThingPos(cid), 29) doPlayerAddItem(cid, 2392, 100) doPlayerAddItem(cid, 12344, 100) addPokeToPlayer(cid, pokemons[item.actionid], false, false, nil, 0, "super", false) end return true end
-
NPC Upgrader
Oi, vi a ideia desse NPC em um lugar por aí e resolvi fazer. Consiste em um NPC que aprimora seu item (deve estar em uma das mãos - esquerda ou direita) a troco de um outro item (configurável). A cada nível de aprimoramento, seu item recebe um valor configurável no ataque, defesa e/ou armadura. Você pode configurar o nível de aprimoramento máximo, chance de falhar, valor adicional que o item receberá a cada aprimoração e, como já dito antes, o item que será cobrado pelo NPC. Em data/npc, crie um arquivo com extensão .XML, nomeie-o Upgrader, e coloque o seguinte conteúdo: <?xml version="1.0" encoding="UTF-8"?> <npc name="Upgrader" script="upgradenpc.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="134" head="39" body="113" legs="38" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|, voce gostaria de aprimorar o seu equipamento?"/> </parameters> </npc> Em data/npc/scripts, crie um arquivo com extensão .lua, nomeie-o upgradenpc.lua, e coloque o seguinte conteúdo: 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 config = { items = {12343, 10}, --Respectivamente, ID do item que o NPC irá cobrar e quantidade. maxBoost = 10, --Nível máximo do equipamento. failChance = 20, --Em porcentagem. upgradeValue = 1, --Valor adicional que o item receberá a cada aprimoração. } if msgcontains(msg:lower(), "yes") then for slot = 5, 6 do local item = getPlayerSlotItem(cid, slot) if item.uid > 0 then if getItemAttack(item) > 0 or getItemDefense(item) > 0 or getItemArmor(item) > 0 then if doPlayerRemoveItem(cid, config.items[1], config.items[2]) then local newUpgrade = (getItemAttribute(item.uid, "upgrade") or 0) + 1 if newUpgrade <= config.maxBoost then if math.random(1, 100) > config.failChance then doItemSetAttribute(item.uid, "name", getItemInfo(item.itemid).name.." [+"..newUpgrade.."]") if getItemAttack(item) > 0 then setItemAttack(item, getItemAttack(item) + config.upgradeValue) end if getItemDefense(item) > 0 then setItemDefense(item, getItemDefense(item) + config.upgradeValue) end if getItemArmor(item) > 0 then setItemArmor(item, getItemArmor(item) + config.upgradeValue) end doItemSetAttribute(item.uid, "upgrade", newUpgrade) selfSay("Seu equipamento foi aprimorado com sucesso.", cid) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("Aah, parece que a aprimoração falhou! Mais sorte na próxima vez.", cid) end return true else return selfSay("Seu equipamento já alcançou o nível máximo.", cid) end else return selfSay("Você não tem "..config._item[2].."x "..getItemNameById(config._item[1])..(config._item[2] > 1 and "s" or "")..".", cid) end end end end selfSay("Parece que você não tem um item para aprimorar.", cid) elseif msgcontains(msg:lower(), "no") then selfSay("Tudo bem, então.") end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Versão testada: 8.54 Bem, é só isso, até mais.
-
(Resolvido)[AJUDA] starter.lua
Qual a base do seu servidor? Se for PDA, procure em some functions.lua o código da função addPokeToPlayer e poste-o aqui.
-
(Resolvido)[Pedido]Algum scripter para min ajuda nesse script
Mude a função para esta: function getEvoPoke(name) local kev = pokevo[name] if kev then local qstones = kev.count local id1 = tonumber(kev.stoneid) local id2 = tonumber(kev.stoneid2) local nomestone1 = getItemNameById(id1) local nomestone2 = getItemNameById(id2) local st = "" st = ""..name.." Evoluir para "..kev.evolution.." \n" st = st.."level:"..kev.level.." \n" if kev.stoneid2 == 0 then st = st.."Stone:"..nomestone1.." \n" else st = st.."Stones:"..nomestone1.." e "..nomestone2.." \n" end st = st.."Quantidade de stones:"..qstones.." \n" return st end end Provavelmente você está usando-a num pokémon que não está configurado na tabela pokevo.
-
(Resolvido)[PEDIDO] Teleport que ao passar entrega um item para o player.
Actually, isso é um moveevent, não uma action.
-
(Resolvido)Sistema de Cofre
Você possui as sources do seu servidor?
-
Sobre o aumento da luz e tudo mais
is that thea queen
-
Evento Assasin
Obrigado. c: PS: Não testei. data/lib: config = { day = {"Saturday"}, --Dia(s) que ocorrerá o evento. time = 5, --Tempo de espera de player, em minutos. playerCount = {2, 20}, --Respectivamente, número mínimo e máximo de jogadores no evento. prize = {itemid, count}, --Respectivamente, ID do prêmio e quantidade. fromPosition = {x = x, y = y, z = z}, --Coordenadas da posição superior esquerda da área. toPosition = {x = x, y = y, z = z}, --Coordenadas da posição inferior direita da área. startTime = 20, --Tempo para iniciar o evento, em segundos. aid = 5901, storages = { global = 9501, players = 9502, storage = 9010, }, teleport = { tpId = xxx, --ID do teleporte. createPos = {x = x, y = y, z = z}, --Onde o teleporte será criado. }, } function addPlayerOnEvent(cid) if isPlayer(cid) then local sto = getGlobalStorageValue(config.storages.players) if type(sto) == "number" then setGlobalStorageValue(config.storages.players, getCreatureName(cid)) else local str = "" sto = sto:explode(",") table.insert(sto, getCreatureName(cid)) for i = 1, #sto do if str == "" then str = sto[i] else str = str..","..sto[i] end end setGlobalStorageValue(config.storages.players, str) end setPlayerStorageValue(cid, config.storages.storage, 1) doTeleportThing(cid, getRandomPositions(config.fromPosition, config.toPosition, 1)[1]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You entered on the Survival event.") doPlayerSetNoMove(cid, true) broadcastMessage(getCreatureName(cid).." entered on the Survival event. "..#getPlayersOnEvent().." on the event now.") end end function getPlayersOnEvent() local pid = {} local sto = getGlobalStorageValue(config.storages.players) if type(sto) ~= "string" then return false end sto = sto:explode(",") for i = 1, #sto do local cid = getCreatureByName(sto[i]) if isPlayer(cid) then table.insert(pid, cid) end end return #pid > 0 and pid or false end function getRandomPositions(fromPos, toPos, count) count = tonumber(count) or 1 local positions = {} for i = 1, count do table.insert(positions, {x = math.random(fromPos.x, toPos.x), y = math.random(fromPos.y, toPos.y), z = math.random(fromPos.z, toPos.z)}) end return positions end function getPlayersInArea(fromPos, toPos) local players = {} for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do local pos = {x = x, y = y, z = z} if isPlayer(getTopCreature(pos).uid) then table.insert(players, getTopCreature(pos).uid) end end end end return players end function addItem(cid, itemid, count) if isItemStackable(itemid) then doPlayerAddItem(cid, itemid, count) else if count > 1 then for i = 1, count do doPlayerAddItem(cid, itemid, 1) end else doPlayerAddItem(cid, itemid, 1) end end end data/globalevents/scripts: function onTime() if isInArray(config.day, os.date("%A")) then broadcastMessage("The survival event is open! You guys have "..config.time.." minutes to enter.") local item = doCreateItem(config.teleport.tpId, 1, config.teleport.createPos) doItemSetAttribute(item, "aid", config.aid) setGlobalStorageValue(config.storages.global, 1) addEvent(function() if getGlobalStorageValue(config.storages.global) == 1 then local tp = getTileItemById(config.teleport.createPos, config.teleport.tpId).uid if tp > 0 then doRemoveItem(tp) end if #getPlayersOnEvent() < config.playerCount[1] then broadcastMessage("Not enough players to start the survival event. :/") setGlobalStorageValue(config.storages.global, -1) for i = 1, #getPlayersOnEvent() do setPlayerStorageValue(getPlayersOnEvent()[i], config.storages.storage, -1) end db.executeQuery("UPDATE player_storage SET value = -1 WHERE key = "..config.storages.storage.." AND value != -1") else broadcastMessage("The survival event will start in "..config.startTime.." seconds.") addEvent(function() broadcastMessage("The survival event started!!!") setGlobalStorageValue(config.storages.global, 2) for i = 1, #getPlayersOnEvent() do doPlayerSetNoMove(getPlayersOnEvent()[i], false) end end, config.startTime * 1000) end end end, config.time * 60 * 1000) end return true end Tag: <!-- Mude 19:30 para o horário que quer que o evento Survival seja aberto. --> <globalevent name="Survival" time="19:30" event="script" value="nome_do_arquivo.lua"/> data/movements/scripts: function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true elseif getGlobalStorageValue(config.storages.global) < 1 then return doPlayerSendCancel(cid, "The event isn't open.") and doTeleportThing(cid, fromPosition) elseif getPlayersOnEvent() and #getPlayersOnEvent() >= config.playerCount[2] then return doPlayerSendCancel(cid, "There's already the maximum number of players on the Survival event.") and doTeleportThing(cid, fromPosition) end addPlayerOnEvent(cid) if #getPlayersOnEvent() >= config.playerCount[2] then local tp = getTileItemById(config.teleport.createPos, config.teleport.tpId).uid if tp > 0 then doRemoveItem(tp) end broadcastMessage("The survival event will start in "..config.startTime.." seconds.") setGlobalStorageValue(config.storages.global, 3) addEvent(function() broadcastMessage("The survival event started!!!") setGlobalStorageValue(config.storages.global, 2) for i = 1, #getPlayersOnEvent() do doPlayerSetNoMove(getPlayersOnEvent()[i], false) end end, config.startTime * 1000) end return true end Tag: <movevent type="StepIn" actionid="5901" event="script" value="nome_do_arquivo.lua"/> data/creaturescripts/scripts: function onPrepareDeath(cid) if getGlobalStorageValue(config.storages.global) > -1 and getPlayerStorageValue(cid, config.storages.storage) > -1 then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, 27, "Oh, you died in the survival event. :/") setPlayerStorageValue(cid, config.storages.storage, -1) if #getPlayersInArea(config.fromPosition, config.toPosition) == 1 then local pid = getPlayersInArea(config.fromPosition, config.toPosition)[1] broadcastMessage(getCreatureName(pid).." won the survival event! Congratulations to him!") doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) doCreatureAddMana(pid, getCreatureMaxMana(pid)) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "You win! Congratulations!\nYour prize: "..config.prize[2].."x "..getItemNameById(config.prize[1])..".") addItem(pid, config.prize[1], config.prize[2]) setPlayerStorageValue(pid, config.storages.storage, -1) setGlobalStorageValue(config.storages.global, -1) end end return true end function onStatsChange(cid, attacker, type, combat, value) if getGlobalStorageValue(config.storages.global) > -1 and getGlobalStorageValue(config.storages.global) ~= 2 and getPlayerStorageValue(cid, config.storages.storage) > -1 then return false end return true end function onLogin(cid) if getPlayerStorageValue(cid, config.storages.storage) > -1 and getGlobalStorageValue(config.storages.global) < 1 then setPlayerStorageValue(cid, config.storages.storage, -1) end registerCreatureEvent(cid, "damageSurvival") registerCreatureEvent(cid, "deathSurvival") return true end function onLogout(cid) if getGlobalStorageValue(config.storages.global) > -1 and getPlayerStorageValue(cid, config.storages.storage) > -1 then return doPlayerSendCancel(cid, "You can't logout on the survival event.") and false end return true end Tags: <event type="preparedeath" name="deathSurvival" event="script" value="nome_do_arquivo.lua"/> <event type="login" name="survivalLogin" event="script" value="nome_do_arquivo.lua"/> <event type="logout" name="survivalLogout" event="script" value="nome_do_arquivo.lua"/> <event type="statschange" name="damageSurvival" event="script" value="nome_do_arquivo.lua"/>
-
Evento Assasin
OK, última pergunta: ao ser teleportado para a área do evento, o jogador ficará parado até começar ou poderá andar livremente?
-
(Resolvido)Sistema de Cofre
O item armazena o dinheiro através do atributo money. E diga-me se entendi corretamente sua pergunta: você quer que só possam ser colocados itens pré-definidos em um container x?
-
(Resolvido)[Pedido]Algum scripter para min ajuda nesse script
Poste o conteúdo do arquivo PokedexLib.lua, se possível. O erro não está na função.
-
Evento Assasin
Como o jogador se inscreverá no evento? Talkaction? Step in? Os jogadores serão teleportados logo após a inscrição ou quando o evento for iniciado? E a posição será constante ou aleatória?
-
Pedido System Vip Da Para Todos
Mas qual VIP System você está utilizando? Há vários pela internet. Sem saber qual é o seu, não tem como ajudar. Se não souber, procure por algum código que adicione VIP ao jogador (geralmente, é uma talkaction) e poste-o aqui.
-
(Resolvido)Sistema de Cofre
function onUse(cid, item) local money = getItemAttribute(item.uid, "money") or 0 if money > 0 then doPlayerAddMoney(cid, money) doItemSetAttribute(item.uid, "money", 0) doItemSetAttribute(item.uid, "description", "It doesn't has money.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have withdrawn "..money.." gold.") else if getPlayerMoney(cid) > 0 then money = getPlayerMoney(cid) doPlayerRemoveMoney(cid, money) doItemSetAttribute(item.uid, "money", money) doItemSetAttribute(item.uid, "description", "It has "..money.." gold.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have deposited "..money.." gold.") else return doPlayerSendCancel(cid, "You do not have money.") end end return true end
-
Problemas ao usar a Pokedex
Você provavelmente não configurou estes pokémons na tabela newpokedex, de configuration.lua. Esta é a causa do erro.
-
colocar limite de itens emcima do depot
Você provavelmente instalou erroneamente o callback onMoveItem nas sources. EDIT: Corrigi um bug que havia encontrado. Agora o script está funcionando perfeitamente. Lembrando que o erro imprimido no console não tem nada a ver com este que citei. Como já dito, é provável que o callback tenha sido mal instalado.
-
(Resolvido)Item que não faz trade e não possa jogar.
Primeiramente, você deverá ter este callback instalado no seu servidor. data/creaturescripts/scripts: function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot = 0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i = 0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end local itemId = 19473 --ID do item. local depot = xxx --ID do depot. function onMoveItem(cid, item, count, toContainer, fromContainer, fromPos, toPos) if getTileItemById(toPos, depot).uid < 1 then if toPos.x ~= 65535 or toPos.y ~= 64 then return doPlayerSendCancel(cid, "You can't move this item.") and false end end return true end function onTradeRequest(cid, target, item) if item.itemid == itemId then return doPlayerSendCancel(cid, "You can't trade this item.") and false elseif isContainer(item.uid) then if #getItemsInContainerById(item.uid, itemId) > 0 then return doPlayerSendCancel(cid, "You can't trade this item.") and false end end return true end function onTradeAccept(cid, target, item, targetItem) if item.itemid == itemId then return doPlayerSendCancel(cid, "You can't trade this item.") and false elseif isContainer(item.uid) then if #getItemsInContainerById(item.uid, itemId) > 0 then return doPlayerSendCancel(cid, "You can't trade this item.") and false end end return true end function onLogin(cid) local events = {"moveItem", "tradeItem", "accItem"} for i = 1, #events do registerCreatureEvent(cid, events[i]) end return true end Tags: <event type="traderequest" name="tradeItem" event="script" value="nome_do_arquivo.lua"/> <event type="moveitem" name="moveItem" event="script" value="nome_do_arquivo.lua"/> <event type="tradeaccept" name="accItem" event="script" value="nome_do_arquivo.lua"/> <event type="login" name="itemLogin" event="script" value="nome_do_arquivo.lua"/> Caso você não possua as sources do seu servidor, avise.
-
Problemas ao usar a Pokedex
Este erro ocorre com todos os pokémons? Troque: for i = 1, #oldpokedex do if getPlayerInfoAboutPokemon(cid, oldpokedex[i][1]).dex then unlock = unlock + 1 end end por: for i = 1, #oldpokedex do if oldpokedex[i] and oldpokedex[i][1] and getPlayerInfoAboutPokemon(cid, oldpokedex[i][1]) and getPlayerInfoAboutPokemon(cid, oldpokedex[i][1]).dex then unlock = unlock + 1 end end e veja se o erro na distro persiste.
- (Resolvido)Evento matar outro player ganhar EXP
-
colocar limite de itens emcima do depot
Você configurou o ID da mesa do depot corretamente? Há algum erro na distro?
-
colocar limite de itens emcima do depot
Este código, na verdade, é um creaturescript, não um moveevent. Em login.lua, registre: registerCreatureEvent(cid, "moveDepot") Tag: <event type="moveitem" name="moveDepot" event="script" value="nome_do_arquivo.lua"/>