Jump to content
  • 0

How to not remove a custom SC effect during death?


Lord Ganja

Question


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

I created a new status effect (SC). And I wanted it not to be removed during death. How do I do it? Thanks in advance!


EDIT: Nvmind. Found it. I added it on source int status_change_clear

Edited by Lord Ganja
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

Go to status.c, find this line:

int status_change_clear(struct block_list* bl, int type)

Above this, will have some commented lines explaining:
 

/**
 * End all statuses except those listed
 * TODO: May be useful for dispel instead resetting a list there
 * @param src: Source of the status change [PC|MOB|HOM|MER|ELEM|NPC]
 * @param type: Changes behaviour of the function
 * 	0: PC killed -> Place here statuses that do not dispel on death.
 * 	1: If for some reason status_change_end decides to still keep the status when quitting.
 * 	2: Do clif_changeoption()
 * 	3: Do not remove some permanent/time-independent effects
 * @return 1: Success 0: Fail
 */

So, just below it, there's a list that's start like:
 

		if(type == 0) {
			switch (i) { // Type 0: PC killed -> Place here statuses that do not dispel on death.
			case SC_ELEMENTALCHANGE: // Only when its Holy or Dark that it doesn't dispell on death
				if( sc->data[i]->val2 != ELE_HOLY && sc->data[i]->val2 != ELE_DARK )
					break;
			case SC_WEIGHT50:
			case SC_WEIGHT90:
			case SC_EDP:
			case SC_MELTDOWN:
			case SC_WEDDING:
			case SC_XMAS:
			case SC_SUMMER:
			case SC_HANBOK:
			case SC_OKTOBERFEST:
			case SC_NOCHAT:
			case SC_FUSION:
			case SC_EARTHSCROLL:
			case SC_READYSTORM:
			case SC_READYDOWN:
			case SC_READYCOUNTER:
			case SC_READYTURN:
			case SC_DODGE:
			case SC_JAILED:
			case SC_EXPBOOST:
			case SC_ITEMBOOST:
			case SC_HELLPOWER:
			case SC_JEXPBOOST:
			case SC_AUTOTRADE:
			case SC_AUTOREFRESH:
			case SC_WHISTLE:
			case SC_ASSNCROS:
			case SC_POEMBRAGI:
			case SC_APPLEIDUN:
			case SC_HUMMING:
			case SC_DONTFORGETME:
			case SC_FORTUNE:
			case SC_SERVICE4U:
			case SC_FOOD_STR_CASH:
			case SC_FOOD_AGI_CASH:
			case SC_FOOD_VIT_CASH:
			case SC_FOOD_DEX_CASH:
			case SC_FOOD_INT_CASH:
			case SC_FOOD_LUK_CASH:
			case SC_SAVAGE_STEAK:
			case SC_COCKTAIL_WARG_BLOOD:
			case SC_MINOR_BBQ:
			case SC_SIROMA_ICE_TEA:
			case SC_DROCERA_HERB_STEAMED:
			case SC_PUTTI_TAILS_NOODLES:
			case SC_DEF_RATE:
			case SC_MDEF_RATE:
			case SC_INCHEALRATE:
			case SC_INCFLEE2:
			case SC_INCHIT:
			case SC_ATKPOTION:
			case SC_MATKPOTION:
			case SC_S_LIFEPOTION:
			case SC_L_LIFEPOTION:
			case SC_PUSH_CART:
			case SC_ALL_RIDING:
			case SC_LIGHT_OF_REGENE:
			case SC_STYLE_CHANGE:
			case SC_MOONSTAR:
			case SC_SUPER_STAR:
			case SC_HEAT_BARREL_AFTER:
			case SC_STRANGELIGHTS:
			case SC_DECORATION_OF_MUSIC:
			case SC_QUEST_BUFF1:
			case SC_QUEST_BUFF2:
			case SC_QUEST_BUFF3:
			case SC_2011RWC_SCROLL:
			case SC_JP_EVENT04:
				continue;
			}
		}

Add it before continue;

...
			case SC_QUEST_BUFF3:
			case SC_2011RWC_SCROLL:
			case SC_JP_EVENT04:
			case SC_MYCUSTOMSTATUS:
				continue;
			}
		}

Then, recompile.

Also, before making a thread, use the Search Tool.
Your question has been answered here.

