Ir para conteúdo
  • Cadastre-se

Suporte [AJUDA] Inserir Novos Monstros no Bestiary


Posts Recomendados

.Qual servidor ou website você utiliza como base? 

OTServBR - Global - Based on TFS 1.3 Client 12.72 

Qual o motivo deste tópico? 

TalkAction não funcionando

Está surgindo algum erro? Se sim coloque-o aqui. 

 

Segui os passos certinho do tutorial, mas não está executando a TalkAction por alguma razão...

vou deixar apenas o nome do tutorial porque é de outra comunidade, se pesquisar no google acha

(Editando monstros custom client 12+ (Bestiary/prey)

 

Se alguém souber alguma outra maneira de registrar um novo monstro no Bestiary, eu ficarei muito grato!

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

Minha TalkAction Fica Localizado em: /data/scripts/talkactions/god 

local hex_monster = {
	author = "Marcosvf132",
	date = "19/02/2021",
	version = "1.0",
	organization = "###### OTServ-Br #####",
	objective = " [OTServ-Br 12.x project] \
		Export hex code to create and insert custom creatures on the client protocol 12.xx \
		This system will create a '.txt' file with all the monsters bytes, to insert it on the client you will need to do it \
		manually using a Hex editor (HxD is a good option). \
		-> With this script the user can insert custom monsters with any outfit on bestiary, prey and boosted creature.\
		-> This script was created to work with OTBR repository, this probably won't work with other repository, so don't ask support for it. \
		-> Created based on the client 12.61 protocol, future protocols may have some problems, if so, seek for updates on the OTBR Forum. \
		-> Important note: This script reads all monsters that have raceId registered on the server, if you wan't to remove, edit or create monsters on the client \
			you need to just remove/edit/add it on their repective '.lua' \
		--> The .txt file will be created on /data/ folder -'hex-monster.txt'-. "
}

local hexmonster = TalkAction("/hexmonster")

local function randomValueToHex(nValue)
	return string.format("%2X ", nValue)
end

local function bigDecimalTohex(value)
	local value = bit.bor(value, 0)
	local jumpEscape = value < 64
	local result = ""
	while (true) do
		local byte = bit.band(value, 0x7f)
		value = bit.rshift(value, 7)
		if ((value == 0) and ((bit.band(byte, 0x40)) == 0)) or ((value == -1) and ((bit.band(byte, 0x40)) ~= 0)) then
			if byte < 10 then
				result = result .. " 0" .. tostring(tonumber(randomValueToHex(tostring(byte)))):gsub("%s+", "") .. " "
			elseif byte < 16 then
				result = result .. " 0" .. randomValueToHex(byte):gsub("%s+", "") .. " "
			else
				result = result .. " " .. randomValueToHex(byte):gsub("%s+", "") .. " "
			end
			result = result:gsub("  ", " ")
			return result
		end
		local borBit = bit.bor(byte, 0x80)
		if borBit < 10 then
			result = result .. " 0" .. tostring(tonumber(randomValueToHex(tostring(borBit)))):gsub("%s+", "") .. " "
		elseif borBit < 16 then
			result = result .. " 0" .. randomValueToHex(borBit):gsub("%s+", "") .. " "
		else
			result = result .. " " .. randomValueToHex(borBit):gsub("%s+", "") .. " "
		end
		jumpEscape = false
	end
end

local function retNumberToHex(look_value)
	local ret = look_value > 64 and tostring(randomValueToHex(look_value)) or randomValueToHex(look_value)
	if look_value < 16 then
		ret = ret:gsub("%s+", "")
		ret = "0" .. ret
	end	
	return ret
end

local function stringTextToHexChar(str)
    return (str:gsub('.', function (c)
        return string.format('%02X ', string.byte(c))
    end))
end

local function numberToHex(value)
	local ret = tostring(randomValueToHex(tostring(value))):gsub("%s+", "")
	if value < 10 then
		ret = "0" .. tonumber(ret)
	elseif value < 16 then
		ret = retNumberToHex(value)
	end
	return ret
end

function hexmonster.onSay(player, words, param)
	if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
		return true
	end

	local alreadyImplementedRaceId = {}
	local file = io.open("data/hex-monster.txt", "wb")
	if file then
		for index, monsterName in pairs(Game.getBestiaryList()) do
			local mType = MonsterType(monsterName)
			if mType and not(table.contains(alreadyImplementedRaceId, mType:raceId())) then
				local name = mType:name():lower()
				local outfit = mType:outfit()
				local monsterid_bit = bigDecimalTohex(mType:raceId())
				local nameDigits = numberToHex(string.len(name))
				local lookt_bit = bigDecimalTohex(outfit.lookType)
				local looka_bot = numberToHex(outfit.lookAddons)
				local lookh_bot = outfit.lookHead < 128 and numberToHex(outfit.lookHead) or (numberToHex(outfit.lookHead) .. " 01")
				local lookb_bot = outfit.lookBody < 128 and numberToHex(outfit.lookBody) or (numberToHex(outfit.lookBody) .. " 01")
				local lookl_bot = outfit.lookLegs < 128 and numberToHex(outfit.lookLegs) or (numberToHex(outfit.lookLegs) .. " 01")
				local lookf_bot = outfit.lookFeet < 128 and numberToHex(outfit.lookFeet) or (numberToHex(outfit.lookFeet) .. " 01")
		
				local counter_09 = 0
				if outfit.lookType < 128 then
					lookt_bit = " " .. numberToHex(outfit.lookType) .. " "
				end
				if outfit.lookHead >= 128 then
					lookh_bot = numberToHex(outfit.lookHead - 19)
				end
				if outfit.lookBody >= 128 then
					counter_09 = counter_09 + 1
				end
				if outfit.lookLegs >= 128 then
					counter_09 = counter_09 + 1
					if counter_09 > 1 then
						counter_09 = counter_09 - 1
						lookl_bot = numberToHex(outfit.lookLegs - 19)
					end
				end
				if outfit.lookFeet >= 128 then
					counter_09 = counter_09 + 1
					if counter_09 > 1 then
						counter_09 = counter_09 - 1
						lookf_bot = numberToHex(outfit.lookFeet - 19)
					end
				end
				local byteIncrease = "08"
				if counter_09 > 0 then
					byteIncrease = "09"
				end
				local look_case = ""
				if counter_09 > 0 then
					look_case = "10"
				else
					if outfit.lookType < 128 then
						look_case = "0E"
					else
						look_case = "0F"
					end
				end
				local stringHex, size_bit, return_hex = "", "", ""
				if outfit.lookType == 0 and outfit.lookTypeEx ~= 0 then
					local looke_bit = ItemType(outfit.lookTypeEx) and ItemType(outfit.lookTypeEx):getClientId() or 0
					stringHex = " 08" .. monsterid_bit .. "12 " .. nameDigits .. " " .. stringTextToHexChar(name) .. "1A 03 20" .. bigDecimalTohex(looke_bit)
					size_bit = numberToHex(string.len(stringHex:gsub("%s+", ""))/2)
					return_hex = "0A " .. size_bit .. stringHex .. " "
				elseif outfit.lookTypeEx == 0 then
					stringHex = " 08" .. monsterid_bit .. "12 " .. nameDigits .. " " .. stringTextToHexChar(name) .. "1A ".. look_case .. " 08" .. lookt_bit .. "12"
					stringHex = stringHex .. " " .. byteIncrease .. " 08 " .. lookh_bot ..  " 10 " .. lookb_bot .. " 18 " .. lookl_bot .. " 20 " .. lookf_bot .. " 18 " .. looka_bot
					size_bit = numberToHex(string.len(stringHex:gsub("%s+", ""))/2)
					return_hex = "0A " .. size_bit .. stringHex .. " "
				end
				table.insert(alreadyImplementedRaceId, mType:raceId())
				return_hex = return_hex:gsub("  ", " ")
				file:write(return_hex)
			end
		end
		player:sendCancelMessage("Data file has been succesfully created.")
		io.close(file)
	end
	return true
end

hexmonster:separator(" ")
hexmonster:register() 

 

Obs: Consegui Inserir o Monstro no Bestiary, porém ele fica Sem o Outfit e Sem Nome...

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Editado por zGiovani (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Você vai precisar saber pelo assents do seu client qual a raça do monstro que você quer adicionar.
Só altera os dados abaixo no arquivo do monstro.

 

Ex:>

 

monster.raceId = 561
monster.Bestiary = {
	class = "Bird",
	race = BESTY_RACE_BIRD,
	toKill = 1000,
	FirstUnlock = 50,
	SecondUnlock = 500,
	CharmsPoints = 25,
	Stars = 3,
	Occurrence = 1,
	Locations = "Isle of Evil."
	}

 

Link para o post
Compartilhar em outros sites

Sim, eu fiz isso, ele adiciona o monstro no Bestiary tudo certinho, porém não aparece a sprite, porque não consigo fazer funcionar o comando /hexmonster do TalkAction, que gera o arquivo hex-monster.txt, e sem esse arquivo não tem como gerar a nova sprite no client :/

imagem_2022-01-20_145244.png

Editado por zGiovani (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 8 months later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por braianlomas
      Como faço para corrigir esse problema para meu cliente, eu uso o tfs 0.3.6  
      Quero resolver esse problema que tenho no meu cliente, como e onde posso resolver?  
      Eu uso o tfs 0.3.6, não tenho as fontes do cliente, se você puder me dar eu vou amá-las para sempre  
       

       
    • Por A.Mokk
      Ola pessoal, estou tentando compilar o TFS 1.5 Downgrade para 8.60 atraves do MSVC 2022, ao tentar compilar da o seguinte erro:
       
       
      Fiz o download do MSVC, GitDash, TFS-SDK-3.2, e de varios boosts que tentei, ao fazer o seguinte procedimento no GitDash:
       
      Ao chegar em ./bootstrap-vcpkg.bat o GitDash nao consegue realizar o procedimento corretamente, alguem poderia me ajudar ?

      Tentei de diversas formas mas o mesmo erro sempre persiste, atualmente meu servidor utiliza TFS 0.4, consigo compilar sem nenhum problema no MSVC 2010, porem, as limitações do TFS 0.4 estão me fazendo precisar atualizar, se alguem souber como corrigir esses erros eu agradeço !

      Tutoriais utilizados :
      Compiling on Windows (vcpkg) · otland/forgottenserver Wiki · GitHub
      Compiling on Windows · otland/forgottenserver Wiki · GitHub
      Compilando TFS 1.3 com vídeo-aula - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
      Compilar TFS 1.3 Vcpkg - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
       
      O que acontece no Powershell:
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary 2.3.6
      Qual o motivo deste tópico? 
      Queria fazer com que os players não pudessem mexer no aleta sio, pois, agora os mesmos estão conseguindo mexer nos itens
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      canary para o cliente 13.16
      Qual o motivo deste tópico? 
      Não consigo encontrar onde ajusta
      to com o problema no 13.16  o exausted, por exemplo os kinas era pra combar exori, erori gran e exori min, porém não ta indo ta dando exausted o char ta soltando magia ou runa e não consegue usar as potions
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Andersontatuador
      Olá galera da TK, me chamo Anderson estou procurando alguém profissional em otservs e site.
      Já tenho um servidor o site e o cliente preciso só de uma pessoal competente, que esteja empenhado a trabalhar,
      não quero nada de graça, pois nessa onda fui mais roubado do quer eu pagar um profissional.
      caso alguém se interesse entrar em contato comigo através do whatsapp
      82 9 9304-9462
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo