antiblock
Rodnia | Alpha & Omega
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
'PACI

Função Pc.Get_Empire_Name()

5 posts in this topic

Oi.Eu cansei-me, em todas as quests que tenho que obter o nome do reino da personagem, de escrever sempre o mesmo array e depois com o output a obter esse nome, portanto fiz esta função e venho partilhá-la com vocês. 

function pc.get_empire_name()	local name = {"Shinsoo", "Chunjo", "Jinno"}	return name[pc.get_empire()]end
Exemplo de uso:
quest teste begin	state start begin		when login with pc.getqf("iniciar") == 0 begin			pc.setqf("iniciar", 1)			notice_all("Uma nova personagem foi criada no reino "..pc.get_empire_name())		end	endend
Output:Uma personagem foi criada no reino ShinsooUma personagem foi criada no reino ChunjoUma personagem foi criada no reino JinnoResumindo, a função obtém o nome do reino da personagem.

Share this post


Link to post
Share on other sites
antiblock
Rodnia | Alpha & Omega

Sim hehe por acaso fiz porque me perguntaste se havia função para isso xD

Share this post


Link to post
Share on other sites

Oi.Eu cansei-me, em todas as quests que tenho que obter o nome do reino da personagem, de escrever sempre o mesmo array e depois com o output a obter esse nome, portanto fiz esta função e venho partilhá-la com vocês. 

function pc.get_empire_name()	local name = {"Shinsoo", "Chunjo", "Jinno"}	return name[pc.get_empire()]end
Exemplo de uso:
quest teste begin	state start begin		when login with pc.getqf("iniciar") == 0 begin			pc.setqf("iniciar", 1)			notice_all("Uma nova personagem foi criada no reino "..pc.get_empire_name())		end	endend
Output:Uma personagem foi criada no reino ShinsooUma personagem foi criada no reino ChunjoUma personagem foi criada no reino JinnoResumindo, a função obtém o nome do reino da personagem.

 

se neste caso eu quiser mete para toda vez que um monstro for morto, exmp (X -NIK ) matou mob tal =aonde eu deveria muda, dou +1

Share this post


Link to post
Share on other sites

sorry o spam. 

bom mais isso não seria preciso pq no locale.lua existe uma função já: 

locale.empire_names = {    [0] = "Todos os Reinos",    [1] = "Reino Shinsoo",    [2] = "Reino Chunjo",    [3] = "Reino Jinno",}

para fazer o return bastar add: "..locale.empire_names[pc.get_empire()].."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this