DE
poketibia

Colocar gender no Look.lua

Por Developer Berg, 13 de jun. de 2015 em Archived

tibia
script
otserv
17
2.5k
Developer BergD
13 de junho de 2015 às 14:32

Olá gente smile.png queria pedir a vcs para colocar Gender no meu look.lua de poketibia, estou usando o base do Exaioros/Kpdo e lá quando a pessoa dá look em um pokemon n aparece se ele é Macho ou Femeá.

Meu Look.lua da pasta Data/ Creaturescripts/ Look.lua

function onLook(cid, thing, position, lookDistance)


	

--for rocks = 0, 8 do
--if thing == rocks then
--if rocks == 8 then
--if #getCreatureSummons(cid) >= 1 then
--setCreatureMaxHealth(getCreatureSummons(cid)[1], getCreatureMaxHealth(getCreatureSummons(cid)[1]) + pokes[getCreatureName(getCreatureSummons(cid)[1])].cons)
--doCreatureAddHealth(getCreatureSummons(cid)[1],getCreatureMaxHealth(getCreatureSummons(cid)[1]))doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 28)
--doSendMagicEffect(getThingPos(cid), 29)
--end
--elseif rocks == 2 then
--doSendMagicEffect(getThingPos(cid), 28)
--if getPlayerStorageValue(cid, 91859) >= 1 then
--local speedskills = getPlayerSkill(cid,2)*10
--doChangeSpeed(cid, -getCreatureSpeed(cid))
--doChangeSpeed(cid, getCreatureBaseSpeed(cid)+speedskills)
--end
--end
--return true
--end

--end






if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
local playerlook = getPlayerStorageValue(thing.uid, 91911)
if isPlayer(playerlook) then
local nick = getCreatureName(playerlook)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." ,Cam mode on")
end
return false

end



if isMonster(thing.uid) then
if getCreatureName(thing.uid) == "Tall Grass" then
local player = getPlayerStorageValue(thing.uid,1)
if isPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
end
return false
end

if isPlayer(getCreatureMaster(thing.uid)) then
local dono = getCreatureMaster(thing.uid)
local nome = getCreatureName(dono)
local poke = string.lower(getCreatureName(thing.uid))
local apelido = getPlayerStorageValue(dono,9000)
local pokemondoido = getPlayerSlotItem(dono, 8)
local catchby = getItemAttribute(pokemondoido.uid, "catchby")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".("..apelido..")\n It belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
else
return true
end


return false
end


return true
end

 

BrunoB
15 de junho de 2015 às 10:08

@@ricardoberg, tenta assim:

 

function onLook(cid, thing, position, lookDistance)

	if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
		local playerlook = getPlayerStorageValue(thing.uid, 91911)
		if isPlayer(playerlook) then
			local nick = getCreatureName(playerlook)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." , Cam mode on")
		end
		return false
	end

	if isMonster(thing.uid) then
		if getCreatureName(thing.uid) == "Tall Grass" then
			local player = getPlayerStorageValue(thing.uid,1)
			if isPlayer(player) then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
			end
			return false
		end

		if isPlayer(getCreatureMaster(thing.uid)) then
			local dono = getCreatureMaster(thing.uid)
			local nome = getCreatureName(dono)
			local poke = string.lower(getCreatureName(thing.uid))
			local sexo = (getPlayerSex(thing.uid) == 0 and 'female' or 'male')
			local apelido = getPlayerStorageValue(dono, 9000)
			local pokemondoido = getPlayerSlotItem(dono, 8)
			local catchby = getItemAttribute(pokemondoido.uid, "catchby")
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a " .. poke .. ", " .. sexo .. ". ("..apelido..")\nIt belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
		else
			return true
		end
		return false
	end

	return true
end

 

Developer BergD
15 de junho de 2015 às 14:03

@@ricardoberg, tenta assim:

 

 

function onLook(cid, thing, position, lookDistance)

	if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
		local playerlook = getPlayerStorageValue(thing.uid, 91911)
		if isPlayer(playerlook) then
			local nick = getCreatureName(playerlook)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." , Cam mode on")
		end
		return false
	end

	if isMonster(thing.uid) then
		if getCreatureName(thing.uid) == "Tall Grass" then
			local player = getPlayerStorageValue(thing.uid,1)
			if isPlayer(player) then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
			end
			return false
		end

		if isPlayer(getCreatureMaster(thing.uid)) then
			local dono = getCreatureMaster(thing.uid)
			local nome = getCreatureName(dono)
			local poke = string.lower(getCreatureName(thing.uid))
			local sexo = (getPlayerSex(thing.uid) == 0 and 'female' or 'male')
			local apelido = getPlayerStorageValue(dono, 9000)
			local pokemondoido = getPlayerSlotItem(dono, 8)
			local catchby = getItemAttribute(pokemondoido.uid, "catchby")
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a " .. poke .. ", " .. sexo .. ". ("..apelido..")\nIt belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
		else
			return true
		end
		return false
	end

	return true
