Ir para conteúdo

FeeTads

Membro
  • Registro em

  • Última visita

Tudo que FeeTads postou

  1. consegue postar o código do que faz ele transformar? se for storage ou aluma função da lib, é só vc fazer um onLogin() que quando ele logue, vá pra transformação inicial, ou caso vc não queria que sempre que o player logar vá pra inicial, somente quando ele morrer, vc faz um prepareDeath() dando set na transformação
  2. SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player. **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag. SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes. vá em creatureevent.cpp procure por: else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH; Adiciona abaixo: else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG; procure por: case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath"; Adicione abaixo: case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea"; procure por: case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList"; Adicione abaixo: case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target"; agora no mesmo arquivo, vá até o final do arquivo e adicione essa função: uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) scriptstream << *m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } } agora vá em creatureevent.h procure por: CREATURE_EVENT_PREPAREDEATH adicione abaixo: CREATURE_EVENT_NOCOUNTFRAG procure por: uint32_t executePrepareDeath(Creature* creature, DeathList deathList); Adicione abaixo: uint32_t executeNoCountFragArea(Creature* creature, Creature* target); agora vá em player.cpp procure por: bool Player::onKilledCreature(Creature* target, DeathEntry& entry) abaixo de: War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); } Adicione o seguinte código: if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } } // Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor vá até creaturescripts/scripts crie um arquivo chamado, "noCountFragInArea.lua" e dentro dele cole o código: --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end agora em creaturescripts.xml <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/> agora em creaturescripts/scripts/login.lua procure por OU semelhante a esse: registerCreatureEvent(cid, "AdvanceSave") e abaixo adicione: registerCreatureEvent(cid, "fragarea") // Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script Exemplo: local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, } assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag. Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar. Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war. Façam bom proveito dos scripts, e deixem os créditos no script rsrs **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
  3. coloca pra quando ele equipar o ring, em vez de vc retirar o "health" seu que eh 150 fixo, coloca "novavida = getPlayerMaxHealth(cid) * 0.95" nisso vc vai pegar a vida maxima menos 5%, ai vc coloca o "doAddCreatureHealth(cid, novavida - getPlayerHealth(cid))
  4. FeeTads postou uma resposta no tópico em Suporte Tibia OTServer
    vai no config/config.php nas pastas do site, e procura por config['site']['serverPath'] = nesse lugar vc tem que colocar o diretório certo do seu OT, talvez ele esta assim "config['site']['serverPath'] = home/servidor/config.lua" vc precisa deixar conforme ele está na maquina
  5. primeiro precisa de 2 coisas kkkk source OTX ou TFS? sempre importante vc dizer no post qual sua source, pq isso ja é 50% do caminho andado segunda, posta o erro do console junto, sem o erro que mostra na distro fica mais dificil. manda essas 2 informações que eu tento te ajudar kkkkkk
  6. consegue postar o erro da distro no console mano?
  7. não vai bugar deixar 2 doRemove ali? procurando o msm item? e doRemove pode ir sem o "cid"? realmente eu não sei, eu sempre uso o cid
  8. coloca isso no lugar doRemoveItem(cid, item2.uid, 1)
  9. coloca assim aqui doPlayerAddItem(cid, eweapons[c][b], 1)
  10. FeeTads postou uma resposta no tópico em Suporte Tibia OTServer
    @vitinhoo96cara não faço ideia o pq ta assim kkkkkkkk, vou te passar o meu, porem não o expulse players ai vc vai precisar implementar realCastle.lua guildwar.luaguildwarClose.lua realCastle.lua na lib guildwar.lua e guildwarClose.lua no global events
  11. tenta assim mano --by Richi~ -- function onUse(cid, item, frompos, item2, topos) local gems = {2146, 2147, 2149, 2150} local egems = {7759, 7760, 7761, 7762} local altars = {{7508, 7509, 7510, 7511}, {7504, 7505, 7506, 7507}, {7516, 7517, 7518, 7519}, {7512, 7513, 7514, 7515}} local weapons = {7364} local eweapons = {{7839, 7840, 7850, 7838}} local type = item.type if type == 0 then type = 1 end local mana = 3000 * type local soul = 40 * type if isInArray(gems, item.itemid) == TRUE then for aa=1, #gems do if item.itemid == gems[aa] then a=aa end end if isInArray(altars[a], item2.itemid)== TRUE then if getPlayerMana(cid) >= mana and getPlayerSoul(cid) >= soul then doRemoveItem(cid, gems[a], 1) doPlayerAddItem(cid, egems[a], 1) doPlayerAddMana(cid,-mana) doPlayerAddSoul(cid,-soul) doSendMagicEffect(frompos,39) else doPlayerSendCancel(cid,"You dont have mana or soul points.") end else return 2 end elseif isInArray(egems, item.itemid)== TRUE then for bb=1, #egems do if item.itemid == egems[bb] then b=bb end end if isInArray(weapons, item2.itemid)== TRUE then for cc=1, #weapons do if item2.itemid == weapons[cc] then c=cc end end doRemoveItem(cid, egems[b], 1) doRemoveItem(cid, weapons[c], 1) doPlayerAddItem(cid, eweapons[c], 1) doSendMagicEffect(frompos,39) doRemoveItem(item.uid,1) else doPlayerSendCancel(cid,"You can't enchanted this.") end else return 0 end return true end
  12. FeeTads postou uma resposta no tópico em Suporte Tibia OTServer
    @vitinhoo96 eu meu castle eh um pouco diferente quando fecha, tenta assim local tomorrow = getTomorrowsDate() local tomorrowString = tomorrow[1].."/"..tomorrow[2].."/"..tomorrow[3] for i = 1, 3 do setGlobalStorageValue(realCastle.dateStorages[i], tomorrow[i]) end
  13. na vdd mano eu acho que todo esse script aqui ta bugado, não sei te dizer oq nele, mas tem que refazer kkkkk, tirando o from e topos da config la iria ficar mais facil até, mais tarde eu chego testo e te mando, tenho ctz ser problema apenas nessas funções
  14. FeeTads postou uma resposta no tópico em Playground (Off-topic)
    depende do host, alguns hosts tem suporte que te ajudam a colocar online, mas ai depende da sua maquina e tudo mais, quando vc compra uma VPS, eles só liberam a maquina e vc precisa compilar ela pra rodar o OT. o luanluciano tem tutorias ótimos explicando como instalar as coisas necessárias pra se ter um OT on. https://tibiaking.com/forums/topic/105623-instalando-o-nginx-no-ubuntu-2004/?tab=comments#comment-558081 https://tibiaking.com/forums/topic/105624-instalando-a-mariadb-no-ubuntu-2004/?tab=comments#comment-558084 https://tibiaking.com/forums/topic/105625-instalando-o-php-no-ubuntu-2004/?tab=comments#comment-558085 https://tibiaking.com/forums/topic/105625-instalando-o-php-no-ubuntu-2004/?tab=comments#comment-558085 esses 4 links tem meio q o necessário, da uma lida uma estudada e tudo mais, indico vc comprar uma VPS mais fraca pra ir testando até abrir, e NUNCA NUNCA NA SUA VIDA, contrate algum serviço de VPS da ot manager esse empresa costuma roubar os clientes (e eu tenho provas mas n vem ao caso pq o TK tbm tem). indico muito OVH mas eh carinho, mas dificilmente vc vai achar uma que te ajude a por teu ot online. tem a bbhost e a servercore que são otimas, e a ATS que é só vps canadá, mas muito boa tbm, pra começar é isso ai.
  15. esse script vai funcionar pra apenas 1 item, caso queira pra outro, da 14 a 26, ai vc vai precisar criar outro script e checar se a vocação ta entre 14 e 26
  16. creio q seja nesse info, tenta colocar configInv.posiciones.from.x no lugar de todos os info.posiciones
  17. tenta colocar doTransformItem(item.uid,egems[a], 1)
  18. não é possivel tbm não, tenta por 10010 - 10015, vai ficar mais facil tbm, ou 10000 - 10001, eu indico vc não modificar o simples kkkkkk
  19. FeeTads postou uma resposta no tópico em Suporte Tibia OTServer
    ah então é só vc por isso: local gsto = getGlobalStorageValue(realCastle.dateStorages) no lugar da gsto
  20. local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) > 13 then doPlayerSendTextMessage(cid, 22, "Sua vocação não pode usar este item!") return true end if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end return true end se funcionar deixa o rep+ ai pra ajudar
  21. tenta assim. local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) > 13 then return true end if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end return true end se continuar esse erro, procura por "getPlayerVocation" na sua source em luascript.cpp
  22. pra ser da 1 até a 13 coloca assim if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then ..código.. end ai ele checa se a vocação é maior ou igual a 1 e menos igual 13, ou seja tudo entre 1 e 13 ele pega me equivoquei nessa parte ali esse "or if" não tem, só "or get..", usa oq te passei acima que vai funcionar . vou arrumar aqui o script pra vc local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 13 then if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end end return true end
  23. pro player ou pra todos? se for pra um player só add uma storage nele setPlayerStorageValue(cid, setting.newTry, os.time() + 20 * 60) se for pra todos do OT ter que esperar 20 mins só add em global storage setGlobalStorageValue(setting.newTry, os.time() + 20 * 60) no local setting vai ficar: local setting = { centerRoom = {x = 1057, y = 1099, z = 8}, storage = 70852, bossPosition = {x = 1055, y = 1096, z = 8}, kickPosition = {x = 1055, y = 1109, z = 8}, playerTeleport = {x = 1055, y = 1101, z = 8} newTry = 70853 --storage de checkar tempo de 20 minutos, pode por o numero q quiser } ai no começo do script vc coloca o check da storage que vc quer -- Start Script function oberonLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1945 and item.actionid == 58111 then if getGlobalStorageValue(setting.newTry) - os.time() <= 0 then ...código todo... setGlobalStorageValue(setting.newTry, os.time() + 20 * 60) --creio q esse set vai ter que estar no começo ou dentro da função que joga o player pra dentro da sala else doPlayerSendTextMessage(cid, 27, "Você precisa esperar ", ..getGlobalStorageValue(setting.newTry)-os.time().. " Minutos pra entrar") end creio que vc vai precisar fazer algumas mudanças minimas, mas é basicamente isso. se for só pro player vc precisar trocar o "GlobalStorage" por "PlayerStorage" ou até de uma maneira mais facil, você pode colocar a storage de os.time pra checar ai no meio oq ocuparia menos espaço -- Start Script function oberonLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey) if getGlobalStorageValue(setting.newTry) - os.time() > 1 then --se ainda restar segundo a mais na storage return true --só retorna end if item.itemid == 1945 and item.actionid == 58111 then ai você só precisa achar o lugar certo pra setar a storage
  24. if getPlayerVocation(cid) == 1 or if getPlayerVocation(cid) == 5 --esse eh sorc (n tenho ctz pode ser druid) if getPlayerVocation(cid) == 2 or if getPlayerVocation(cid) == 6 -- esse eh druid (n tenho ctz pode ser sorc) if getPlayerVocation(cid) == 3 or if getPlayerVocation(cid) == 7 --esse é pally if getPlayerVocation(cid) == 4 or if getPlayerVocation(cid) == 8 --esse eh knight vc adicionaria acima a vocation que vc quer assim: if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end end ai vc olha la no teu vocation.xml e escolhe quais vc quiser kkkkkkkk
  25. local remover = false -- Remover ao usar? false = não remove, true = remover local outfits = { [11478] = {out = 2013}, } function onUse(cid, item) local t = outfits[item.itemid] if getCreatureOutfit(cid).lookType ~= 2013 then --se o outfit for diferente do 2013 setPlayerStorageValue(cid, 1234567, getCreatureOutfit(cid).lookType) --salva o looktype atual do player doCreatureChangeOutfit(cid, {lookType = t.out}) --transforma doPlayerSendTextMessage(cid, 22, "Voce alterou seu Outfit!") else doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 1234567)}) --se o looktype for 2013 volta ao original doPlayerSendTextMessage(cid, 22, "De volta ao seu outfit original!") end if remover then doRemoveItem(item.uid, 1) -- pode deixar 1 aqui e no escopo deixa false end return true end uma dica não use "remove" "callback" como variavel, pq ja são funções do tibia, isso pode dar conflito as vezes alterei onde estava "remove" pra "remover" testa esse pra ver se funciona, se não funcionar posta o erro do console em spoiler pf.

Informação Importante

Confirmação de Termo