Jump to content
Michyalex

[OTClient] House look PXG

Recommended Posts

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

Edited by Michyalex
Nao tirei uma linha no otui e reupei o conteudo tamben o virustotal
Link to post
Share on other sites
		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?

Link to post
Share on other sites
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

Link to post
Share on other sites

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

Link to post
Share on other sites
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

Link to post
Share on other sites
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...

 

Link to post
Share on other sites

[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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...