
Tudo que Vodkart postou
-
[RESOLVIDO] - [SQLite] -=[TFS]=- 0.4 8.60 Problema com npc Scrutinon
é pq na storage você só pode armanezar até um valor númerico - decimais, acho que é 99999999, e com essa experiencia do level toda, teria que ser armazenado em um outro arquivo as experiencias. por exemplo level 3 mil: 449,100,849,800
-
(Resolvido)[SQLite] -=[TFS]=- 0.4 8.60 [CREATURESCRIPT] VIP Days Não Funciona Alguem Pode me Ajuda
posta o script do tile
-
[Spell] Como fazer monstro perde o target durante o cast
tenta usar addEvent, +ou- assim: local conf = { stunTime = 4500, delayCast = 600, scream = "EXPLOSION FIRE", speakChance = 5, speakList = {"Did you get burned?", "I like well-done meat"} } local s = 0 -- Combat local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN) -- Stun local stun = createConditionObject(CONDITION_PARALYZE) setConditionParam(stun, CONDITION_PARAM_TICKS, conf.stunTime) setConditionFormula(stun, -1, 0, -1, 0) local function setInitCast(cid) if isCreature(cid) then doAddCondition(cid, stun) doCreatureSetLookDir(cid, SOUTH) doCreatureSay(cid, conf.scream, TALKTYPE_MONSTER_YELL) end end function onCastSpell(cid, var) setInitCast(cid) addEvent(function() if not isCreature(cid) then return true elseif s > conf.stunTime then return true end doCreatureSetLookDir(cid, SOUTH) s = s + 250 end, 250) return doCombat(cid, combat, var) end
-
[RESOLVIDO] - [SQLite] -=[TFS]=- 0.4 8.60 Problema com npc Scrutinon
https://tibiaking.com/forums/topic/12807-recovery-exp/
-
[SQLite] -=[TFS]=- 0.4 8.60 buga a contagem dos days vip quando digita !buyvip fica com 31 dias de vip.
function onSay(cid, words, param) local level = getPlayerLevel(cid) local vocation = getPlayerVocationName(cid) local health, maxhealth = getCreatureHealth(cid), getCreatureMaxHealth(cid) local mana, maxmana = getCreatureMana(cid), getCreatureMaxMana(cid) local balance, pdays = getPlayerBalance(cid), getPlayerPremiumDays(cid) local fist, club, sword, axe = getPlayerSkillLevel(cid, 0), getPlayerSkillLevel(cid, 1), getPlayerSkillLevel(cid, 2), getPlayerSkillLevel(cid, 3) local distance, shield, fishing, magic = getPlayerSkillLevel(cid, 4), getPlayerSkillLevel(cid, 5), getPlayerSkillLevel(cid, 6), getPlayerMagLevel(cid) local lvldodge = getPlayerStorageValue(cid, 98798644) local lvlcrit = getPlayerStorageValue(cid, 48903) local lvlatk = getPlayerStorageValue(cid, 48904) local a = os.time() local b = math.floor((getPlayerStorageValue(cid, 13545) - a)/(24 * 60 * 60)) local reset = getPlayerStorageValue(cid, 54676) local cap = getPlayerFreeCap(cid) local msg = "Vocation: "..vocation.."\nLevel: ".. level .."\nHP: ".. health .."/".. maxhealth .."\nMP: ".. mana .."/".. maxmana .."\nCapacity: ".. cap .."\nBalance: "..balance.."\nPremium Days: "..pdays.."\nDodge Level: ".. lvldodge .."\nCritical Level: ".. lvlcrit .."\nBOOSTER ATK: ".. lvlatk .."\nMagic Level: ".. magic .."\n[VIP] Days: ".. (b < 0 and 0 or b) .."\nReset Count: ".. reset .." \n\nFist: ".. fist .."\nClub: ".. club .."\nSword: ".. sword .."\nAxe: ".. axe .."\nDistance: ".. distance .."\nShield: ".. shield .."\nFishing: ".. fishing .."" doPlayerPopupFYI(cid, msg) return true end
-
Up vocation
lembrando que ao invés de criar uma tabela e ir adicionando voc por voc, poderia usar somente em uma linha esssa função: doPlayerSetVocation(cid, isSorcerer(cid) and 17 or isDruid(cid) and 18 or isPaladin(cid) and 19 or 20) porém o importante é dar certo, reputado.
-
(Resolvido)Boss Room tfs 0.4
já existe a função de remover o boss, basta usá-la. function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for i = 1, #BossRoom.alavanca do local v = getTopCreature(BossRoom.alavanca[i]).uid players[i] = isPlayer(v) and v or nil end function checkPlayersInRoom() -- Responsável por verificar se há jogadores na sala enfrentando o boss. local player_room = 0 for x = BossRoom.areaSalaBoss[1].x, BossRoom.areaSalaBoss[2].x do for y = BossRoom.areaSalaBoss[1].y, BossRoom.areaSalaBoss[2].y do for z = BossRoom.areaSalaBoss[1].z, BossRoom.areaSalaBoss[2].z do local pos = {x=x, y=y, z=z,stackpos = 253} local thing = getThingfromPos(pos) if thing.itemid > 0 and isPlayer(thing.uid) == true then player_room = player_room+1 end end end end return player_room end if #players < BossRoom.minPlayers then doPlayerSendCancel(cid, "You need at least "..BossRoom.minPlayers.." players to enter.") return true end if checkPlayersInRoom() >= 1 then doPlayerSendTextMessage(cid,19, "There is already a team in the boss room.") return true end function playersTP(position) -- Responsável por teleportar os jogadores for i = 1, 6 do if players[i] then doTeleportThing(players[i], position) doSendMagicEffect(position, CONST_ME_TELEPORT) end end end function removeBoss() -- Responsavel por Remover o BOSS da sala (caso os players nao tenham matado) for x = BossRoom.areaSalaBoss[1].x, BossRoom.areaSalaBoss[2].x do for y = BossRoom.areaSalaBoss[1].y, BossRoom.areaSalaBoss[2].y do for z = BossRoom.areaSalaBoss[1].z, BossRoom.areaSalaBoss[2].z do local area = {x = x, y = y, z = z} local creature = getTopCreature(area).uid if isCreature(creature) then doRemoveCreature(creature) end end end end end function checkBossTime() -- Responsável por verificar se os jogadores matou ou não o boss após 10 minutos. for x = BossRoom.areaSalaBoss[1].x - 1, BossRoom.areaSalaBoss[2].x + 1 do for y = BossRoom.areaSalaBoss[1].y - 1, BossRoom.areaSalaBoss[2].y + 1 do local pos = {x=x, y=y, z=BossRoom.areaSalaBoss[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) and isInArray(BossRoom.name, getCreatureName(m)) then playersTP(BossRoom.positionKickPlayer) removeBoss() end end end return false end removeBoss() playersTP(BossRoom.positionSalaBoss) doCreateMonster(BossRoom.name, BossRoom.positionSpawnBoss) addEvent(checkBossTime, BossRoom.timeToKill*60*1000) return true end
-
2 comandos para checar itens
https://tibiaking.com/forums/topic/77212-86-talkactions-find-item/
- Exclusive Cave System By Account! 8.6
-
Morrendo infinitamente no mesmo local
Este tópico foi movido para a seção de Suporte Otserv Alternativo
-
Npc pra diferentes vocations
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 shopWindow = {} local t = { [2195] = {price = 15, vocs = {1,5}}, -- [ITEMID] = {valor e vocation ids} [2493] = {price = 25, vocs = {2,6}}, [2361] = {price = 30, vocs = {3,7}}, [8851] = {price = 20, vocs = {4,8}}, [8925] = {price = 30, vocs = {1,5}}, [2640] = {price = 50, vocs = {3,7}}, [2494] = {price = 100, vocs = {2,6}}, [9932] = {price = 50, vocs = {4,8}}, [2472] = {price = 70, vocs = {1,5}}, [8931] = {price = 100, vocs = {1,5}} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveMoney(cid, t[item].price) then selfSay("you dont have "..t[item].price.." gps.", cid) else doPlayerAddItem(cid, item) selfSay("Here your item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE')) then for var, ret in pairs(t) do if isInArray(ret.vocs, getPlayerVocation(cid)) then table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Npc pra diferentes vocations
é todos os npc's ou um npc especifico?
-
criar npc dentro da house
Pelo que eu percebi é que vc vai ter que compilar sua distro ou trocar ela para uma que aceite o npc dentro da house, no meu server test (baiak) funcionou normalmente.
-
criar npc dentro da house
só dá erro neste npc Alice? já testou com outros?
-
Alguem ajudar a adicionar comando nesse MOD
<talkaction words="/task;!task" event="buffer"><![CDATA[ domodlib('task_func') param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid) if isInArray({"counter","contador"},param) then setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true elseif isInArray({"daily","diaria"},param) then if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true end return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".") end if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then doPlayerSendCancel(cid, "você não está em nenhuma task.") return true end return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".") ]]></talkaction> por <talkaction words="/task;!task" event="buffer"><![CDATA[ domodlib('task_func') param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid) if isInArray({"counter","contador"},param) then setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true elseif isInArray({"pontos","points","ponto","point"},param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] Voce tem ".. getTaskPoints(cid) .." Task Points.") return true elseif isInArray({"daily","diaria"},param) then if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true end return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".") end if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then doPlayerSendCancel(cid, "você não está em nenhuma task.") return true end return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".") ]]></talkaction> só usa agora !task points
-
(Resolvido)Ajuda com boss diário. 8.0
- [PROBLEMA] Storage não armazena valor correto
não é mais fácil colocar 0 então ao invés de -1.30? setPlayerStorageValue(cid, sorte[1], 0) ou são varias formulas?- AJUDA COM TABELAS ! monster name = "Name" list = {"Name Um", "Name Dois", "Name Tres"}
posta o código de todo o sistema, para que possamos fazer a alteração!- mudar script de action para outro
mas não precisa adc um por um na db... ao usar o action o proprio script manda para a db a pos da planta, o id da planta atual +id futuro da nova planta+ time.- mudar script de action para outro
melhor metodo seria criar uma db + globalevents, ai n teria como cancelar o event, ja que o time seria salvo na propria db... é mta plantação?- (Resolvido)GetGainedExperience, como usar a função?
na lib tenta deixar assim: monsters_boosteds = { -- Configuracao dos monstros que irão ter exp e loot aumentados [1] = {monster_name = "Dwarf", exp = 0.05, loot = 7}, [2] = {monster_name = "Goblin", exp = 0.05, loot = 5}, [3] = {monster_name = "Orc", exp = 0.25, loot = 15}, [4] = {monster_name = "Dwarf Soldier", exp = 0.35, loot = 10}, --[5] = {monster_name = "NOME DO MONSTRO", exp = "PORCENTAGEM DE EXP", loot = "PORCENTAGEM DO LOOT"}, } o onKill function onKill(cid, target, damage, flags) if not (isMonster(target)) then return true end if (string.lower(getCreatureName(target)) == string.lower(getGlobalStorageValue(monster_name_backup))) then local percent = tonumber(getGlobalStorageValue(74813)) local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local amount = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent)) doPlayerAddExperience(cid, amount) addLoot(getCreaturePosition(target), getCreatureName(target), {}) end return true end function addLoot(position, name, ignoredList) local check = false for i = 0, 255 do position.stackpos = i corpse = getTileThingByPos(position) if corpse.uid > 0 and isCorpse(corpse.uid) then check = true break end end if check == true then local newRate = (1 + (getGlobalStorageValue(monster_loot_backup)/100)) * getConfigValue("rateLoot") local mainbp = doCreateItemEx(1987, 1) local monsterLoot = getMonsterLootList(name) for i, loot in pairs(monsterLoot) do if math.random(1, 100000) <= newRate * loot.chance then if #ignoredList > 0 then if (not isInArray(ignoredList, loot.id)) then doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1) end else doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1) end end end doAddContainerItemEx(corpse.uid, mainbp) end end OBS: O EVENTO TEM QUE SER COMEÇADO DE NOVO PARA ATUALIZAR A EXP NA STORAGE, ou seja, testa só depois que dar o boost exp- (Resolvido)GetGainedExperience, como usar a função?
local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local amount = math.floor(getMonsterInfo(string.lower(getCreatureName(target))).experience*exp) doPlayerAddExperience(cid, amount) se quer adicionar em porcentagem, pode ser assim: local percent = 0.25 -- 25% local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local amount = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent)) doPlayerAddExperience(cid, amount)- Ajuda com getslot item
local slots = {CONST_SLOT_HEAD, CONST_SLOT_ARMOR, CONST_SLOT_LEGS, CONST_SLOT_FEET, CONST_SLOT_LEFT, CONST_SLOT_RIGHT} for _, i in pairs(slots) do local check = getPlayerSlotItem(cid, i) if check.uid ~= 0 then doPlayerSendTextMessage(cid, 24, "Você não pode fazer está ação com algum item equipado! Retire todos os seus itens e coloque em sua backpack.") return true end end- Quest diaria por IP
function onSay(cid, words, param) local storage, ip = 18000, getPlayerIp(cid) return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, getIpStorageValue(ip, storage) - os.time() <= 0 and "Voce esta habilitado para receber sua recompensa." or "Espere " .. timeString(getIpStorageValue(ip, storage) - os.time()) .. " para pegar um novo item!") end- porque esse script não lê a função de trocar de outfit?
local STORAGE = 91811 local imortal_time = 5 --Segundos. local homem = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} --outfit que muda caso seja homem local mulher = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} --outfit que muda caso seja mulher function onCastSpell(cid, var) if getPlayerStorageValue(cid, STORAGE) > os.time() then doPlayerSendCancel(cid, "Você já está imortal.") return true end setPlayerStorageValue(cid, STORAGE, os.time() + imortal_time) doPlayerSendTextMessage(cid, 27, "During ".. imortal_time .." you'll be imortal.") doSetCreatureOutfit(cid, getPlayerSex(cid) == 0 and mulher or homem, imortal_time*1000) doCombat(cid, combat, var) return true end - [PROBLEMA] Storage não armazena valor correto
Informação Importante
Confirmação de Termo