Tudo que Flavio S postou
-
Mudança de nick
- Dúvida com Código
Mas tu quer as skill fique por um tempo determinado ou pra sempre ?- (Resolvido)Erro script
- Equipe TK Poderia Mudar o meu Nome?
Você tem que entrar na fila, já anotei aqui seu nome, em meados de 2020 tu vai ser atendido ai poderá trocar seu nick.- (Resolvido)[AJUDA] Sair de rookguard e ganhar montaria
Use : local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local vocation = {} local town = {} local config = { towns = { ["venore"] = 1, ["thais"] = 2, ["carlin"] = 4 }, vocations = { ["sorcerer"] = { text = "A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 1, --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}}, --container rope, shovel, mana potion {{2120, 1}, {2554, 1}, {7620, 1}} }, ["druid"] = { text = "A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 2, --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}}, --container rope, shovel, mana potion {{2120, 1}, {2554, 1}, {7620, 1}} }, ["paladin"] = { text = "A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 3, --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}}, --container rope, shovel, health potion, bow, 50 arrow {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}} }, ["knight"] = { text = "A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 4, --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}}, --container jagged sword, daramian mace, rope, shovel, health potion {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}} } } } 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 local function greetCallback(cid) local player = Player(cid) local level = player:getLevel() if level < 8 then npcHandler:say("CHILD! COME BACK WHEN YOU HAVE GROWN UP!", cid) npcHandler:resetNpc(cid) return false elseif level > 31 then npcHandler:say(player:getName() ..", I CAN'T LET YOU LEAVE - YOU ARE TOO STRONG ALREADY! YOU CAN ONLY LEAVE WITH LEVEL 9 OR LOWER.", cid) npcHandler:resetNpc(cid) return false elseif player:getVocation():getId() > 0 then npcHandler:say("YOU ALREADY HAVE A VOCATION!", cid) npcHandler:resetNpc(cid) return false else npcHandler:setMessage(MESSAGE_GREET, player:getName() ..", ARE YOU PREPARED TO FACE YOUR DESTINY?") end return true end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if npcHandler.topic[cid] == 0 then if msgcontains(msg, "yes") then npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {CARLIN}, {THAIS}, OR {VENORE}?", cid) npcHandler.topic[cid] = 1 end elseif npcHandler.topic[cid] == 1 then local cityTable = config.towns[msg:lower()] if cityTable then town[cid] = cityTable npcHandler:say("IN ".. string.upper(msg) .."! AND WHAT PROFESSION HAVE YOU CHOSEN: {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 else npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {CARLIN}, {THAIS}, OR {VENORE}?", cid) end elseif npcHandler.topic[cid] == 2 then local vocationTable = config.vocations[msg:lower()] if vocationTable then npcHandler:say(vocationTable.text, cid) npcHandler.topic[cid] = 3 vocation[cid] = vocationTable.vocationId else npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) end elseif npcHandler.topic[cid] == 3 then if msgcontains(msg, "yes") then npcHandler:say("SO BE IT!", cid) player:setVocation(Vocation(vocation[cid])) player:setTown(Town(town[cid])) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:addMount(38) player:teleportTo(Town(town[cid]):getTemplePosition()) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received a backpack with starting items for reaching the mainlands.") local targetVocation = config.vocations[Vocation(vocation[cid]):getName():lower()] for i = 1, #targetVocation[1] do player:addItem(targetVocation[1][i][1], targetVocation[1][i][2]) end local backpack = player:addItem(1988) for i = 1, #targetVocation[2] do backpack:addItem(targetVocation[2][i][1], targetVocation[2][i][2]) end else npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 end end return true end local function onAddFocus(cid) town[cid] = 0 vocation[cid] = 0 end local function onReleaseFocus(cid) town[cid] = nil vocation[cid] = nil end npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus) npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setMessage(MESSAGE_FAREWELL, "COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!") npcHandler:setMessage(MESSAGE_WALKAWAY, "COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())- [Resolvido] Item com dias
Erro meu tente agora : local days = 30 * 24 * 60 * 60 -- 30 Dias local storage = 44641 function onUse(player, item) local daysRest = os.date("%d", getPlayerStorageValue(player, storage) - os.time()) if daysRest == 0 or daysRest == nil then doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados 30 dias de VIP na sua conta.") setPlayerStorageValue(player, storage, os.time() + days) doSendMagicEffect(getThingPos(player), math.random(13,14)) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem ".. daysRest .." dias de VIP restantes.") end return true end- (Resolvido)[PEDIDO] Skull Remover e Change Sex
Change sex : http://www.tibiaking.com/forum/topic/41033-tfs-1011-change-sex-por-item/ Skull remover : http://www.tibiaking.com/forum/topic/38808-tfs-10-frag-remover/- Duvida com tfs 1.0
Não é tfs 1.0 e sim 1.1 ... #define CLIENT_VERSION_STR "10.76" Versão 10.76- [Dúvida] Posso usar a tag style=' na linha echo "<input?
Pronto : <?phprequire_once("system/application/config/create_character.php"); echo "<h1>Create Guild</h1>"; if(count($characters) == 0) error("Todos os seus personagens ja estao em uma guilda ou eles nao tem level necessario. (<b>".$config['levelToCreateGuild']."</b>)"); else { error(validation_errors()); echo form_open("guilds/create", array('method'=>'post')); echo "<label style='PADDING-LEFT: 50px;'> Character:</label>"; echo "<select name='character'>"; foreach($characters as $character) { echo "<option value='".$character['id']."'>".$character['name']." (".$character['level'].")</option>"; } echo "</select><br /><br />"; echo "<label style='PADDING-LEFT: 50px;'>Guild name:</label>"; echo "<input type='text' <style> .submitbox { padding-left: 50px; } </style> name='name'><br />"; echo "</form>"; } ?>- [Dúvida] Posso usar a tag style=' na linha echo "<input?
<?phprequire_once("system/application/config/create_character.php"); echo "<h1>Create Guild</h1>"; if(count($characters) == 0) error("Todos os seus personagens ja estao em uma guilda ou eles nao tem level necessario. (<b>".$config['levelToCreateGuild']."</b>)"); else { error(validation_errors()); echo form_open("guilds/create", array('method'=>'post')); echo "<label style='PADDING-LEFT: 50px;'> Character:</label>"; echo "<select name='character'>"; foreach($characters as $character) { echo "<option value='".$character['id']."'>".$character['name']." (".$character['level'].")</option>"; } echo "</select><br /><br />"; echo "<label style='PADDING-LEFT: 50px;'>Guild name:</label>"; echo "<input type='text' name='name'><br />"; echo "</form>"; } <style> .submitbox { padding-left: 50px; } </style> ?>- [Dúvida] Posso usar a tag style=' na linha echo "<input?
Tente assim : <?phprequire_once("system/application/config/create_character.php"); echo "<h1>Create Guild</h1>"; if(count($characters) == 0) error("Todos os seus personagens ja estao em uma guilda ou eles nao tem level necessario. (<b>".$config['levelToCreateGuild']."</b>)"); else { error(validation_errors()); echo form_open("guilds/create", array('method'=>'post')); echo "<label style='PADDING-LEFT: 50px;'> Character:</label>"; echo "<select name='character'>"; foreach($characters as $character) { echo "<option value='".$character['id']."'>".$character['name']." (".$character['level'].")</option>"; } echo "</select><br /><br />"; echo "<label style='PADDING-LEFT: 50px;'>Guild name:</label>"; echo "<input type='text' name='name'><br />"; echo "<input class='submitbox' type='submit' value='Create' name='submit'>"; <style> .submitbox { padding-left: 50px; } </style> echo "</form>"; } ?> o que foi mudado : echo "<input class='submitbox' type='submit' value='Create' name='submit'>"; <style> .submitbox { padding-left: 50px; } </style>- [Resolvido] Item com dias
Tente usar esse : local days = 30 * 24 * 60 * 60 -- 30 Dias local storage = 12301 function onUse(player, item) local daysRest = math.floor((getPlayerStorageValue(player, storage) - os.time())/(24 * 60 * 60)) if daysRest == 0 then doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados 30 dias de VIP na sua conta.") setPlayerStorageValue(player, storage, os.time() + days) doSendMagicEffect(getThingPos(player), math.random(13,14)) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem ".. daysRest .." dias de VIP restantes.") end return true end- (Resolvido)[Duvida e Pedido] Great Potion / Stamina
local money = XXXX -- Valor ... function onSay(player, words, param) if not doPlayerRemoveMoney(player, money) then doPlayerSendCancel(player, "You no have money.") return false end doPlayerAddStamina(player, 2520) doSendMagicEffect(getThingPos(player), CONST_ME_GIFT_WRAPS) return false end <talkaction words="!stamina" event="script" value="ARQUIVO.lua"/> Sobre o 2 não faço ideia.- Arena PVP
Sou o summ... você só precisa colocar a pos que os 2 player tem que estar aqui : player1pos = {x= 652, y= 1024, z= 7}, -- Posição 1 player2pos = {x= 652, y= 1026, z= 7}, -- Posição 2 não precisa colocar action id no piso.- Personagems Estilo RPG
Seria legal postar as 2 sprites lado a lado tipo : \/\/\/\//\\/\/ | WWWW | SPRITE DBO | SUA SPRITE Porque muitos não conhece as sprites usadas em WODBO, como eu, ai fica difícil saber qual é melhor a original ou a sua.- (Resolvido)PEDIDO SCRIPT
local cfg = { player1 = {x= xxx, y= xxx, z= x}, -- Posição do player 1 player2 = {x= xxx, y= xxx, z= x}, -- Posição do player 2 player1tpPos = {x= xxx, y= xxx, z= x}, -- Pra onde o player 1 vai ser teleportado player2tpPos = {x= xxx, y= xxx, z= x}, -- Pra onde o player 2 vai ser teleportado } function onUse(player) local player1 = getTopCreature(cfg.player1).uid local player2 = getTopCreature(cfg.player2).uid if isPlayer(player1) and isPlayer(player2) then doPlayerSendTextMessage(player1, MESSAGE_STATUS_WARNING, 'Go!') doPlayerSendTextMessage(player2, MESSAGE_STATUS_WARNING, 'Go!') doTeleportThing(player1, cfg.player1tpPos) doTeleportThing(player2, cfg.player2tpPos) else doCreatureSay(player, "Precisa de dois players pra iniciar!", TALKTYPE_ORANGE_1) end return true -- body end <action actionid="XXXX" event="script" value="ARQUIVO.lua"/> Colocar o mesmo actionid na alavanca pelo RME.- (Resolvido)3 Dias Premium ao Logar e Ao Avançar de Premium!
LoL é vdd, tinha até me esquecido , mas pelo menos valeu eu ter feito, pois aprendi alguns truques com querys.- (Resolvido)3 Dias Premium ao Logar e Ao Avançar de Premium!
data/creaturescripts/scripts/ crie : advancepremium.lua local advance = { level = xxx, -- Level que vai ganhar a premium days = 5, -- quantos dias de premium vai ganhar storage = 45646, -- Não mecher } function onAdvance(player, skill, oldLevel, newLevel) if skill == SKILL_LEVEL and newLevel == advance.level and player:getStorageValue(advance.storage) < 1 then player:addPremiumDays(advance.days) player:setStorageValue(advance.storage, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Congratulations! You won '.. advance.days ..'days of premium for advance to level '.. advance.level ..'!') end return true end function onLogin(player) player:registerEvent("AdvancePremium") return true end XML : <event type="advance" name="AdvancePremium" script="advancepremium.lua" /> <event type="login" name="Verf_AdvancePremium" script="advancepremium.lua" /> Agora o de logar e ganhar 3 dias de premium por account. Primeiro vai no seu phpmyadmin e use comando : CREATE TABLE `account_storage` ( `account_id` int(11) NOT NULL default '0', `key` int(10) unsigned NOT NULL default '0', `value` varchar(255) NOT NULL default '0', UNIQUE KEY `account_id_2` (`account_id`,`key`), KEY `account_id` (`account_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; agora vá em data/creaturescripts/script crie firstloginpremium.lua : function getAccountStorageValue(accid, key) local resultId = db.storeQuery("SELECT `account_id`, `key` FROM `account_storage` WHERE `account_id` = " .. accid .. " and `key` = " .. key) if resultId ~= false then return result.getNumber(resultId, 'key') else return -1 end return resultId:free() end function setAccountStorageValue(accid, key, value) local resultId = db.storeQuery("SELECT `value` FROM `account_storage` WHERE `account_id` = " .. accid .. " and `key` = " .. key) if resultId ~= false then db.query("UPDATE `account_storage` SET `value` = " .. accid .. " WHERE `key`=" .. key .. " LIMIT 1');") else db.query("INSERT INTO `account_storage` (`account_id`, `key`, `value`) VALUES (" .. accid .. ", " .. key .. ", '"..value.."');") end return true end function onLogin(player) local storage = 545465 local pid = player:getGuid() local query = db.storeQuery("SELECT `account_id` FROM `players` WHERE `id` = ".. pid) local value = result.getNumber(query, 'account_id') if getAccountStorageValue(value, storage) < 1 then player:addPremiumDays(3) setAccountStorageValue(value, storage, 1) end return true end XML : <event type="login" name="FirstLoginPremium" script="firstloginpremium.lua" /> Créditos ao luanluciano93 por ter me ajudado com as query. abrçs- (Resolvido)[Talkaction] Level Max
Mas ele irá deslogar ao pegar o level tudo bem ? (as alterações só podem ser feitas se ele deslogar...) Basta excluir essa linha : doTeleportThing(cid, maximum.pos)- (Resolvido)Mudar recompensa evento
- (Resolvido)Mudar recompensa evento
basta configurar em : local reward = {{ITEMID, QUANTIDADE}} -- {ITEMID, QUANTIDADE}, local centeroffight = {x=24553,y=23720,z=7} local waitingplace = {x=24554,y=23720,z=6} local depotcenter = {x=32345,y=32223,z=7} local MinimumPlayers = 2 local reward = {{ITEMID, QUANTIDADE}} -- {ITEMID, QUANTIDADE}, local function lmsclosed1() -- broadcastMessage("Last Man Standing event will start in 1 minutes. Portal is opened in depot", MESSAGE_STATUS_WARNING) end local function lmsclosed() count = 0 local spectators = getSpectators(waitingplace, 10, 10, false) if spectators ~= nil then for _, spectator in ipairs(spectators) do if isPlayer(spectator) then count = count + 1 end end end if (count >= MinimumPlayers) then broadcastMessage("Last Man Standing event portal closed and event started!", MESSAGE_STATUS_WARNING) for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) doTeleportThing(playerids,centeroffight) doSendMagicEffect(center, CONST_ME_TELEPORT) end end else broadcastMessage("Not enough players to start Last man Standing event! Minimum: "..MinimumPlayers.." players. We have "..count.."!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(25002, 0) for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) doTeleportThing(playerids,depotcenter) doSendMagicEffect(depotcenter, CONST_ME_TELEPORT) setPlayerStorageValue(pid, 25001, 0) end end end return true end local function lmscheck() count = 0 local spectators = getSpectators(centeroffight, 500, 500, false) if spectators ~= nil then for _, spectator in ipairs(spectators) do if isPlayer(spectator) then count = count + 1 end end end if count == 1 then for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) setPlayerStorageValue(playerids, 25001, 0) end end local spectators = getSpectators(centeroffight, 10, 10, false) if spectators ~= nil then for _, spectator in ipairs(spectators) do if isPlayer(spectator) then doTeleportThing(spectator,depotcenter) doSendMagicEffect(depotcenter, CONST_ME_TELEPORT) for x = 1, #reward do doPlayerAddItem(spectator, reward[x][1], reward[x][2]) end broadcastMessage("Last Man Standing ended winner is: "..getPlayerName(spectator)..".", MESSAGE_STATUS_WARNING) end end end for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) setPlayerStorageValue(pid, 25001, 0) end end stopEvent(lmscheck) else addEvent(lmscheck, 10*1000) end end local function lms() broadcastMessage("Last Man Standing event will start in 2 minutes. Portal is opened in depot", MESSAGE_STATUS_WARNING) portalwhere = {x= 32349, y=32222, z=7} local portal = doCreateItem(11796,1,portalwhere) doSetItemActionId(portal, 25001) doSendMagicEffect(portalwhere, CONST_ME_TELEPORT) iteminfo = {x= 32348, y=32222, z=7} local item = doCreateItem(1431,1,iteminfo) doSetItemActionId(item, 25002) doSendMagicEffect(iteminfo, CONST_ME_TELEPORT) addEvent(function() doRemoveItem(getTileItemById(portalwhere, 11796).uid) end, 120 * 1000) addEvent(function() doSendMagicEffect(portalwhere, CONST_ME_TELEPORT) end, 120 * 1000) addEvent(function() doRemoveItem(getTileItemById(iteminfo, 1431).uid) end, 120 * 1000) addEvent(function() doSendMagicEffect(iteminfo, CONST_ME_TELEPORT) end, 120 * 1000) addEvent(lmsclosed, 2*60*1000) addEvent(lmsclosed1, 1*60*1000) addEvent(lmscheck, 130*1000) return true end function onThink(interval) broadcastMessage("Last Man Standing event will start in 3 minutes.", MESSAGE_STATUS_WARNING) addEvent(lms, 60*1000) return true end- raid boss
Eu fiz um script de raid esses tempos atrás : http://pastebin.com/wWSEzjQm- (Resolvido)3 Dias Premium ao Logar e Ao Avançar de Premium!
Tem que setar storage por account ... precisa adaptar esse sistema pra tfs 1.1, http://www.tibiaking.com/forum/topic/21851-function-account-storage/ se ninguém te ajudar até a noite eu faço pra ti- (Resolvido)[Talkaction] Level Max
maximumlevel.lua function onAdvance(cid, skill, oldLevel, newLevel) -- body local maximum = { player = getPlayerGUID(cid), lvlmax = (getPlayerLevel(cid) + 1), pos = {x= xxx, y= xxx, z= x}, -- Coordenadas do templo } local levels = {717217, 903637, 1034406, 1138511, 1226423, 1303269, 1371986, 1434433, 1491871, 1545196, 1595075, 1642016, 1686416, 1728594, 1768808, 1807272, 1844166, 1879639, 1913822, 1946825, 1978746, 2009669, 2039668, 2068810, 2097153, 2124751, 2151649, 2177891, 2203516, 2228558, 2253050} -- Level que o player vai usar o comando. if skill == 8 and isInArray(levels, getPlayerLevel(cid)) then doTeleportThing(cid, maximum.pos) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 10000 WHERE `id` = "..maximum.player) end return true end function onLogin(cid) -- body registerCreatureEvent(cid, "MaxLevel") return true end creaturescripts.XML <!-- Maximum Level --> <event type="advance" name="MaxLevel" event="script" value="maximumlevel.lua"/> <event type="login" name="r_MaxLevel" event="script" value="maximumlevel.lua"/>- ALAVANCA ARENA
Isso parece ser uma arena pvp néh ? Eu fiz um sistema parecido se quiser dar uma olhada > http://www.tibiaking.com/forum/topic/54988-arena-pvp/ < Qualquer erro pode postar lá no tópico que eu dou suporte. - Dúvida com Código
Informação Importante
Confirmação de Termo