<?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/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Poison</id>
		<title>Hercules Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Poison"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/wiki/Special:Contributions/Poison"/>
		<updated>2026-05-03T04:39:04Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/wiki/Adding_a_Script</id>
		<title>Adding a Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/wiki/Adding_a_Script"/>
				<updated>2014-07-07T03:43:13Z</updated>
		
		<summary type="html">&lt;p&gt;Poison: /* Configuration Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Adding and Activating Scripts ==&lt;br /&gt;
Scripts are usually kept in the ''npc'' folder for the sake of organization even though scripts can contain more than a mere NPC.  All files are saved as text files.  Scripts cannot be loaded on to the server unless their text file is activated in a *.conf file.&lt;br /&gt;
&lt;br /&gt;
=== A New Script ===&lt;br /&gt;
New scripts must be saved as a text file first.  The file may be located anywhere in the Hercules directory, but is in the ''npc'' folder by default.&lt;br /&gt;
&lt;br /&gt;
=== Configuration Files ===&lt;br /&gt;
Any text editor may be used to edit *.conf files.  The ''npc/*.conf'' files are used to determine which script text files should be loaded.  There are about a dozen *.conf that handle different groups of scripts for the purpose of organization.  It does not matter which *.conf holds your custom scripts as long as the path is correct.&lt;br /&gt;
&lt;br /&gt;
Typical *.conf entry layout:&lt;br /&gt;
 npc: npc/path/to/yourscript1.txt&lt;br /&gt;
 // npc: npc/path/to/yourscript2.txt&lt;br /&gt;
Note how the second line is preceded with a double slash.  Content on the same line after double slashes will not be parsed.  In other words, ''script2.txt'' will not be loaded.  The slashes can be used to write comments.&lt;br /&gt;
&lt;br /&gt;
{{git|npc/pre-re/scripts_main.conf}} or {{git|npc/re/scripts_main.conf}} determines which of the *.conf will be read by the server.&lt;br /&gt;
 import: npc/path/to/configuration.conf&lt;br /&gt;
&lt;br /&gt;
=== The NPC in Game ===&lt;br /&gt;
After adding the script, it must be loaded before the script contents take effect in game.  There are a few ways to do this.&lt;br /&gt;
* The map server can be rebooted.  This is generally the safest route though not the most convenient for active servers.&lt;br /&gt;
* The GM command '''@reloadscript''' maybe used in game, though this may cause monster spawn bugs.&lt;br /&gt;
* If a script needs to be reloaded because it has been edited, the GM commands '''@loadnpc''' and '''@unloadnpc''' may be used.  This method is not convenient for script texts that contain multiple NPCs.&lt;br /&gt;
&lt;br /&gt;
== Client Side ==&lt;br /&gt;
The NPC name used in examples is &amp;quot;Teddy&amp;quot;.&lt;br /&gt;
===Lua===&lt;br /&gt;
The two files you will need to open and edit are &amp;quot;jobname.lua&amp;quot; and &amp;quot;npcidentity.lua&amp;quot;. Jobname.lua will look like:&lt;br /&gt;
&lt;br /&gt;
 	[jobtbl.NPCNAME] = &amp;quot;NPCNAME&amp;quot;,&lt;br /&gt;
Example:&lt;br /&gt;
 	[jobtbl.TEDDY] = &amp;quot;TEDDY&amp;quot;,&lt;br /&gt;
npcidentity.lua will look like:&lt;br /&gt;
 	[&amp;quot;NPCNAME&amp;quot;] = NPCID,&lt;br /&gt;
Example:&lt;br /&gt;
 	[&amp;quot;TEDDY&amp;quot;] = 587,&lt;br /&gt;
If your NPC has spaces in its name, its best to either remove them or replace them with underscores. So if the NPC's name was Brown Teddy the sprite's name would be Brown_Teddy.spr or BrownTeddy.spr and the lua files would be BROWN_TEDDY or BROWNTEDDY. Whatever ID you choose for your sprite, either NPC Sprite name(Case-Sensitive, In Capital Letters) or ID will be use in the script. The beginning of my script will look like:&lt;br /&gt;
&lt;br /&gt;
 	xmas_in,111,107,3	script	Teddy	587,{&lt;br /&gt;
 	xmas_in,111,107,3	script	Teddy	TEDDY,{&lt;br /&gt;
&lt;br /&gt;
===Sprite===&lt;br /&gt;
The sprite part is straightforward, just Teddy.spr is fine, you don't need Teddy_m.spr or anything like that, but if you want to add m for male to the name you can do that, but it won't effect its functionality in-game. NPC sprites are located in data/sprite/npc.&lt;br /&gt;
&lt;br /&gt;
== Tips &amp;amp; Hints ==&lt;br /&gt;
* If you are copy/pasting a script from a forum, be sure to check that the tabs are still intact.&lt;br /&gt;
* Remember that paths and file names are case sensitive.&lt;br /&gt;
* Remember to save after editing.&lt;br /&gt;
* Create your own NPC folder and *.conf file.  This will make it much easier to keep track of your own scripts and can reduce the hassle when merging new revisions of Hercules.  Follow the basic layout of the other *.conf files and remember to import the *.conf in {{git|npc/scripts_main.conf}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>Poison</name></author>	</entry>

	<entry>
		<id>https://wiki.herc.ws/wiki/Adding_a_Script</id>
		<title>Adding a Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/wiki/Adding_a_Script"/>
				<updated>2014-07-07T03:42:32Z</updated>
		
		<summary type="html">&lt;p&gt;Poison: /* Configuration Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Adding and Activating Scripts ==&lt;br /&gt;
Scripts are usually kept in the ''npc'' folder for the sake of organization even though scripts can contain more than a mere NPC.  All files are saved as text files.  Scripts cannot be loaded on to the server unless their text file is activated in a *.conf file.&lt;br /&gt;
&lt;br /&gt;
=== A New Script ===&lt;br /&gt;
New scripts must be saved as a text file first.  The file may be located anywhere in the Hercules directory, but is in the ''npc'' folder by default.&lt;br /&gt;
&lt;br /&gt;
=== Configuration Files ===&lt;br /&gt;
Any text editor may be used to edit *.conf files.  The ''npc/*.conf'' files are used to determine which script text files should be loaded.  There are about a dozen *.conf that handle different groups of scripts for the purpose of organization.  It does not matter which *.conf holds your custom scripts as long as the path is correct.&lt;br /&gt;
&lt;br /&gt;
Typical *.conf entry layout:&lt;br /&gt;
 npc: npc/path/to/yourscript1.txt&lt;br /&gt;
 // npc: npc/path/to/yourscript2.txt&lt;br /&gt;
Note how the second line is preceded with a double slash.  Content on the same line after double slashes will not be parsed.  In other words, ''script2.txt'' will not be loaded.  The slashes can be used to write comments.&lt;br /&gt;
&lt;br /&gt;
{{git|npc/pre-re/scripts_main.conf or npc/re/scripts_main.conf}} determines which of the *.conf will be read by the server.&lt;br /&gt;
 import: npc/path/to/configuration.conf&lt;br /&gt;
&lt;br /&gt;
=== The NPC in Game ===&lt;br /&gt;
After adding the script, it must be loaded before the script contents take effect in game.  There are a few ways to do this.&lt;br /&gt;
* The map server can be rebooted.  This is generally the safest route though not the most convenient for active servers.&lt;br /&gt;
* The GM command '''@reloadscript''' maybe used in game, though this may cause monster spawn bugs.&lt;br /&gt;
* If a script needs to be reloaded because it has been edited, the GM commands '''@loadnpc''' and '''@unloadnpc''' may be used.  This method is not convenient for script texts that contain multiple NPCs.&lt;br /&gt;
&lt;br /&gt;
== Client Side ==&lt;br /&gt;
The NPC name used in examples is &amp;quot;Teddy&amp;quot;.&lt;br /&gt;
===Lua===&lt;br /&gt;
The two files you will need to open and edit are &amp;quot;jobname.lua&amp;quot; and &amp;quot;npcidentity.lua&amp;quot;. Jobname.lua will look like:&lt;br /&gt;
&lt;br /&gt;
 	[jobtbl.NPCNAME] = &amp;quot;NPCNAME&amp;quot;,&lt;br /&gt;
Example:&lt;br /&gt;
 	[jobtbl.TEDDY] = &amp;quot;TEDDY&amp;quot;,&lt;br /&gt;
npcidentity.lua will look like:&lt;br /&gt;
 	[&amp;quot;NPCNAME&amp;quot;] = NPCID,&lt;br /&gt;
Example:&lt;br /&gt;
 	[&amp;quot;TEDDY&amp;quot;] = 587,&lt;br /&gt;
If your NPC has spaces in its name, its best to either remove them or replace them with underscores. So if the NPC's name was Brown Teddy the sprite's name would be Brown_Teddy.spr or BrownTeddy.spr and the lua files would be BROWN_TEDDY or BROWNTEDDY. Whatever ID you choose for your sprite, either NPC Sprite name(Case-Sensitive, In Capital Letters) or ID will be use in the script. The beginning of my script will look like:&lt;br /&gt;
&lt;br /&gt;
 	xmas_in,111,107,3	script	Teddy	587,{&lt;br /&gt;
 	xmas_in,111,107,3	script	Teddy	TEDDY,{&lt;br /&gt;
&lt;br /&gt;
===Sprite===&lt;br /&gt;
The sprite part is straightforward, just Teddy.spr is fine, you don't need Teddy_m.spr or anything like that, but if you want to add m for male to the name you can do that, but it won't effect its functionality in-game. NPC sprites are located in data/sprite/npc.&lt;br /&gt;
&lt;br /&gt;
== Tips &amp;amp; Hints ==&lt;br /&gt;
* If you are copy/pasting a script from a forum, be sure to check that the tabs are still intact.&lt;br /&gt;
* Remember that paths and file names are case sensitive.&lt;br /&gt;
* Remember to save after editing.&lt;br /&gt;
* Create your own NPC folder and *.conf file.  This will make it much easier to keep track of your own scripts and can reduce the hassle when merging new revisions of Hercules.  Follow the basic layout of the other *.conf files and remember to import the *.conf in {{git|npc/scripts_main.conf}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>Poison</name></author>	</entry>

	<entry>
		<id>https://wiki.herc.ws/wiki/Sc_start</id>
		<title>Sc start</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/wiki/Sc_start"/>
				<updated>2013-06-19T16:12:34Z</updated>
		
		<summary type="html">&lt;p&gt;Poison: Reverted edits by Valil (talk) to last revision by Mysterious&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Script_Command]]&lt;br /&gt;
==Syntax==&lt;br /&gt;
* [[sc_start]]   &amp;lt;effect type&amp;gt;,&amp;lt;ticks&amp;gt;,&amp;lt;extra argument&amp;gt;{,&amp;lt;target ID number&amp;gt;};&lt;br /&gt;
* [[sc_start2]] &amp;lt;effect type&amp;gt;,&amp;lt;ticks&amp;gt;,&amp;lt;extra argument&amp;gt;,&amp;lt;percent chance&amp;gt;{,&amp;lt;target ID number&amp;gt;};&lt;br /&gt;
* [[sc_start4]] &amp;lt;effect type&amp;gt;,&amp;lt;ticks&amp;gt;,&amp;lt;value 1&amp;gt;,&amp;lt;value 2&amp;gt;,&amp;lt;value 3&amp;gt;,&amp;lt;value 4&amp;gt;{,&amp;lt;target ID number&amp;gt;};&lt;br /&gt;
* [[sc_end]]    &amp;lt;effect type&amp;gt;{,&amp;lt;target ID number&amp;gt;};&lt;br /&gt;
==Description==&lt;br /&gt;
These command bestow a status effect on the invoking character. This command is &lt;br /&gt;
used a lot in the item scripts.&lt;br /&gt;
&lt;br /&gt;
Effect type is a number of effect, {{git|db/const.txt}} lists the common (mostly &lt;br /&gt;
negative) status effect types as constants, starting with 'SC_'. You can also &lt;br /&gt;
use this to give someone an effect of a player-cast spell.&lt;br /&gt;
&lt;br /&gt;
Extra argument's meaning differs depending on the effect type, for most effects &lt;br /&gt;
caused by a player skill the extra argument means the level of the skill that &lt;br /&gt;
would have been used to create that effect, for others it might have no meaning &lt;br /&gt;
whatsoever. You can actually bless someone with a 0 bless spell level this way, &lt;br /&gt;
which is fun, but weird.&lt;br /&gt;
&lt;br /&gt;
The target ID number, if given, will cause the status effect to appear on a &lt;br /&gt;
specified character, instead of the one attached to the running script. This has &lt;br /&gt;
not been properly tested.&lt;br /&gt;
&lt;br /&gt;
'[[sc_start2]]' is perfectly equivalent, but unlike '[[sc_start]]', a status change &lt;br /&gt;
effect will only occur with a specified percentage chance. 10000 given as the &lt;br /&gt;
chance is equivalent to a 100% chance, 0 is a zero.&lt;br /&gt;
&lt;br /&gt;
'[[sc_start4]]' is just like '[[sc_start]]', however it takes four parameters for the&lt;br /&gt;
status change instead of one. What these values are depends on the status&lt;br /&gt;
change in question. For example, elemental armor defense takes the following&lt;br /&gt;
four values:&lt;br /&gt;
- val1 is the first element, val2 is the resistance to the element val1.&lt;br /&gt;
- val3 is the second element, val4 is the resistance to said element.&lt;br /&gt;
eg: [[sc_start4]] SC_DefEle,60000,Ele_Fire,20,Ele_Water,-15;&lt;br /&gt;
&lt;br /&gt;
'[[sc_end]]' will remove a specified status effect. If SC_All is used (-1), it will&lt;br /&gt;
do a complete removal of all statuses (although permanent ones will re-apply).&lt;br /&gt;
&lt;br /&gt;
You can see the full list of status effects caused by skills in &lt;br /&gt;
{{git|src/map/status.h}} - they are currently not fully documented, but most of that &lt;br /&gt;
should be rather obvious.&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // This would poison them for 10 min&lt;br /&gt;
    sc_start SC_Poison,600000,0;&lt;br /&gt;
&lt;br /&gt;
    // This will bless someone as if with Bless 10:&lt;br /&gt;
    sc_start 10,240000,10;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Poison</name></author>	</entry>

	</feed>