Jump to content
  • 0

Group Leader can give himself the group buff


Xaleas

Question

Hello,

 

I want the group leaders to be able to give themselves a group buff.

 

What i try:

 

(ENABLE_PARTY_BUFF_LEADER)

 

party.cpp

bool CParty::SetRole(DWORD dwPID, BYTE bRole, bool bSet)

Spoiler
bool CParty::SetRole(DWORD dwPID, BYTE bRole, bool bSet)
{
	TMemberMap::iterator it = m_memberMap.find(dwPID);

	if (it == m_memberMap.end())
	{
		return false;
	}

	LPCHARACTER ch = it->second.pCharacter;

	if (bSet)
	{
		if (m_anRoleCount[bRole] >= m_anMaxRole[bRole])
			return false;
#if not defined(ENABLE_PARTY_BUFF_LEADER)
		if (it->second.bRole != PARTY_ROLE_NORMAL)
			return false;
#endif
		it->second.bRole = bRole;

		if (ch && GetLeader())
			ComputeRolePoint(ch, bRole, true);

		if (bRole < PARTY_ROLE_MAX_NUM)
		{
			++m_anRoleCount[bRole];
		}
		else
		{
			sys_err("ROLE_COUNT_INC_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM);
		}
	}
	else
	{
		if (it->second.bRole == PARTY_ROLE_LEADER)
			return false;

		if (it->second.bRole == PARTY_ROLE_NORMAL)
			return false;

		it->second.bRole = PARTY_ROLE_NORMAL;

		if (ch && GetLeader())
			ComputeRolePoint(ch, PARTY_ROLE_NORMAL, false);

		if (bRole < PARTY_ROLE_MAX_NUM)
		{
			--m_anRoleCount[bRole];
		}
		else
		{
			sys_err("ROLE_COUNT_DEC_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM);
		}
	}

	SendPartyInfoOneToAll(dwPID);
	return true;
}

 

 

 

And remove at uiparty.py in (def OnMouseLeftButtonDown(self):) :

Spoiler
		if player.IsPartyLeader(player.GetMainCharacterIndex()):
			if player.PARTY_STATE_LEADER != self.state:

              if self.isShowStateButton:
                  self.__HideStateButton()

              else:
                  self.__ShowStateButton()

to:
  
  		if player.IsPartyLeader(player.GetMainCharacterIndex()):
			# if player.PARTY_STATE_LEADER != self.state:

			if self.isShowStateButton:
				self.__HideStateButton()

			else:
				self.__ShowStateButton()

 

 

I can now give myself a buff but lose the leader rank in the group and thats a big problem.

 

Someone have maybe a idea?

 

Thanks for any help!

 

 

 

 

Link to post

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

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