Jump to content

[C++] Add a bonus of alignment


VegaS™
 Share

Recommended Posts

  • 2 years later...
En 9/6/2016 a las 4:30, VegaS™ dijo:

Debes iniciar sesión para ver el contenido del enlace en esta publicación.

A guy asked from other community a tutorial on how to add a bonus of alignment.

Well today I show you a small tutorial that can do that, i not tested.

 

- [ File: /Src/game/affect.h ]

 

#1.) Search:

	AFFECT_BLEND

// 2) After make a new line and paste:

  ALIGNMENT_BONUS_1,
  ALIGNMENT_BONUS_2,

Code for use:

    #ifdef __ALIGNMENT_BONUS__
        if (GetRealAlignment() == NAME_ALIGNMENT_1)
        {
            AddAffect(ALIGNMENT_BONUS_1, POINT_MAX_HP, VALUE_BONUS_ALIGNMENT_1, 0, ALIGNMENT_TIME, 0, true);
        }
        if (GetRealAlignment() == NAME_ALIGNMENT_2)
        {
            AddAffect(ALIGNMENT_BONUS_2, POINT_MAX_HP, VALUE_BONUS_ALIGNMENT_2, 0, ALIGNMENT_TIME, 0, true);
        }
    #endif
#ifdef __ALIGNMENT_BONUS__
	if (FindAffect(ALIGNMENT_BONUS_1))
	{
		if (GetRealAlignment() != NAME_ALIGNMENT_1)
		{ 
			RemoveAffect(ALIGNMENT_BONUS_1);
		} 
	}
#endif

- [ File: /Src/common/service.h ]

    #define    __ALIGNMENT_BONUS__

- [ File: /Src/common/ length .h ]

#ifdef __ALIGNMENT_BONUS__
enum EAlignmentBonus
{
	NAME_ALIGNMENT_1 = 100000
	NAME_ALIGNMENT_2 = 200000,
	
	ALIGNMENT_TIME = 60*60*24*365,
	
	VALUE_BONUS_ALIGNMENT_1 = 1000,
	VALUE_BONUS_ALIGNMENT_2 = 2000,
};
#endif

You can use the code in function ComputePoints() from char.cpp or EnterGame() from input_main.cpp 

Thank you very much for sharing VegaS!
I have a doubt, to make the bonus permanent, that I would have to edit in the code?

Link to comment
Share on other sites

  • 1 month later...
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...