end

 

aqui n pegou, ficou do mesmo jeito que tava antes

 

14:02 You see an Ultra ball.
Contains a Shiny Salamence, ST[+0]=[310].
ItemID: [2220].
Position: [X: 748] [Y: 851] [Z: 6].
BrunoB
17 de junho de 2015 às 08:41

 

aqui n pegou, ficou do mesmo jeito que tava antes

 

14:02 You see an Ultra ball.
Contains a Shiny Salamence, ST[+0]=[310].
ItemID: [2220].
Position: [X: 748] [Y: 851] [Z: 6].

 

Tem algum outro script de look?

No script atual não está dessa forma...

Ou isso vem de compilação na source?

Luga03L
17 de junho de 2015 às 08:49

Man poderia postar o look.lua completo?? pq só isto ai não dá para adaptar e aparecer o gender

 

Developer BergD
17 de junho de 2015 às 14:56

Man poderia postar o look.lua completo?? pq só isto ai não dá para adaptar e aparecer o gender

 

 

 

Tem algum outro script de look?

No script atual não está dessa forma...

Ou isso vem de compilação na source?

eu só achei esse look.lua, to usando o server do Kpdo/exaioros, e n sei se já veio compilado na source, pq eles n passaram a source '-'

Luga03L
17 de junho de 2015 às 16:14

abre o Notpad++ aperta control + f, e seleciona Localizar em arquivos, coloca no primeiro "you see", e seleciona a pasta, ai quando terminar o resultado, manda print da janelinha que apareceu!

Developer BergD
17 de junho de 2015 às 18:28

abre o Notpad++ aperta control + f, e seleciona Localizar em arquivos, coloca no primeiro "you see", e seleciona a pasta, ai quando terminar o resultado, manda print da janelinha que apareceu!

olha ai

post-381687-0-85807500-1434576462_thumb.jpg

Luga03L
17 de junho de 2015 às 22:59

 

 
function onLook(cid, thing, position, lookDistance)


    

--for rocks = 0, 8 do
--if thing == rocks then
--if rocks == 8 then
--if #getCreatureSummons(cid) >= 1 then
--setCreatureMaxHealth(getCreatureSummons(cid)[1], getCreatureMaxHealth(getCreatureSummons(cid)[1]) + pokes[getCreatureName(getCreatureSummons(cid)[1])].cons)
--doCreatureAddHealth(getCreatureSummons(cid)[1],getCreatureMaxHealth(getCreatureSummons(cid)[1]))doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 28)
--doSendMagicEffect(getThingPos(cid), 29)
--end
--elseif rocks == 2 then
--doSendMagicEffect(getThingPos(cid), 28)
--if getPlayerStorageValue(cid, 91859) >= 1 then
--local speedskills = getPlayerSkill(cid,2)*10
--doChangeSpeed(cid, -getCreatureSpeed(cid))
--doChangeSpeed(cid, getCreatureBaseSpeed(cid)+speedskills)
--end
--end
--return true
--end

--end






if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
local playerlook = getPlayerStorageValue(thing.uid, 91911)
if isPlayer(playerlook) then
local nick = getCreatureName(playerlook)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." ,Cam mode on")
end
return false

end



if isMonster(thing.uid) then
if getCreatureName(thing.uid) == "Tall Grass" then
local player = getPlayerStorageValue(thing.uid,1)
if isPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
end
return false
end

if isPlayer(getCreatureMaster(thing.uid)) then
local dono = getCreatureMaster(thing.uid)
local nome = getCreatureName(dono)
local poke = string.lower(getCreatureName(thing.uid))
local apelido = getPlayerStorageValue(dono,9000)
local pokemondoido = getPlayerSlotItem(dono, 8)
local catchby = getItemAttribute(pokemondoido.uid, "catchby")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".("..apelido..")\n It belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
   if getPokemonGender(thing.uid)  == SEX_MALE then
      table.insert(str, "Este pokémon é macho.")
   elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
      table.insert(str, "Este pokémon é femia.")
   else
      table.insert(str, "Este pokémon é indefinido.")
   end
