metin2-factory 1010 Posted April 8, 2016 Share Posted April 8, 2016 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hey guys, I'v added a little function to source that will retrieve party leader name. Very useful for party/dungeon bosses hunt,you can notice everyone the name of the party leader when performing an action(kill boss,finish dungeon,etc). Open party.h look for Spoiler DWORD GetLeaderPID(); add below: Spoiler const char * GetLeaderName(); open party.cpp look for: Spoiler DWORD CParty::GetLeaderPID() add below this function: Spoiler const char * CParty::GetLeaderName() { LPCHARACTER leader_ch = CHARACTER_MANAGER::instance().FindByPID(m_dwLeaderPID); return leader_ch->GetName(); } open questlua_party.cpp look for: Spoiler int party_get_leader_pid(lua_State* L) add below this function: Spoiler int party_get_leader_name(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (ch->GetParty()) { lua_pushstring(L, ch->GetParty()->GetLeaderName()); } else { lua_pushnumber(L, -1); } return 1; } look for: Spoiler { "get_leader_pid", party_get_leader_pid}, add below: Spoiler {"get_leader_name", party_get_leader_name}, open quest_function file add there: party.get_leader_name Example how to use in quest: Spoiler when 6091.kill begin notice_all(party.get_leader_name().." Group has killed razador!") end Enjoy! 7 Link to comment Share on other sites More sharing options...
Uyas 0 Posted April 9, 2016 Share Posted April 9, 2016 (edited) Bugged when im without party text is: Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
metin2-factory 1010 Posted April 9, 2016 Author Share Posted April 9, 2016 The whole purpose of this function is to use while in party. Anyway,it is easy to fix. change function int party_get_leader_name inside questlua_party.cpp to this: int party_get_leader_name(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (ch->GetParty()) { lua_pushstring(L, ch->GetParty()->GetLeaderName()); } else { lua_pushstring(L, ch->GetName()); } return 1; } 1 Link to comment Share on other sites More sharing options...
Uyas 0 Posted April 9, 2016 Share Posted April 9, 2016 This working but i dont want text when im without party. I want this text when im only in party. This text must be when im without party? Link to comment Share on other sites More sharing options...
Premium Harold 39 Posted April 9, 2016 Premium Share Posted April 9, 2016 use party.is_party() 1 Link to comment Share on other sites More sharing options...
Uyas 0 Posted April 9, 2016 Share Posted April 9, 2016 where i must enter this? Link to comment Share on other sites More sharing options...
Premium Galet 510 Posted April 9, 2016 Premium Share Posted April 9, 2016 In quest, use it with a if statement Link to comment Share on other sites More sharing options...
metin2-factory 1010 Posted April 9, 2016 Author Share Posted April 9, 2016 when 6091.kill begin if party.is_party() then notice_all(party.get_leader_name().." Group has killed razador!") end end 1 Link to comment Share on other sites More sharing options...
Rainbow3D 54 Posted April 10, 2016 Share Posted April 10, 2016 Have you some screen in game? Link to comment Share on other sites More sharing options...
Recommended Posts