Jump to content
×
×
  • Create New...
  • 0

[C++] Party


Zevilke

Question

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

15 answers to this question

Recommended Posts

  • 0

    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

  • 0
  • Premium

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

  • 0
  • Premium

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

  • 0

...

    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

  • 0
  • Premium

try this, look for    

if (pkChr->GetEmpire() != pkVictim->GetEmpire())

add ABOVE

if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { return false; }

  • Love 1
Link to comment
Share on other sites

  • 0

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

 

Link to comment
Share on other sites

  • 0
  • 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

  • 0

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.