else
return true
end


return false
end


return true
end
Developer BergD
20 de junho de 2015 às 17:46
 
function onLook(cid, thing, position, lookDistance)


    

--for rocks = 0, 8 do
--if thing == rocks then
--if rocks == 8 then
--if #getCreatureSummons(cid) >= 1 then
--setCreatureMaxHealth(getCreatureSummons(cid)[1], getCreatureMaxHealth(getCreatureSummons(cid)[1]) + pokes[getCreatureName(getCreatureSummons(cid)[1])].cons)
--doCreatureAddHealth(getCreatureSummons(cid)[1],getCreatureMaxHealth(getCreatureSummons(cid)[1]))doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 28)
--doSendMagicEffect(getThingPos(cid), 29)
--end
--elseif rocks == 2 then
--doSendMagicEffect(getThingPos(cid), 28)
--if getPlayerStorageValue(cid, 91859) >= 1 then
--local speedskills = getPlayerSkill(cid,2)*10
--doChangeSpeed(cid, -getCreatureSpeed(cid))
--doChangeSpeed(cid, getCreatureBaseSpeed(cid)+speedskills)
--end
--end
--return true
--end

--end






if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
local playerlook = getPlayerStorageValue(thing.uid, 91911)
if isPlayer(playerlook) then
local nick = getCreatureName(playerlook)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." ,Cam mode on")
end
return false

end



if isMonster(thing.uid) then
if getCreatureName(thing.uid) == "Tall Grass" then
local player = getPlayerStorageValue(thing.uid,1)
if isPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
end
return false
end

if isPlayer(getCreatureMaster(thing.uid)) then
local dono = getCreatureMaster(thing.uid)
local nome = getCreatureName(dono)
local poke = string.lower(getCreatureName(thing.uid))
local apelido = getPlayerStorageValue(dono,9000)
local pokemondoido = getPlayerSlotItem(dono, 8)
local catchby = getItemAttribute(pokemondoido.uid, "catchby")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".("..apelido..")\n It belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
   if getPokemonGender(thing.uid)  == SEX_MALE then
      table.insert(str, "Este pokémon é macho.")
   elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
      table.insert(str, "Este pokémon é femia.")
   else
      table.insert(str, "Este pokémon é indefinido.")
   end
else
return true
end


return false
end


return true
end

Aqui ficou do mesmo jeito '-' ta aparecendo mesma coisa e n ta aparecendo o gender '-'

zipter98Z
20 de junho de 2015 às 19:36

 

function onLook(cid, thing, position, lookDistance)
 
--for rocks = 0, 8 do
--if thing == rocks then
--if rocks == 8 then
--if #getCreatureSummons(cid) >= 1 then
--setCreatureMaxHealth(getCreatureSummons(cid)[1], getCreatureMaxHealth(getCreatureSummons(cid)[1]) + pokes[getCreatureName(getCreatureSummons(cid)[1])].cons)
--doCreatureAddHealth(getCreatureSummons(cid)[1],getCreatureMaxHealth(getCreatureSummons(cid)[1]))doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 28)
--doSendMagicEffect(getThingPos(cid), 29)
--end
--elseif rocks == 2 then
--doSendMagicEffect(getThingPos(cid), 28)
--if getPlayerStorageValue(cid, 91859) >= 1 then
--local speedskills = getPlayerSkill(cid,2)*10
--doChangeSpeed(cid, -getCreatureSpeed(cid))
--doChangeSpeed(cid, getCreatureBaseSpeed(cid)+speedskills)
--end
--end
--return true
--end
 
--end
 
 
    if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
        local playerlook = getPlayerStorageValue(thing.uid, 91911)
        if isPlayer(playerlook) then
            local nick = getCreatureName(playerlook)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." ,Cam mode on")
        end
        return false
    end
 
 
 
    if isMonster(thing.uid) then
        if getCreatureName(thing.uid) == "Tall Grass" then
            local player = getPlayerStorageValue(thing.uid,1)
            if isPlayer(player) then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
            end
            return false
        end
        if isPlayer(getCreatureMaster(thing.uid)) then
            local dono = getCreatureMaster(thing.uid)
            local nome = getCreatureName(dono)
            local poke = string.lower(getCreatureName(thing.uid))
            local apelido = getPlayerStorageValue(dono,9000)
            local pokemondoido = getPlayerSlotItem(dono, 8)
            local catchby = getItemAttribute(pokemondoido.uid, "catchby")
            local sex = getPokemonGender(thing.uid) == SEX_MALE and "macho" or getPokemonGender(thing.uid) == SEX_FEMALE and "femea" or "indefinido"
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".("..apelido..")\n It belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".\nEste pokémon é "..sex..".")
        else
            return true
        end
        return false
    end
    return true
