<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Adding_new_statuses</id>
		<title>Adding new statuses - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Adding_new_statuses"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Adding_new_statuses&amp;action=history"/>
		<updated>2026-05-02T03:14:59Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Adding_new_statuses&amp;diff=813&amp;oldid=prev</id>
		<title>Sevenzz23 at 12:06, 25 December 2013</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Adding_new_statuses&amp;diff=813&amp;oldid=prev"/>
				<updated>2013-12-25T12:06:54Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:06, 25 December 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Status effect immunity ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Status effect immunity ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;	undead_flag = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;battle_check_undead&lt;/del&gt;(status-&amp;gt;race,status-&amp;gt;def_ele);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;	undead_flag = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;battle-&amp;gt;check_undead&lt;/ins&gt;(status-&amp;gt;race,status-&amp;gt;def_ele);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	//Check for inmunities / sc fails&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	//Check for inmunities / sc fails&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	switch (type)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	switch (type)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 69:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 69:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Jump to the function ''status_calc_hit'':&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Jump to the function ''status_calc_hit'':&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;	if(sc-&amp;gt;data[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;SC_MERC_HITUP&lt;/del&gt;])&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;	if(sc-&amp;gt;data[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SC_MERC_HIT&lt;/ins&gt;])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		hit += sc-&amp;gt;data[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;SC_MERC_HITUP&lt;/del&gt;]-&amp;gt;val2;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		hit += sc-&amp;gt;data[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SC_MERC_HIT&lt;/ins&gt;]-&amp;gt;val2;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you can see, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;SC_MERC_HITUP &lt;/del&gt;directly influences the HIT rate as calculated in ''status_calc_hit''. We can add a custom code which will also modify HIT, such as below:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you can see, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SC_MERC_HIT &lt;/ins&gt;directly influences the HIT rate as calculated in ''status_calc_hit''. We can add a custom code which will also modify HIT, such as below:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;	if(sc-&amp;gt;data[SC_CUSTOMSTATUS])&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;	if(sc-&amp;gt;data[SC_CUSTOMSTATUS])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sevenzz23</name></author>	</entry>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Adding_new_statuses&amp;diff=191&amp;oldid=prev</id>
		<title>Nameless2you: Created page with &quot;== Information ==  When modifying your server, the time may come when you need to add or ammend status effects, and the bonuses or the 'scripts' that they provide. To do so, w...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Adding_new_statuses&amp;diff=191&amp;oldid=prev"/>
				<updated>2013-01-14T05:01:59Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Information ==  When modifying your server, the time may come when you need to add or ammend status effects, and the bonuses or the &amp;#039;scripts&amp;#039; that they provide. To do so, w...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Information ==&lt;br /&gt;
&lt;br /&gt;
When modifying your server, the time may come when you need to add or ammend status effects, and the bonuses or the 'scripts' that they provide. To do so, will require some source modifications, but will result in the ability to create and initialize status effects.&lt;br /&gt;
&lt;br /&gt;
== Open {{git|src/map/status.h}} ==&lt;br /&gt;
&lt;br /&gt;
You will notice a large enumerator called &amp;quot;sc_type&amp;quot;, which defines the different statuses. When creating a new status, we need to move to the ''end'' of the enumerator, and add a custom SC type like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	SC_HELLPOWER = 294,&lt;br /&gt;
	SC_INVINCIBLE, //295&lt;br /&gt;
	SC_INVINCIBLEOFF,&lt;br /&gt;
	SC_CUSTOMSTATUS, // This is our custom status effect&lt;br /&gt;
&lt;br /&gt;
	SC_MAX, //Automatically updated max, used in for's to check we are within bounds.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that SC_CUSTOMSTATUS is placed ''before'' the SC_MAX entry. Any new status effects must be placed before SC_MAX and preceed with a comma. Here we have declared a new status effect, so we can now move onto use it.&lt;br /&gt;
