Jump to content
  • 0

Magnificat Skill Modification Adds % MaxHP


Question

Posted

Hello, i would like to ask/request a modification for magnificat skill during the skill effect i want to have an additional effect to increase HP by % until the magnificat duration is finish it will be gone aswell.

TIA.

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

find in status.c

static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp)

and after 

int rate = 100;

add this code below.

int myrate = 20; // 100 = 100%

if (sc->data[SC_MAGNIFICAT])
	maxhp += maxhp * myrate / 100;

so that your code would look like
 

/**
 * Calculates a max HP based on status changes
 * Values can either be percentages or fixed, based on how equations are formulated
 * @param bl: Object's block_list data
 * @param maxhp: Object's current max HP
 * @return modified maxhp
 */
static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp)
{
	int rate = 100;
	int myrate = 20; // 100 = 100%
	
	if (sc->data[SC_MAGNIFICAT])
		maxhp += maxhp * myrate / 100;
	
	maxhp += status_get_hpbonus(bl,STATUS_BONUS_FIX);

	if ((rate += status_get_hpbonus(bl,STATUS_BONUS_RATE)) != 100)
		maxhp = maxhp * rate / 100;

	return (unsigned int)cap_value(maxhp,1,UINT_MAX);
}

Recompile.


Edit:
This is un-tested code but should probably work. Please provide feedback if anything fails. 

Edited by Jhedzkie
comment
  • 0
Posted (edited)

i know this is painfully late, but it's quite simple. i do the same thing for angelus, so you can just copy my angelus code. find the section in status.c where apple of idun increases max health, and add an entry for your SC effect as such :

 

7wJBlyu.png

in this equation, sc->data[SC_ANGELUS]->val1 is the level of skill being used. 10 * sc->data[SC_ANGELUS]->val1 is a 10 flat health per level, whereas maxhp * sc->data[SC_ANGELUS]->val1 / 100 is 1% more max health per level. 

 

then, you have to tell the source to update your max HP when it interacts with your skill, as such:

 

wVL8ois.png

 

you add the SCB_MAXHP at the end with the rest of the SCB effects for your skill so that it knows to update your max health when this status is in play. you have to do this for any skill that you change the stat bonuses for, or your changes will not work.

 

peace

Edited by blinzer

Join the conversation

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

Guest
Answer this question...

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

  • Recently Browsing   0 members

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