Jump to content

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 144
  • Eyes 2
  • Dislove 1
  • Sad 1
  • Cry 1
  • Confused 1
  • Scream 1
  • Good 43
  • muscle 1
  • Love 4
  • Love 101
Link to comment
https://metin2.dev/topic/20378-buffs-to-all-party-members/
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
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-110901
Share on other sites

Acum 11 ore, Zeph a spus:

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.

search on wolfman branch

Link to comment
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-110913
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
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-110942
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
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-110965
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
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-119638
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
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-119643
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
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-119778
Share on other sites

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

It doens't seem to work for me, tried computeskillparty withoput party, tried with struct and everything possible I think

https://metin2.download/picture/h6S17UrA171NZ8oRB4n8rSJoWVtC6Jfc/.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-151821
Share on other sites

  • 7 months later...
  • 2 weeks later...
  • Developer

I did a small refactory, not tested yet:

This is the hidden content, please

Edited by Mitachi
  • Metin2 Dev 70
  • kekw 1
  • Good 22
  • muscle 1
  • Love 3
  • Love 38

Villains are not born, they are made.
Join

Link to comment
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-157364
Share on other sites

  • 1 year later...

Thanks for sharing!

This might be a stupid question, but when you look at the definition of `int CHARACTER::ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel)`, it  expects 3 input arguments, but you called it with only two arguments: `ComputeSkillParty(dwVnum, this);`
Did I miss something? Wouldn't  `BYTE bSkillLevel = GetSkillLevel(dwVnum); for calling it again like `ComputeSkillParty(dwVnum, this,bSkillLevel);` be required?

Thanks in advance!

Link to comment
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-168905
Share on other sites

  • Developer
On 1/3/2025 at 12:26 PM, im4x8061 said:

Thanks for sharing!

This might be a stupid question, but when you look at the definition of `int CHARACTER::ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel)`, it  expects 3 input arguments, but you called it with only two arguments: `ComputeSkillParty(dwVnum, this);`
Did I miss something? Wouldn't  `BYTE bSkillLevel = GetSkillLevel(dwVnum); for calling it again like `ComputeSkillParty(dwVnum, this,bSkillLevel);` be required?

Thanks in advance!

In the declaration, bSkillLevel is initialized to 0:

int ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel = 0);

This means that you can avoid passing the 3rd param, 'cause it will be automatically filled with 0.

Then, call ::ComputeSkill, which in case of (0 == bSkillLevel) will already call ::GetSkillLevel:

// from ::ComputeSkill(..)
	if (0 == bSkillLevel)
	{
		if ((bSkillLevel = GetSkillLevel(pkSk->dwVnum)) == 0)
		{
			if (test_server)
				sys_log(0, "ComputeSkill : name:%s vnum:%d  skillLevelBySkill : %d ", GetName(), pkSk->dwVnum, bSkillLevel);
			return BATTLE_NONE;
		}
	}

Don't worry, you can always ask questions, that's what the forum is for

  • Good 1

Villains are not born, they are made.
Join

Link to comment
https://metin2.dev/topic/20378-buffs-to-all-party-members/#findComment-168926
Share on other sites

  • 4 months later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

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.