NewWars 875 Posted May 13, 2015 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. 3 'PACI, xXBoyDarkXx and Laurindinha reacted to this Share this post Link to post Share on other sites
xXBoyDarkXx 328 Posted May 13, 2015 Podes dar um exemplo da quest sff? Share this post Link to post Share on other sites
NewWars 875 Posted May 13, 2015 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. 1 xXBoyDarkXx reacted to this Share this post Link to post Share on other sites
xXBoyDarkXx 328 Posted May 13, 2015 Obrigadão, continua assim ;) Share this post Link to post Share on other sites
NewWars 875 Posted May 13, 2015 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. 1 xXBoyDarkXx reacted to this Share this post Link to post Share on other sites