&lt;br /&gt;
== Open {{git|src/map/status.c}} ==&lt;br /&gt;
&lt;br /&gt;
Jump to the function ''status_change_start'':&lt;br /&gt;
&lt;br /&gt;
=== Status effect immunity ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	undead_flag = battle_check_undead(status-&amp;gt;race,status-&amp;gt;def_ele);&lt;br /&gt;
	//Check for inmunities / sc fails&lt;br /&gt;
	switch (type)&lt;br /&gt;
	{&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This block is where we actually perform any checks, such as circumstances which disallow a status from being used.&lt;br /&gt;
For example, let's say that SC_CUSTOMSTATUS cannot be inflicted when the target has SC_BLIND active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	case SC_CUSTOMSTATUS:&lt;br /&gt;
		if(sc-&amp;gt;data[SC_BLIND])&lt;br /&gt;
			return 0;&lt;br /&gt;
	break;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now, if the target has SC_BLIND active, the status will not be inflicted at all.&lt;br /&gt;
&lt;br /&gt;
=== Status effect curing ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	//Before overlapping fail, one must check for status cured.&lt;br /&gt;
	switch (type)&lt;br /&gt;
	{&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This block actually cancels ''other'' status effects if your status effect is being activated. Like the above, it's not necessary, but let's say that SC_CUSTOMSTATUS ''removes'' SC_BLIND.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	case SC_CUSTOMSTATUS:&lt;br /&gt;
		status_change_end(bl, SC_BLIND, -1);&lt;br /&gt;
		break;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As simple as that, now whenever SC_CUSTOMSTATUS is inflicted, SC_BLIND will be removed.&lt;br /&gt;
&lt;br /&gt;
=== val1, val2, val3 and val4 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;		case SC_REBIRTH:&lt;br /&gt;
			val2 = 20*val1; //% of life to be revived with&lt;br /&gt;
			break;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find this piece of code, it means you're in the actual block which manipulates val1, val2, val3, val4 and tick. This is especially useful when altering status effects that have been initialized by skills.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;		case SC_CUSTOMSTATUS:&lt;br /&gt;
			val2 = val1 * 30; // HIT reduced by 30 per val1.&lt;br /&gt;
			break;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this block of code, we set the 'val2' property of SC_CUSTOMSTATUS to ''val1 * 30''. Therefore, if val1 is set to 1, val2 is 30, is val1 is set to 2, val2 is 60. Usually, skills pass '''skill_lv''' (the level of the skill used) into val1, which means you can adjust the settings for val2, val3 and val4 based on the skill level used.&lt;br /&gt;
&lt;br /&gt;
=== Using the status effect ===&lt;br /&gt;
&lt;br /&gt;
Jump to the function ''status_calc_hit'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	if(sc-&amp;gt;data[SC_MERC_HITUP])&lt;br /&gt;
		hit += sc-&amp;gt;data[SC_MERC_HITUP]-&amp;gt;val2;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, SC_MERC_HITUP directly influences the HIT rate as calculated in ''status_calc_hit''. We can add a custom code which will also modify HIT, such as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	if(sc-&amp;gt;data[SC_CUSTOMSTATUS])&lt;br /&gt;
		hit -= sc-&amp;gt;data[SC_CUSTOMSTATUS]-&amp;gt;val2;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that HIT will be decreased by whatever value is in val2 (as calculated in ''status_change_start'').&lt;br /&gt;
&lt;br /&gt;
== Open {{git|db/const.txt}} ==&lt;br /&gt;
&lt;br /&gt;
=== Implementing ===&lt;br /&gt;
&lt;br /&gt;
Find&lt;br /&gt;
&amp;lt;pre&amp;gt;SC_INVINCIBLEOFF&amp;lt;tab&amp;gt;296&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add below&lt;br /&gt;
&amp;lt;pre&amp;gt;SC_CUSTOMSTATUS&amp;lt;tab&amp;gt;297&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And there you go. The status effect ''SC_CUSTOMSTATUS'' is now ready for use.&lt;br /&gt;
&lt;br /&gt;
=== Using the status ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sc_start SC_CUSTOMSTATUS, 60000, 2;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will start SC_CUSTOMSTATUS, it will last for 60 seconds and it will remove SC_BLIND if it is active.&lt;br /&gt;
The '2' is the ''val1'' entry, which means that ''val2 = 2 * 30;'', which will cause HIT to be decreased by 60 for 60 seconds.&lt;br /&gt;
&lt;br /&gt;
[[Category:Source Snippets]]&lt;br /&gt;
[[Category:Customization]]&lt;/div&gt;</summary>
		<author><name>Nameless2you</name></author>	</entry>

	</feed>