
Tudo que Vodkart postou
-
(Resolvido)Auto Ranking Top 5 Online Broadcast
https://tibiaking.com/forums/topic/71229-86-top-5-level-no-broadcast/ era online kk function onThink(interval, lastExecution) local players, max = getPlayersOnline(), 5 local str = "TOP "..max.." Rank Level Online:\n\n" table.sort(players, function(a, b) return getPlayerLevel(a) > getPlayerLevel(b) end) for i = 1, max do str = str .. "\n " .. i .. " - "..getPlayerName(players[i]).."["..getPlayerLevel(players[i]).."]" end doBroadcastMessage(str, 22) return true end
-
(Resolvido){RESOLVIDO} Monstro virando outro com % de vida
é pq tme mto jogador atingindo ao mesmo tempo, use assim: function onStatsChange(cid, attacker, type, combat, value) local stor = 354867 -- n mexa local monster = "Rabbit" -- Monstro que irá atingir o 50% e sumir local monstro = "Demon" -- Monstro que irá ser invocado local msg = "Irei sumir" -- Mensagem quando o monstro for sumir if not isMonster(cid) then return true end if type == STATSCHANGE_HEALTHLOSS and getCreatureName(cid):lower() == monster:lower() then local monsterPercent = 100/(getCreatureMaxHealth(cid)/getCreatureHealth(cid)) if monsterPercent <= 50 and monsterPercent >= 49 then if getGlobalStorageValue(stor) - os.time() <= 0 then doCreatureSay(cid, msg, 1) setGlobalStorageValue(stor, os.time() + 120) addEvent(doCreateMonster, 1000, monstro, getCreaturePosition(cid)) addEvent(doRemoveCreature, 1000, cid) end end end return true end
-
(Resolvido)Casulo que sumona monstro
então tira isso do items.xml e deixa normal e tenta assim function onUse(cid, item, fromPosition, itemEx, toPosition) local time = 60 -- seconds local name = "Spider" -- Monster name local chance = 30 -- Em % a chance de nascer a spider if math.random(1, 100) <= chance then doCreateMonster(name, getCreaturePosition(cid)) end doTransformItem(item.uid, item.itemid - 1) addEvent(function() doTransformItem(getTileItemById(toPosition, 7536).uid, 7537) end, time*1000) return true end
-
(Resolvido)Casulo que sumona monstro
https://otland.net/threads/cocoon.175379/
-
[TFS 1.x] Scripting Service
ja n existe esse sistema? como funciona essa budega
-
(Resolvido){RESOLVIDO} Monstro virando outro com % de vida
é que depende do hp do monstro, eu acho que o hp do seu monstro é bastante alta certo? no caso é: SE (hp do monstro) é igual ou menor(<=) que 50 E (hp do monstro) é igual ou maior(>=) que 49 ENTÃO porque isso? Porque digamos que mtos players hitem ao mesmo tempo e o hp do monstro pule de 51% para 49%, ou seja, pulou 50% e o script não iria executar... entendeu? de qualquer jeito se o hp do seu monstro não for tão alto, só usar: if monsterPercent <= 50 then
- Arcan Isle | Cave Hunt | 8.60
-
(Resolvido){RESOLVIDO} Monstro virando outro com % de vida
tenta assim: function onStatsChange(cid, attacker, type, combat, value) local monster = "Rabbit" -- Monstro que irá atingir o 50% e sumir local monstro = "Demon" -- Monstro que irá ser invocado local msg = "Irei sumir" -- Mensagem quando o monstro for sumir if not isMonster(cid) then return true end if type == STATSCHANGE_HEALTHLOSS and getCreatureName(cid):lower() == monster:lower() then local monsterPercent = 100/(getCreatureMaxHealth(cid)/getCreatureHealth(cid)) if monsterPercent <= 50 and monsterPercent >= 49 then doCreatureSay(cid, msg, 1) addEvent(doCreateMonster, 1000, monstro, getCreaturePosition(cid)) addEvent(doRemoveCreature, 1000, cid) end end return true end
-
( PEDIDO ) Script com conflito
posta o seu globalevents.xml que eu coloco pra vc
-
( PEDIDO ) Script com conflito
globalevents vip_install.lua function onStartup() local Query = db.getResult("SELECT `config`, `value` FROM `server_config` WHERE `server_config`.`config` = 'vip_sys';") if(Query:getID() == -1) then local Install_Query = { mysql = { "ALTER TABLE `accounts` ADD `vip` TINYINT NOT NULL DEFAULT '0' AFTER `premdays`;", "ALTER TABLE `accounts` ADD `vip_days` INT NOT NULL DEFAULT '0' AFTER `vip`;", "ALTER TABLE `accounts` ADD `vip_time` INT NOT NULL DEFAULT '0' AFTER `vip_days`;", "ALTER TABLE `players` ADD `reset_temple` TINYINT NOT NULL DEFAULT '0' AFTER `town_id`;", "INSERT INTO `server_config` (`config`, `value`) VALUES ('vip_sys', 1);" }, sqlite = { "ALTER TABLE `accounts` ADD `vip` INTEGER NOT NULL DEFAULT 0;", "ALTER TABLE `accounts` ADD `vip_days` INTEGER NOT NULL DEFAULT 0;", "ALTER TABLE `accounts` ADD `vip_time` INTEGER NOT NULL DEFAULT 0;", "ALTER TABLE `players` ADD `reset_temple` INTEGER NOT NULL DEFAULT 0;", "INSERT INTO `server_config` VALUES ('vip_sys', 1);" } } print(">> Instalando vip_sys...") print(">> Verificando tipo de banco de dados...") print(">> Tipo do banco de dados ".. getConfigValue('sqlType') .."...") if getConfigValue('sqlType') == "mysql" then for i = 1, #Install_Query.mysql do print(">> ".. Install_Query.mysql[i] .."") db.executeQuery(Install_Query.mysql[i]) end elseif getConfigValue('sqlType') == "sqlite" then for i = 1, #Install_Query.sqlite do print(">> ".. Install_Query.sqlite[i] .."") db.executeQuery(Install_Query.sqlite[i]) end else print(">> Banco de dados ".. getConfigValue('sqlType') .." sem suporte ao sistema vip_sys") end print(">> vip_sys instalado e operando...") return true end local Config = Query:getDataString("config") local Value = Query:getDataInt("value") if Value == 1 then print(">> Sistema vip funcionando e atualizado...") end return true end tag <globalevent name="vippsystem" type="start" event="script" value="vip_install.lua"/>
-
TALKACTION CM
só editar o comando /i do servidor para bloquear alguns items do ot se for GOD <
-
Trade OFF 8.60
@Zzyzx muda essa parte if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then 7 é o preço máximo tipo: 9999999 e o 3 é o item count
-
(Resolvido)Systema de Vip Por players e nao por Account
eu já fiz um sistema vip por players: Query Primeiro passado execute essa query na sua DB: ALTER TABLE `players` ADD `vipacess` INT(15) NOT NULL DEFAULT 0; Agora vá em Data/lib/050-function e adicione essas funções: function getCharacterAcess(cid) local query = db.getResult("SELECT `vipacess` FROM `players` WHERE `id` = "..getPlayerGUID(cid)) if query:getID() ~= -1 then return query:getDataInt("vipacess") end end function getCharacterDays(cid) local acess = math.ceil((getCharacterAcess(cid) - os.time())/(86400)) return acess <= 0 and 0 or acess end function HaveCharaterAcess(cid) return getCharacterDays(cid) > 0 and true or false end function setAcessTime(cid, time) return db.executeQuery("UPDATE `players` SET `vipacess` = "..time.." WHERE `id` = "..getPlayerGUID(cid)) end function addCharacterAcess(cid, days) local add = (days <= 0 and 1 or days)*86400 local time = getCharacterDays(cid) == 0 and (os.time() + add) or (getCharacterAcess(cid) + add) return setAcessTime(cid, time) end function doRemoveCharacterAcess(cid, days) local remove = days*86400 local time = getCharacterAcess(cid) - remove return setAcessTime(cid, (time <= 0 and 1 or time)) end function getVipAcessDate(cid) if HaveCharaterAcess(cid) then return os.date("%d/%m/%y %X", getCharacterAcess(cid)) end return false end Talkactions agora em talkactions/scripts vipsystemplayer.lua function onSay(cid, words, param) if(words == "!buyvip") then local days = 10 local price = 50000 if not doPlayerRemoveMoney(cid, price) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar vip.") return true end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados "..days.." dias de VIP no seu character.") addCharacterAcess(cid, days) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getCharacterDays(cid).." dias de VIP, ela acaba em "..getVipAcessDate(cid)) elseif(words == "!vipdays") then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getCharacterDays(cid).." dias de VIP. "..(getCharacterDays(cid) > 0 and "ela acaba em "..getVipAcessDate(cid).."." or "")) end return true end vipsystemgod.lua function onSay(cid, words, param) if(words == "/checkvip") then if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local player = getPlayerByName(param) if not isPlayer(player) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..player.." not found.") return true end return doPlayerPopupFYI(cid, "O jogador tem "..getCharacterDays(player).." dias de VIP no character.") elseif(words == "/addvip") then local t = string.explode(param, ",") if not tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByNameWildcard(t[1]) if(not player)then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") end addCharacterAcess(player, tonumber(t[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..tonumber(t[2]).." dias de VIP no player "..getCreatureName(player)) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..tonumber(t[2]).." dias de VIP no seu character.") elseif(words == "/delvip") then local t = string.explode(param, ",") if not tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByNameWildcard(t[1]) if(not player)then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") end doRemoveCharacterAcess(player, tonumber(t[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você removeu "..tonumber(t[2]).." dias de VIP do jogador "..getCreatureName(player)..".") end return true end em talkactions.xml adicione as tags: <talkaction words="!buyvip;!vipdays" event="script" value="vipsystemplayer.lua"/> <talkaction words="/addvip;/delvip;/checkvip" access="4" event="script" value="vipsystemgod.lua"/> Item Vip item que adiciona vip no character actions/script addvipdays.lua function onUse(cid, item, fromPosition, itemEx, toPosition) local days = 15 addCharacterAcess(cid, (days <= 0 and 1 or days)) doRemoveItem(item.uid) return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getCharacterDays(cid).." dias de VIP, ela acaba em "..getVipAcessDate(cid)) end Actions.xml <action itemid="ID DO SEU ITEM" script="addvipdays.lua"/> Vip Door actions/script perfectvipdoor.lua function onUse(cid, item, frompos, item2, topos) if not HaveCharaterAcess(cid) then return doPlayerSendTextMessage(cid,22,"Você precisa ser vip para passar aqui.") end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, topos, true) return true end actions.xml <action actionid="7779" script="perfectvipdoor.lua"/> Tile VIP em movements/scripts crie um arquivo.lua e renomeie para vipe.lua function onStepIn(cid, item, position, fromPosition) if item.actionid == 13700 and not HaveCharaterAcess(cid) then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"você não é vip.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"bem vindo.") return true end Em movements.xml adicione a tag: <movevent type="StepIn" actionid="13700" event="script" value="vipe.lua"/> no seu piso coloque ACTIONID 13700 Fim Vip em creaturescript/script endvip.lua function onLogin(cid) if getCharacterDays(cid) > 0 then setPlayerStorageValue(cid, 9898, 1) elseif getPlayerStorageValue(cid, 9898) == 1 and getCharacterDays(cid) <= 0 then doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerPopupFYI(cid, "Sua vip Account acabou.") setPlayerStorageValue(cid, 9898, -1) end return true end em creaturescript.xml adicione a tag: <event type="login" name="CheckVip" script="endvip.lua"/> -------------------------------------------------------------------------------------------------------------------- só procurar no Google: Perfect Vip System 3.0
-
(Resolvido)Summon que cura o Player
@Cerberus Tibiaking agradece pelo seu esforço!! Você conseguiu resolver este problema, parabéns!! Você que tens muito futuro no campo de scripts!!
- [Modal] Elemental Wand
-
(Resolvido)Double Potion que marca o Tempo
n testei function onSay(cid, words, param) local str,c ="# INFO EXP Potions #\n\n",2 for i = 61002, 61005 do str = str.."[X"..c.."] -> "..(getPlayerStorageValue(cid, i) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, i) - os.time()).." de exp potion").."\n" c = c + 1 end return doShowTextDialog(cid, 6579, str) end
-
(Resolvido)Double Potion que marca o Tempo
manda seu script ai com todas as storages que vc fez pra eu arrumar
-
Storage para alavanca
CLARO CARA VOCÊ NÃO POSTOU SEU CÓDIGO EM BB CODE, AI QUANDO VOCÊ JOGOU DESSE JEITO O [i] some , porque o forum buga o codigo e entende como ITALICO -------------------- local config = { requiredLevel = 100, daily = false, playerPositions = { Position(33010, 31660, 14), Position(33010, 31661, 14), Position(33010, 31662, 14), Position(33010, 31663, 14), Position(33010, 31664, 14) }, newPositions = { Position(32974, 31670, 14), Position(32975, 31670, 14), Position(32976, 31670, 14), Position(32977, 31670, 14), Position(32978, 31670, 14) }, BossPositions = { Position(32977, 31658, 14) } } local check, hours, storage = true, 24, 574984 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions[i]):getTopCreature() if playerTile and not playerTile:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "summon? u are noob?") return true end if playerTile:getLevel() < config.requiredLevel then player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end if check and playerTile:getStorageValue(storage) - os.time() > 0 then player:sendCancelMessage("The chest is empty, come back tomorrow for a new reward.") return true end storePlayers[#storePlayers + 1] = playerTile end for i = 1, #config.BossPositions do Game.createMonster("The Time Guardian", config.BossPositions[i]) end local players for i = 1, #storePlayers do players = storePlayers[i] config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions[i]) config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) players:setStorageValue(storage, os.time()+hours*3600) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end
-
Storage para alavanca
local config = { requiredLevel = 100, daily = false, playerPositions = { Position(33010, 31660, 14), Position(33010, 31661, 14), Position(33010, 31662, 14), Position(33010, 31663, 14), Position(33010, 31664, 14) }, newPositions = { Position(32974, 31670, 14), Position(32975, 31670, 14), Position(32976, 31670, 14), Position(32977, 31670, 14), Position(32978, 31670, 14) }, BossPositions = { Position(32977, 31658, 14) } } local hours, storage = 24, 574984 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions):getTopCreature() if playerTile and not playerTile:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "summon? u are noob?") return true end if playerTile:getLevel() < config.requiredLevel then player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end if playerTile:getStorageValue(storage) >= os.time() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "The chest is empty, come back tomorrow for a new reward.") return true end storePlayers[#storePlayers + 1] = playerTile end for i = 1, #config.BossPositions do Game.createMonster("The Time Guardian", config.BossPositions) end local players for i = 1, #storePlayers do players = storePlayers config.playerPositions:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions) players:setStorageValue(storage, os.time()+hours*3600) config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end
-
(Resolvido)Talkactions por Actions
nao é necessario porque ele não vai ter mais a voc 10, então vai retornar uma msg dizendo que ele n tem a voc necessaria
-
(Resolvido)Talkactions por Actions
sim, só te expliquei como fazer. function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { vocs = {10}, pid = getPlayerGUID(cid), newlv = 100, life = 1000, mana = 1500, newvoc = 14 } if not isInArray(config.vocs, getPlayerVocation(cid)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você Não é Revoluction Druid Para Atingir Uma Nova Promotion.") end doBroadcastMessage("O jogador "..getCreatureName(cid).." Virou New Revoluction Druid! Se Virem Ele Fuja!!! ",MESSAGE_STATUS_WARNING) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doRemoveCreature(cid) db.query("UPDATE `players` SET `level` = "..config.newlv..", `experience` = "..getExperienceForLevel(config.newlv)..",`manamax` = "..config.mana..",`health` = "..config.life..", `healthmax` = "..config.life..",`mana` = "..config.mana..",`vocation` = "..config.newvoc.." WHERE `id` = "..config.pid) return true end
-
Storage para alavanca
que estranho, como se tivesse caracteres especiais dentro do código... tenta assim: local config = { requiredLevel = 100, daily = false, playerPositions = { Position(33010, 31660, 14), Position(33010, 31661, 14), Position(33010, 31662, 14), Position(33010, 31663, 14), Position(33010, 31664, 14) }, newPositions = { Position(32974, 31670, 14), Position(32975, 31670, 14), Position(32976, 31670, 14), Position(32977, 31670, 14), Position(32978, 31670, 14) }, BossPositions = { Position(32977, 31658, 14) } } local check, hours, storage = true, 24, 574984 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions):getTopCreature() if playerTile and not playerTile:isPlayer() then -- pra n ir summon player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.") return true end if playerTile:getLevel() < config.requiredLevel then player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end if check and playerTile:getStorageValue(storage) >= os.time() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "The chest is empty, come back tomorrow for a new reward.") return true end storePlayers[#storePlayers + 1] = playerTile end for i = 1, #config.BossPositions do Game.createMonster("The Time Guardian", config.BossPositions) end local players for i = 1, #storePlayers do players = storePlayers config.playerPositions:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions) players:setStorageValue(storage, os.time()+hours*3600) config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end
-
Item que Muda Vocation
o item vc vai comprar pelo shop do site? pelo npc?
-
(Resolvido)Talkactions por Actions
troque a função main... troque: function onSay(cid, words, param) por function onUse(cid, item, fromPosition, itemEx, toPosition) --------- e se quiser remover o item usa doRemoveItem(item.uid)
-
Storage para alavanca
local config = { requiredLevel = 100, daily = false, playerPositions = { Position(33010, 31660, 14), Position(33010, 31661, 14), Position(33010, 31662, 14), Position(33010, 31663, 14), Position(33010, 31664, 14) }, newPositions = { Position(32974, 31670, 14), Position(32975, 31670, 14), Position(32976, 31670, 14), Position(32977, 31670, 14), Position(32978, 31670, 14) }, BossPositions = { Position(32977, 31658, 14) } } local check, hours, storage = true, 24, 574984 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions):getTopCreature() if playerTile and not playerTile:isPlayer() then -- pra n ir summon player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.") return true end if playerTile:getLevel() < config.requiredLevel then player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end if check and playerTile:getStorageValue(storage) - os.time() > 0 then player:sendCancelMessage("The chest is empty, come back tomorrow for a new reward.") return true end storePlayers[#storePlayers + 1] = playerTile end for i = 1, #config.BossPositions do Game.createMonster("The Time Guardian", config.BossPositions) end local players for i = 1, #storePlayers do players = storePlayers config.playerPositions:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions) players:setStorageValue(storage, os.time()+hours*3600) config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end