ѕeмa™ 308 Posted March 20, 2015 Share Posted March 20, 2015 Hi, someonke can explain me how works the connections like this: LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L,npc ? npc->GetHP() : 0); *EXAMPLE: this go to questmanager.cpp, choose the npc and get the hp from mob_proto Where is defined the GetHp() from a npc/mob? and why if i put LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L,npc ? npc->GetExp() : 0); the GetExp() doesnt work? I want learn how works, i want learn more about c++. Thanks. https://m2admin.net/ Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted March 20, 2015 Premium Share Posted March 20, 2015 idk but maybe like that : int npc_get_hp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetHPPct()); return 1; } this is a quest function for get the hp ! If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted March 20, 2015 Author Share Posted March 20, 2015 idk but maybe like that : int npc_get_hp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetHPPct()); return 1; } this is a quest function for get the hp ! oh i think u dont understand what i mean, i have this function working , but i wanna know how work the function. I make the GetExp() and doesnt work, and why¿¿¿??? i dont know, but i want know what do the LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); and npc->GetHPPct() where is this defined? https://m2admin.net/ Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted March 20, 2015 Premium Share Posted March 20, 2015 (edited) will i dont know c++ anyway https://metin2.download/picture/Dej0vMg7QsKZFUpRKn69U8226ms6OgPT/.png + i think for the exp : int npc_get_exp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetExp()); return 1; } i dont think it's will work anyway !becous npc dont have exp ! Edited August 30, 2022 by Metin2 Dev Core X - External 2 Internal If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted March 20, 2015 Author Share Posted March 20, 2015 (edited) will i dont know c++ anyway https://metin2.download/picture/Dej0vMg7QsKZFUpRKn69U8226ms6OgPT/.png + i think for the exp : int npc_get_exp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetExp()); return 1; } i dont think it's will work anyway !becous npc dont have exp ! yep u have right but the mobs yes, how can get the exp of one mob when i kill him? Edited August 30, 2022 by Metin2 Dev Core X - External 2 Internal https://m2admin.net/ Link to comment Share on other sites More sharing options...
newja 53 Posted March 20, 2015 Share Posted March 20, 2015 (edited) will i dont know c++ anyway https://metin2.download/picture/Dej0vMg7QsKZFUpRKn69U8226ms6OgPT/.png + i think for the exp : int npc_get_exp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetExp()); return 1; } i dont think it's will work anyway !becous npc dont have exp ! yep u have right but the mobs yes, how can get the exp of one mob when i kill him? Well, you can't. It's calculated by the GiveExp function. Where is defined GetHP() char.h Edited August 30, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted March 20, 2015 Author Share Posted March 20, 2015 (edited) will i dont know c++ anyway https://metin2.download/picture/Dej0vMg7QsKZFUpRKn69U8226ms6OgPT/.png + i think for the exp : int npc_get_exp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetExp()); return 1; } i dont think it's will work anyway !becous npc dont have exp ! yep u have right but the mobs yes, how can get the exp of one mob when i kill him? Well, you can't. It's calculated by the GiveExp function. Thanks, now i know how works the exp. But how works the connections? Edited August 30, 2022 by Metin2 Dev Core X - External 2 Internal https://m2admin.net/ Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now