Premium Sirio 253 Posted January 23, 2016 Premium Share Posted January 23, 2016 Hi metin2dev. I wanted to ask, is there a quest function that allow once kill a mob and if you are in a party, the whole party receive the drop? Link to comment Share on other sites More sharing options...
Premium Unknown 12 Posted January 23, 2016 Premium Share Posted January 23, 2016 I think there is not, I wrote a function to do this (based on pc.give_item_with_ownership) : add to questlua_party.cpp Quote // drop an item for each member of the group // 20.04.2015 int party_drop_item_with_ownership(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 ch2 = CHARACTER_MANAGER::instance().FindByPID(*it); if (ch2->GetMapIndex() == ch->GetMapIndex()) { LPITEM item = NULL; switch (lua_gettop(L)) { case 1: item = ITEM_MANAGER::instance().CreateItem((DWORD) lua_tonumber(L, 1)); break; case 2: case 3: item = ITEM_MANAGER::instance().CreateItem((DWORD) lua_tonumber(L, 1), (int) lua_tonumber(L, 2)); break; default: return 0; } if ( item == NULL ) { return 0; } if (lua_isnumber(L, 3)) { int sec = (int) lua_tonumber(L, 3); if (sec <= 0) { item->SetOwnership( ch2 ); } else { item->SetOwnership( ch2, sec ); } } else item->SetOwnership( ch2 ); PIXEL_POSITION pos; pos.x = ch2->GetX() + number(-200, 200); pos.y = ch2->GetY() + number(-200, 200); item->AddToGround(ch2->GetMapIndex(), pos); item->StartDestroyEvent(); } } return 0; } { "drop_item_with_ownership", party_drop_item_with_ownership }, 1 Link to comment Share on other sites More sharing options...
Premium Sirio 253 Posted January 25, 2016 Author Premium Share Posted January 25, 2016 Thanks a lot man, it work. Link to comment Share on other sites More sharing options...
ben80600 0 Posted March 28, 2016 Share Posted March 28, 2016 dont work :/ i have error in compile Link to comment Share on other sites More sharing options...
metin2-factory 1010 Posted March 28, 2016 Share Posted March 28, 2016 49 minutes ago, ben80600 said: dont work :/ i have error in compile don't forget to include the following in the begining of the file Spoiler #include "char_manager.h" #include "item_manager.h" #include "item.h" Link to comment Share on other sites More sharing options...
ben80600 0 Posted March 28, 2016 Share Posted March 28, 2016 yeah thanks i just saw my error C++ is realy new for me but i try to learn thanks for your answer ! 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