MI

[OTClient] House look PXG

Por Michyalex, 21 de jun. de 2020 em Clients

11
9.7k
MichyalexM
21 de junho de 2020 às 17:29

Oi galera venho a postar o module House Look igual ao PXG que fiz hoje.

 

No server vamos para a pasta de creaturescripts, no Look.lua colocamos o seguente

local houseId = getHouseFromPos(position)
if houseId and getItemNameById(thing.itemid):find("door") then

   if getHouseOwner(houseId) ~= 0 then house_owner = getPlayerNameByGUID(getHouseOwner(houseId)) else house_owner = "Nobody" end

   house_name = getHouseName(houseId)
   house_town = getTownName(getHouseTown(houseId))
   house_size = getHouseTilesCount(houseId)
   house_price = getHousePrice(houseId)
   
   local house_information = string.format("house_data|%s|%s|%s|%u|%u", house_name, house_owner, house_town, house_size, house_price)
   return doSendPlayerExtendedOpcode(cid, 199, house_information) and false

Esse codigo debe ser colocado como o if principal ou como um elseif no final do arquivo Look.lua

Baixe o Modolo e ja era. Ficaria assim:

image.png.b5217d87a7c1e0e2ef937b6d82124944.pngimage.png.0b018acaca987ce455361f84715224eb.png

 

 

PD: o modulo usa o opcode 199, lembrese de registrar o modulo no GAME_INTERFACE como
- game_house

Virustotal: https://www.virustotal.com/gui/file/58db3f2aa43c1297dc24b26e751e66a1acb6bdbbd3c0fecd27e35e789f7eb440/detection

Credits:
A mim por fazer
PXG por fazer o desenho principal

 

game_house.rar

Editado Junho 21 por Michyalex

Nao tirei uma linha no otui e reupei o conteudo tamben o virustotal

anderson127A
21 de junho de 2020 às 17:36

top mano conteudo top mesmo irei testar aqui

MichyalexM
21 de junho de 2020 às 17:40
3 minutos atrás, anderson127 disse:

top mano conteudo top mesmo irei testar aqui

Obrigado ^^!

anderson127A
21 de junho de 2020 às 17:59
		local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
		local isDittoBall = isInArray({"Ditto", "Shiny Ditto"}, getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "poke")) and true or false
		if getCreatureMaster(thing.uid) == cid then
			local myball = getPlayerSlotItem(cid, 8).uid
			table.insert(str, "You see your "..doCorrectString(getCreatureName(thing.uid)).. (isDittoBall and " (Ditto)" or "") ..".\n")
			if boostlevel > 0 then
				table.insert(str, "\nBoost level: +"..boostlevel..".")
			end
			if isGod(cid) then
				table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
				table.insert(str, "Looktype: ".. getCreatureOutfit(thing.uid).lookType ..".")
			end 
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
		else
			local health = "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..doCorrectString(getCreatureName(thing.uid)).. (isDittoBall and " (Ditto)" or "") ..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid)).."." .. (isGod(cid) and health .. "\nLooktype: ".. getCreatureOutfit(thing.uid).lookType .."." or "") )
			local houseId = getHouseFromPos(position)
			if houseId and getItemNameById(thing.itemid):find("door") then

   if getHouseOwner(houseId) ~= 0 then
      house_owner = getPlayerNameByGUID(getHouseOwner(houseId))
   else
      house_owner = "Nobody"
   end

   house_name = getHouseName(houseId)
   house_town = getTownName(getHouseTown(houseId))
   house_size = getHouseTilesCount(houseId)
   house_price = getHousePrice(houseId)
   
   local house_information = string.format("house_data|%s|%s|%s|%u|%u", house_name, house_owner, house_town, house_size, house_price)
   return doSendPlayerExtendedOpcode(cid, 199, house_information) and false
else
		end
		return false
	end
	return true
end

o meu deu erro pode me dizer oq tem de errado?

MichyalexM
21 de junho de 2020 às 18:02
1 minuto atrás, anderson127 disse:
		local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
		local isDittoBall = isInArray({"Ditto", "Shiny Ditto"}, getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "poke")) and true or false
		if getCreatureMaster(thing.uid) == cid then
			local myball = getPlayerSlotItem(cid, 8).uid
			table.insert(str, "You see your "..doCorrectString(getCreatureName(thing.uid)).. (isDittoBall and " (Ditto)" or "") ..".\n")
			if boostlevel > 0 then
				table.insert(str, "\nBoost level: +"..boostlevel..".")
			end
			if isGod(cid) then
				table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
				table.insert(str, "Looktype: ".. getCreatureOutfit(thing.uid).lookType ..".")
			end 
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
		else
			local health = "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..doCorrectString(getCreatureName(thing.uid)).. (isDittoBall and " (Ditto)" or "") ..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid)).."." .. (isGod(cid) and health .. "\nLooktype: ".. getCreatureOutfit(thing.uid).lookType .."." or "") )
			local houseId = getHouseFromPos(position)
			if houseId and getItemNameById(thing.itemid):find("door") then

   if getHouseOwner(houseId) ~= 0 then
      house_owner = getPlayerNameByGUID(getHouseOwner(houseId))
   else
      house_owner = "Nobody"
   end

   house_name = getHouseName(houseId)
   house_town = getTownName(getHouseTown(houseId))
   house_size = getHouseTilesCount(houseId)
   house_price = getHousePrice(houseId)
   
   local house_information = string.format("house_data|%s|%s|%s|%u|%u", house_name, house_owner, house_town, house_size, house_price)
   return doSendPlayerExtendedOpcode(cid, 199, house_information) and false
