
-
-
-
-
-
-
-
-
-
-
-
-
-
(Resolvido)Npc de Troca
@isac001
-
Tirar exigência de gold do npc barco
@ADM Alef Como sugestão, uma solução mais rápida, para não precisar fazer isso em todos os NPCS: apenas troque o "cost" para false O que era assim: travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = cost, discount = 'postman', destination = destination}, nil, action) Fica assim: travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = false, discount = 'postman', destination = destination}, nil, action)
-
(Resolvido)Spell Cura Self, Mudar para Sio
Coloquei a fórmula da magia como no exura sio que você deixou. Qualquer coisa é só trocar a fórmula ali como você quiser. local spellConfig = { healCount = 12, -- número de vezes que vai curar healInterval = 75 -- intervalo da cura em milisegundos } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onGetFormulaValues(player, level, maglevel) local div = 1 / spellConfig.healCount local min = div * ((level / 5) + (maglevel * 10)) local max = div * ((level / 5) + (maglevel * 14)) return min, max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local function sendHealingEffect(cid, var, target, healcounter) local player = Player(cid) if not player then return end local targetPlayer = Player(target) if not targetPlayer then return end combat:execute(player, var) local targetPos = targetPlayer:getPosition() local randPos = Position(targetPos.x + math.random(-4, 3), targetPos.y + math.random(-3, 2), targetPos.z) randPos:sendMagicEffect(CONST_ME_ASSASSIN) randPos:sendDistanceEffect(targetPos, CONST_ANI_SMALLHOLY) targetPos:sendMagicEffect(CONST_ME_MAGIC_BLUE) if healcounter == 0 then targetPos:sendMagicEffect(CONST_ME_HOLYAREA) end end function onCastSpell(creature, var) local target = Player(var:getNumber()) if not target then return end local healcounter, interval = spellConfig.healCount, spellConfig.healInterval local playerId = creature:getId() local targetId = target:getId() creature:say(string.format('Brothers, heal %s now!', target:getName()), TALKTYPE_MONSTER_SAY) for i = 1, healcounter do addEvent(sendHealingEffect, (i-1) * interval, playerId, var, targetId, healcounter - i) end return false end Pega a tag do exura sio no spells.xml e coloca para sua magia. Vai ficar assim: https://i.imgur.com/Uiha0uB.gif
-
(Resolvido)Bug ao Remover arma
Pelo que entendi da sua magia, já que não tive como testar, primeiro é recomendável que você adicione na tag da magia no spells.xml o seguinte: needweapon="1" Para que não dê mais erros, deixe a magia assim: Dessa maneira, caso o player desequipe a arma ou troque o tipo de arma em relação ao tipo que estava equipado quando soltou a magia (ex.: solta com sword e depois equipa um axe), a magia vai parar. Lembrando que do jeito que sua magia está, ele ainda vai poder desequipar a arma e caso volte a equipá-la dentro do tempo de duração da magia, a magia voltará a atacar. Não sei se isso foi proposital, se é pra funcionar assim mesmo... Ajuste o tempo de duração da magia com o cooldown para soltar novamente e vai funcionar corretamente.
-
Como colocar STORAGE GLOBAL, Nesse Script
local leverCooldown = {1, "hour"} -- Configure o tempo para usar novamente. Ex.: {30, "sec"}, {2, "min"}, {5, "hour"}, {3, "day"} local cooldownStorage = 91801 -- só modifique se necessário local items = { {pos = {x = 431, y = 285, z = 7}, itemid = 2129}, {pos = {x = 441, y = 284, z = 7}, itemid = 5943}, {pos = {x = 440, y = 290, z = 7}, itemid = 2363}, } local monsters = { {pos = {x = 436, y = 285, z = 7}, name = "Wolf"}, } local config = { onSpawnMonster = CONST_ME_TELEPORT, -- efeito lançado quando monstro é criado onRemoveItem = CONST_ME_BLOCKHIT, -- efeito lançado quando item é removido missingItem = CONST_ME_POFF, -- efeito lançado quando não encontrou o item para remover } -- 255 faz com que não lance efeito algum local function mathtime(table) -- by dwarfer if table[1] == 0 then return 0 end local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end end function onUse(cid, item, frompos, item2, topos) if getGlobalStorageValue(cooldownStorage) > os.time() then doPlayerSendCancel(cid, "Espere 1h para usar a alavanca novamente.") return true end local missing_items, remove_items = false, {} for _, itemcheck in pairs (items) do local i = getTileItemById(itemcheck.pos, itemcheck.itemid).uid if i < 1 then missing_items = true if tonumber(config.missingItem) and config.missingItem ~= 255 then doSendMagicEffect(itemcheck.pos, config.missingItem) end else table.insert(remove_items, i) end end if missing_items then return doPlayerSendCancel(cid, "Está faltando algum item.") else for _, iuid in pairs (remove_items) do if tonumber(config.onRemoveItem) and config.onRemoveItem ~= 255 then doSendMagicEffect(getThingPos(iuid), config.onRemoveItem) end doRemoveItem(iuid) end for _, monsterinfo in pairs (monsters) do local m = doCreateMonster(monsterinfo.name, monsterinfo.pos, false) if isCreature(m) and tonumber(config.onSpawnMonster) and config.onSpawnMonster ~= 255 then doSendMagicEffect(getThingPos(m), config.onSpawnMonster) end end setGlobalStorageValue(cooldownStorage, mathtime(leverCooldown) + os.time()) end return true end
-
-
-
(Resolvido)adicionar magic level nesse script
- ####################################### -- ####### Developed by MaXwEllDeN ####### -- ####### Level Points System ####### -- ####### Version: 1.0 ####### -- ####################################### local function addMagLevel(cid, amount) local amount = amount or 1 for i = 1, amount do doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid), false) end return true end function onSay(cid, words, param) if not (L_LvlPoints.vocPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = string.explode(param, ",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["distance"] = 4, } if (param == "check") then doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574) .."\nPontos por level: ".. L_LvlPoints.vocPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (L_LvlPoints.attributes[p2[2]]) and (tonumber(p2[3])) then if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) then doPlayerSendCancel(cid, "Você não tem pontos suficientes para distribuir!") return doSendMagicEffect(getThingPos(cid), 2) end if (p2[2] == "vitalidade") then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddHealth(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "energy") then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddMana(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "magic" then) addMagLevel(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false) end end doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 30) doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np, 180) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) else local msgx = "" for i, v in pairs(L_LvlPoints.attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n" end doPlayerPopupFYI(cid, "Pontos necessários para aumentar os stats:\n\n".. msgx .. "\nExemplo de uso: ".. words .." add, vitalidade, 5\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574)) end return true end
-
Boss para mission, usando item.
@Lisbeky Não tive como testar, mas se você configurar certinho creio que funcionará. 1. Adicione o NPC Em data/npc, adicione o arquivo.xml. As falas, o nome do NPC bem como o looktype são apenas para exemplo, configure como quiser. <?xml version="1.0" encoding="UTF-8"?> <npc name="Ghoster" script="default.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="48"/> <voices> <voice text="Annnnnnkkkhhhhhhhhh" interval2="50"/> <voice text="Boo!" interval2="50"/> <voice text="Why are you scared?" interval2="50"/> </voices> </npc> 2. Em data/actions/scripts crie um arquivo.lua e cole isto dentro: No actions.xml adicione a tag e edite o id do item: <action itemid="1111" script="NOMEDOARQUIVO.lua" /> 3. No arquivo do monstro, adicione antes de </monster>, o seguinte: <script> <event name = "GhostBossDeath"/> </script> 4. Em data/creaturescripts/scripts, crie um arquivo.lua e cole isto dentro: Edite o storage para os valores da sua quest. Lembrando que só ganharão o storage aqueles que causarem dano ao boss. No creaturescripts.xml, adicione a tag: <event type="death" name="GhostBossDeath" event="script" value="NOMEDOARQUIVO.lua"/> É isso.
-
-
Dwarfer reagiu a uma resposta no tópico: [8.60][OLD Client] Narutibia (NTO HARD) - Servidor Completo
-
(Resolvido)[Movements] Dúvida
Para os próximos pedidos, tente deixar o título do seu tópico representativo do pedido. Se entendi bem o que você quis dizer... No movements.xml adicione as tags para o StepIn e para o StepOut referentes ao actionid do piso.
-
(Resolvido)Script alavanca
local t = { players = { [1] = Position(1,1,1), [2] = Position(1,1,1), [3] = Position(1,1,1), [4] = Position(1,1,1), [5] = Position(1,1,1) }, boss = {name = "Dwarf Guard", create_pos = Position(1,1,1)}, destination = Position(1,1,1), cooldown = {20, "hour"}, storage = 56482 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local players, tab = {}, t.players for i = 1, #tab do local tile = Tile(tab[i]) if tile then local p = Player(tile:getTopCreature()) if p then if p:getStorageValue(t.storage) <= os.time() then players[#players + 1] = p:getId() end end end end if #players == 0 then player:sendCancelMessage("None of the players did not wait " .. getStrTime(t.cooldown) .. " to go again.") return true end for i = 1, #tab do local playerTile = Tile(tab[i]) local playerToGo = Player(playerTile:getTopCreature()) if playerToGo then if isInArray(players, playerToGo:getId()) then playerToGo:setStorageValue(t.storage, mathtime(t.cooldown) + os.time()) playerTile:relocateTo(t.destination) tab[i]:sendMagicEffect(CONST_ME_POFF) end end end t.destination:sendMagicEffect(CONST_ME_TELEPORT) Game.createMonster(t.boss.name, t.boss.create_pos) item:transform(item.itemid == 1945 and 1946 or 1945) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end return error("Bad declaration in mathtime function.") end function getStrTime(table) -- by dwarfer local unit = {["sec"] = "second",["min"] = "minute",["hour"] = "hour",["day"] = "day"} return tostring(table[1].." "..unit[table[2]]..(table[1] > 1 and "s" or "")) end
-
Ajuda com Task
Se você utilizar a mesma lib que enviou, o mesmo npc e substituir o script de movements que você tem pelo que eu enviei, vai resolver. Siga o que eu falei aí sobre os uniqueids. Ele deixa repetir a task, desde que na Lib não esteja com o: norepeatable = true, 'true' a task não pode ser repetida, 'false' a task pode ser repetida. Se sair da sala do boss ele não some, mas se outra pessoa foi entrar, o boss que estava lá vai ser removido e será criado outro boss. É assim que está o script que você enviou e que eu acho que dá no mesmo que ele sumir assim que o player sair.
-
(Resolvido)Script reward
local moneyRate = 50 -- % de dinheiro que será perdida local sendMoneyMsg = true -- 'true' para enviar mensagem de quanto dinheiro foi perdido, 'false' para não enviar function onDeath(cid, corpse, killer, frompos) if not isPlayer(cid) then return true end local check_killer = killer[1] local playerKiller = isCreature(check_killer) and (isPlayer(check_killer) and check_killer or getCreatureMaster(check_killer)) or nil if not playerKiller then return true end local victimName, victimLevel, killerName, killerLevel = getPlayerName(cid), getPlayerLevel(cid), getPlayerName(playerKiller), getPlayerLevel(playerKiller) local victimMoney = getPlayerMoney(cid) if victimMoney > 0 then local money = math.ceil(.01 * moneyRate * victimMoney) if money > 0 then doPlayerRemoveMoney(cid, money) doPlayerAddMoney(playerKiller, money) if sendMoneyMsg then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("You lost %d gold coin%s due to this death.", money, (money > 1 and "s" or ""))) doPlayerSendTextMessage(playerKiller, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("You earned %d gold coin%s for this kill.", money, (money > 1 and "s" or ""))) end end end doBroadcastMessage(string.format("O jogador %s (Level: %d) foi morto pelo jogador %s (Level: %d).", victimName, victimLevel, killerName, killerLevel), MESSAGE_STATUS_CONSOLE_RED) return true end
-
Teleporta players de X area para o templo
Em data/movements/scripts crie um arquivo.lua e cole isto dentro: No movements.xml, adicione a tag: <movevent type="StepIn" actionid="ACTIONID_DO_PISO" event="script" value="NOMEDOARQUIVO.lua"/>
-
(Resolvido)como por numeros quebrados na stage?
@guhcast Não fique com dúvidas, pergunte mesmo. Podem ter outras pessoas com a mesma dúvida que a sua. <stage minlevel="1" maxlevel="7" multiplier="12" /> <stage minlevel="8" maxlevel="50" multiplier="10" /> <stage minlevel="51" maxlevel="80" multiplier="8" /> <stage minlevel="81" maxlevel="100" multiplier="6" /> <stage minlevel="101" maxlevel="140" multiplier="1.5" /> <stage minlevel="141" maxlevel="200" multiplier="0.5" /> <stage minlevel="201" multiplier="0.05" /> Exemplifiquei os três últimos.
-
Ajuda com Task
@nanomeyer, ao que parece você pegou um script qualquer de teleporte para os bosses sem que ele tivesse relação com o sistema de task que você tá utilizando. Por isso não funciona. Substitua o que tem no arquivo data/movements/scripts/tasks.lua, por esse: Exemplifiquei para o The Snapper, perceba na linha: [16691] = {monsters = {"The Snapper"}, telePos = {x = 32610, y = 32724, z = 8}, spawnPos = {x = 32611, y = 32727, z = 8}, from = {x = 32606, y = 32720, z = 8}, to = {x = 32620, y = 32733, z = 8}}, Entre [ ] é o uniqueid que você colocará no teleporte. Esse uniqueid deve ser igual ao storage configurado no arquivo data/lib/104-KillingInTheNameOf.lua: Veja para a task dos crocodilos: [3] = {killsRequired = 1, raceName = "Crocodiles", level = {6, 49}, premium = true, creatures = {"crocodile"}, rewards = { {type = "exp", value = {11000}}, {type = "achievement", value = {"Blood-Red Snapper"}}, {type = "storage", value = {16691, 1}}, {type = "points", value = {1}} }}, Em: {type = "storage", value = {16691, 1}}, Em "value", sempre deixe o segundo valor igual a 1. Agora é com você pra colocar os storages em uma sequência e deixar os uniqueids mais organizados. Ou então deixa tudo bagunçado mesmo. ?♂️
-
Outfit exclusiva
Existem várias maneiras de fazer isso. Uma delas é a seguinte: No outfits.xml, adicione a storage necessária para que o jogador possua o outfit. Exemplo: <outfit id="1" storageId="1111" storageValue="1"> <list gender="0" lookType="136" name="Citizen"/> <list gender="1" lookType="128" name="Citizen"/> </outfit> Utilizei como exemplo o storage 1111, modifique para o seu. Em data/creaturescripts/scripts crie um arquivo.lua e cole isto dentro: local vocations = {1,2,3,4,5,6} -- ids das vocações que terão permissão de utilizar o outfit local storage = 1111 -- storage do outfit (mesmo storage configurado para o outfit no outfits.xml) function onLogin(cid) if getPlayerStorageValue(cid, storage) == 1 then return true end if not isInArray(vocations, getPlayerVocation(cid)) then return true end setPlayerStorageValue(cid, storage, 1) return true end No creaturescripts.xml, adicione a tag: <event type="login" name="CitizenLogin" event="script" value="NOMEDOARQUIVO.lua"/>