Jump to content

Recommended Posts

Hello, i have one problem, recently i added on server system buff Group, but i have problem with him. 

I can buff peoples who are in group, but i cant buff peoples without group. 

I try fix, but dont work and i cant buff peoples who are not in the group.

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif.html

Please, someone help? 

I added system with https://metin2.dev/board/index.php?/topic/5029-c-party-flag/&page=3

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Love 1
  • Love 1
Link to comment
https://metin2.dev/topic/22590-buff-group/
Share on other sites

in char_skill.cpp


 

//in:
int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel)

//bellow:

    if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
        pkVictim = this;
// #ifdef ENABLE_WOLFMAN_CHARACTER
    // else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY))
        // pkVictim = this;
// #endif

//1-add:

    if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && !GetParty() && !pkVictim)
        pkVictim = this;




//in
bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaster)
  
//below
	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
		pkVictim = this;
#ifdef ENABLE_WOLFMAN_CHARACTER
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY))
		pkVictim = this;
#endif
  
//2-add
	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && !GetParty() && !pkVictim)
		pkVictim = this;



//below
	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
		ComputeSkill(dwVnum, this);	
#ifdef ENABLE_WOLFMAN_CHARACTER
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY))
		ComputeSkillParty(dwVnum, this);
#endif
  
//3-add
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && !GetParty() && !pkVictim)
		ComputeSkill(dwVnum, this);
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && GetParty())
	{
		FPartyPIDCollector f;
		GetParty()->ForEachOnMapMember(f, GetMapIndex());
		for (std::vector <DWORD>::iterator it = f.vecPIDs.begin(); it != f.vecPIDs.end(); it++)
		{
			LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(*it);
			ComputeSkill(dwVnum, ch);
		}
	}

 

and then you have to add the flag "  SKILL_FLAG_PARTY2 " 

 

after that go to your skill proto add new flag "party2 ", then set the skills that you want to be used with and without a group

 

 

the reason why i added new flag is that there are some skills like lycan buff and shaman healing cannot be used to other people without group 

 

 

 

hopefully it fix your problem 

 

 

 

 

  • Love 2
Link to comment
https://metin2.dev/topic/22590-buff-group/#findComment-122537
Share on other sites

10 godzin temu, jeddawee napisał:

in char_skill.cpp


 


//in:
int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel)

//bellow:

    if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
        pkVictim = this;
// #ifdef ENABLE_WOLFMAN_CHARACTER
    // else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY))
        // pkVictim = this;
// #endif

//1-add:

    if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && !GetParty() && !pkVictim)
        pkVictim = this;




//in
bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaster)
  
//below
	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
		pkVictim = this;
#ifdef ENABLE_WOLFMAN_CHARACTER
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY))
		pkVictim = this;
#endif
  
//2-add
	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && !GetParty() && !pkVictim)
		pkVictim = this;



//below
	if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
		ComputeSkill(dwVnum, this);	
#ifdef ENABLE_WOLFMAN_CHARACTER
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY))
		ComputeSkillParty(dwVnum, this);
#endif
  
//3-add
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && !GetParty() && !pkVictim)
		ComputeSkill(dwVnum, this);
	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY2) && GetParty())
	{
		FPartyPIDCollector f;
		GetParty()->ForEachOnMapMember(f, GetMapIndex());
		for (std::vector <DWORD>::iterator it = f.vecPIDs.begin(); it != f.vecPIDs.end(); it++)
		{
			LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(*it);
			ComputeSkill(dwVnum, ch);
		}
	}

 

and then you have to add the flag "  SKILL_FLAG_PARTY2

 

after that go to your skill proto add new flag "party2 ", then set the skills that you want to be used with and without a group

 

 

the reason why i added new flag is that there are some skills like lycan buff and shaman healing cannot be used to other people without group 

 

 

 

hopefully it fix your problem 

 

 

 

 

thank you very much, its work ! :D 

close 

 

Link to comment
https://metin2.dev/topic/22590-buff-group/#findComment-122553
Share on other sites

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.