end
Developer BergD
20 de junho de 2015 às 22:59
function onLook(cid, thing, position, lookDistance)
 
--for rocks = 0, 8 do
--if thing == rocks then
--if rocks == 8 then
--if #getCreatureSummons(cid) >= 1 then
--setCreatureMaxHealth(getCreatureSummons(cid)[1], getCreatureMaxHealth(getCreatureSummons(cid)[1]) + pokes[getCreatureName(getCreatureSummons(cid)[1])].cons)
--doCreatureAddHealth(getCreatureSummons(cid)[1],getCreatureMaxHealth(getCreatureSummons(cid)[1]))doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 28)
--doSendMagicEffect(getThingPos(cid), 29)
--end
--elseif rocks == 2 then
--doSendMagicEffect(getThingPos(cid), 28)
--if getPlayerStorageValue(cid, 91859) >= 1 then
--local speedskills = getPlayerSkill(cid,2)*10
--doChangeSpeed(cid, -getCreatureSpeed(cid))
--doChangeSpeed(cid, getCreatureBaseSpeed(cid)+speedskills)
--end
--end
--return true
--end
 
--end
 
 
    if isPlayer(thing.uid) and getPlayerStorageValue(thing.uid, 91911) >= 1 then
        local playerlook = getPlayerStorageValue(thing.uid, 91911)
        if isPlayer(playerlook) then
            local nick = getCreatureName(playerlook)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..nick.." ,Cam mode on")
        end
        return false
    end
 
 
 
    if isMonster(thing.uid) then
        if getCreatureName(thing.uid) == "Tall Grass" then
            local player = getPlayerStorageValue(thing.uid,1)
            if isPlayer(player) then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..getCreatureName(player).." Watch a tv.")
            end
            return false
        end
        if isPlayer(getCreatureMaster(thing.uid)) then
            local dono = getCreatureMaster(thing.uid)
            local nome = getCreatureName(dono)
            local poke = string.lower(getCreatureName(thing.uid))
            local apelido = getPlayerStorageValue(dono,9000)
            local pokemondoido = getPlayerSlotItem(dono, 8)
            local catchby = getItemAttribute(pokemondoido.uid, "catchby")
            local sex = getPokemonGender(thing.uid) == SEX_MALE and "macho" or getPokemonGender(thing.uid) == SEX_FEMALE and "femea" or "indefinido"
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".("..apelido..")\n It belongs to "..nome..".(catch by "..catchby..")\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".\nEste pokémon é "..sex..".")
        else
            return true
        end
        return false
    end
    return true
end

quando a pessoa da look na ball com o poke dentro da ball fica do mesmo jeito

 

 

22:56 You see an Ultra ball.
Contains a Shiny Dragonite, ST[+0]=[100].
ItemID: [2220].
Position: [X: 1052] [Y: 1058] [Z: 7].
mais quando a pessoa tira o pokemon da ball e da look em cima do pokemon aparece esse erro aqui

post-381687-0-09559900-1434851997_thumb.png

zipter98Z
20 de junho de 2015 às 23:12

Ah, pelo fato do Zet0N0Murmurouu ter usado esta função, acreditei que ela existisse neste servidor.

Saberia dizer como os gêneros dos pokémons são atribuídos? Ou teria ao menos um código que chame esta informação para termos como base?

Developer BergD
20 de junho de 2015 às 23:25

Ah, pelo fato do Zet0N0Murmurouu ter usado esta função, acreditei que ela existisse neste servidor.

Saberia dizer como os gêneros dos pokémons são atribuídos? Ou teria ao menos um código que chame esta informação para termos como base?

só da pra saber se os pokemons é macho, fêmea ou indefinido quando a pessoa da catch nele, ai aparece o simbolo de macho ou fêmea quando a pessoa solta ele da ball, acho que isso é nas source mesmo '-', tipo até ele selvagem n aparece se é male ou female, ele fica sem sexo quanto ta selvagem, ai só quando a pessoa da catch que aparece

Wend llW
22 de junho de 2015 às 18:34

Poste o script do catch aqui , quero dar uma conferida

Editado Junho 22 por AnnaFeeh