metin2-factory 1017 Posted March 28, 2016 Share Posted March 28, 2016 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hey, so i know it is not the best solution to prevent from players using multiple clients to get bosses drop, since low percent of players are playing from the same network(brothers for exmaple). Anyway,i think it is good enough for now. this quest function will check if there are party members with same IP and return true/false open questlua_party.cpp Look for: Spoiler int party_get_member_pids(lua_State *L) below this function add the following function: Spoiler int party_have_same_ip(lua_State* L) { CQuestManager & q = CQuestManager::instance(); LPCHARACTER ch = q.GetCurrentCharacterPtr(); LPPARTY pParty = ch->GetParty(); if (NULL == pParty) { return 0; } FPartyPIDCollector f; pParty->ForEachOnMapMember(f, ch->GetMapIndex()); for (std::vector <DWORD>::iterator it = f.vecPIDs.begin(); it != f.vecPIDs.end(); ++it) { LPCHARACTER ch1 = CHARACTER_MANAGER::instance().FindByPID(*it); for (std::vector <DWORD>::iterator it2 = f.vecPIDs.begin(); it2 != f.vecPIDs.end(); ++it2) { LPCHARACTER ch2 = CHARACTER_MANAGER::instance().FindByPID(*it2); if (ch1->GetPlayerID() != ch2->GetPlayerID() && !(strcmp(ch1->GetDesc()->GetHostName(),ch2->GetDesc()->GetHostName()))) { lua_pushboolean(L, true); return 1; } } } lua_pushboolean(L, false); return 0; } search for: Spoiler { "get_member_pids", party_get_member_pids }, add below: Spoiler { "have_same_ip", party_have_same_ip}, add to questfunction the function: party.have_same_ip example of a quest: if party.have_same_ip() == true then say("2 or more members have same ip!") else say("all party members has different ip!") enjoy 3 1 4 Link to comment Share on other sites More sharing options...
Hik 108 Posted September 19, 2016 Share Posted September 19, 2016 questlua_party.cpp: In function 'int quest::party_have_same_ip(lua_State*)': questlua_party.cpp:413: error: 'CHARACTER_MANAGER' has not been declared questlua_party.cpp:417: error: 'CHARACTER_MANAGER' has not been declared gmake: *** [Makefile:120: OBJDIR/questlua_party.o] Error 1 FIX: Add in quest questlua_party: #include "char_manager.h" Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4929 Posted January 17, 2018 Bot Share Posted January 17, 2018 Okay? For what? King Regards Cyber Link to comment Share on other sites More sharing options...
Recommended Posts