else
		end
		return false
	end
	return true
end

o meu deu erro pode me dizer oq tem de errado?

Vc nao trocou para elseif quando vai deixar no final do arquivo, troca esse if perto do houseId por elseif

26 de junho de 2020 às 23:12

opa,fiz tudo certinho e coloquei no fim do look.lua soq quando dou look na house,fica o look padrao do tibia mesmo,nao aparece a janelinha,o que pode ser?

aqui como coloquei o script no fim do look

 

Screenshot_2.png

MichyalexM
28 de junho de 2020 às 09:25
Em 27/06/2020 em 04:12, arthur santos disse:

opa,fiz tudo certinho e coloquei no fim do look.lua soq quando dou look na house,fica o look padrao do tibia mesmo,nao aparece a janelinha,o que pode ser?

aqui como coloquei o script no fim do look

 

Screenshot_2.png

Intao coloca no inicio do if do script deixando o actual principal if para um elseif e colocando esse elseif da house para if

DiazXdD
29 de junho de 2020 às 17:57
Em 28/06/2020 em 09:25, Michyalex disse:

Intao coloca no inicio do if do script deixando o actual principal if para um elseif e colocando esse elseif da house para if

Tem Facebook ou alguma rede social pra me dar um suporte? To voltando a mecher em poketibia agr dps de uns 2 anos...

 

1 mês depois...
JavazinJ
07 de julho de 2020 às 19:30

[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/look.lua:1: unexpected symbol near 'ï'
[07/07/2020 19:29:39] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/look.lua)
[07/07/2020 19:29:39] data/creaturescripts/scripts/look.lua:1: unexpected symbol near 'ï'

 

mesmo com a troca ele fica dando esse erro

1 ano depois...
ericles345E
14 de outubro de 2021 às 22:37
Em 21/06/2020 em 17:29, Michyalex disse:

Oi galera venho a postar o module House Look igual ao PXG que fiz hoje.

 

No server vamos para a pasta de creaturescripts, no Look.lua colocamos o seguente

local houseId = getHouseFromPos(position)
if houseId and getItemNameById(thing.itemid):find("door") then

   if getHouseOwner(houseId) ~= 0 then house_owner = getPlayerNameByGUID(getHouseOwner(houseId)) else house_owner = "Nobody" end

   house_name = getHouseName(houseId)
   house_town = getTownName(getHouseTown(houseId))
   house_size = getHouseTilesCount(houseId)
   house_price = getHousePrice(houseId)
   
   local house_information = string.format("house_data|%s|%s|%s|%u|%u", house_name, house_owner, house_town, house_size, house_price)
   return doSendPlayerExtendedOpcode(cid, 199, house_information) and false

Esse codigo debe ser colocado como o if principal ou como um elseif no final do arquivo Look.lua

Baixe o Modolo e ja era. Ficaria assim:

image.png.b5217d87a7c1e0e2ef937b6d82124944.pngimage.png.0b018acaca987ce455361f84715224eb.png

 

 

PD: o modulo usa o opcode 199, lembrese de registrar o modulo no GAME_INTERFACE como
- game_house

Virustotal: https://www.virustotal.com/gui/file/58db3f2aa43c1297dc24b26e751e66a1acb6bdbbd3c0fecd27e35e789f7eb440/detection

Credits:
A mim por fazer
PXG por fazer o desenho principal

 

game_house.rar 354.8 kB · 155 downloads

mano desculpa reviver isso o meu ta dando esse erro na hora de abrir o client 

 

image.thumb.png.07bbbae009798148ded3acf92a89b2c4.png

25 minutos atrás, ericles345 disse:

mano desculpa reviver isso o meu ta dando esse erro na hora de abrir o client 

 

image.thumb.png.07bbbae009798148ded3acf92a89b2c4.png

ja conseguir resolver foi pq eu estava salvando com notped ai nao funfava mais agora nao estou consguindo colocar a imagem da casa pode me ajuda ? 

 

image.thumb.png.d864269de82473e5b52e29fc999f241d.png

9 meses depois...
17 de julho de 2022 às 16:05

tem codigo para tfs 1.x??