Luffy Posted November 13, 2017 at 04:53 AM Share Posted November 13, 2017 at 04:53 AM Pessoal, eu queria saber como faço pra acessar o rank ou level de um mob através da função mysql_query. Por exemplo, eu derroto o mob de ID 101 e quero que apareça no chat o rank ou level do mob que derrotei. Porém quero acessar o rank ou level através da função mysql_query. Link to comment Share on other sites More sharing options...
Aeglon Posted November 13, 2017 at 07:25 AM Share Posted November 13, 2017 at 07:25 AM @Luffy podes fazer por mysql, mas não sei de todo se é a forma mais correcta de o fazer. Eu aconselho-te a fazer isso por quest. Spoiler Citar quest get_lvl_npc begin state start begin when kill with not npc.is_pc() begin chat("Acabas-te de matar o bicho feio com o nível: "..npc.get_level().."") end end end Link to comment Share on other sites More sharing options...
juniorsilva Posted November 13, 2017 at 08:34 PM Share Posted November 13, 2017 at 08:34 PM func...... int npc_get_level(lua_State* L) { lua_pushnumber(L, CQuestManager::instance().GetCurrentNPCCharacterPtr()->GetLevel()); return 1; } int npc_get_rank(lua_State* L) { lua_pushnumber(L, CQuestManager::instance().GetCurrentNPCCharacterPtr()->GetMobRank()); return 1; } { "get_level", npc_get_level}, { "get_rank", npc_get_rank}, quest_functions npc.get_level() npc.get_rank() Link to comment Share on other sites More sharing options...
Luffy Posted November 14, 2017 at 03:36 AM Author Share Posted November 14, 2017 at 03:36 AM 6 horas atrás, juniorsilva disse: func...... int npc_get_level(lua_State* L) { lua_pushnumber(L, CQuestManager::instance().GetCurrentNPCCharacterPtr()->GetLevel()); return 1; } int npc_get_rank(lua_State* L) { lua_pushnumber(L, CQuestManager::instance().GetCurrentNPCCharacterPtr()->GetMobRank()); return 1; } { "get_level", npc_get_level}, { "get_rank", npc_get_rank}, quest_functions npc.get_level() npc.get_rank() A primeira parte vai no questlib.lua? Link to comment Share on other sites More sharing options...
juniorsilva Posted November 14, 2017 at 08:18 AM Share Posted November 14, 2017 at 08:18 AM 4 horas atrás, Luffy disse: A primeira parte vai no questlib.lua? add a função na sua source em game/src/questlua_npc.cpp .... Mandei várias funções lua pra ti por PM....... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now