antiblock
Cyphriun
  • Chatbox

    Did you check out our Discord? https://discord.gg/FFdvMjk9xA
    You don't have permission to chat.
    Load More
Sign in to follow this  
NewWars

[Metin2 C++ Source] Advance Level Quest Function

5 posts in this topic

Boas Pessoal.


 


So para animar a malta, uns podem precisar ou não, quem conhece aquele comando /a <Nome> <Level>, e gostaria de ter isso como quest function, para colocar num npc ou assim, ai têm a quest function que tirei do do_advance e fiz so uns checks:



int pc_advance_level(lua_State * L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

if (!lua_isnumber(L, 1))
{
sys_err("QUEST : pc_advance_level wrong argument");
return 0;
}

int level = (int) lua_tonumber(L, 1);

ch->ResetPoint(MINMAX(0, level, PLAYER_MAX_LEVEL_CONST));

return 1;
}

Cumprimentos.


Share this post


Link to post
Share on other sites
antiblock
https://arwen2.global/

Podes dar um exemplo da quest sff?

Share this post


Link to post
Share on other sites
quest setlevele begin
	state start begin
		when 20090.chat."Meter Level" begin
			say_title("Hey:")
			say("level?")
			local a = input()
			pc.set_level(a)
			say("Têns agora level"..a)
		end
	end
end

NOTA: Eu subscrevi o set_level, meti o codigo do advance_level la dentro simplesmente.

 

Cumprimentos.

Share this post


Link to post
Share on other sites

Obrigadão, continua assim ;)

Share this post


Link to post
Share on other sites

Se quiseres usar a função para o npc meter level em outra pessoa, faz find_pc_by_name, seleciona com pc.select, e depois executas o pc.set_level ou pc.advance_level(depende se tenhas subscrevido ou adicionado).

Exemplo:

		when 20091.chat."Meter Level a outro" begin
			say_title("Hey:")
			say("Level?")
			local level = input()
			
			say("Nome da Char?")
			local name = input()
			local vid = find_pc_by_name(name)

			if vid == 0 then
				say(""..name.." não existe ou não está online")
			end

			local oldVid = pc.select(vid)
			pc.set_level(level)
			pc.select(oldVid)
		end

Cumprimentos.

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