Ir para conteúdo

Wakon

Héroi
  • Registro em

  • Última visita

Solutions

  1. Wakon's post in (Resolvido)Aparecer item em 'pos' was marked as the answer   
    function onUse(cid, item, fromPosition, itemEx, toPosition) local items = {} local reward = 0 local size = isContainer(item.uid) and getContainerSize(item.uid) or 0 if(size == 0) then reward = doCopyItem(item, false) else for i = 0, size do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then table.insert(items, tmp) end end end size = table.maxn(items) if(size >= 1) then reward = doCopyItem(items[1], true) doCreateItem(reward.itemid, 1, fromPosition) doCreatureSay(cid, "You found a ".. getItemNameById(reward.itemid) ..".", TALKTYPE_MONSTER) doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE) doRemoveItem(item.uid, 1) else doSendMagicEffect(fromPosition, CONST_ME_POFF) end return true end  
  2. Wakon's post in (Resolvido)[Adicionar função a script] was marked as the answer   
    local teleport = {x=986, y=926, z=7} -- Coordenadas para onde o player irá ser teleportado. function onUse(cid, item, fromPosition, item2, toPosition) if not isPremium(cid) then return doPlayerSendTextMessage(cid, 22, "Apenas jogadores premium.") and true end doTeleportThing(cid, teleport) doSendMagicEffect(getPlayerPosition(cid), 10) doPlayerSendTextMessage(cid, 22, "Teleportado.") return true end  
  3. Wakon's post in (Resolvido)Alterando preço de bless com nova moeda was marked as the answer   
    local bless = {1, 2, 3, 4, 5} local moeda, cost = 11230, 1 function onSay(cid, words, param) for i = 1, table.maxn(bless) do if(getPlayerBlessing(cid, bless)) then doPlayerSendCancel(cid, "Voce ja possui a bless do Hokage Sarutobi.") return true end end if doPlayerRemoveItem(cid, moeda, cost) then for i = 1, table.maxn(bless) do doPlayerAddBlessing(cid, bless) end doCreatureSay(cid, "Agora voce esta abencoado pelo Hokage Sarutobi" ,19) doSendMagicEffect(getPlayerPosition(cid), 5) else doPlayerSendCancel(cid, "Voce precisa de ".. cost .." ".. getItemNameById(moeda) .." para ser abencoado.") end return true end  
  4. Wakon's post in (Resolvido)Item ser removido quando usado was marked as the answer   
    function onUse(cid, item, fromPosition, itemEx, toPosition) local cfg = {} cfg.refuel = 42 * 60 * 1000 if(getPlayerStamina(cid) >= cfg.refuel) then doPlayerSendCancel(cid, "Your stamina is already full.") elseif(not isPremium(cid)) then doPlayerSendCancel(cid, "You must have a premium account.") else doPlayerSetStamina(cid, cfg.refuel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.") doRemoveItem(item.uid, 1) end return true end  
  5. Wakon's post in (Resolvido)Alavanca que crie um teleporte. was marked as the answer   
    local teleport = {{x = 1015, y = 1042, z = 7}, {x = 1013, y = 1042, z = 7}, 3} -- posição do teleport, posição que irá teleportar, segundos para fechar function onUse(cid, item, fromPos) local function doRemove() local teleportThing = getTileItemById(teleport[1], 1387).uid local lever = getTileItemById(fromPos, 1945) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O teleporte foi fechado!") doSendMagicEffect(teleport[1], CONST_ME_POFF) doRemoveItem(teleportThing, 1) doTransformItem(lever.uid, 1946) end if (item.itemid == 1946) then doCreateTeleport(1387, teleport[2], teleport[1]) doTransformItem(item.uid, 1945) doCreatureSay(cid, "O teleporte irá fechar em ".. teleport[3] .." segundos!", TALKTYPE_MONSTER) addEvent(doRemove, teleport[3] * 1000, item) else doPlayerSendTextMessage(cid, 28, "O teleporte já está aberto.") doSendMagicEffect(fromPos, CONST_ME_POFF) end return true end Lembre-se, você deve criar a alavanca com o ID 1946! Se der algum problema, me avise :D.
  6. Wakon's post in (Resolvido)[HELP] Remover Portal was marked as the answer   
    local stone = {{x = 1014, y = 1041, z = 7}, 1285} -- posição da pedra, id da pedra local teleport = {{x = 1015, y = 1042, z = 7}, {x = 1013, y = 1042, z = 7}} -- posição do teleport, posição que irá teleportar function onUse(cid, item) local stoneThing = getTileItemById(stone[1], stone[2]).uid local teleportThing = getTileItemById(teleport[1], 1387).uid if (item.itemid == 1945) then local stoneThing = getTileItemById(stone[1], stone[2]).uid doRemoveItem(stoneThing, 1) doTransformItem(item.uid, 1946) doCreateTeleport(1387, teleport[2], teleport[1]) doPlayerSendTextMessage(cid, 28 , "A pedra foi retirada e o portal apareceu!") else doTransformItem(item.uid, 1945) doCreateItem(stone[2], 1, stone[1]) doRemoveItem(teleportThing, 1) doPlayerSendTextMessage(cid, 28 , "A pedra foi re-colocada e o portal desapareceu!") end return true end  
  7. Wakon's post in (Resolvido)Ajuda com cliente was marked as the answer   
    Esta é uma mensagem automática! Este tópico foi movido para a área correta.
    Pedimos que você leia as regras do fórum.
     
  8. Wakon's post in (Resolvido)COMO TRANSFORMAR O NEW CLIENT EM OLD CLIENT was marked as the answer   
    Esta é uma mensagem automática! Este tópico foi movido para a área correta.
    Pedimos que você leia as regras do fórum.
     
  9. Wakon's post in (Resolvido)[Help] Action com filtro was marked as the answer   
    Eu recomendo que você coloque um level mínimo para fazer a quest ao invés de adicionar uma verificação por IP.
    Essa verificação por IP é muito fácil de burlar e pode prejudicar quem utiliza proxy para se conectar ao seu servidor.
  10. Wakon's post in (Resolvido)[ACTION] Item add description was marked as the answer   
    Tente assim:
    function onUse(cid, item, position) if item.itemid == 1945 then doTransformItem(item.uid, 1946) else doTransformItem(item.uid, 1945) end local removeItem1 = 11192 local removeItem2 = 7772 local AddItem = 7753 -- o item que o player vai ganhar if getPlayerItemCount(cid, removeItem1) >= 10 and getPlayerItemCount(cid, removeItem2) >= 1 then doPlayerRemoveItem(cid, removeItem1, 10) doPlayerRemoveItem(cid, removeItem2, 1) local add = doPlayerAddItem(cid, AddItem, 1) doItemSetAttribute(add, "description", "Este item foi comprado por " .. getPlayerName(cid) .. ".") doPlayerPopupFYI(cid, "Voce realizou seu upgrade com sucesso!") else doPlayerPopupFYI(cid, "voce precisa de: \n *10 pontos \n *arma +7 \n \n para relizar o upgrade.") return false end end  
  11. Wakon's post in (Resolvido)Player usando item e não some was marked as the answer   
    Tente assim:
    function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid,2765) >= 1 then doPlayerSendCancel(cid,"You are already vip.") doSendMagicEffect(topos,2) else doPlayerSendTextMessage(cid,22,mensagem) doSendMagicEffect(topos,56) doSendMagicEffect(topos,55) setPlayerStorageValue(cid,2765,1) doRemoveItem(item.uid, 1) end return true end  
  12. Wakon's post in (Resolvido)SetPlayerStorageValue(cid, Storage, +1) [RESOLVIDO] was marked as the answer   
    setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
  13. Wakon's post in (Resolvido)Ajuda em script de inserção was marked as the answer   
    Fiz um com onKill pra você:
    function onKill(cid, target) local cidID, targetID = getPlayerGUID(cid), getPlayerGUID(target) local targetREP = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. targetID .. ";") local rep = targetREP:getDataInt("rep") if isPlayer(cid) and isPlayer(target) then if getPlayerLevel(cid) >= 750 and getPlayerLevel(target) >= 750 then db.executeQuery("UPDATE `players` SET `rep` = `rep` + " .. 1 .. " WHERE `id` = " .. cidID .. ";") if rep > 0 then db.executeQuery("UPDATE `players` SET `rep` = `rep` - " .. 1 .. " WHERE `id` = " .. targetID .. ";") end end end return true end TAG:
    <event type="kill" name="repNew" event="script" value="arquivo.lua"/> E não esqueça de registrar no login.lua!
    registerCreatureEvent(cid, "repNew") Coloquei também uma checagem de rep para não deixar o player com rep negativo, se você quiser tirar é só remover essas linhas:
    if rep > 0 then db.executeQuery("UPDATE `players` SET `rep` = `rep` - " .. 1 .. " WHERE `id` = " .. targetID .. ";") end  
  14. Wakon's post in (Resolvido)Proibir alguns items de serem criados no comando /i was marked as the answer   
    local items = {11458, 3128} -- Aqui você coloca os items bloqueados. function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local ret = RETURNVALUE_NOERROR local pos = getCreaturePosition(cid) local id = tonumber(t[1]) if(not id) then id = getItemIdByName(t[1], false) if(not id) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end end if isInArray(items, id) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode criar este item!") end local amount = 100 if(t[2]) then amount = t[2] end local item = doCreateItemEx(id, amount) if(t[3] and getBooleanFromString(t[3])) then if(t[4] and getBooleanFromString(t[4])) then pos = getCreatureLookPosition(cid) end ret = doTileAddItemEx(pos, item) else ret = doPlayerAddItemEx(cid, item, true) end if(ret ~= RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1]) return true end doDecayItem(item) if(not isPlayerGhost(cid)) then doSendMagicEffect(pos, CONST_ME_MAGIC_RED) end return true end  
  15. Wakon's post in (Resolvido)broadcast was marked as the answer   
    Não deu pra entender muito bem, fiz um aqui veja se é o que você precisa.
    Em "Data/globalevents/scripts", broadcastArea.lua:
    local t = { fromPos = {x = 888, y = 767, z = 7}, toPos = {x = 902, y = 781, z = 7}, message = {[[ Mensagem. Pode adicionar outras linhas: linha 3 linha 4... ]]} } function onThink(interval, lastExecution) for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), t.fromPos, t.toPos) then doPlayerSendTextMessage(pid, 22, t.message[math.random(1,table.maxn(t.message))]) end end return true end Em "Data/globalevents", no arquivo globalevents.xml: <globalevent name="broadcastArea" interval="5" event="script" value="broadcastArea.lua"/> Se não for isso que você está procurando, tente explicar melhor.
     
  16. Wakon's post in (Resolvido)Addon Doll não funciona was marked as the answer   
    @lucaspds, vá no seu config.lua e procure por:
    addonsOnlyPremium = true
    troque por:
    addonsOnlyPremium = false
     
    Caso não tenha essa opção, adicione.
  17. Wakon's post in (Resolvido)[Pedido] Teleport por comando que tenha uma certa lista de tps was marked as the answer   
    Em "Data/talkactions/scripts", script.lua:
    local locais = { ["thais"] = {pos = {x = 160, y = 54, z = 7}, extraInfo = "- Cidade principal."}, ["edron"] = {pos = {x = 161, y = 55, z = 7}, extraInfo = "- Cidade dos Elfos."}, ["venore"] = {pos = {x = 161, y = 55, z = 7}, extraInfo = ""}, } local pz = true function onSay(cid, words, param) if pz == true and getTilePzInfo(getPlayerPosition(cid)) == false then doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você só pode teleportar em zonas de proteção.') and true end local param = param:lower(); local x = locais[param] if param == "list" then local str = "Locais:\n\n", "" for v, k in pairs(locais) do str = str.."".. v .." ".. k.extraInfo .."\n" end return doShowTextDialog(cid, 1950, str) end if x then doTeleportThing(cid, x.pos) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você foi teleportado para '.. param ..'.') else doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'A cidade '.. param ..' não existe, digite '.. words ..' list para ver as opções.') end return true end Tag:
    <talkaction words="!tl" event="script" value="nome_do_script.lua"/> Se der algum problema, me avise :).
  18. Wakon's post in (Resolvido)[HELP] Função onStepIn was marked as the answer   
    Script:
    local config = { storageQuest = 70001, timeWait = 20, -- Tempo em horas. } function onStepIn(cid, item, position, fromPosition) if (getPlayerStorageValue(cid, config.storageQuest) < os.time()) then setPlayerStorageValue(cid, config.storageQuest, os.time() + (config.timeWait * 3600)) doSendMagicEffect(getThingPos(cid), 73) doPlayerAddItem(cid, 25860 ,1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens! Voce acabou de completar a quest diaria.") doTeleportThing(cid, fromPosition) else doTeleportThing(cid, fromPosition) local s = getPlayerStorageValue(cid,config.storageQuest) - os.time() local h = math.ceil(((getPlayerStorageValue(cid, config.storageQuest)) - os.time()) / 3600) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Aguarde ".. s .." segundos (".. h .." horas) para pegar novamente.") end return true end TAG:
    <movevent type="StepIn" actionid="63301" event="script" value="nome_do_script.lua"/>  
  19. Wakon's post in (Resolvido)Fixar Rashid em uma city apenas was marked as the answer   
    Olha, eu nunca mexi com essa versão, mas acho que isso pode lhe ajudar.
    Vá em "Data/globalevents/scripts/spawn, abra o arquivo RashidSpawn.lua e troque por esse:
    Se você tiver o map editor funcionando certinho, você pode simplesmente desativar esse script e colocar o Rashid pelo map editor. Para desativar, vá em "Data/globalevents", abra o arquivo globalevents.xml e procure por essa linha: <globalevent type="startup" name="RashidSpawn" script="spawn/RashidSpawn.lua"/> Ai é só deletar ela ou trocar por essa:
    <!-- <globalevent type="startup" name="RashidSpawn" script="spawn/RashidSpawn.lua"/> -->  
  20. Wakon's post in (Resolvido)script quando o tempo da storage terminar player é teleportado was marked as the answer   
    Use um globalevents como o vankk disse, porém utilize esse script:
    local storage = XXXX -- Storage desejada. function onThink(interval, lastExecution) for _, pid in ipairs(getPlayersOnline()) do local stor = getPlayerStorageValue(pid, storage) if (stor < os.time()) and stor > 0 then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doSendMagicEffect(getPlayerPosition(pid), CONST_ME_TELEPORT) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Seu tempo acabou.') setPlayerStorageValue(pid, storage, 0) end end return true end A tag é essa:
    <globalevent name="checkTeleport" interval="1" event="script" value="checkTeleport.lua"/> Não esqueça de alterar o nome do script em value! E talvez seja necessário alterar o interval para 1000, caso seu OT seja em MS.
    Ser der algum problema, avise.
  21. Wakon's post in (Resolvido)Script infuncional (com e sem erro no distro) was marked as the answer   
    Fiz um aqui pra você, veja se lhe agrada:
    local storage, escudo = 40955, 2520 function onCastSpell(cid, var) local slot1, slot2 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid, getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid local target, pos = getCreatureTarget(cid), getCreaturePosition if isPlayer(target) then if slot1 == escudo or slot2 == escudo then setPlayerStorageValue(target, storage, 1) doCreatureSay(target, 'Charged!', TALKTYPE_MONSTER) doSendMagicEffect(pos(target), CONST_ME_STUN) addEvent(function() setPlayerStorageValue(target, storage, -1) doCreatureSay(target, 'Charged lost!', TALKTYPE_MONSTER) doSendMagicEffect(pos(target), CONST_ME_MAGIC_GREEN) end, 4000) else doSendMagicEffect(pos(cid), CONST_ME_POFF) return doPlayerSendCancel(cid, 'Você só pode usar esta magia com o escudo "'.. getItemNameById(escudo) ..'" equiipado.') and false end else doSendMagicEffect(pos(cid), CONST_ME_POFF) return doPlayerSendCancel(cid, 'Você só pode usar em jogadores.') and false end return true end  
  22. Wakon's post in (Resolvido)Talk Criar apenas itens configurados no script was marked as the answer   
    Troque pelo seu createitem:
    local items = {2160, 2161, 2162, 2163} -- Aqui você coloca os items permitidos. function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 9909) < 1 then return doPlayerSendCancel(cid, "Você não tem permissão para usar este comando.") and true end if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local ret = RETURNVALUE_NOERROR local pos = getCreaturePosition(cid) if t[1] == "list" then local str, n = "Items permitidos:\n\n", "" for v, k in pairs(items) do n = getItemNameById(k) str = str.."".. k .." - ".. n .."\n" end return doShowTextDialog(cid, 1950, str) end local id = tonumber(t[1]) if(not id) then id = getItemIdByName(t[1], false) if(not id) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end end if not isInArray(items, id) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode criar este item, para ver a lista de items permitidos digite: /i list") end local amount = 100 if(t[2]) then amount = t[2] end local item = doCreateItemEx(id, amount) if(t[3] and getBooleanFromString(t[3])) then if(t[4] and getBooleanFromString(t[4])) then pos = getCreatureLookPosition(cid) end ret = doTileAddItemEx(pos, item) else ret = doPlayerAddItemEx(cid, item, true) end if(ret ~= RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1]) return true end doDecayItem(item) if(not isPlayerGhost(cid)) then doSendMagicEffect(pos, CONST_ME_MAGIC_RED) end return true end Adicionei também uma lista dos items permitidos, basta digitar /i list.
    Se der algum problema, me avise.
  23. Wakon's post in (Resolvido)Comando /i por storage was marked as the answer   
    Troque seu script por esse:
    function onSay(cid, words, param, channel) if getPlayerAccess(cid) < 4 and getPlayerStorageValue(cid, 9909) < 1 then return doPlayerSendCancel(cid, "Você não tem permissão para usar este comando.") and true end if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local ret = RETURNVALUE_NOERROR local pos = getCreaturePosition(cid) local id = tonumber(t[1]) if(not id) then id = getItemIdByName(t[1], false) if(not id) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end end local amount = 100 if(t[2]) then amount = t[2] end local item = doCreateItemEx(id, amount) if(t[3] and getBooleanFromString(t[3])) then if(t[4] and getBooleanFromString(t[4])) then pos = getCreatureLookPosition(cid) end ret = doTileAddItemEx(pos, item) else ret = doPlayerAddItemEx(cid, item, true) end if(ret ~= RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1]) return true end doDecayItem(item) if(not isPlayerGhost(cid)) then doSendMagicEffect(pos, CONST_ME_MAGIC_RED) end return true end E no arquivo talkactions.xml, altere o access do /i para 3.
  24. Wakon's post in (Resolvido)BUG ITENS was marked as the answer   
    Vá em "Data/movements", abra o arquivo movements.xml e procure pelo ID do item desejado, ai é só alterar as vocações e o level para poder usar.
  25. Wakon's post in (Resolvido)Comando para remover mana atual do player was marked as the answer   
    Use a função doCreatureAddMana(cid, mana), basta colocar para adicionar - mana ao jogador.
    doCreatureAddMana(cid, -1000)  

Informação Importante

Confirmação de Termo