Zevilke 0 Posted April 7, 2017 Share Posted April 7, 2017 Hy community, I'm working on to make party between different empires. Now i can make the group, but different empire charaters in the group can hurt each others in the group, I hope you can suggest me a solution for this. Thanks Link to comment Share on other sites More sharing options...
Premium North 1171 Posted April 7, 2017 Premium Share Posted April 7, 2017 I did this for my server few time ago, you just have to edit pvp.cpp This: bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) 1 Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 7, 2017 Author Share Posted April 7, 2017 if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { return false; // Cannot attack same party on any pvp model } i found this condition that place, if i'm right, it should have block hurt others, but the problem still alive. Link to comment Share on other sites More sharing options...
Premium North 1171 Posted April 7, 2017 Premium Share Posted April 7, 2017 Try this if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { if (pkChr->GetEmpire() != pkVictim->GetEmpire()) // { return false; } return false; } Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 7, 2017 Author Share Posted April 7, 2017 it's not solved my problem. i can still hit each other. :/ Link to comment Share on other sites More sharing options...
Premium North 1171 Posted April 7, 2017 Premium Share Posted April 7, 2017 Try just below: else { if (pkVictim->IsKillerMode()) { //original return false; return true; } By the way you will still attack but wont do any dmg with this Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 7, 2017 Author Share Posted April 7, 2017 ... if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { if (pkChr->GetEmpire() != pkVictim->GetEmpire()) return false; // Cannot attack same party on any pvp model } else { if (pkVictim->IsKillerMode()) { return true; } if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() >= 0) { if (g_protectNormalPlayer) { // ąüąýŔÚ´Â ĆňȸđµĺŔÎ ÂřÇŃ»ç¶÷Ŕ» °ř°ÝÇŇ Ľö ľř´Ů. if (PK_MODE_PEACE == pkVictim->GetPKMode()) return false; } } switch (pkChr->GetPKMode()) ... here is the part of my function. Your suggestion was there in the else condition, Link to comment Share on other sites More sharing options...
Premium North 1171 Posted April 7, 2017 Premium Share Posted April 7, 2017 yes, with that you can still attack but wont do any dmg, right? im going with my reminds im not 100% sure, if it doesnt work still ill lookup better Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 7, 2017 Author Share Posted April 7, 2017 i take damage. That's funny But thanks the replies. Link to comment Share on other sites More sharing options...
Premium North 1171 Posted April 7, 2017 Premium Share Posted April 7, 2017 try this, look for if (pkChr->GetEmpire() != pkVictim->GetEmpire()) add ABOVE if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { return false; } 1 Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 7, 2017 Author Share Posted April 7, 2017 it's working, i can't take damage for the grouped mate. Is there any solution to avoid the attack? for example if i write a run, it's embrassing when the hit away each others by the way thanks your help, i'm very glad Link to comment Share on other sites More sharing options...
Premium North 1171 Posted April 7, 2017 Premium Share Posted April 7, 2017 16 minutes ago, Zevilke said: it's working, i can't take damage for the grouped mate. Is there any solution to avoid the attack? for example if i write a run, it's embrassing when the hit away each others by the way thanks your help, i'm very glad You should modify other parts, if i get into that i will post here, glad you solved Link to comment Share on other sites More sharing options...
Denis 1474 Posted April 7, 2017 Share Posted April 7, 2017 The attack part is at client src so you need to change that too Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 7, 2017 Author Share Posted April 7, 2017 can you tell me a little closer information Denis Sensei? Link to comment Share on other sites More sharing options...
Zevilke 0 Posted April 14, 2017 Author Share Posted April 14, 2017 Finally i found it. at the client source: InstanceBase.cpp find this: bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) and after if (GetVirtualID() == rkInstVictim.GetVirtualID()) return false; put this two lines: if (IAbstractPlayer::GetSingleton().IsSamePartyMember(GetVirtualID(), rkInstVictim.GetVirtualID())) return false; Hope it will help for all, who want to make the same feature! Link to comment Share on other sites More sharing options...
xDiiZeRx 40 Posted May 15, 2017 Share Posted May 15, 2017 Can you send the feature? The part of the party create too. Please 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