[TFS 0.x] New look system

Sttorm

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/04/15Posts: 22Gênero: Masculino

Fala pessoal , vi muita galera com problema no look (principalmente em narutibias). Então resolvi refazer o sistema de look


tcx9XuR.jpg

 

 

Crie um novo arquivo em Creaturescripts e cole isso ( Tem que registrar na XML e no login.lua, ambas tags estão na script)

-- <event type="look" name="showVoc" event="script" value="showvoc.lua"/>
-- registerCreatureEvent(cid, showVoc)

local t = {

[-1] = "Estudante",
[0]  = "Estudante",
[1]  = "Genin",
[2]  = "Chunnin",
[3]  = "Jounin",
[4]  = "Anbu",
[5]  = "Sennin"

}

function onLook(cid, thing, position, lookDistance)


local storage = 35461
local get_description = t[getPlayerStorageValue(thing.uid, storage)]
local get_sex = (getPlayerSex(thing.uid) == 0 and "She" or "He")
local get_town = getTownName(getPlayerTown(thing.uid))
    
    if isPlayer(thing.uid) and thing.uid ~= cid then  
    doPlayerSetSpecialDescription(thing.uid, "\n ".. get_sex .." are ".. get_description ..". \n ".. get_sex .." is the resident of ".. get_town ..".")
    end 
    return true     
end

Como o sistema funciona ? como eu configuro ? 

Primeiramente , a script pega o valor que o player tem de uma storage e a identifica na tabela , onde o que está entre "[]" é o valor da storage
Exemplo : O player tem a storage 35461 e 3 como o value dela , então no look retornará Jounin 
Para configurar , mecha aqui

local t = {

[-1] = "Estudante",
[0]  = "Estudante",
[1]  = "Genin",
[2]  = "Chunnin",
[3]  = "Jounin",
[4]  = "Anbu",
[5]  = "Sennin"

}

Lembrando que a ultima parte não deverá conter virgula , ficando assim

local t = {

[-1] = "Estudante",
[0]  = "Estudante",
[1]  = "Genin"
  
}

A script não funciona se você der look em si mesmo.
Chars com group maior que 2 retornarão erro ao dar look.

 

 

 

 

shadowzim

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/12/09Posts: 12Char no Tibia: shadowzim
local t = {

[-1] = "Estudante",
[0]  = "Estudante",
[1]  = "Genin",
[2]  = "Chunnin",
[3]  = "Jounin",
[4]  = "Anbu",
[5]  = "Sennin"

}

function onLook(cid, thing, position, lookDistance)


local storage = 35461
local get_description = t[getPlayerStorageValue(thing.uid, storage)]
if thing.uid == cid then
  get_sex = "You"
else 
  get_sex = (getPlayerSex(thing.uid) == 0 and "She" or "He")
End
  
local get_town = getTownName(getPlayerTown(thing.uid))
    
    if isPlayer(thing.uid) and thing.uid ~= cid then  
    doPlayerSetSpecialDescription(thing.uid, "\n ".. get_sex .." are ".. get_description ..". \n ".. get_sex .." is the resident of ".. get_town ..".")
    end 
    return true     
end

Com Isso, resolve o problema de dar look em si mesmo, já a parte dos groups, eu precisaria saber como funciona e como eles estão distribuidos no seu servidor pra que eu possa mudar...

leozinpbb

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 14/05/15Posts: 129Gênero: Masculino

@Sttorm PODERIA ME AJUDAR, NO MEU EU INSTALEI TUDO CERTO , POREM QUANDO VAI DAR LOOK NAO APARECE NADA .

 USO TFS. 0.4  ( 8.6)

 

Screenshot_39.png