Jump to content

Buffs to All Party Members


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( 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 95
  • Eyes 2
  • Dislove 1
  • Sad 1
  • Cry 1
  • Confused 1
  • Scream 1
  • Good 30
  • Love 3
  • Love 57
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...
  • Forum 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

  • Premium

IWSBcab.png

 

Solved:

in char.h i had the macro for wolfman:

#ifdef ENABLE_WOLFMAN_CHARACTER
        int                    ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel = 0);
#endif

Edited by Metin2 Dev
Core X - External 2 Internal
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
  • Metin2 Dev 1
  • Good 1
  • Love 2

english_banner.gif

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...
  • 7 months later...
  • 6 months later...
  • 7 months later...
  • 2 weeks later...

Announcements



×
×
  • 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.