summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3rdparty/libconfig/libconfig.c4
-rw-r--r--conf/messages.conf32
-rw-r--r--src/common/HPM.c2
-rw-r--r--src/common/HPMi.h24
-rw-r--r--src/map/atcommand.c78
-rw-r--r--src/map/atcommand.h1
-rw-r--r--src/map/script.h1
-rw-r--r--src/map/skill.c2
-rw-r--r--src/plugins/db2sql.c18
-rw-r--r--src/plugins/sample.c32
10 files changed, 106 insertions, 88 deletions
diff --git a/3rdparty/libconfig/libconfig.c b/3rdparty/libconfig/libconfig.c
index 194c891be..358c415f5 100644
--- a/3rdparty/libconfig/libconfig.c
+++ b/3rdparty/libconfig/libconfig.c
@@ -557,7 +557,7 @@ static int __config_read(config_t *config, FILE *stream, const char *filename,
yyscan_t scanner;
struct scan_context scan_ctx;
struct parse_context parse_ctx;
- YY_BUFFER_STATE buffer = NULL;
+ /*YY_BUFFER_STATE buffer = NULL;*/
int r;
/* Reinitialize the config */
@@ -589,7 +589,7 @@ static int __config_read(config_t *config, FILE *stream, const char *filename,
if(stream)
libconfig_yyrestart(stream, scanner);
else /* read from string */
- buffer = libconfig_yy_scan_string(str, scanner);
+ /*buffer = */libconfig_yy_scan_string(str, scanner);
libconfig_yyset_lineno(1, scanner);
r = libconfig_yyparse(scanner, &parse_ctx, &scan_ctx);
diff --git a/conf/messages.conf b/conf/messages.conf
index f98a91083..b6904328f 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -241,12 +241,12 @@
218: This player's Peco Peco has been released.
219: %d day
220: %d days
-221: %s %d hour
-222: %s %d hours
-223: %s %d minute
-224: %s %d minutes
-225: %s and %d second
-226: %s and %d seconds
+221: %d hour
+222: %d hours
+223: %d minute
+224: %d minutes
+225: and %d second
+226: and %d seconds
227: Party modification is disabled on this map.
228: Guild modification is disabled on this map.
229: Your effect has changed.
@@ -254,9 +254,9 @@
231: Game time: The game is in permanent daylight.
232: Game time: The game is in permanent night.
233: Game time: The game is in night for %s.
-234: Game time: After, the game will be in permanent daylight.
+//234:
235: Game time: The game is in daylight for %s.
-236: Game time: After, the game will be in permanent night.
+//236:
237: Game time: After, the game will be in night for %s.
238: Game time: A day cycle has a normal duration of %s.
239: Game time: After, the game will be in daylight for %s.
@@ -812,18 +812,18 @@
// @recall
1020: You are not authorized to warp this player from their map.
-// @charblock
-1021: Please enter a player name (usage: @charblock/@block <char name>).
+// @block
+1021: Please enter a player name (usage: @block <char name>).
-// @charban
-1022: Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
+// @ban
+1022: Please enter ban time and a player name (usage: @ban <time> <char name>).
1023: You are not allowed to reduce the length of a ban.
-// @charunblock
-1024: Please enter a player name (usage: @charunblock <char name>).
+// @unblock
+1024: Please enter a player name (usage: @unblock <char name>).
-// @charunban
-1025: Please enter a player name (usage: @charunban <char name>).
+// @unban
+1025: Please enter a player name (usage: @unban <char name>).
// @kick
1026: Please enter a player name (usage: @kick <char name/ID>).
diff --git a/src/common/HPM.c b/src/common/HPM.c
index 641ffe2e6..005bc2ddc 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -644,6 +644,8 @@ void hplugins_share_defaults(void) {
/* libconfig (temp) */
HPM->share(config_setting_lookup_string,"config_setting_lookup_string");
HPM->share(config_setting_lookup_int,"config_setting_lookup_int");
+ HPM->share(config_setting_get_member,"config_setting_get_member");
+ HPM->share(config_setting_length,"config_setting_length");
}
void hpm_init(void) {
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 7637dc832..2cd1075c4 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -105,6 +105,30 @@ enum HPluginDataTypes {
#define getFromNPCD(ptr,index) (HPMi->getFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))
#define removeFromNPCD(ptr,index) (HPMi->removeFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))
+/* HPMi->addCommand */
+#define addAtcommand(cname,funcname) \
+ if ( HPMi->addCommand != NULL ) { \
+ HPMi->addCommand(cname,atcommand_ ## funcname); \
+ } else { \
+ ShowWarning("HPM (%s):addAtcommand(\"%s\",%s) failed, addCommand sub is NULL!\n",pinfo.name,cname,# funcname);\
+ }
+/* HPMi->addScript */
+#define addScriptCommand(cname,scinfo,funcname) \
+ if ( HPMi->addScript != NULL ) { \
+ HPMi->addScript(cname,scinfo,buildin_ ## funcname); \
+ } else { \
+ ShowWarning("HPM (%s):addScriptCommand(\"%s\",\"%s\",%s) failed, addScript sub is NULL!\n",pinfo.name,cname,scinfo,# funcname);\
+ }
+/* HPMi->addCPCommand */
+#define addCPCommand(cname,funcname) \
+ if ( HPMi->addCPCommand != NULL ) { \
+ HPMi->addCPCommand(cname,console_parse_ ## funcname); \
+ } else { \
+ ShowWarning("HPM (%s):addCPCommand(\"%s\",%s) failed, addCPCommand sub is NULL!\n",pinfo.name,cname,# funcname);\
+ }
+/* HPMi->addPacket */
+#define addPacket(cmd,len,receive,point) HPMi->addPacket(cmd,len,receive,point,HPMi->pid)
+
/* Hercules Plugin Mananger Include Interface */
HPExport struct HPMi_interface {
/* */
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 3b06140d4..b18868b0c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2692,7 +2692,7 @@ ACMD(char_block)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif->message(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block <char name>).
+ clif->message(fd, msg_txt(1021)); // Please enter a player name (usage: @block <char name>).
return false;
}
@@ -2728,7 +2728,7 @@ ACMD(char_ban)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
- clif->message(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
+ clif->message(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @ban <time> <char name>).
return false;
}
@@ -2807,7 +2807,7 @@ ACMD(char_unblock)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif->message(fd, msg_txt(1024)); // Please enter a player name (usage: @charunblock <char name>).
+ clif->message(fd, msg_txt(1024)); // Please enter a player name (usage: @unblock <char name>).
return false;
}
@@ -2827,7 +2827,7 @@ ACMD(char_unban)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif->message(fd, msg_txt(1025)); // Please enter a player name (usage: @charunban <char name>).
+ clif->message(fd, msg_txt(1025)); // Please enter a player name (usage: @unban <char name>).
return false;
}
@@ -4237,10 +4237,9 @@ ACMD(unloadnpc)
char* txt_time(unsigned int duration)
{
int days, hours, minutes, seconds;
- char temp[CHAT_SIZE_MAX];
static char temp1[CHAT_SIZE_MAX];
+ int tlen = 0;
- memset(temp, '\0', sizeof(temp));
memset(temp1, '\0', sizeof(temp1));
days = duration / (60 * 60 * 24);
@@ -4251,22 +4250,22 @@ char* txt_time(unsigned int duration)
seconds = duration - (60 * minutes);
if (days == 1)
- sprintf(temp, msg_txt(219), days); // %d day
+ tlen += sprintf(tlen + temp1, msg_txt(219), days); // %d day
else if (days > 1)
- sprintf(temp, msg_txt(220), days); // %d days
+ tlen += sprintf(tlen + temp1, msg_txt(220), days); // %d days
if (hours == 1)
- sprintf(temp1, msg_txt(221), temp, hours); // %s %d hour
+ tlen += sprintf(tlen + temp1, msg_txt(221), hours); // %d hour
else if (hours > 1)
- sprintf(temp1, msg_txt(222), temp, hours); // %s %d hours
+ tlen += sprintf(tlen + temp1, msg_txt(222), hours); // %d hours
if (minutes < 2)
- sprintf(temp, msg_txt(223), temp1, minutes); // %s %d minute
+ tlen += sprintf(tlen + temp1, msg_txt(223), minutes); // %d minute
else
- sprintf(temp, msg_txt(224), temp1, minutes); // %s %d minutes
+ tlen += sprintf(tlen + temp1, msg_txt(224), minutes); // %d minutes
if (seconds == 1)
- sprintf(temp1, msg_txt(225), temp, seconds); // %s and %d second
+ tlen += sprintf(tlen + temp1, msg_txt(225), seconds); // and %d second
else if (seconds > 1)
- sprintf(temp1, msg_txt(226), temp, seconds); // %s and %d seconds
-
+ tlen += sprintf(tlen + temp1, msg_txt(226), seconds); // and %d seconds
+
return temp1;
}
@@ -4275,8 +4274,6 @@ char* txt_time(unsigned int duration)
* Calculation management of GM modification (@day/@night GM commands) is done
*------------------------------------------*/
ACMD(servertime) {
- const struct TimerData * timer_data;
- const struct TimerData * timer_data2;
time_t time_server; // variable for number of seconds (used with time() function)
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
char temp[CHAT_SIZE_MAX];
@@ -4289,33 +4286,11 @@ ACMD(servertime) {
strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X.
clif->message(fd, temp);
- if (battle_config.night_duration == 0 && battle_config.day_duration == 0) {
- if (map->night_flag == 0)
- clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
- else
- clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
- } else if (battle_config.night_duration == 0) {
- if (map->night_flag == 1) { // we start with night
- timer_data = timer->get(pc->day_timer_tid);
- sprintf(temp, msg_txt(233), // Game time: The game is actually in night for %s.
- txt_time((unsigned int)(DIFF_TICK(timer_data->tick,timer->gettick())/1000)));
- clif->message(fd, temp);
- clif->message(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight.
- } else
- clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
- } else if (battle_config.day_duration == 0) {
- if (map->night_flag == 0) { // we start with day
- timer_data = timer->get(pc->night_timer_tid);
- sprintf(temp, msg_txt(235), // Game time: The game is actualy in daylight for %s.
- txt_time((unsigned int)(DIFF_TICK(timer_data->tick,timer->gettick())/1000)));
- clif->message(fd, temp);
- clif->message(fd, msg_txt(236)); // Game time: After, the game will be in permanent night.
- } else
- clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
- } else {
+ if (pc->day_timer_tid != INVALID_TIMER && pc->night_timer_tid != INVALID_TIMER) {
+ const struct TimerData * timer_data = timer->get(pc->night_timer_tid);
+ const struct TimerData * timer_data2 = timer->get(pc->day_timer_tid);
+
if (map->night_flag == 0) {
- timer_data = timer->get(pc->night_timer_tid);
- timer_data2 = timer->get(pc->day_timer_tid);
sprintf(temp, msg_txt(235), // Game time: The game is actualy in daylight for %s.
txt_time((unsigned int)(DIFF_TICK(timer_data->tick,timer->gettick())/1000)));
clif->message(fd, temp);
@@ -4327,21 +4302,24 @@ ACMD(servertime) {
txt_time((unsigned int)(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)));
clif->message(fd, temp);
} else {
- timer_data = timer->get(pc->day_timer_tid);
- timer_data2 = timer->get(pc->night_timer_tid);
sprintf(temp, msg_txt(233), // Game time: The game is actualy in night for %s.
- txt_time((unsigned int)(DIFF_TICK(timer_data->tick,timer->gettick()) / 1000)));
+ txt_time((unsigned int)(DIFF_TICK(timer_data2->tick,timer->gettick()) / 1000)));
clif->message(fd, temp);
- if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0)
+ if (DIFF_TICK(timer_data2->tick,timer_data->tick) > 0)
sprintf(temp, msg_txt(239), // Game time: After, the game will be in daylight for %s.
- txt_time((unsigned int)((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)));
+ txt_time((unsigned int)((timer_data2->interval - DIFF_TICK(timer_data2->tick, timer_data->tick)) / 1000)));
else
sprintf(temp, msg_txt(239), // Game time: After, the game will be in daylight for %s.
- txt_time((unsigned int)(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)));
+ txt_time((unsigned int)(DIFF_TICK(timer_data->tick, timer_data2->tick) / 1000)));
clif->message(fd, temp);
}
- sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
+ sprintf(temp, msg_txt(238), txt_time(timer_data2->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
clif->message(fd, temp);
+ } else {
+ if (map->night_flag == 0)
+ clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
+ else
+ clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
}
return true;
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 6b5a52fcb..d01f00d8e 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -122,6 +122,5 @@ void atcommand_defaults(void);
/* stay here */
#define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
-#define ACMD_A(x) atcommand_ ## x
#endif /* _ATCOMMAND_H_ */
diff --git a/src/map/script.h b/src/map/script.h
index 32426e988..e0e5f9ea9 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -145,7 +145,6 @@ struct eri;
#define is_string_variable(name) ( (name)[strlen(name) - 1] == '$' )
#define BUILDIN(x) bool buildin_ ## x (struct script_state* st)
-#define BUILDIN_A(x) buildin_ ## x
#define script_fetch(st, n, t) do { \
if( script_hasdata((st),(n)) ) \
diff --git a/src/map/skill.c b/src/map/skill.c
index dcb29701f..43d669a53 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -10581,7 +10581,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
{
struct skill_condition req = skill->get_requirement(sd,skill_id,skill_lv);
ARR_FIND(0, MAX_SKILL_ITEM_REQUIRE, i, req.itemid[i] && (req.itemid[i] == ITEMID_TRAP || req.itemid[i] == ITEMID_TRAP_ALLOY));
- if( req.itemid[i] )
+ if( i != MAX_SKILL_ITEM_REQUIRE && req.itemid[i] )
req_item = req.itemid[i];
if( map_flag_gvg2(src->m) || map->list[src->m].flag.battleground )
limit *= 4; // longer trap times in WOE [celest]
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index 3c3981bdd..1bf3f6c01 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -36,6 +36,8 @@ bool torun = false;
int (*itemdb_readdb_libconfig_sub) (config_setting_t *it, int n, const char *source);
int (*h_config_setting_lookup_string) (const config_setting_t *setting, const char *name, const char **value);
int (*h_config_setting_lookup_int) (const config_setting_t *setting, const char *name, int *value);
+config_setting_t *(*h_config_setting_get_member) (const config_setting_t *setting, const char *name);
+int (*h_config_setting_length) (const config_setting_t *setting);
void hstr(const char *str) {
if( strlen(str) > tosql.buf[3].len ) {
@@ -54,7 +56,8 @@ int db2sql(config_setting_t *entry, int n, const char *source) {
char *str;
int i32;
unsigned int ui32, job = 0, upper = 0;
-
+ config_setting_t *t = NULL;
+
SQL->EscapeString(NULL, e_name, it->name);
SQL->EscapeString(NULL, e_jname, it->jname);
if( it->script ) { h_config_setting_lookup_string(entry, "Script", &script); hstr(script); str = tosql.buf[3].p; if ( strlen(str) > tosql.buf[0].len ) { tosql.buf[0].len = tosql.buf[0].len + strlen(str) + 1000; RECREATE(tosql.buf[0].p,char,tosql.buf[0].len); } SQL->EscapeString(NULL, tosql.buf[0].p, str); }
@@ -75,8 +78,13 @@ int db2sql(config_setting_t *entry, int n, const char *source) {
upper = ui32;
- fprintf(tosql.fp,"REPLACE INTO `%s` VALUES ('%u','%s','%s','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%s','%s','%s');\n",
- tosql.db_name,it->nameid,e_name,e_jname,it->flag.delay_consume?IT_DELAYCONSUME:it->type,it->value_buy,it->value_sell,it->weight,it->atk,it->matk,it->def,it->range,it->slot,job,upper,it->sex,it->equip,it->wlv,it->elv,it->elvmax,it->flag.no_refine?0:1,it->look,it->flag.bindonequip?1:0,it->script?tosql.buf[0].p:"",it->equip_script?tosql.buf[1].p:"",it->unequip_script?tosql.buf[2].p:"");
+ /* check if we have the equip_level_max, if so we send it -- otherwise we send NULL */
+ if( (t = h_config_setting_get_member(entry, "EquipLv")) && config_setting_is_aggregate(t) && h_config_setting_length(t) >= 2 )
+ fprintf(tosql.fp,"REPLACE INTO `%s` VALUES ('%u','%s','%s','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%s','%s','%s');\n",
+ tosql.db_name,it->nameid,e_name,e_jname,it->flag.delay_consume?IT_DELAYCONSUME:it->type,it->value_buy,it->value_sell,it->weight,it->atk,it->matk,it->def,it->range,it->slot,job,upper,it->sex,it->equip,it->wlv,it->elv,it->elvmax,it->flag.no_refine?0:1,it->look,it->flag.bindonequip?1:0,it->script?tosql.buf[0].p:"",it->equip_script?tosql.buf[1].p:"",it->unequip_script?tosql.buf[2].p:"");
+ else
+ fprintf(tosql.fp,"REPLACE INTO `%s` VALUES ('%u','%s','%s','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u',NULL,'%u','%u','%u','%s','%s','%s');\n",
+ tosql.db_name,it->nameid,e_name,e_jname,it->flag.delay_consume?IT_DELAYCONSUME:it->type,it->value_buy,it->value_sell,it->weight,it->atk,it->matk,it->def,it->range,it->slot,job,upper,it->sex,it->equip,it->wlv,it->elv,it->flag.no_refine?0:1,it->look,it->flag.bindonequip?1:0,it->script?tosql.buf[0].p:"",it->equip_script?tosql.buf[1].p:"",it->unequip_script?tosql.buf[2].p:"");
}
return it?it->nameid:0;
@@ -186,6 +194,8 @@ void db2sql_arg(char *param) {
HPExport void server_preinit (void) {
h_config_setting_lookup_string = GET_SYMBOL("config_setting_lookup_string");
h_config_setting_lookup_int = GET_SYMBOL("config_setting_lookup_int");
+ h_config_setting_get_member = GET_SYMBOL("config_setting_get_member");
+ h_config_setting_length = GET_SYMBOL("config_setting_length");
SQL = GET_SYMBOL("SQL");
itemdb = GET_SYMBOL("itemdb");
@@ -196,7 +206,7 @@ HPExport void server_preinit (void) {
addArg("--db2sql",false,db2sql_arg,NULL);
}
HPExport void plugin_init (void) {
- HPMi->addCPCommand("server:tools:db2sql",CPCMD_A(db2sql));
+ addCPCommand("server:tools:db2sql",db2sql);
}
HPExport void server_online (void) {
if( torun )
diff --git a/src/plugins/sample.c b/src/plugins/sample.c
index cffd39992..552194e43 100644
--- a/src/plugins/sample.c
+++ b/src/plugins/sample.c
@@ -36,6 +36,7 @@ struct sample_data_struct {
struct point lastMSGPosition;
unsigned int someNumber;
};
+
/* sample packet implementation */
/* cmd 0xf3 - it is a client-server existent id, for clif_parse_GlobalMessage */
/* in this sample we do nothing and simply redirect */
@@ -138,26 +139,31 @@ HPExport void plugin_init (void) {
ShowInfo ("I'm being run from the '%s' filename\n", server_name);
- if( HPMi->addCommand != NULL ) {//link our '@sample' command
- HPMi->addCommand("sample",ACMD_A(sample));
- }
-
- if( HPMi->addScript != NULL ) {//link our 'sample' script command
- HPMi->addScript("sample","i",BUILDIN_A(sample));
- }
+ /* addAtcommand("command-key",command-function) tells map server to call ACMD(sample) when "sample" command is used */
+ /* - it will print a warning when used on a non-map-server plugin */
+ addAtcommand("sample",sample);//link our '@sample' command
- if( HPMi->addCPCommand != NULL ) {//link our 'sample' console command
- HPMi->addCPCommand("this:is:a:sample",CPCMD_A(sample));
- }
+ /* addScriptCommand("script-command-name","script-command-params-info",script-function) tells map server to call BUILDIN(sample) for the "sample(i)" command */
+ /* - it will print a warning when used on a non-map-server plugin */
+ addScriptCommand("sample","i",sample);
- if( HPMi->addPacket != NULL ) {//link our 'sample' packet to map-server
- HPMi->addPacket(0xf3,-1,sample_packet0f3,hpClif_Parse,HPMi->pid);
- }
+ /* addCPCommand("console-command-name",command-function) tells server to call CPCMD(sample) for the 'this is a sample <optional-args>' console call */
+ /* in "console-command-name" usage of ':' indicates a category, for example 'this:is:a:sample' translates to 'this is a sample',
+ * therefore 'this -> is -> a -> sample', it can be used to aggregate multiple commands under the same category or to append commands to existing categories
+ * categories inherit the special keyword 'help' which prints the subsequent commands, e.g. 'server help' prints all categories and commands under 'server'
+ * therefore 'this help' would inform about 'is (category) -> a (category) -> sample (command)'*/
+ addCPCommand("this:is:a:sample",sample);
+ /* addPacket(packetID,packetLength,packetFunction,packetIncomingPoint) */
+ /* adds packetID of packetLength (-1 for dynamic length where length is defined in the packet { packetID (2 Byte) , packetLength (2 Byte) , ... })
+ * to trigger packetFunction in the packetIncomingPoint section ( available points listed in enum HPluginPacketHookingPoints within src/common/HPMi.h ) */
+ addPacket(0xf3,-1,sample_packet0f3,hpClif_Parse);
+
/* in this sample we add a PreHook to pc->dropitem */
/* to identify whether the item being dropped is on amount higher than 1 */
/* if so, it stores the amount on a variable (my_pc_dropitem_storage) and changes the amount to 1 */
addHookPre("pc->dropitem",my_pc_dropitem_pre);
+
/* in this sample we add a PostHook to pc->dropitem */
/* if the original pc->dropitem was successful and the amount stored on my_pc_dropitem_storage is higher than 1, */
/* our posthook will display a message to the user about the cap */