<?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=Veilside</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=Veilside"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/wiki/Special:Contributions/Veilside"/>
		<updated>2026-05-02T01:50:24Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/wiki/Building_HPM_Plugin_for_MSVC</id>
		<title>Building HPM Plugin for MSVC</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/wiki/Building_HPM_Plugin_for_MSVC"/>
				<updated>2015-10-02T08:06:40Z</updated>
		
		<summary type="html">&lt;p&gt;Veilside: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a guide on how to prepare your MSVC environment for a new [[HPM]] plugin.&lt;br /&gt;
= Guide =&lt;br /&gt;
1. Go to '''src/plugins/''' folder, create a new '''.c''' file, e.g. '''dance.c''' (this name will be used throughout this guide)&lt;br /&gt;
[[File:step1.JPG|center|750px]]&lt;br /&gt;
2. Open dance.c and paste this code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;quot;../common/HPMi.h&amp;quot;&lt;br /&gt;
#include &amp;quot;../map/script.h&amp;quot;&lt;br /&gt;
#include &amp;quot;../map/pc.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;../common/HPMDataCheck.h&amp;quot;    //Should always be the last include file.&lt;br /&gt;
&lt;br /&gt;
HPExport struct hplugin_info pinfo =&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;@dance&amp;quot;,		// Plugin name&lt;br /&gt;
    SERVER_TYPE_MAP,// Which server types this plugin works with?&lt;br /&gt;
    &amp;quot;0.1a&amp;quot;,			// Plugin version&lt;br /&gt;
    HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
ACMD(dance)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      if (!message || !*message) {&lt;br /&gt;
		  clif-&amp;gt;message(fd, &amp;quot;usage: @dance 1-9&amp;quot;);&lt;br /&gt;
return -1;&lt;br /&gt;
   }&lt;br /&gt;
   if ( atoi(message) == 1 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 413, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 2 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 414, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 3 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 415, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 4 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 426, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 5 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 458, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 6 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 466, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 7 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 501, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 8 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 540, ALL_CLIENT);&lt;br /&gt;
   } else if ( atoi(message) == 9 ) {&lt;br /&gt;
clif-&amp;gt;specialeffect(&amp;amp;sd-&amp;gt;bl, 550, ALL_CLIENT);&lt;br /&gt;
   }&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
	clif-&amp;gt;message(fd, &amp;quot;usage: @dance 1-9&amp;quot;); &lt;br /&gt;
	}&lt;br /&gt;
   return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Server Startup */&lt;br /&gt;
HPExport void plugin_init (void)&lt;br /&gt;
{&lt;br /&gt;
    clif = GET_SYMBOL(&amp;quot;clif&amp;quot;);&lt;br /&gt;
    script = GET_SYMBOL(&amp;quot;script&amp;quot;);&lt;br /&gt;
    skill = GET_SYMBOL(&amp;quot;skill&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    addAtcommand(&amp;quot;dance&amp;quot;,dance);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
3. Open your MSVC project (e.g. '''Hercules-10.sln'')&lt;br /&gt;
[[File:step2.JPG|center|750px]]&lt;br /&gt;
4. Go to the '''Solution Explorer'''&lt;br /&gt;
[[File:step3.JPG|center|750px]]&lt;br /&gt;
5. Right click the Hercules project (first item in '''Solution Explorer'''), and click '''Add-&amp;gt;New Project'''&lt;br /&gt;
[[File:step4.JPG|center|750px]]&lt;br /&gt;
6. Select '''General''', and pick '''Empty Project'''.&lt;br /&gt;
[[File:step5.JPG|center|750px]]&lt;br /&gt;
7. Enter the name of your plugin in the '''Name''' field, and click OK.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. In the solution explorer it'll display the new project.&lt;br /&gt;
[[File:step6.JPG|center|750px]]&lt;br /&gt;
9. Right click the new project, and open '''Add-&amp;gt;Existing Item'''&lt;br /&gt;
[[File:step7.JPG|center|750px]]&lt;br /&gt;
10. Browse to '''src/plugins/''' and select the '''dance.c''' file, and hit OK.&lt;br /&gt;
[[File:step8.JPG|center|750px]]&lt;br /&gt;
11. It will place the '''dance.c''' file under the '''Source Files''' folder, drag it to the project you created and drop it (in a manner it be placed out of the source files folder.)&lt;br /&gt;
[[File:step9.JPG|center|750px]]&lt;br /&gt;
(It should look like the image below)&lt;br /&gt;
[[File:step10.JPG|center|750px]]&lt;br /&gt;
12. With the '''dance.c''' out of the folders, delete the 3 of them (select the 3, hit delete, hit ok)&lt;br /&gt;
[[File:step11.JPG|center|750px]]&lt;br /&gt;
(It should look like the image below)&lt;br /&gt;
[[File:step12.JPG|center|750px]]&lt;br /&gt;
13. Right click the project you created, open '''Properties'''&lt;br /&gt;
[[File:step13.JPG|center|750px]]&lt;br /&gt;
14. Under '''Configuration Properties''' click '''General''', change '''Output Directory''' to '''..\plugins\''', '''Intermediate Directory''' to '''$(ProjectName)\$(ConfigurationName)\''' and  '''Configuration Type''' to '''Dynamic Library (.dll)'''&lt;br /&gt;
[[File:step14.JPG|center|750px]]&lt;br /&gt;
15. Under '''Configuration Properties''' click '''C/C++''' and open '''General''', change '''Additional Include Directories''' to '''..\src\common;..\3rdparty\msinttypes\include'''&lt;br /&gt;
[[File:step15.JPG|center|750px]]&lt;br /&gt;
16. Under '''Configuration Properties''' click '''Linker''' and open '''General''', change '''Output File''' to '''$(OutDir)\PluginName.dll''' (TargetName is the name of the project)&lt;br /&gt;
[[File:step16.JPG|center|750px]]&lt;br /&gt;
17. Add your code to the '''dance.c''' file, and then right-click the project you created, and select '''Build'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Add it to ''' /conf/plugins.conf'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
plugins_list: [&lt;br /&gt;
	/* Enable HPMHooking when plugins in use rely on Hooking */&lt;br /&gt;
	//&amp;quot;HPMHooking&amp;quot;,&lt;br /&gt;
	//&amp;quot;db2sql&amp;quot;,&lt;br /&gt;
	//&amp;quot;sample&amp;quot;,&lt;br /&gt;
	//&amp;quot;other&amp;quot;,&lt;br /&gt;
	&amp;quot;dance&amp;quot;, // loads dance plugin&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
* This guide is probably the worst I've ever written, if you can do better please hit the 'Edit' button, will be most welcome. - Ind&lt;br /&gt;
* I used MSVC 2008 when testing this guide.&lt;br /&gt;
&lt;br /&gt;
= New Note =&lt;br /&gt;
* Sorry for editing this page, I added step by step images for other people to follow so they can easily follow one of the best feature Hercules have, the HPM. - Thanna&lt;br /&gt;
* The tutorial is tested on MSVC 2010.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Veilside</name></author>	</entry>

	</feed>