Ir para conteúdo

Imperius

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Imperius recebeu reputação de neengoso em [TFS 0.4] SafeZone Event - Adaptação de compatibilidade   
    Olá! Fiz uma adaptação no evento "SafeZone" criado e disponibilizado aqui no TK por @Movie e @luanluciano93.
     
     
    Agora o evento é compatível para TFS 0.4.
     
    IMPORTANTE:  Como mencionado anteriormente, o evento foi criado por "Movie" e "LuanLuciano93". Eu (imperius) APENAS ADAPTEI para funcionar em TFS 0.4. Todos os créditos do evento vão para os criadores originais. Além disso, é importante alertar que esta adaptação não está 100%.
     
    Abaixo está todo o processo explicando como configurar e rodar o evento em seu servidor!
     
     
    Vídeo demonstrativo:
     
     
     
    em data > lib > crie um arquivo chamado safeZone.lua
     
     
     
    data > globalevents > globalevents.xml
     
     
     
    em data > globalevents > scripts > crie um arquivo chamado safeZoneEvent.lua
     
     
     
    data > movements > movements.xml
     
     
     
    em data > movements > scripts > crie um arquivo chamado safeZoneMovement.lua
     
     
     
    por fim, vá até o banco de dados do seu servidor e adicione o seguinte código em "SQL"
     
     
    É isso! Espero ter ajudado o pessoal do TFS 0.4
  2. Curtir
    Imperius recebeu reputação de Doria Louro em TFS 0.4 Jogadores não logam   
    Dá uma olhada se o problema está em creaturescripts. Talvez um "return false" em vez de "return true" em algum script com callback "onLogin".
  3. Gostei
    Imperius recebeu reputação de L3K0T em [TFS 0.4] CreatureScripts (onOpenRuleViolation) + Telegram Notification   
    O propósito é criar uma nova função em creaturescripts que será acionada toda vez que um novo report (CTRL + R) for aberto.
     
    Eu implementei para enviar uma notificação no grupo do Telegram, contendo os dados do report.
     
    Isso garantirá que os GMs tenham acesso aos reports dos jogadores mesmo quando não estiverem logados, e também evitará que algum report seja perdido caso o jogador saia do servidor.
    A parte do Telegram é apenas um exemplo. Você pode ajustar o script para executar outras ações desejadas.
     
    creatureevent.cpp:
    Dentro deste arquivo, localize a função:
     
    uint32_t CreatureEvent::executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap)  
    abaixo dela, adicione:
     
    uint32_t CreatureEvent::executeOpenRuleViolation(Player* player, std::string message) { if (!m_interface->reserveEnv()) { std::clog << "[Error - CreatureEvent::executeOpenRuleViolation] Call stack overflow." << std::endl; return 0; } ScriptEnviroment* env = m_interface->getEnv(); env->setScriptId(m_scriptId, m_interface); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushstring(L, message.c_str()); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; }  
    Após, procure por:
     
    std::string CreatureEvent::getScriptEventName() const  
    abaixo de:
     
    case CREATURE_EVENT_CHANNEL_LEAVE: return "onLeaveChannel";  
    adicione:
     
    case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "onOpenRuleViolation";  
    Agora, procure por:
     
    std::string CreatureEvent::getScriptEventParams() const  
    abaixo de:
     
    case CREATURE_EVENT_CHANNEL_LEAVE: return "cid, channel, users";  
    adicione:
     
    case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "cid, message";  
    Procure por:
     
    bool CreatureEvent::configureEvent(xmlNodePtr p)  
    abaixo de:
     
    else if(tmpStr == "leavechannel") m_type = CREATURE_EVENT_CHANNEL_LEAVE;  
    adicione:
     
    else if(tmpStr == "openruleviolation") m_type = CREATURE_EVENT_OPEN_RULE_VIOLATION;  
     
    creatureevent.h:
    Dentro deste arquivo, localize:
     
    enum CreatureEventType_t  
    adicione "CREATURE_EVENT_OPEN_RULE_VIOLATION" como o último item de enum CreatureEventType_t
     
    Exemplo:
     
    enum CreatureEventType_t { // ... CREATURE_EVENT_OPEN_RULE_VIOLATION };  
    Agora, procure por:
     
    uint32_t executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap);  
    abaixo dela, adicione:
     
    uint32_t executeOpenRuleViolation(Player* player, std::string message);  
    game.cpp:
    Dentro deste arquivo, localize:
     
    bool Game::playerReportRuleViolation(Player* player, const std::string& text)  
    e substitua por:
     
    bool Game::playerReportRuleViolation(Player* player, const std::string& text) { //Do not allow reports on multiclones worlds since reports are name-based if(g_config.getNumber(ConfigManager::ALLOW_CLONES)) { player->sendTextMessage(MSG_INFO_DESCR, "Rule violation reports are disabled."); return false; } cancelRuleViolation(player); boost::shared_ptr<RuleViolation> rvr(new RuleViolation(player, text, time(NULL))); ruleViolations[player->getID()] = rvr; ChatChannel* channel = g_chat.getChannelById(CHANNEL_RVR); if(!channel) return false; for(UsersMap::const_iterator it = channel->getUsers().begin(); it != channel->getUsers().end(); ++it) it->second->sendToChannel(player, SPEAK_RVR_CHANNEL, text, CHANNEL_RVR, rvr->time); CreatureEventList joinEvents = player->getCreatureEvents(CREATURE_EVENT_OPEN_RULE_VIOLATION); for(CreatureEventList::iterator it = joinEvents.begin(); it != joinEvents.end(); ++it) (*it)->executeOpenRuleViolation(player, text); return true; }  
    Agora é só compilar a source.
     
    depois em "data > creaturescripts > creaturescripts.xml", adicione:
     
    <event type="login" name="loginNotifyRuleViolation" script="notifyRuleViolation.lua"/> <event type="openruleviolation" name="openNotifyRuleViolation" script="notifyRuleViolation.lua"/>  
    em "data > creaturescripts > scripts", crie um arquivo notifyRuleViolation.lua e adicione:
     
    function onOpenRuleViolation(cid, message) local config = { token = "", -- Token do seu BOT no Telegram chatId = "" -- ID do chat do Telegram que será enviado a notificação. } local message = "Player: "..getCreatureName(cid).."\n\nReport:\n"..message.."" message = string.gsub(message, "\n", "%%0A") local url = "https://api.telegram.org/bot"..config.token.."/sendMessage" local data = "chat_id="..config.chatId.."&text="..message.."" local curl = io.popen('curl -d "'..data..'" "'..url..'"'):read("*a") return true end function onLogin(cid) registerCreatureEvent(cid, "openNotifyRuleViolation") return true end  
     
    Demonstração:
    1. Jogador abre um novo report (CTRL + R)

    2. notifyRuleViolation.lua, definido em creaturescripts.xml, é acionado para enviar uma notificação ao grupo do Telegram.
     

     
  4. Curtir
    data > npc > scripts > NomeDoNPC.lua
     
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 config = { itemID = 11192, -- ID da Moeda VIP quantity = 100, -- Quantidade de moedas que o jogador precisa ter na mochila minLevel = 8 -- Level minimo que o jogador precisa ter para comprar a promotion } local itemName = getItemNameById(config.itemID) function checkPlayerHavePromotion(cid) local currentVocation = getPlayerVocation(cid) - 4 local vocationPromoted = getPromotedVocation(currentVocation) - 4 return currentVocation == vocationPromoted; end function checkPlayerHaveItems(cid, message, keywords, parameters, node) if (not npcHandler:isFocused(cid)) then return false end if (config.minLevel ~= nil and getPlayerLevel(cid) < config.minLevel) then npcHandler:say('You must reach level '..config.minLevel..' to buy promotion.', cid) return true end if checkPlayerHavePromotion(cid) then npcHandler:say('You are already promoted!', cid) return true end if (not doPlayerRemoveItem(cid, config.itemID, config.quantity)) then npcHandler:say('You do not have enough '..itemName..'!', cid) return true end doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) npcHandler:say(parameters.text, cid) return true end local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, { npcHandler = npcHandler, onlyFocus = true, text = "I can promote you for "..config.quantity.." {"..itemName.."}. Do you want me to promote you?" }) node1:addChildKeyword({'yes'}, checkPlayerHaveItems, { npcHandler = npcHandler, text = "Congratulations! You are now promoted." }) node1:addChildKeyword({'no'}, StdModule.say, { npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Alright then, come back when you are ready." }) npcHandler:addModule(FocusModule:new())
    data > npc > NomeDoNPC.xml
     
    <?xml version="1.0" encoding="UTF-8"?> <npc name="NomeDoNPC" script="data/npc/scripts/NomeDoNPC.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="160" head="77" body="79" legs="56" feet="115" addons="0"/> </npc>
     
  5. Obrigado
    Imperius recebeu reputação de Mikethekingsz em ESTOQUE DE ITEM   
    Veja se é isso o que você está procurando. TFS 0.4:
     
    em data > npc > Testador.xml:
     
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Testador" script="data/npc/scripts/Testador.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="160" head="77" body="79" legs="56" feet="115" addons="0"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|! Deseja {comprar} alguma coisa?"/> </parameters> </npc>  
     
    data > npc > scripts > Testador.lua:
     
    -- Imperius ~ Alecrim local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} local configNPC = { storage = 40004400, estoque = 10, -- Quantas vezes o player poderá comprar este item? itemID = 2400, -- ID do item que será vendido pelo NPC moedaID = 6500, -- ID da moeda de troca customizada. valor = 45, -- Quantas moedas o player precisará ter para comprar o item? } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid, configNPC.storage) < 0 then setPlayerStorageValue(cid, configNPC.storage, configNPC.estoque) end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) local itemName = getItemNameById(configNPC.itemID) local moedaName = getItemNameById(configNPC.moedaID) if isInArray({"comprar", "buy"}, msg) then if getPlayerStorageValue(cid, configNPC.storage) < 1 then selfSay("Voce já comprou todo o meu estoque.", cid) npcHandler:releaseFocus(cid) else selfSay("Voce quer trocar 1x {"..itemName.."} por "..configNPC.valor.."x {"..moedaName.."}?", cid) talkState[talkUser] = 1 end end if isInArray({"sim", "yes"}, msg) and talkState[talkUser] == 1 then talkState[talkUser] = 0 if getPlayerItemCount(cid, configNPC.moedaID) >= configNPC.valor then setPlayerStorageValue(cid, configNPC.storage, getPlayerStorageValue(cid, configNPC.storage) - 1) -- Atualiza o estoque do player doPlayerRemoveItem(cid, configNPC.moedaID, configNPC.valor) -- Remove as moedas do player doPlayerAddItemEx(cid, doCreateItemEx(configNPC.itemID, 1)) -- Da o item ao player doSendMagicEffect(getThingPos(cid), 13) -- Da um efeitinho no player selfSay("Certo! Troca realizada.", cid) else selfSay("Você não tem a quantidade de "..moedaName.." o suficiente", cid) npcHandler:releaseFocus(cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
     
     
  6. Gostei
    Imperius deu reputação a cccaa em [MOSTRANDO WEBSITE] - LAYOUT E ALGUNS SISTEMA   
    Olá pessoal,

    Quero compartilhar com todo mundo um dos meus projetos recentes, o Uniq Poke. Eu mesmo criei tudo do zero usando meu próprio framework, o Uniq Frame.
    Esse foi meu primeiro projeto com a comunidade de Poketibia, com o objetivo de trazer layouts inovadores e motivar os usuários. Espero que curtam!
    Para mais detalhes, é só me chamar no Discord: @php7

    Página inicial (home)

    Página de Ranking:
     
    Página de Suporte:
     
    Página de Cadastro
     
    Página da loja:
     
    Página de pagamentos (Apenas PIX no momento)
     
    Página de perfil:
     
     
    Bom, esse foi o site, ainda falta algumas páginas para finaliza-lo. Mas, já estou trabalhando no painel de controle, onde o administrador vai poder gerenciar o site, usuário e a parte financeira.
     
  7. Gostei
    Imperius recebeu reputação de Mateus Robeerto em Error script boss   
    data > creaturescripts > creaturescripts.xml
     
    <event type="kill" name="killTheBoss" event="script" value="killTheBoss.lua"/> <event type="login" name="killTheBossLogin" event="script" value="killTheBoss.lua"/>  
    data > creaturescripts > scripts > killTheBoss.lua
     
    local config = { monsters = {"Boss Hits"}, rewards = { {itemID = 8300, chanceToGainInPercent = 10, quantity = 1}, {itemID = 8301, chanceToGainInPercent = 20, quantity = 1}, {itemID = 8302, chanceToGainInPercent = 30, quantity = 1}, {itemID = 8303, chanceToGainInPercent = 40, quantity = 1}, }, effect = 27, } -- Função para selecionar um item com base na porcentagem function selectRandomItem() local totalChance = 0 for _, reward in pairs(config.rewards) do totalChance = totalChance + reward.chanceToGainInPercent end local randomValue = math.random(1, totalChance) local cumulativeChance = 0 for _, reward in pairs(config.rewards) do cumulativeChance = cumulativeChance + reward.chanceToGainInPercent if randomValue <= cumulativeChance then return reward end end end function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getCreatureMaster(target) ~= nil then return true end local monsterNameKilled = getCreatureName(target) if isInArray(config.monsters, monsterNameKilled) then local selectedItem = selectRandomItem() doPlayerAddItem(cid, selectedItem.itemID, selectedItem.quantity) doSendMagicEffect(getCreaturePosition(cid), config.effect) end end return true end function onLogin(cid) registerCreatureEvent(cid, "killTheBoss") return true end  
  8. Obrigado
    Imperius recebeu reputação de Under em Error script boss   
    data > creaturescripts > creaturescripts.xml
     
    <event type="kill" name="killTheBoss" event="script" value="killTheBoss.lua"/> <event type="login" name="killTheBossLogin" event="script" value="killTheBoss.lua"/>  
    data > creaturescripts > scripts > killTheBoss.lua
     
    local config = { monsters = {"Boss Hits"}, rewards = { {itemID = 8300, chanceToGainInPercent = 10, quantity = 1}, {itemID = 8301, chanceToGainInPercent = 20, quantity = 1}, {itemID = 8302, chanceToGainInPercent = 30, quantity = 1}, {itemID = 8303, chanceToGainInPercent = 40, quantity = 1}, }, effect = 27, } -- Função para selecionar um item com base na porcentagem function selectRandomItem() local totalChance = 0 for _, reward in pairs(config.rewards) do totalChance = totalChance + reward.chanceToGainInPercent end local randomValue = math.random(1, totalChance) local cumulativeChance = 0 for _, reward in pairs(config.rewards) do cumulativeChance = cumulativeChance + reward.chanceToGainInPercent if randomValue <= cumulativeChance then return reward end end end function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getCreatureMaster(target) ~= nil then return true end local monsterNameKilled = getCreatureName(target) if isInArray(config.monsters, monsterNameKilled) then local selectedItem = selectRandomItem() doPlayerAddItem(cid, selectedItem.itemID, selectedItem.quantity) doSendMagicEffect(getCreaturePosition(cid), config.effect) end end return true end function onLogin(cid) registerCreatureEvent(cid, "killTheBoss") return true end  
  9. Obrigado
    Imperius recebeu reputação de Doidodepeda em Error script boss   
    data > creaturescripts > creaturescripts.xml
     
    <event type="kill" name="killTheBoss" event="script" value="killTheBoss.lua"/> <event type="login" name="killTheBossLogin" event="script" value="killTheBoss.lua"/>  
    data > creaturescripts > scripts > killTheBoss.lua
     
    local config = { monsters = {"Boss Hits"}, rewards = { {itemID = 8300, chanceToGainInPercent = 10, quantity = 1}, {itemID = 8301, chanceToGainInPercent = 20, quantity = 1}, {itemID = 8302, chanceToGainInPercent = 30, quantity = 1}, {itemID = 8303, chanceToGainInPercent = 40, quantity = 1}, }, effect = 27, } -- Função para selecionar um item com base na porcentagem function selectRandomItem() local totalChance = 0 for _, reward in pairs(config.rewards) do totalChance = totalChance + reward.chanceToGainInPercent end local randomValue = math.random(1, totalChance) local cumulativeChance = 0 for _, reward in pairs(config.rewards) do cumulativeChance = cumulativeChance + reward.chanceToGainInPercent if randomValue <= cumulativeChance then return reward end end end function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getCreatureMaster(target) ~= nil then return true end local monsterNameKilled = getCreatureName(target) if isInArray(config.monsters, monsterNameKilled) then local selectedItem = selectRandomItem() doPlayerAddItem(cid, selectedItem.itemID, selectedItem.quantity) doSendMagicEffect(getCreaturePosition(cid), config.effect) end end return true end function onLogin(cid) registerCreatureEvent(cid, "killTheBoss") return true end  
  10. Gostei
    Imperius recebeu reputação de brunei em [TFS 0.4 / 8.60] - GM, CM e GOD falam em vermelho no channel Help   
    Tinha visto isso no servidor do MegaTibia / Kaldrox e achei bem interessante.
     
    Todos os tópicos que encontrei sobre o assunto de alterar a cor das mensagens dos GMs, CMs e ADM no channel Help para vermelho, falavam que tinham que fazer uma configuração na própria source do servidor.
     
    Fiz uma gambiarra que funciona, sem a necessidade de mexer na source do servidor e de utilizar comandos para isso. Testei somente em TFS 0.4 e funciona tranquilamente.
     
    segue abaixo como configurar em seu otserver:
     
    data > talkactions > scripts > crie um arquivo chamado gmsayred.lua e cole o código abaixo:
     
    function onSay(cid, words, param, channel) if channel == CHANNEL_HELP then for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', "".. getCreatureName(cid) .. ": ".. words, TALKTYPE_CHANNEL_R1, CHANNEL_HELP) end return true end end  
    em talkactions.xml cole a tag abaixo:

     
    <!-- Gamemasters --> <talkaction default="yes" filter="quotation" logged="no" access="3" event="script" value="gmsayred.lua"/>    
    e pronto! Agora é só enviar alguma mensagem no Help que a mensagem ficará em vermelho.
     

     
  11. Gostei
    Imperius recebeu reputação de JowL em [TFS 0.4] Treasure Chest Lottery + PHP Page   
    Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar.
     
    É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/
     
    Como funciona?
     
    O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte.
     
    O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador.
     
    Para entender melhor o seu funcionamento, segue o GIF abaixo:
     

     
     
    em data > actions > actions.xml
     
     
    em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua
     
     
    no banco de dados do servidor, adicione o seguinte código em "SQL":
     
     
     

    Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros.
     

     
     
    Espero ter ajudado de alguma forma! : )
     
    treasure_chest.php
  12. Obrigado
    Imperius recebeu reputação de Armouzt em Sistema de encantamento   
    data > actions > scripts > enchantmentSystem.lua:
     
    function onUse(cid, item, frompos, item2, topos) local playerLocation = getCreaturePosition(cid) local weaponData = { -- ID da arma | ID do item de encantamento | quantidade do item de encantamento (opcional) | ID do item que a arma será transformada. {weaponId = 7735, enchantmentId = 2361, transformId = 2453}, {weaponId = 6132, enchantmentId = 2159, amountEnchantment = 10, transformId = 2646} } local positions = { weaponTable = {x = 32352, y = 31912, z = 7}, -- Onde o jogador deverá colocar a arma. enchantmentTable = {x = 32354, y = 31912, z = 7} -- Onde o jogador deverá colocar o item de encantamento. } function check() for _, data in pairs(weaponData) do local weapon = getTileItemById(positions.weaponTable, data.weaponId) local enchantment = getTileItemById(positions.enchantmentTable, data.enchantmentId) if weapon.itemid == data.weaponId and enchantment.itemid == data.enchantmentId then local amountEnchantment = enchantment.type and data.amountEnchantment or 1 if doRemoveItem(enchantment.uid, amountEnchantment) then doRemoveItem(weapon.uid, 1) doPlayerAddItem(cid, data.transformId, 1) doSendMagicEffect(playerLocation, 39) return true end end end end if not check() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sem itens necessários para o encantamento.") doSendMagicEffect(playerLocation, CONST_ME_POFF) end return true end  
    data > actions > actions.xml:
     
    <!-- Coloque a sua ActionID da alavanca --> <action actionid="11404" event="script" value="enchantmentSystem.lua" />  
  13. Gostei
    Imperius recebeu reputação de Claudio Marcio em Sistema de encantamento   
    data > actions > scripts > enchantmentSystem.lua:
     
    function onUse(cid, item, frompos, item2, topos) local playerLocation = getCreaturePosition(cid) local weaponData = { -- ID da arma | ID do item de encantamento | quantidade do item de encantamento (opcional) | ID do item que a arma será transformada. {weaponId = 7735, enchantmentId = 2361, transformId = 2453}, {weaponId = 6132, enchantmentId = 2159, amountEnchantment = 10, transformId = 2646} } local positions = { weaponTable = {x = 32352, y = 31912, z = 7}, -- Onde o jogador deverá colocar a arma. enchantmentTable = {x = 32354, y = 31912, z = 7} -- Onde o jogador deverá colocar o item de encantamento. } function check() for _, data in pairs(weaponData) do local weapon = getTileItemById(positions.weaponTable, data.weaponId) local enchantment = getTileItemById(positions.enchantmentTable, data.enchantmentId) if weapon.itemid == data.weaponId and enchantment.itemid == data.enchantmentId then local amountEnchantment = enchantment.type and data.amountEnchantment or 1 if doRemoveItem(enchantment.uid, amountEnchantment) then doRemoveItem(weapon.uid, 1) doPlayerAddItem(cid, data.transformId, 1) doSendMagicEffect(playerLocation, 39) return true end end end end if not check() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sem itens necessários para o encantamento.") doSendMagicEffect(playerLocation, CONST_ME_POFF) end return true end  
    data > actions > actions.xml:
     
    <!-- Coloque a sua ActionID da alavanca --> <action actionid="11404" event="script" value="enchantmentSystem.lua" />  
  14. Você Tentou
    Imperius recebeu reputação de Doidodepeda em Tirar vocation e botar por storage   
    Seria tipo isso?
     
    data > creaturescripts > creaturescripts.xml
     
    <event type="login" name="playerTextEffect" event="script" value="playerTextEffect.lua"/>  
     
    data > creaturescripts > scripts > playerTextEffect.lua
     
    local config = { storage = 808072, -- Storage que o player precisa ter. colorsText = {10, 30, 50, 70}, -- valores que o player poderá ter no storage (cada valor corresponde a uma coloração diferente de texto) texts = {"' . ,", ". ' ,", "' . ,", ", ' ."} -- Textos que ficará saindo do jogador. } function ariseText(cid) if not isPlayer(cid) then return true end local playerColorTextEffect = getPlayerStorageValue(cid, config.storage) if not isInArray(config.colorsText, playerColorTextEffect) then return true end local playerPosition = getCreaturePosition(cid) local randomTextEffect = config.texts[math.random(1, #config.texts)] doSendAnimatedText(playerPosition, randomTextEffect, playerColorTextEffect) doSendMagicEffect(playerPosition, CONST_ME_MAGIC_GREEN) -- Efeito mágico adicionado addEvent(ariseText, 1000, cid) return true end function onLogin(cid) ariseText(cid) return true end  
  15. Curtir
    Exemplo:
     
    data > spells > spells.xml
     
    <instant name="NOME DA MAGIA" words="NOME DA MAGIA" lvl="100" mana="160" prem="0" selftarget="1" exhaustion="60000" needlearn="0" event="script" value="support/nomedamagia.lua"> <vocation id="1"/> <vocation id="8"/> </instant>  
    data > spells > scripts > support > nomedamagia.lua
     
    function teleportPlayer(player, position) doTeleportThing(player, position) doSendMagicEffect(position, CONST_ME_TELEPORT) end function onCastSpell(cid, var) local playerPosition = getCreaturePosition(cid) addEvent(teleportPlayer, 5000, cid, playerPosition) doSendMagicEffect(playerPosition, 13) return true end  
  16. Obrigado
    Imperius recebeu reputação de Doidodepeda em (Resolvido)Script boss + teleport (Adaptação)   
    seria tipo isso? Não entendi mt bem como será feito p/ nascer boss, então fiz uma talkaction, aí é só vc adapta da maneira que quiser.
     
    data > lib > spawnBoss.lua
     
    BOSS_SPAWN_CONFIG = { bosses = { ["Boss Thdagger"] = { -- Nome do Boss. position = { spawnBoss = {x = 263, y = 349, z = 7 }, -- Onde o boss nascerá. openTP = {x = 0, y = 0, z = 0}, -- Onde o TP aparecerá. locationTP = {x = 0, y = 0, z = 0} -- Onde o TP levará o jogador. }, timeInSeconds = { closeTP = 60 -- segundos p/ fechar o TP após o boss ter nascido. } } -- Adicione outros bosses aqui se quiser ... } } -- Mostrará a contagem regressiva em cima do TP -- function spawnBossCountdownOnTeleport(bossCreature, teleport, timeToCloseTP) local bossName = getCreatureName(bossCreature); if not bossName then doRemoveItem(getTileItemById(teleport, 1387).uid) doSendMagicEffect(teleport, CONST_ME_POFF) return true end local timeToCloseTP = tonumber(timeToCloseTP) - 1; if timeToCloseTP == 0 then doRemoveItem(getTileItemById(teleport, 1387).uid) doSendMagicEffect(teleport, CONST_ME_POFF) return true end doSendAnimatedText(teleport, timeToCloseTP, 725) addEvent(spawnBossCountdownOnTeleport, 1000, bossCreature, teleport, timeToCloseTP); return true end  
     
    data > talkactions > scripts > spawnBoss.lua
     
    function onSay(cid, words, param, channel) local bossName = param; if not BOSS_SPAWN_CONFIG.bosses[bossName] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Boss nao encontrado! Escreva o nome corretamente, incluindo letras maiuscula/minuscula.") return true end local bossCreature = doCreateMonster(bossName, BOSS_SPAWN_CONFIG.bosses[bossName].position.spawnBoss) doCreateTeleport(1387, BOSS_SPAWN_CONFIG.bosses[bossName].position.locationTP, BOSS_SPAWN_CONFIG.bosses[bossName].position.openTP) spawnBossCountdownOnTeleport(bossCreature, BOSS_SPAWN_CONFIG.bosses[bossName].position.openTP, BOSS_SPAWN_CONFIG.bosses[bossName].timeInSeconds.closeTP); doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOSS: "..bossName.." foi criado!") return true end  
    data > talkactions > talkactions.xml
     
    <!-- Spawn Boss --> <talkaction access="5" words="/boss" script="spawnBoss.lua"/>  
    /boss nome do boss
  17. Curtir
    data > talkactions > scripts > online.lua
     
    function onSay(cid, words, param, channel) local quantityOnline = 0 for _, pid in ipairs(getPlayersOnline()) do if getPlayerAccess(pid) < 4 then quantityOnline = quantityOnline + 1 local playerReset = getPlayerStorageValue(pid, 54676) playerReset = (playerReset > 0) and playerReset or 0 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..getCreatureName(pid).." ["..getPlayerLevel(pid).."] - "..getPlayerVocationName(pid).." | Resets: "..playerReset.."") end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, quantityOnline.." Player(s) online") return true end  
  18. Curtir
    data > talkactions > scripts > online.lua
     
    function onSay(cid, words, param, channel) local quantityOnline = 0 for _, pid in ipairs(getPlayersOnline()) do if getPlayerAccess(pid) < 4 then quantityOnline = quantityOnline + 1 local playerReset = getPlayerStorageValue(pid, 54676) playerReset = (playerReset > 0) and playerReset or 0 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..getCreatureName(pid).." ["..getPlayerLevel(pid).."] - "..getPlayerVocationName(pid).." | Resets: "..playerReset.."") end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, quantityOnline.." Player(s) online") return true end  
  19. Curtir
    aqui funcionou de boa
     
    Só que tem um porém: o NPC só vai liberar a opção de "buy" se você tiver a mesma quantidade de gold na backpack em relação ao preço do item em moeda vip.
  20. Obrigado
    Imperius recebeu reputação de FeeTads em [TFS 0.4] Treasure Chest Lottery + PHP Page   
    Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar.
     
    É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/
     
    Como funciona?
     
    O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte.
     
    O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador.
     
    Para entender melhor o seu funcionamento, segue o GIF abaixo:
     

     
     
    em data > actions > actions.xml
     
     
    em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua
     
     
    no banco de dados do servidor, adicione o seguinte código em "SQL":
     
     
     

    Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros.
     

     
     
    Espero ter ajudado de alguma forma! : )
     
    treasure_chest.php
  21. Gostei
    Imperius recebeu reputação de Movie em [TFS 0.4] SafeZone Event - Adaptação de compatibilidade   
    Olá! Fiz uma adaptação no evento "SafeZone" criado e disponibilizado aqui no TK por @Movie e @luanluciano93.
     
     
    Agora o evento é compatível para TFS 0.4.
     
    IMPORTANTE:  Como mencionado anteriormente, o evento foi criado por "Movie" e "LuanLuciano93". Eu (imperius) APENAS ADAPTEI para funcionar em TFS 0.4. Todos os créditos do evento vão para os criadores originais. Além disso, é importante alertar que esta adaptação não está 100%.
     
    Abaixo está todo o processo explicando como configurar e rodar o evento em seu servidor!
     
     
    Vídeo demonstrativo:
     
     
     
    em data > lib > crie um arquivo chamado safeZone.lua
     
     
     
    data > globalevents > globalevents.xml
     
     
     
    em data > globalevents > scripts > crie um arquivo chamado safeZoneEvent.lua
     
     
     
    data > movements > movements.xml
     
     
     
    em data > movements > scripts > crie um arquivo chamado safeZoneMovement.lua
     
     
     
    por fim, vá até o banco de dados do seu servidor e adicione o seguinte código em "SQL"
     
     
    É isso! Espero ter ajudado o pessoal do TFS 0.4
  22. Gostei
    Imperius recebeu reputação de luanluciano93 em [TFS 0.4] SafeZone Event - Adaptação de compatibilidade   
    Olá! Fiz uma adaptação no evento "SafeZone" criado e disponibilizado aqui no TK por @Movie e @luanluciano93.
     
     
    Agora o evento é compatível para TFS 0.4.
     
    IMPORTANTE:  Como mencionado anteriormente, o evento foi criado por "Movie" e "LuanLuciano93". Eu (imperius) APENAS ADAPTEI para funcionar em TFS 0.4. Todos os créditos do evento vão para os criadores originais. Além disso, é importante alertar que esta adaptação não está 100%.
     
    Abaixo está todo o processo explicando como configurar e rodar o evento em seu servidor!
     
     
    Vídeo demonstrativo:
     
     
     
    em data > lib > crie um arquivo chamado safeZone.lua
     
     
     
    data > globalevents > globalevents.xml
     
     
     
    em data > globalevents > scripts > crie um arquivo chamado safeZoneEvent.lua
     
     
     
    data > movements > movements.xml
     
     
     
    em data > movements > scripts > crie um arquivo chamado safeZoneMovement.lua
     
     
     
    por fim, vá até o banco de dados do seu servidor e adicione o seguinte código em "SQL"
     
     
    É isso! Espero ter ajudado o pessoal do TFS 0.4
  23. Gostei
    Imperius recebeu reputação de Tinkyzin em [TFS 0.4] SafeZone Event - Adaptação de compatibilidade   
    Olá! Fiz uma adaptação no evento "SafeZone" criado e disponibilizado aqui no TK por @Movie e @luanluciano93.
     
     
    Agora o evento é compatível para TFS 0.4.
     
    IMPORTANTE:  Como mencionado anteriormente, o evento foi criado por "Movie" e "LuanLuciano93". Eu (imperius) APENAS ADAPTEI para funcionar em TFS 0.4. Todos os créditos do evento vão para os criadores originais. Além disso, é importante alertar que esta adaptação não está 100%.
     
    Abaixo está todo o processo explicando como configurar e rodar o evento em seu servidor!
     
     
    Vídeo demonstrativo:
     
     
     
    em data > lib > crie um arquivo chamado safeZone.lua
     
     
     
    data > globalevents > globalevents.xml
     
     
     
    em data > globalevents > scripts > crie um arquivo chamado safeZoneEvent.lua
     
     
     
    data > movements > movements.xml
     
     
     
    em data > movements > scripts > crie um arquivo chamado safeZoneMovement.lua
     
     
     
    por fim, vá até o banco de dados do seu servidor e adicione o seguinte código em "SQL"
     
     
    É isso! Espero ter ajudado o pessoal do TFS 0.4
  24. Curtir
    Imperius recebeu reputação de leozincorsair em [TFS 0.4] SafeZone Event - Adaptação de compatibilidade   
    Olá! Fiz uma adaptação no evento "SafeZone" criado e disponibilizado aqui no TK por @Movie e @luanluciano93.
     
     
    Agora o evento é compatível para TFS 0.4.
     
    IMPORTANTE:  Como mencionado anteriormente, o evento foi criado por "Movie" e "LuanLuciano93". Eu (imperius) APENAS ADAPTEI para funcionar em TFS 0.4. Todos os créditos do evento vão para os criadores originais. Além disso, é importante alertar que esta adaptação não está 100%.
     
    Abaixo está todo o processo explicando como configurar e rodar o evento em seu servidor!
     
     
    Vídeo demonstrativo:
     
     
     
    em data > lib > crie um arquivo chamado safeZone.lua
     
     
     
    data > globalevents > globalevents.xml
     
     
     
    em data > globalevents > scripts > crie um arquivo chamado safeZoneEvent.lua
     
     
     
    data > movements > movements.xml
     
     
     
    em data > movements > scripts > crie um arquivo chamado safeZoneMovement.lua
     
     
     
    por fim, vá até o banco de dados do seu servidor e adicione o seguinte código em "SQL"
     
     
    É isso! Espero ter ajudado o pessoal do TFS 0.4
  25. Gostei
    Imperius recebeu reputação de leozincorsair em [8.60 | TFS 0.4] - NPC Gênio da Lâmpada   
    Olá! Estou disponibilizando um NPC que desenvolvi. Porém, devo avisar que só testei em TFS 0.4, e não posso garantir que funcionará em outras versões.
     
    Sobre:
     
    O NPC em questão é o "Gênio da Lâmpada". Para chegar até ele, o jogador precisa ter a "Lâmpada Mágica", que pode ser adquirida através de uma quest ou em algum evento do servidor, por exemplo.
     
    A lâmpada pode ser usada apenas uma vez e, mesmo que o jogador obtenha outra lâmpada, não poderá usá-la novamente. Ao usar a Lâmpada, o jogador será teleportado para a sala do Gênio. Lá, ele não poderá sair até realizar os três desejos.
     
    O Gênio pode atender desejos como "entregar itens", "reiniciar tasks", "completar addons" e até mesmo "matar um jogador". Você pode personalizar o NPC para oferecer outras recompensas, como "vip days", "premium points" ou "remover redskull". Seja criativo! :)
     
    Após o Gênio realizar os três desejos, o jogador será teleportado para o seu templo de origem.
     
     
    Vídeo demonstrativo:
     
     
     
     
    data > actions > actions.xml
     
     
     
    data > actions > lampadaDoGenio.lua
     
     
     
    data > npc > Genio.xml
     
     
     
    data > npc > scripts > Genio.lua
     
     
     
    Isso é tudo! Se tiverem sugestões ou dúvidas, estou à disposição!

Informação Importante

Confirmação de Termo