summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c77
1 files changed, 71 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 35a71868a..ca53b6f6d 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2322,6 +2322,15 @@ void read_constdb(void)
ShowWarning("read_constdb: Invalid constant name %s. Skipping.\n", name);
continue;
}
+ if (strcmp(name, "comment__") == 0) {
+ const char *comment = libconfig->setting_get_string(t);
+ if (comment == NULL)
+ continue;
+ if (*comment == '\0')
+ comment = NULL;
+ script->constdb_comment(comment);
+ continue;
+ }
if (config_setting_is_aggregate(t)) {
int i32;
if (!libconfig->setting_lookup_int(t, "Value", &i32)) {
@@ -2342,9 +2351,22 @@ void read_constdb(void)
}
script->set_constant(name, value, is_parameter, is_deprecated);
}
+ script->constdb_comment(NULL);
libconfig->destroy(&constants_conf);
}
+/**
+ * Sets the current constdb comment.
+ *
+ * This function does nothing (used by plugins only)
+ *
+ * @param comment The comment to set (NULL to unset)
+ */
+void script_constdb_comment(const char *comment)
+{
+ (void)comment;
+}
+
// Standard UNIX tab size is 8
#define TAB_SIZE 8
#define update_tabstop(tabstop,chars) \
@@ -18490,7 +18512,7 @@ BUILDIN(setcashmount)
if (sd->sc.data[SC_ALL_RIDING])
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
else
- sc_start(NULL,&sd->bl, SC_ALL_RIDING, 100, 0, -1);
+ sc_start(NULL,&sd->bl, SC_ALL_RIDING, 100, 25, -1);
script_pushint(st,1);//in both cases, return 1.
}
return true;
@@ -20820,9 +20842,11 @@ void script_label_add(int key, int pos) {
**/
void script_hardcoded_constants(void)
{
+ script->constdb_comment("Boolean");
script->set_constant("true", 1, false, false);
script->set_constant("false", 0, false, false);
- /* server defines */
+
+ script->constdb_comment("Server defines");
script->set_constant("PACKETVER",PACKETVER,false, false);
script->set_constant("MAX_LEVEL",MAX_LEVEL,false, false);
script->set_constant("MAX_STORAGE",MAX_STORAGE,false, false);
@@ -20834,7 +20858,7 @@ void script_hardcoded_constants(void)
script->set_constant("MAX_CHAT_USERS",MAX_CHAT_USERS,false, false);
script->set_constant("MAX_REFINE",MAX_REFINE,false, false);
- /* status options */
+ script->constdb_comment("status options");
script->set_constant("Option_Nothing",OPTION_NOTHING,false, false);
script->set_constant("Option_Sight",OPTION_SIGHT,false, false);
script->set_constant("Option_Hide",OPTION_HIDE,false, false);
@@ -20860,11 +20884,11 @@ void script_hardcoded_constants(void)
script->set_constant("Option_Hanbok",OPTION_HANBOK,false, false);
script->set_constant("Option_Oktoberfest",OPTION_OKTOBERFEST,false, false);
- /* status option compounds */
+ script->constdb_comment("status option compounds");
script->set_constant("Option_Dragon",OPTION_DRAGON,false, false);
script->set_constant("Option_Costume",OPTION_COSTUME,false, false);
- /* send_target */
+ script->constdb_comment("send_target");
script->set_constant("ALL_CLIENT",ALL_CLIENT,false, false);
script->set_constant("ALL_SAMEMAP",ALL_SAMEMAP,false, false);
script->set_constant("AREA",AREA,false, false);
@@ -20898,7 +20922,46 @@ void script_hardcoded_constants(void)
script->set_constant("BG_AREA_WOS",BG_AREA_WOS,false, false);
script->set_constant("BG_QUEUE",BG_QUEUE,false, false);
- /* Renewal */
+ script->constdb_comment("LOOK_ constants, use in setlook/changelook script commands");
+ script->set_constant("LOOK_BASE", LOOK_BASE, false, false);
+ script->set_constant("LOOK_HAIR", LOOK_HAIR, false, false);
+ script->set_constant("LOOK_WEAPON", LOOK_WEAPON, false, false);
+ script->set_constant("LOOK_HEAD_BOTTOM", LOOK_HEAD_BOTTOM, false, false);
+ script->set_constant("LOOK_HEAD_TOP", LOOK_HEAD_TOP, false, false);
+ script->set_constant("LOOK_HEAD_MID", LOOK_HEAD_MID, false, false);
+ script->set_constant("LOOK_HAIR_COLOR", LOOK_HAIR_COLOR, false, false);
+ script->set_constant("LOOK_CLOTHES_COLOR", LOOK_CLOTHES_COLOR, false, false);
+ script->set_constant("LOOK_SHIELD", LOOK_SHIELD, false, false);
+ script->set_constant("LOOK_SHOES", LOOK_SHOES, false, false);
+ script->set_constant("LOOK_BODY", LOOK_BODY, false, false);
+ script->set_constant("LOOK_FLOOR", LOOK_FLOOR, false, false);
+ script->set_constant("LOOK_ROBE", LOOK_ROBE, false, false);
+ script->set_constant("LOOK_BODY2", LOOK_BODY2, false, false);
+
+ script->constdb_comment("Equip Position in Bits, use with *getiteminfo type 5, or @inventorylist_equip");
+ script->set_constant("EQP_HEAD_LOW", EQP_HEAD_LOW, false, false);
+ script->set_constant("EQP_HEAD_MID", EQP_HEAD_MID, false, false);
+ script->set_constant("EQP_HEAD_TOP", EQP_HEAD_TOP, false, false);
+ script->set_constant("EQP_HAND_R", EQP_HAND_R, false, false);
+ script->set_constant("EQP_HAND_L", EQP_HAND_L, false, false);
+ script->set_constant("EQP_ARMOR", EQP_ARMOR, false, false);
+ script->set_constant("EQP_SHOES", EQP_SHOES, false, false);
+ script->set_constant("EQP_GARMENT", EQP_GARMENT, false, false);
+ script->set_constant("EQP_ACC_L", EQP_ACC_L, false, false);
+ script->set_constant("EQP_ACC_R", EQP_ACC_R, false, false);
+ script->set_constant("EQP_COSTUME_HEAD_TOP", EQP_COSTUME_HEAD_TOP, false, false);
+ script->set_constant("EQP_COSTUME_HEAD_MID", EQP_COSTUME_HEAD_MID, false, false);
+ script->set_constant("EQP_COSTUME_HEAD_LOW", EQP_COSTUME_HEAD_LOW, false, false);
+ script->set_constant("EQP_COSTUME_GARMENT", EQP_COSTUME_GARMENT, false, false);
+ script->set_constant("EQP_AMMO", EQP_AMMO, false, false);
+ script->set_constant("EQP_SHADOW_ARMOR", EQP_SHADOW_ARMOR, false, false);
+ script->set_constant("EQP_SHADOW_WEAPON", EQP_SHADOW_WEAPON, false, false);
+ script->set_constant("EQP_SHADOW_SHIELD", EQP_SHADOW_SHIELD, false, false);
+ script->set_constant("EQP_SHADOW_SHOES", EQP_SHADOW_SHOES, false, false);
+ script->set_constant("EQP_SHADOW_ACC_R", EQP_SHADOW_ACC_R, false, false);
+ script->set_constant("EQP_SHADOW_ACC_L", EQP_SHADOW_ACC_L, false, false);
+
+ script->constdb_comment("Renewal");
#ifdef RENEWAL
script->set_constant("RENEWAL", 1, false, false);
#else
@@ -20934,6 +20997,7 @@ void script_hardcoded_constants(void)
#else
script->set_constant("RENEWAL_ASPD", 0, false, false);
#endif
+ script->constdb_comment(NULL);
}
/**
@@ -21111,6 +21175,7 @@ void script_defaults(void) {
script->parse_expr = parse_expr;
script->parse_line = parse_line;
script->read_constdb = read_constdb;
+ script->constdb_comment = script_constdb_comment;
script->print_line = script_print_line;
script->errorwarning_sub = script_errorwarning_sub;
script->set_reg = set_reg;