Edited by Haziel
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

Go to status.c, find this line:

int status_change_clear(struct block_list* bl, int type)

Above this, will have some commented lines explaining:

 

/**
 * End all statuses except those listed
 * TODO: May be useful for dispel instead resetting a list there
 * @param src: Source of the status change [PC|MOB|HOM|MER|ELEM|NPC]
 * @param type: Changes behaviour of the function
 * 	0: PC killed -> Place here statuses that do not dispel on death.
 * 	1: If for some reason status_change_end decides to still keep the status when quitting.
 * 	2: Do clif_changeoption()
 * 	3: Do not remove some permanent/time-independent effects
 * @return 1: Success 0: Fail
 */

So, just below it, there's a list that's start like:

 

		if(type == 0) {
			switch (i) { // Type 0: PC killed -> Place here statuses that do not dispel on death.
			case SC_ELEMENTALCHANGE: // Only when its Holy or Dark that it doesn't dispell on death
				if( sc->data[i]->val2 != ELE_HOLY && sc->data[i]->val2 != ELE_DARK )
					break;
			case SC_WEIGHT50:
			case SC_WEIGHT90:
			case SC_EDP:
			case SC_MELTDOWN:
			case SC_WEDDING:
			case SC_XMAS:
			case SC_SUMMER:
			case SC_HANBOK:
			case SC_OKTOBERFEST:
			case SC_NOCHAT:
			case SC_FUSION:
			case SC_EARTHSCROLL:
			case SC_READYSTORM:
			case SC_READYDOWN:
			case SC_READYCOUNTER:
			case SC_READYTURN:
			case SC_DODGE:
			case SC_JAILED:
			case SC_EXPBOOST:
			case SC_ITEMBOOST:
			case SC_HELLPOWER:
			case SC_JEXPBOOST:
			case SC_AUTOTRADE:
			case SC_AUTOREFRESH:
			case SC_WHISTLE:
			case SC_ASSNCROS:
			case SC_POEMBRAGI:
			case SC_APPLEIDUN:
			case SC_HUMMING:
			case SC_DONTFORGETME:
			case SC_FORTUNE:
			case SC_SERVICE4U:
			case SC_FOOD_STR_CASH:
			case SC_FOOD_AGI_CASH:
			case SC_FOOD_VIT_CASH:
			case SC_FOOD_DEX_CASH:
			case SC_FOOD_INT_CASH:
			case SC_FOOD_LUK_CASH:
			case SC_SAVAGE_STEAK:
			case SC_COCKTAIL_WARG_BLOOD:
			case SC_MINOR_BBQ:
			case SC_SIROMA_ICE_TEA:
			case SC_DROCERA_HERB_STEAMED:
			case SC_PUTTI_TAILS_NOODLES:
			case SC_DEF_RATE:
			case SC_MDEF_RATE:
			case SC_INCHEALRATE:
			case SC_INCFLEE2:
			case SC_INCHIT:
			case SC_ATKPOTION:
			case SC_MATKPOTION:
			case SC_S_LIFEPOTION:
			case SC_L_LIFEPOTION:
			case SC_PUSH_CART:
			case SC_ALL_RIDING:
			case SC_LIGHT_OF_REGENE:
			case SC_STYLE_CHANGE:
			case SC_MOONSTAR:
			case SC_SUPER_STAR:
			case SC_HEAT_BARREL_AFTER:
			case SC_STRANGELIGHTS:
			case SC_DECORATION_OF_MUSIC:
			case SC_QUEST_BUFF1:
			case SC_QUEST_BUFF2:
			case SC_QUEST_BUFF3:
			case SC_2011RWC_SCROLL:
			case SC_JP_EVENT04:
				continue;
			}
		}

Add it before continue;

...
			case SC_QUEST_BUFF3:
			case SC_2011RWC_SCROLL:
			case SC_JP_EVENT04:
			case SC_MYCUSTOMSTATUS:
				continue;
			}
		}

Then, recompile.

Also, before making a thread, use the Search Tool.

Your question has been answered here.

I've already answered my question before you posted. But thanks anyway xD

Edited by Lord Ganja
Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

Three minutes before, it means, I was typing when you edited your post. ~

Link to comment
Share on other sites

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.

×
×
  • Create New...