Jump to content
×
×
  • Create New...

[SEARCH] C++ Coder for Group System like Shiro3


TekkForCe

Recommended Posts

  • Honorable Member

You have to add a button which set the new distibution mode(2) for party and extend the switch with a new case.

party.h

enum EPartyExpDistributionModes
{
	PARTY_EXP_DISTRIBUTION_NON_PARITY,
	PARTY_EXP_DISTRIBUTION_PARITY,
	PARTY_EXP_DISTRIBUTION_EQUAL,
	PARTY_EXP_DISTRIBUTION_MAX_NUM
};

char_battle.cpp

	struct FPartyDistributor
	{
		int		total;
		LPCHARACTER	c;
		int		x, y;
		DWORD		_iExp;
		int		m_iMode;
		int		m_iMemberCount;

		FPartyDistributor(LPCHARACTER center, int member_count, int total, DWORD iExp, int iMode)
			: total(total), c(center), x(center->GetX()), y(center->GetY()), _iExp(iExp), m_iMode(iMode), m_iMemberCount(member_count)
			{
				if (m_iMemberCount == 0)
					m_iMemberCount = 1;
			};

		void operator () (LPCHARACTER ch)
		{
			if (DISTANCE_APPROX(ch->GetX() - x, ch->GetY() - y) <= PARTY_DEFAULT_RANGE)
			{
				DWORD iExp2 = 0;

				switch (m_iMode)
				{
					case PARTY_EXP_DISTRIBUTION_NON_PARITY:
						iExp2 = (DWORD) (_iExp * (float) __GetPartyExpNP(ch->GetLevel()) / total);
						break;

					case PARTY_EXP_DISTRIBUTION_PARITY:
						iExp2 = _iExp / m_iMemberCount;
						break;

					case PARTY_EXP_DISTRIBUTION_EQUAL:
						iExp2 = _iExp;
						break;

					default:
						sys_err("Unknown party exp distribution mode %d", m_iMode);
						return;
				}

				GiveExp(c, ch, iExp2);
			}
		}
	};

 

 

  • Love 5
Link to comment

"Part python" fucking easy here (example): you need to duplicate other func haha

		if app.PARTY_EXP_DISTRIBUTION_EQUAL:
			partyEqual = ui.RadioButton()
			partyEqual.SetParent(self)
			partyEqual.SetWindowHorizontalAlignCenter()
			partyEqual.SetEvent(ui.__mem_func__(self.OnClickEXPDistributeEqual))
			partyEqual.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
			partyEqual.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
			partyEqual.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
			partyEqual.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_EQUAL)
			partyEqual.SetToolTipText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_EQUAL_TOOLTIP, 70)
			partyEqual.Show()
			self.modeButtonList[player.PARTY_EXP_DISTRIBUTION_EQUAL] = partyEqual
	if app.PARTY_EXP_DISTRIBUTION_EQUAL:
		def OnClickEXPDistributeEqual(self):
			self.__SetModeButton(self.distributionMode)
			if self.isLeader:
				net.SendPartyParameterPacket(player.PARTY_EXP_DISTRIBUTION_EQUAL)
		if app.PARTY_EXP_DISTRIBUTION_EQUAL:
			partyMenu.SetSize(106, 70 + 70 + 30)
		else:
			partyMenu.SetSize(106, 70 + 70)

 

  • Love 5
Link to comment
  • 2 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


  • Read our Rules
  • Activity

    1. 1

      Fix CursorImage 'NoneType' object is not callable.

    2. 0

      [Land of Heroes] We are looking for Game / Game Economy Designers

    3. 177

      Render Target Remastered

    4. 1

      MySQL stop when start server

    5. 0

    6. 59

      Emoji in TextLine

    7. 1

      MySQL stop when start server

  • Recently Browsing

    No registered users viewing this page.

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.