Jump to content

Recommended Posts

...

    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

  • Premium
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 :D

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

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! :D

Link to comment
Share on other sites

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.