MaJeStiC 2 Posted September 5, 2018 Share Posted September 5, 2018 Hi, Im searching for something that make all players fight against each other? like free pvp mode in certain map thanks Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10266 Posted September 5, 2018 Forum Moderator Share Posted September 5, 2018 I didn't test it, but you can try. //@Srcs\Client\UserInterface\InstanceBase.cpp //@bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) //Search for: if (GetVirtualID() == rkInstVictim.GetVirtualID()) return false; //Add after: if (IsPC() && rkInstVictim.IsPC()) { const std::string & c_rstrMapFileName = CPythonBackground::Instance().GetWarpMapName(); if (!c_rstrMapFileName.compare("MAP_NAME")) return true; } //@Srcs\Server\game\src\pvp.cpp //bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) //Search for: if (pkChr == pkVictim) return false; //Add after: if (pkChr->GetMapIndex() == MAP_INDEX) return true; 2 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 5, 2018 Author Share Posted September 5, 2018 9 hours ago, VegaS™ said: I didn't test it, but you can try. //@Srcs\Client\UserInterface\InstanceBase.cpp //@bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) //Search for: if (GetVirtualID() == rkInstVictim.GetVirtualID()) return false; //Add after: if (IsPC() && rkInstVictim.IsPC()) { const std::string & c_rstrMapFileName = CPythonBackground::Instance().GetWarpMapName(); if (!c_rstrMapFileName.compare("MAP_NAME")) return true; } //@Srcs\Server\game\src\pvp.cpp //bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) //Search for: if (pkChr == pkVictim) return false; //Add after: if (pkChr->GetMapIndex() == MAP_INDEX) return true; thanks Vegas i will test it and post here the result Link to comment Share on other sites More sharing options...
Contributor MrQuin 6400 Posted September 5, 2018 Contributor Share Posted September 5, 2018 Nice idea you could make quest in that map so that anyone dies would teleport automaticly out of it and the last one standing win a prize My only accounts are here and on M2D, Don't trust anyone else from other shitty sites. Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 5, 2018 Author Share Posted September 5, 2018 9 hours ago, MrQuin said: Nice idea you could make quest in that map so that anyone dies would teleport automaticly out of it and the last one standing win a prize exactly Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 6, 2018 Author Share Posted September 6, 2018 *tested works attack but no dmg Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 6, 2018 Author Share Posted September 6, 2018 up Link to comment Share on other sites More sharing options...
ridetpro 116 Posted September 6, 2018 Share Posted September 6, 2018 Acum 3 ore, MaJeStiC a spus: up #delete request , didnt understand the question, Not tested. Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 6, 2018 Author Share Posted September 6, 2018 11 hours ago, ridetpro said: // void CInputLogin::Entergame(LPDESC d, const char* data) // End of the function if (ch->GetMapIndex() == <number>) { ch->SetObserverMode(true); } Not tested. didn't work i ask how to make all players in certain map fight each other, not login in observer mode Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 8, 2018 Author Share Posted September 8, 2018 up Link to comment Share on other sites More sharing options...
Active Member Exygo 1090 Posted September 8, 2018 Active Member Share Posted September 8, 2018 On 9/6/2018 at 5:04 AM, MaJeStiC said: *tested works attack but no dmg Because you need serverside too VegaS is bored and shares cancer EDIT: this is the code that I wrote long time ago(6 Octombrie 2017) for a client (rumble event fight etc) bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) { if (__IsMainInstance()) { CPythonPlayer& rkPlayer=CPythonPlayer::Instance(); if(rkPlayer.IsObserverMode()) return false; } if (GetVirtualID() == rkInstVictim.GetVirtualID()) return false; if (IsStone()) { if (rkInstVictim.IsPC()) return true; } else if (IsPC()) { if (rkInstVictim.IsStone()) return true; if (rkInstVictim.IsPC()) { #ifdef ENABLE_RUMBLE_EVENT std::string strMapName = CPythonBackground::Instance().GetWarpMapName(); if (strMapName == "metin2_map_name") return true; #endif bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim) { // 상대방이 죽었으면 중단한다. if (victim->IsDead()) return false; // 안전지대면 중단 { SECTREE *sectree = NULL; sectree = ch->GetSectree(); if (sectree && sectree->IsAttr(ch->GetX(), ch->GetY(), ATTR_BANPK)) return false; sectree = victim->GetSectree(); if (sectree && sectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) return false; } // 내가 죽었으면 중단한다. if (ch->IsStun() || ch->IsDead()) return false; if (ch->IsPC() && victim->IsPC()) { CGuild* g1 = ch->GetGuild(); CGuild* g2 = victim->GetGuild(); if (g1 && g2) { if (g1->UnderWar(g2->GetID())) return true; } } #ifdef ENABLE_RUMBLE_EVENT // rumble event can attack in a map by Exygo // 6 Octombrie 2017 if (ch->IsPC() && victim->IsPC() && ch->GetMapIndex() == 41) // map index return true; // #endif 4 https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 8, 2018 Author Share Posted September 8, 2018 thanks i will test Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 8, 2018 Author Share Posted September 8, 2018 10 hours ago, Exygo said: Because you need serverside too VegaS is bored and shares cancer EDIT: this is the code that I wrote long time ago(6 Octombrie 2017) for a client (rumble event fight etc) bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) { if (__IsMainInstance()) { CPythonPlayer& rkPlayer=CPythonPlayer::Instance(); if(rkPlayer.IsObserverMode()) return false; } if (GetVirtualID() == rkInstVictim.GetVirtualID()) return false; if (IsStone()) { if (rkInstVictim.IsPC()) return true; } else if (IsPC()) { if (rkInstVictim.IsStone()) return true; if (rkInstVictim.IsPC()) { #ifdef ENABLE_RUMBLE_EVENT std::string strMapName = CPythonBackground::Instance().GetWarpMapName(); if (strMapName == "metin2_map_name") return true; #endif bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim) { // 상대방이 죽었으면 중단한다. if (victim->IsDead()) return false; // 안전지대면 중단 { SECTREE *sectree = NULL; sectree = ch->GetSectree(); if (sectree && sectree->IsAttr(ch->GetX(), ch->GetY(), ATTR_BANPK)) return false; sectree = victim->GetSectree(); if (sectree && sectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) return false; } // 내가 죽었으면 중단한다. if (ch->IsStun() || ch->IsDead()) return false; if (ch->IsPC() && victim->IsPC()) { CGuild* g1 = ch->GetGuild(); CGuild* g2 = victim->GetGuild(); if (g1 && g2) { if (g1->UnderWar(g2->GetID())) return true; } } #ifdef ENABLE_RUMBLE_EVENT // rumble event can attack in a map by Exygo // 6 Octombrie 2017 if (ch->IsPC() && victim->IsPC() && ch->GetMapIndex() == 41) // map index return true; // #endif same result no dmg Link to comment Share on other sites More sharing options...
MaJeStiC 2 Posted September 9, 2018 Author Share Posted September 9, 2018 up Link to comment Share on other sites More sharing options...
Premium msnas 1416 Posted September 9, 2018 Premium Share Posted September 9, 2018 // char_battle.cpp #define MAP_INDEX 3 void CHARACTER::SetPKMode(BYTE bPKMode) { if (bPKMode >= PK_MODE_MAX_NUM) return; if (GetMapIndex() == MAP_INDEX) { if (IsGM()) bPKMode = PK_MODE_PROTECT; else bPKMode = PK_MODE_FREE; } 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