
b3499063
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
b3499063 deu reputação a crazydave em AJUDA [Error - IOMapSerialize::loadMapBinary]Peço desculpas se não for permitido comentar em posts antigos.
Ao menos no meu caso foi causado por causa da tabela houses na database... Só truncar ela que não aparece mais.
TRUNCATE ` houses ` Espero que isso ainda ajude alguém agora ou no futuro.
Obrigado.
#edit
Tive mesmo erro, esqueci como resolver e acabei aqui de novo.
Motivo do erro foi que adicionei uma nova house com depot e lixeira nela... A solução foi o que falei, de truncar a tabela houses, mas também trunquei as outras tabelas relacionadas a houses como por exemplo houses_data.
-
b3499063 deu reputação a diarmaint em [C++] Regenerar mana em pzO título é auto explicativo, precisei recentemente e só achei no final de um tópico escondido, resolvi respostar.
Algo bem comum em servidores derivados, encher mana e hp em pz..
Procure por esta função: bool ConditionRegeneration::executeCondition(Creature* creature, int32_t interval) Em seguida, selecione ela toda:
bool ConditionRegeneration::executeCondition(Creature* creature, int32_t interval) { internalHealthTicks += interval; internalManaTicks += interval; if(creature->getZone() != ZONE_PROTECTION) { if(internalHealthTicks >= healthTicks) { internalHealthTicks = 0; creature->changeHealth(healthGain); } if(internalManaTicks >= manaTicks) { internalManaTicks = 0; creature->changeMana(manaGain); } } return ConditionGeneric::executeCondition(creature, interval); } E cola essa no lugar:
bool ConditionRegeneration::executeCondition(Creature* creature, int32_t interval) { internalHealthTicks += interval; internalManaTicks += interval; if(internalHealthTicks >= healthTicks) { internalHealthTicks = 0; creature->changeHealth(healthGain); } if(internalManaTicks >= manaTicks) { internalManaTicks = 0; creature->changeMana(manaGain); } return ConditionGeneric::executeCondition(creature, interval); } Agora é só compilar e pronto, Testada em tfs 0.4 funcionando..
Totais créditos para @RenanPhellip
As alterações que foram feitas estão aqui.
essa parte foi retirada,
e no lugar inserida essa,
Não entendo muito de source, mas uso um site que facilita bastante, ele verifica as mudanças de um texto para o outro.
Se o código que busco não for compatível com a que utilizo eu entro no site e vejo as diferenças para ir tentando soluções.
https://www.diffchecker.com/N47NJgaf exemplo da função que foi modificada no tutorial.
-
b3499063 deu reputação a Danyel Varejao em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
b3499063 deu reputação a 9k22 em Raid Automática (por horário)Versão Testada: 8.6 TFS 0.4
Versão recomendada: 8.6 TFS 0.3.6 ~ 0.4
Tipo do script: Globalevents
Bem, procurei aqui no fórum e não encontrei, vou compartilhar aqui o'que muitos procuravam e não encontravam, uma RAID altomatica que aconteçe 1x todas as semanas (configuravel).
Em data/globalevents/script crie um arquivo com extensão .lua e adicione:
--[[ - hora deve ser exata SERVER - para fazer o raid tera que ser ex: 00 hour(horas) e 00 minu (minutos) - para fazer a raid na data e hora no tempo exato, uso "exact" - para fazer a raid ocorrer todas as semanas (pelo menos 1x na semana) uso "weekly" - o nome dos dias sao ultilizados apenas para o tipo semanal que devera ser - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday" - tambem devem estar dentro de uma matriz-> {} ]] local raids = { [1] = { name = 'Morgaroth', type = 'weekly', days = {'friday'}, hour = 16, minu = 00 }, [2] = { name = 'Ferumbras', type = 'weekly', days = {'tuesday'}, hour = 18, minu = 00 } } local last_execsutes = {} function onThink(interval, lastExecution, thinkInterval) local static_time = os.time() for k, raid in ipairs(raids) do if (raid.type == 'weekly') then local day = os.date("%A", static_time):lower() if isInArray(raid.days, day) then local hour = tonumber(os.date("%H", static_time)) if (raid.hour == hour) then local minute = tonumber(os.date("%M", static_time)) if (raid.minu == minute) then local day_number = tonumber(os.date("%d", static_time)) if (last_execsutes[k] ~= day_number) then last_execsutes[k] = day_number doExecuteRaid(raid.name) end end end end elseif (raid.type == 'exact') then local month = tonumber(os.date("%m", static_time)) if (raid.date.month == month) then local day = tonumber(os.date("%d", static_time)) if (raid.date.day == day) then local hour = tonumber(os.date("%H", static_time)) if (raid.hour == hour) then local minute = tonumber(os.date("%M", static_time)) if (raid.minu == minute) then if (last_execsutes[k] ~= day) then last_execsutes[k] = day doExecuteRaid(raid.name) end end end end end end end return true end Bem, como podem ver, eu fiz apenas 2 como exemplo, você pode adicionar mais, só não esqueça de colocar o }, no anterior. Agora em data/globalevents/globalevents.xml adicione: <globalevent name="raids" interval="15000" event="script" value="raid.lua"/> Ps: não mecha no interval! Agora em data/raids crie um arquivo .xml com o nome Morgaroth "Morgaroth.xml" e adicione isto lá dentro: <?xml version="1.0" encoding="utf-8"?> <raid> <!-- // Raid System by 5mok3 // Nao mude o intervalo da raid, apenas em globalevents vocce podera mudar --> <!--Announcements--> <announce delay="1000" type="Event" message="The ancient volcano on Goroma slowly becomes active once again." /> <announce delay="30000" type="Event" message="There is an evil presence at the volcano of Goroma." /> <announce delay="60000" type="Event" message="Evil Cultists have called an ancient evil into the volcano on Goroma. Beware of its power mortals." /> <!--Single Spawns--> <singlespawn delay="60000" name="Morgaroth" x="32063" y="32612" z="14" /> </raid> Crie outro no mesmo lugar com extenção .xml com o nome Ferumbras "Ferumbras.xml" e adicione: <?xml version="1.0" encoding="utf-8"?> <raid> <!-- // Raid System by 5mok3 // Nao mude o intervalo da raid, apenas em globalevents vocce podera mudar --> <!--Announcements--> <announce delay="1000" type="Event" message="The seals on Ferumbras old cidatel are glowing. Prepare for HIS return mortals." /> <announce delay="50000" type="Event" message="Ferumbras return is at hand. The Edron Academy calls for Heroes to fight that evil." /> <announce delay="60000" type="Event" message="Ferumbras has returned to his citadel once more. Stop him before its too late." /> <!--Single Spawns--> <singlespawn delay="60000" name="Ferumbras" x="32124" y="32687" z="4" /> </raid> Mude o x=" " y=" " z=" " para o local aonde o monstro irá nascer... Em raids/raids.xml adicione: <raid name="Morgaroth" file="Morgaroth.xml" interval2="30" margin="1000" enabled="yes"/> <raid name="Ferumbras" file="Ferumbras.xml" interval2="30" margin="1000" enabled="yes"/> PS: não mude o interval2. Agora caso você queira que apareça um broadcast quando o Tal player matar o boss, faça o seguinte. Em creaturescript/scripts e crie um arquivo .lua e adicione: local monstrolol = {"Morgaroth","Ferumbras"} function onKill(cid, target, lastHit) if isInArray(monstrolol,getCreatureName(target)) then doBroadcastMessage("O jogador "..getCreatureName(cid).." killed the powerful boss "..getCreatureName(target).."!") end return true end Em creaturescript/creaturescript.xml adicione: <event type="kill" name="killboss" event="script" value="NOME_DO_SCRIPT.lua"/> Para finalizar, em creaturescript/login.lua adicione: registerCreatureEvent(cid, "killboss")
Adicionado vídeo tutorial de como adicionar novas raids a pedido de nosso membro GabrielSv.
Créditos: 5mok3 90%
.............. Subyth 10%
-
b3499063 deu reputação a Hadggar em [NPC Guard] Ataca Skulls e Monsters, InvasoresOpa Galera, hoje vou trazer para vocês um NPC que ataca players pk é monstros invasores, analizem no forum e não achei nem um funcionando , testei em 8.54 é 8.60 e funcionou perfeitamente então vamos la.
Primeiramente vá em /data/npc/script/ é crie um arquivo chamado defender.lua é lá dentro adicione :
local level = 10 ----- change this to make the npc hit more/less---------------------|damage_min = (level * 2 + maglevel * 3) * min_multiplier | local maglevel = 10 ----- change this to make the npc hit more/less -----------------|damage_max = (level * 2 + maglevel * 3) * max_multiplier | local min_multiplier = 2.1 ----- change this to make the npc hit more/less ----------|damage_formula = math.random(damage_min,damage_max) | local max_multiplier = 4.2 ----- change this to make the npc hit more/less --------------------------------------------------------------------- local check_interval = 5 ----- change this to the time between checks for a creature (the less time the more it will probably lag :S) local radiusx = 7 ----- change this to the amount of squares left/right the NPC checks (default 7 so he checks 7 squares left of him and 7 squares right (the hole screen) local radiusy = 5 ----- change this to the amount of squares left/right the NPC checks (default 5 so he checks 5 squares up of him and 5 squares down (the hole screen) local Attack_message = "An Invader, ATTACK!!!" ----- change this to what the NPC says when he sees a monster(s) local town_name = "Archgard" ----- the name of the town the NPC says when you say "hi" local Attack_monsters = TRUE ----- set to TRUE for the npc to attack monsters in his area or FALSE if he doesnt local Attack_swearers = TRUE ----- set to TRUE for the npc to attack players that swear near him or FALSE if he doesnt local Attack_pkers = TRUE ----- set to TRUE for the npc to attack players with white and red skulls or FALSE if he doesnt local health_left = 10 ----- set to the amount of health the npc will leave a player with if they swear at him (ie at 10 he will hit the player to 10 health left) local swear_message = "Take this!!!" ----- change this to what you want the NPC to say when he attackes a swearer local swear_words = {"shit", "fuck", "dick", "cunt"} ----- if "Attack_swearers" is set to TRUE then the NPC will attack anyone who says a word in here. Remember to put "" around each word and seperate each word with a comma (,) local hit_effect = CONST_ME_MORTAREA ----- set this to the magic effect the creature will be hit with, see global.lua for more effects local shoot_effect = CONST_ANI_SUDDENDEATH ----- set this to the magic effect that will be shot at the creature, see global.lua for more effects local damage_colour = TEXTCOLOR_RED ----- set this to the colour of the text that shows the damage when the creature gets hit ------------------end of config------------------ local check_clock = os.clock() ----- leave this local focus = 0 ----- leave this function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) health = getCreatureHealth(cid) - health_left if ((string.find(msg, '(%a*)hi(%a*)'))) and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I am a defender of '..town_name..'.') doNpcSetCreatureFocus(cid) focus = 0 end if msgcontains(msg, 'time') then selfSay('The time is ' .. getWorldTime() .. '.') end if messageIsInArray(swear_words, msg) then if Attack_swearers == TRUE then selfSay('' .. swear_message ..' ') doCreatureAddHealth(cid,-health) doSendMagicEffect(getThingPos(cid),17) doSendAnimatedText(getThingPos(cid),health,180) doNpcSetCreatureFocus(cid) focus = 0 end end end function getMonstersfromArea(pos, radiusx, radiusy, stack) local monsters = { } local starting = {x = (pos.x - radiusx), y = (pos.y - radiusy), z = pos.z, stackpos = stack} local ending = {x = (pos.x + radiusx), y = (pos.y + radiusy), z = pos.z, stackpos = stack} local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos} repeat creature = getThingfromPos(checking) if creature.itemid > 0 then if isCreature(creature.uid) == TRUE then if isPlayer(creature.uid) == FALSE then if Attack_monsters == TRUE then table.insert (monsters, creature.uid) check_clock = os.clock() end elseif isPlayer(creature.uid) == TRUE then if Attack_pkers == TRUE then if getPlayerSkullType(creature.uid) > 0 then table.insert (monsters, creature.uid) check_clock = os.clock() end end end end end if checking.x == pos.x-1 and checking.y == pos.y then checking.x = checking.x+2 else checking.x = checking.x+1 end if checking.x > ending.x then checking.x = starting.x checking.y = checking.y+1 end until checking.y > ending.y return monsters end function onThink() if (Attack_monsters == TRUE and Attack_pkers == TRUE) or (Attack_monsters == TRUE and Attack_pkers == FALSE) or (Attack_monsters == FALSE and Attack_pkers == TRUE) then if (os.clock() - check_clock) > check_interval then monster_table = getMonstersfromArea(getCreaturePosition(getNpcCid( )), radiusx, radiusy, 253) if #monster_table >= 1 then selfSay('' .. Attack_message ..' ') for i = 1, #monster_table do doNpcSetCreatureFocus(monster_table[i]) local damage_min = (level * 2 + maglevel * 3) * min_multiplier local damage_max = (level * 2 + maglevel * 3) * max_multiplier local damage_formula = math.random(damage_min,damage_max) doSendDistanceShoot(getCreaturePosition(getNpcCid( )), getThingPos(monster_table[i]), shoot_effect) doSendMagicEffect(getThingPos(monster_table[i]),hit_effect) doSendAnimatedText(getThingPos(monster_table[i]),damage_formula,damage_colour) doCreatureAddHealth(monster_table[i],-damage_formula) check_clock = os.clock() focus = 0 end elseif table.getn(monster_table) < 1 then focus = 0 check_clock = os.clock() end end end focus = 0 end Depois vá em /data/npc/ é la crie um arquivo defender.xml é lá adicione:
<?xml version="1.0"?> <npc name="Defender" script="defender.lua" access="5" lookdir="2" autowalk="25"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="131" head="116" body="94" legs="78" feet="115" addons="3"/> </npc> local level = 10 -- Quanto o NPC irar tirar. local maglevel = 10 -- Quanto o NPC Irar tirar. local min_multiplier = 2.1 -- Quanto o NPC Irar tirar. local max_multiplier = 4.2 -- Quanto o NPC Irar tirar. local Attack_message = "An Invader, ATTACK!!!" -- A mensagem queo NPC irar falar quanto detectar um invasor. Creditos: Knekarn Eu (Por Postar aki no forum) -
b3499063 deu reputação a Movie em Ensinando como compilar TFS 0.4 [COM IMAGENS]Como compilar no Windows (TFS 0.4)
E aí pessoal, beleza?
Apanhei muito para aprender a compilar no Windows, nunca dava conta, e um dia alguém (não me lembro quem) me ajudou e estou aqui para repassar esse conhecimento...
Enfim, hoje vou ensinar como compilar a TFS 0.4 no Windows, e em breve, no Linux.
Primeiramente, irei deixar a lista de programas que iremos precisar.
====================================================================================
Dev C++ (Links para download no spoiler)
====================================================================================
Uma TFS 0.4
====================================================================================
Feito o download de tudo isso, vamos ao passo a passo.
====================================================================================
1º Após baixar a TFS, abra a pasta e encontre a pasta src
====================================================================================
2º Abra a pasta, encontre a pasta dev-cpp encontrada dentro da pasta src
====================================================================================
3º Crie uma pasta chamada "Obj" dentro dessa pasta
====================================================================================
4º Beleza, agora vamos abrir o Dev C++
====================================================================================
5º Com o Dev C++ aberto, vamos abrir o projeto da TFS 0.4
====================================================================================
6º Irá aparecer uma caixa para você escolher qual arquivo você irá procurar. Então vamos naquela pasta dev-cpp e encontraremos o "TheForgottenServer.dev" e selecionaremos ele.
====================================================================================
7º Irá carregar muitos arquivos que apareceram em uma lista, não recomendo vocês mexerem neles se não tiver um conhecimento necessário para tal.
====================================================================================
8º Agora vamos no Menu Project -> Project Options, ou apertar Alt + P
====================================================================================
9º Feito isso, vamos em Parameters e iremos adicionar algumas coisas em C++ compiler e em Linker
====================================================================================
10º Em C++ compiler coloque esses parâmetros
====================================================================================
11º Agora em Linker, coloque esses parâmetros
====================================================================================
12º Ainda em Project Options, vamos na aba Build Options e iremos escolher o Object file output directory e colocar aquela pasta "Obj" que criamos lá em cima
====================================================================================
13º Feito isso, irá ficar assim
====================================================================================
14º Agora pode dar Ok no Project Options
====================================================================================
15º Agora, vamos COMPILAR!!
Use o primeiro item (o que tem 4 janelinhas de cores diferentes) ou use Ctrl + F9
====================================================================================
16º Irá aparecer uma janela como essa aqui, fique tranquilo, está tudo normal!
====================================================================================
17º Ao terminar, aparecerá essa janela e a sua TFS 0.4 está compilada.
====================================================================================
18º Voltamos naquela pasta dev-cpp e encontraremos esse arquivo, ele é a sua Distro.
====================================================================================
19º Agora só jogar ela na sua datapack e utilizá-la. (Não esqueça de adicionar as libs)
====================================================================================
É isso pessoal, espero que tenham conseguido, se houver alguma dúvida, vai deixar aqui nos comentários que vou tentar ir respondendo...