Jump to content
×
×
  • Create New...

Buffs to All Party Members


Recommended Posts

  • Premium

M2 Download Center

Download Here ( Internal )

 

 

char_skill.cpp search:

	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
		ComputeSkill(dwVnum, this);

add before:

	//Party buff system
	if (GetParty() && (dwVnum == 94 || dwVnum == 95 || dwVnum == 96 || dwVnum == 110 || dwVnum == 111))
	{
		if (pkVictim->GetParty()){
			if (pkVictim->GetParty() == GetParty()){
				ComputeSkillParty(dwVnum, this);
			}
		}
	}

 

  • Metin2 Dev 12
  • Love 21
  • Good 10
  • Scream 1
  • Confused 1
Link to comment
Share on other sites

  • 2 weeks later...
Dnia 9.01.2019 o 16:54, serex napisał:

 

 

char_skill.cpp search:

	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
		ComputeSkill(dwVnum, this);

add before:

	//Party buff system
	if (GetParty() && (dwVnum == 94 || dwVnum == 95 || dwVnum == 96 || dwVnum == 110 || dwVnum == 111))
	{
		if (pkVictim->GetParty()){
			if (pkVictim->GetParty() == GetParty()){
				ComputeSkillParty(dwVnum, this);
			}
		}
	}

 

Hello bro, i don't have "ComputeSkillParty" function in my source so.. can you give me this?

I changed this to "ComputeSkill" but i can buff only on 2 players on group.

Link to comment
Share on other sites

  • Premium
En 19/1/2019 a las 17:47, Zeph dijo:

Hello bro, i don't have "ComputeSkillParty" function in my source so.. can you give me this?

I changed this to "ComputeSkill" but i can buff only on 2 players on group.

struct FComputeSkillParty
{
	FComputeSkillParty(DWORD dwVnum, LPCHARACTER pkAttacker, BYTE bSkillLevel = 0)
		: m_dwVnum(dwVnum), m_pkAttacker(pkAttacker), m_bSkillLevel(bSkillLevel)
		{
		}

	void operator () (LPCHARACTER ch)
	{
		m_pkAttacker->ComputeSkill(m_dwVnum, ch, m_bSkillLevel);
	}

	DWORD m_dwVnum;
	LPCHARACTER m_pkAttacker;
	BYTE m_bSkillLevel;
};

int CHARACTER::ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel)
{
	FComputeSkillParty f(dwVnum, pkVictim, bSkillLevel);
	if (GetParty() && GetParty()->GetNearMemberCount())
		GetParty()->ForEachNearMember(f);
	else
		f(this);

	return BATTLE_NONE;
}

 

Link to comment
Share on other sites

Dnia 21.01.2019 o 11:21, serex napisał:
struct FComputeSkillParty
{
	FComputeSkillParty(DWORD dwVnum, LPCHARACTER pkAttacker, BYTE bSkillLevel = 0)
		: m_dwVnum(dwVnum), m_pkAttacker(pkAttacker), m_bSkillLevel(bSkillLevel)
		{
		}

	void operator () (LPCHARACTER ch)
	{
		m_pkAttacker->ComputeSkill(m_dwVnum, ch, m_bSkillLevel);
	}

	DWORD m_dwVnum;
	LPCHARACTER m_pkAttacker;
	BYTE m_bSkillLevel;
};

int CHARACTER::ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel)
{
	FComputeSkillParty f(dwVnum, pkVictim, bSkillLevel);
	if (GetParty() && GetParty()->GetNearMemberCount())
		GetParty()->ForEachNearMember(f);
	else
		f(this);

	return BATTLE_NONE;
}

 

Thank you ?

Link to comment
Share on other sites

  • 8 months later...
  • Moderator
1 hour ago, sonyc73 said:

after tests is doing crash core, but i don`t know why

There's no check for victim pointer.

// Replace:
if (pkVictim->GetParty())
// With:
if (pkVictim && pkVictim->GetParty())

 

  • Love 2
Link to comment
Share on other sites

  • Bot
On 1/19/2019 at 5:47 PM, Zeph said:

//Party buff system if (GetParty() && (dwVnum == 94 || dwVnum == 95 || dwVnum == 96 || dwVnum == 110 || dwVnum == 111)) { if (pkVictim->GetParty()){ if (pkVictim->GetParty() == GetParty()){ ComputeSkillParty(dwVnum, this); } } }

If you add this, you can give buffs to people who are not in your group:
 

	if (GetParty() && (dwVnum == 94 || dwVnum == 95 || dwVnum == 96 || dwVnum == 109 || dwVnum == 110 || dwVnum == 111))
	{
		if (pkVictim && pkVictim->GetParty())
		{
			if (pkVictim->GetParty() == GetParty())
			{
				if (GetParty()->GetNearMemberCount())
					ComputeSkillParty(dwVnum, this);
				else
					ComputeSkill(dwVnum, pkVictim);
			}
			else
				ComputeSkill(dwVnum, pkVictim);
		}
		else if (pkVictim && !pkVictim->GetParty())
		{
			ComputeSkill(dwVnum, pkVictim);
		}
	}

 

Edited by M2Dev
You can give buffs yourself, if dont have near members on party
  • Love 2
  • Good 1

english_banner.gif

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

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


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.