Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    verdade, tinha uma linha que estava criando a pedra e duplicando ela, esqueci de remover... abre o mapa normalmente (que ja vem com a pedra do mapper edito) e inicia o evento com esse código: local THRONE_POS = {x = 2561, y = 2446, z = 5} local dk = {x = 2539, y = 2474, z = 7} -- door or rock local STORAGE_EVENT = 83902 local STORAGE_PLAYER = 73289 local DUR = 2 -- in minutes local days = {"Friday", "Saturday", "Thursday"} -- coloque os dias function OpenEvent() for _, tid in ipairs(getPlayersOnline()) do setPlayerStorageValue(tid, STORAGE_PLAYER, 1) end setGlobalStorageValue(STORAGE_EVENT, 1) doBroadcastMessage("O Evento castle foi aberto e vai durar ".. DUR .." minutos.", 25) end function doTransLaderRock(n) -- 1 vira escada e 0 pedra return doTransformItem(getTileItemById(dk, n == 1 and 1285 or 3687).uid, n == 1 and 3687 or 1285) end function getWinnerCastle() doTransLaderRock(0) -- pedra local player = getTopCreature(THRONE_POS).uid if getGlobalStorageValue(STORAGE_EVENT) < 0 then return true end if (isPlayer(player)) then if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then local id, pid = 561, getPlayerGUID(player) setHouseOwner(id, pid) db.executeQuery("UPDATE `houses` SET `owner` = "..pid.." WHERE `id` = "..id) doPlayerAddPremiumDays(player, 7) for _, cid in ipairs(getPlayersOnline()) do setPlayerStorageValue(cid, STORAGE_PLAYER, 0) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25) doTeleportThing(player, {x = 2531, y = 2460, z = 7}) doCreateItem(391, 1, {x = 2561, y = 2446, z = 5}) end else doBroadcastMessage("Ningúem ganhou o evento.", 27) for _, pid in ipairs(getPlayersOnline()) do setPlayerStorageValue(pid, STORAGE_PLAYER, 0) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end setGlobalStorageValue(STORAGE_EVENT, 0) return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER) end function isEventDay() for _, dia in pairs(days) do if dia == os.date("%A") then return true end end return false end function onTimer() if isEventDay() then OpenEvent() doTransLaderRock(1) -- escada addEvent(getWinnerCastle, DUR * 60 * 1000) end return true end e não preciso remover ela, eu posso transformar ela em pedra ou escada...
  2. https://tibiaking.com/forums/topic/94479-raid-automatica-mod-raid-automatica-edit-brunds/
  3. local function doCheckHouses() local ids = {1111,2222,3333} local dias = 3 local tempo = os.time() - (dias * 24 * 60 * 60) local registros = db.storeQuery("SELECT `houses`.`owner`, `houses`.`id` FROM `houses`,`players` WHERE `houses`.`owner` != 0 AND `houses`.`owner` = `players`.`id` AND `players`.`lastlogin` <= " .. tempo .. ";") if registros ~= false then local count = 0 print('house leave code') repeat count = count + 1 local owner = result.getNumber(registros, "owner") local houseId = result.getNumber(registros, "id") local house = House(houseId) if house and (owner > 0) then local house_tiles = house:getTiles() if house_tiles and next(house_tiles) then for x = 1, #house_tiles do local tile = house_tiles[x] local items = tile:getItems() if items and next(items) then for y = 1, #items do local item = items[y] if isInArray(ids, item:getId()) then item:remove() end end end end end print(house:getName()) house:setOwnerGuid(0) end until not result.next(registros) print('house leave house count:' .. count) result.free(registros) end end function onStartup() addEvent(doCheckHouses, 10 * 1000) return true end aqui vc edita os ids local ids = {1111,2222,3333}
  4. testa essa função e ve se retorna o id da arvore na house function checkHouseTiles(house) if (house) then local tiles = house:getTiles() for i = 1, #tiles do local tile = tiles[i] print(tile:getId(), tile:getName()) end end end
  5. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    local THRONE_POS = {x = 2561, y = 2446, z = 5} local dk = {x = 2539, y = 2474, z = 7} -- door or rock local STORAGE_EVENT = 83902 local STORAGE_PLAYER = 73289 local DUR = 2 -- in minutes local days = {"Friday", "Saturday", "Thursday"} -- coloque os dias function OpenEvent() for _, tid in ipairs(getPlayersOnline()) do setPlayerStorageValue(tid, STORAGE_PLAYER, 1) end setGlobalStorageValue(STORAGE_EVENT, 1) doBroadcastMessage("O Evento castle foi aberto e vai durar ".. DUR .." minutos.", 25) end function doTransLaderRock(n) -- 1 vira escada e 0 pedra return doTransformItem(getTileItemById(dk, n == 1 and 3687 or 1285).uid, n == 1 and 1285 or 3687) end function getWinnerCastle() doTransLaderRock(0) -- pedra local player = getTopCreature(THRONE_POS).uid if getGlobalStorageValue(STORAGE_EVENT) < 0 then return true end if (isPlayer(player)) then if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then local id, pid = 561, getPlayerGUID(player) setHouseOwner(id, pid) db.executeQuery("UPDATE `houses` SET `owner` = "..pid.." WHERE `id` = "..id) doPlayerAddPremiumDays(player, 7) for _, cid in ipairs(getPlayersOnline()) do setPlayerStorageValue(cid, STORAGE_PLAYER, 0) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25) doTeleportThing(player, {x = 2531, y = 2460, z = 7}) doCreateItem(391, 1, {x = 2561, y = 2446, z = 5}) end else doBroadcastMessage("Ningúem ganhou o evento.", 27) for _, pid in ipairs(getPlayersOnline()) do setPlayerStorageValue(pid, STORAGE_PLAYER, 0) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end setGlobalStorageValue(STORAGE_EVENT, 0) return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER) end function isEventDay() for _, dia in pairs(days) do if dia == os.date("%A") then return true end end return false end function onTimer() if isEventDay() then doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) ERRO E AQUI <<<<<<<<<<< OpenEvent() doTransLaderRock(1) -- escada addEvent(getWinnerCastle, DUR * 60 * 1000) end return true end
  6. function onLogin(player) local stor = 785421 if player:getStorageValue(stor) <= 0 then local query, pid = db.storeQuery("SELECT `id` FROM `houses` WHERE `owner` = 0;"), player:getGuid() if query ~= false then local house = House(result.getDataInt(query, "id")) house:setOwnerGuid(pid) player:setStorageValue(stor, 1) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"você recebeu a ".. house:getName() .." House parabens!") end end return true end
  7. <?xml version="1.0" encoding="UTF-8"?> <mod name="Simple Task" version="3.0" author="Vodkart" contact="xtibia.com" enabled="yes"> <config name="task_func"><![CDATA[ tasktabble = { ["diabolic"] = {monster_race={"diabolic"}, storage_start = 200201, storage = 91001,count = 2000,exp = 2350000,money = 3500000, reward = {{11717,20},{9970,200}}}, ["nukenin"] = {monster_race={"nukenin"}, storage_start = 200202, storage = 91002,count = 2000,exp = 2350000,money = 3500000, reward = {{11717,20},{9970,200}}}, ["task orochimaru"] = {monster_race={"task orochimaru"}, storage_start = 200239, storage = 91039,count = 20, exp = 2350000, money = 3500000, reward = {{11717,10},{9970,200}}} } configbosses_task = { {race = "minotaur",Playerpos = {x = 189, y = 57, z = 7}, FromPosToPos = {{x = 186, y = 54, z = 7},{x = 193, y = 60, z = 7}},time = 5}, {race = "necromancer",Playerpos = {x = 196, y = 39, z = 7}, FromPosToPos = {{x = 195, y = 37, z = 7},{x = 198, y = 41, z = 7}}, time = 5}, {race = "dragon",Playerpos = {x = 208, y = 59, z = 7}, FromPosToPos = {{x = 206, y = 56, z = 7},{x = 209, y = 65, z = 7}}, time = 5} } function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function CheckTask(cid) for k, v in pairs(tasktabble) do if getPlayerStorageValue(cid,v.storage_start) >= 1 then return true end end return false end function finisheAllTask(cid) local config = { exp = {false,350000}, money = {false,350000}, items ={false,{{11191,20},{11192,20}}}, premium ={true,5} } local x = true for k, v in pairs(tasktabble) do if tonumber(getPlayerStorageValue(cid,v.storage)) then x = false end end if x == true then setPlayerStorageValue(cid, 521456, 0) local b = getGlobalStorageValue(63005) if b == -1 then b = 1 end if b < 11 then setGlobalStorageValue(63005,b+1) doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' was the '..b..' to finish the task!.') doPlayerAddPremiumDays(cid, config.premium[1] == true and config.premium[2] or 0) doPlayerAddExp(cid, config.exp[1] == true and config.exp[2] or 0) doPlayerAddMoney(cid, config.money[1] == true and config.money[2] or 0) if config.items[1] == true then doAddItemsFromList(cid,config.items[2]) end doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy "..getCreatureName(cid).." completed all the task.") end end end function HavePlayerPosition(cid, from, to) return isInRange(getPlayerPosition(cid), from, to) and true or false end function getRankStorage(cid, value, max, RankName) -- by vodka local str ="" str = "--[".. (RankName == nil and "RANK STORAGE" or ""..RankName.."") .."]--\n\n" local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > max then break end str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "]" k = k + 1 until not query:next() end return doShowTextDialog(cid, 2529, str) end 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 function getItemsFromList(items) -- by vodka local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end function doAddItemsFromList(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function pairsByKeys(t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 local iter = function () i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end ]]></config> <event type="login" name="TaskLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "KillTask") return true end]]></event> <talkaction words="/task;!task" event="buffer"><![CDATA[ domodlib('task_func') local param = string.lower(param) if param == "rank" then getRankStorage(cid, 521456, 20, "Task Rank Finalizadas") return true end local str = "" str = str .. "Task Completed :\n\n" for k, v in pairsByKeys(tasktabble) do local contagem = getPlayerStorageValue(cid, v.storage) if (contagem == -1) then contagem = 1 end str = str..k.." = ".. (not tonumber(contagem) and "["..contagem.."]" or "["..((contagem)-1).."/"..v.count.."]") .."\n" end str = str .. "" return doShowTextDialog(cid, 8983, str) ]]></talkaction> <event type="kill" name="KillTask" event="script"><![CDATA[ domodlib('task_func') function onKill(cid, target, lastHit) if isMonster(target) then local n = string.lower(getCreatureName(target)) for race, mob in pairs(tasktabble) do if getPlayerStorageValue(cid,mob .storage_start) >= 1 then for i = 1,#mob.monster_race do if n == mob.monster_race[i] then local contagem = getPlayerStorageValue(cid, mob.storage) if not tonumber(contagem) then return true end if (contagem == -1) then contagem = 1 end if contagem > mob.count then return true end setPlayerStorageValue(cid, mob.storage, contagem+1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == mob.count and "Congratulations! You finished the task of "..race.."." or "defeated. Total [" .. contagem .. "/" .. mob.count .. "] " .. race .. ".").."") end end end end end return true end]]></event> </mod>
  8. sim, qndo eu tiver tempo traduzo para o tfs 1.3
  9. rateStaminaAboveNormal = 1.2
  10. ok dps me manda seu discord que fazemos isso rapidinho
  11. testa o dano local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo local storage = 753159 function isInKamuiArea(cid) return isInRange(getCreaturePosition(cid), from, to) and true or false end function TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target > 0 and isCreature(target) then -- se tiver target if isMonster(target) then if isInArray(blocks, getCreatureName(target):lower()) then doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5 local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8 doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT) -- defina combat e effect COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5 local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8 doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT) -- defina combat e effect COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT addEvent(TeleportToKamui, 300, target, teleport) end else if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) doCreatureAddHealth(cid, -100) end return true end
  12. @Nother local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo local storage = 753159 function isInKamuiArea(cid) return isInRange(getCreaturePosition(cid), from, to) and true or false end function TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target > 0 and isCreature(target) then -- se tiver target if isMonster(target) then if isInArray(blocks, getCreatureName(target):lower()) then doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target, teleport) end else if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) end return true end
  13. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_HITCOLOR, COLOR_TEAL) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 32) function onGetFormulaValues(cid, level, maglevel) min = -((30) * (maglevel + level)) max = -((33) * (maglevel + level)) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local function onCastSpell1(parameters) return isCreature(parameters.cid) and doCombat(parameters.cid, combat, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var} local waittime = 1 -- Tempo de exhaustion local storage = 445000 if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Podera usar novamente dentro de 1 segundos.") doSendMagicEffect(getCreaturePosition(cid), 32) return false end exhaustion.set(cid, storage, waittime) local positionp = getPlayerPosition(cid) local target = getCreatureTarget(cid) local enemypos = getCreaturePosition(target) addEvent(onCastSpell1, 550, parameters) if target == isMonster or isCreature then addEvent(function() if not isCreature(cid) then return LUA_ERROR end doTeleportThing(cid, enemypos) end, 500) addEvent(doSendMagicEffect, 500, {x = enemypos.x, y = enemypos.y+1, z = enemypos.z}, 311) addEvent(doSendMagicEffect, 10, {x = positionp.x, y = positionp.y+1, z = positionp.z}, 312) end return true end
  14. @Nother n sou mto bom com spells, não manjo nada, mas vamo seguindo os testes... é que estou pelo celular e o computador do escritório kkkk sem tibia nem nada, só bloco de nota msm xD local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo local storage = 753159 function isInKamuiArea(cid) return isInRange(getCreaturePosition(cid), from, to) and true or false end function TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not target then -- executa no cid if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) elseif target and isCreature(target) then -- se tiver target if isMonster(target) then if isInArray(blocks, getCreatureName(target):lower()) then doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target, teleport) end end return true end (nao botei dano ainda)
  15. testa assim (só para teste) spell: local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo local storage = 753159 function isInKamuiArea(cid) return isInRange(getCreaturePosition(cid), from, to) and true or false end function TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getCreaturePosition(alvo), 3) -- target end function onCastSpell(cid, var) local target = var.number if target and isCreature(target) then -- se tiver target if isMonster(target) then if isInArray(blocks, getCreatureName(target):lower()) then doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then -- salva a coordenada do target player if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, target,teleport) end else if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) end return true end e o movements o teleport: function onStepIn(cid, item, position, fromPosition) local storage = 753159 if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, storage) == -1 then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) return true end local w = tostring(getPlayerStorageValue(cid, storage)):gsub(':', ''):explode(',') doTeleportThing(cid, {x = tonumber(w[1]), y = tonumber(w[2]), z = tonumber(w[3])}) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) return true end
  16. local area = {{x=630,y=58,z=7}, {x=649,y=71,z=7}} function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end return true end tag <movevent type="StepIn" actionid="45120" event="script" value="nome do seu script.lua"/>
  17. abri meu servidor para testar e deu certo, a house foi dada ao jogador sem maiores problemas!!! ou a houses não estão configuradas de forma correta no mapa ou é a função da lib mesmo... qual servidor/distro vc usa?
  18. usou esse ultimo codigo que te mandei? coloquei uma query para dar a house
  19. sim e era para remover, estranho hein... testa em outra house pra ver se passa, troca o id lá naquela linha o 223 por outra house só para testar local THRONE_POS = {x = 2561, y = 2446, z = 5} local STORAGE_EVENT = 83902 local STORAGE_PLAYER = 73289 local DUR = 15 -- in minutes local days = {"Monday", "Saturday", "Thursday"} -- coloque os dias function OpenEvent() for _, tid in ipairs(getPlayersOnline()) do setPlayerStorageValue(tid, STORAGE_PLAYER, 1) end setGlobalStorageValue(STORAGE_EVENT, 1) doBroadcastMessage("O Evento castle foi aberto e vai durar ".. DUR .." minutos.", 25) end function getWinnerCastle() CastleWalls() local player = getTopCreature(THRONE_POS).uid if getGlobalStorageValue(STORAGE_EVENT) < 0 then return true end if (isPlayer(player)) then if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then local id, pid = 223, getPlayerGUID(player) setHouseOwner(id, pid) db.executeQuery("UPDATE `houses` SET `owner` = "..pid.." WHERE `id` = "..id) doPlayerAddPremiumDays(player, 7) for _, cid in ipairs(getPlayersOnline()) do setPlayerStorageValue(cid, STORAGE_PLAYER, 0) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25) doTeleportThing(player, {x = 2531, y = 2460, z = 7}) doCreateItem(391, 1, {x = 2561, y = 2446, z = 5}) end else doBroadcastMessage("Ningúem ganhou o evento.", 27) for _, pid in ipairs(getPlayersOnline()) do setPlayerStorageValue(pid, STORAGE_PLAYER, 0) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end setGlobalStorageValue(STORAGE_EVENT, 0) return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER) end function isEventDay() for _, dia in pairs(days) do if dia == os.date("%A") then return true end end return false end function CastleWalls() local pedra = getTileItemById({ x = 2539, y = 2474, z = 7}, 1285) local escada = getTileItemById({ x = 2539, y = 2474, z = 7}, 3687) if pedra.uid > 0 then return doRemoveItem(pedra.uid) else return doCreateItem(1285, 1, { x = 2539, y = 2474, z = 7}) end if escada.uid > 0 then return doRemoveItem(escada.uid) else return doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) end end function onTimer() if isEventDay() then doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) OpenEvent() CastleWalls() addEvent(getWinnerCastle, DUR * 60 * 1000) end return true end
  20. ue vai la na house e ve a informação da porta, lá vai falar o id da house e se tem dono
  21. a house id ta certa msm? é esse 223 que colocamos? vê lá com o god certinho...
  22. local THRONE_POS = {x = 2561, y = 2446, z = 5} local STORAGE_EVENT = 83902 local STORAGE_PLAYER = 73289 local DUR = 15 -- in minutes local days = {"Monday", "Saturday", "Thursday"} -- coloque os dias function OpenEvent() for _, tid in ipairs(getPlayersOnline()) do setPlayerStorageValue(tid, STORAGE_PLAYER, 1) end setGlobalStorageValue(STORAGE_EVENT, 1) doBroadcastMessage("O Evento castle foi aberto e vai durar ".. DUR .." minutos.", 25) end function getWinnerCastle() CastleWalls() local player = getTopCreature(THRONE_POS).uid if getGlobalStorageValue(STORAGE_EVENT) < 0 then return true end if (isPlayer(player)) then if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then local pid = getPlayerGUID(player) setHouseOwner(223, pid, true) doPlayerAddPremiumDays(player, 7) for _, cid in ipairs(getPlayersOnline()) do setPlayerStorageValue(cid, STORAGE_PLAYER, 0) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25) doTeleportThing(player, {x = 2531, y = 2460, z = 7}) doCreateItem(391, 1, {x = 2561, y = 2446, z = 5}) end else doBroadcastMessage("Ningúem ganhou o evento.", 27) for _, pid in ipairs(getPlayersOnline()) do setPlayerStorageValue(pid, STORAGE_PLAYER, 0) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end setGlobalStorageValue(STORAGE_EVENT, 0) return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER) end function isEventDay() for _, dia in pairs(days) do if dia == os.date("%A") then return true end end return false end function CastleWalls() local pedra = getTileItemById({ x = 2539, y = 2474, z = 7}, 1285) local escada = getTileItemById({ x = 2539, y = 2474, z = 7}, 3687) if pedra.uid > 0 then return doRemoveItem(pedra.uid) else return doCreateItem(1285, 1, { x = 2539, y = 2474, z = 7}) end if escada.uid > 0 then return doRemoveItem(escada.uid) else return doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) end end function onTimer() if isEventDay() then doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) OpenEvent() CastleWalls() addEvent(getWinnerCastle, DUR * 60 * 1000) end return true end
  23. deixa eu ver seu código... algum erro?
  24. é pq no seu código está outra house id né... nessa linha: setHouseOwner(6257, pid) troca por: setHouseOwner(223, pid, true) ## EDIT ## era "pid" ao invés de "player" ... já arrumei!! ------------------------- EDITEI O TÓPICO, ARRUMEI A VARIÁVEL!!

Informação Importante

Confirmação de Termo