diff options
-rw-r--r-- | src/emap/init.c | 2 | ||||
-rw-r--r-- | src/emap/script_buildins.c | 48 | ||||
-rw-r--r-- | src/emap/script_buildins.h | 2 |
3 files changed, 52 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index 0e83b9a..0837489 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -210,6 +210,8 @@ HPExport void plugin_init (void) addScriptCommand("getitemoptionparambyindex", "ii", getItemOptionParamByIndex); addScriptCommand("setitemoptionbyindex", "iii*", setItemOptionByIndex); addScriptCommand("isinstance", "i", isInstance); + addScriptCommand("getguildpostax","ii",getguildpostax); + addScriptCommand("getguildpostitle","ii",getguildpostitle); do_init_langs(); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index c0a7e1b..a47049a 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -2348,3 +2348,51 @@ BUILDIN(isInstance) script_pushint(st, instance->valid(instance_id) ? 1 : 0); return true; } + + +/*========================================== + * Return the EXP tax for (guild, position) + * -1 if not found + *------------------------------------------*/ +BUILDIN(getguildpostax) +{ + int guild_id, gpos; + struct guild* g; + + guild_id = script_getnum(st,2); + gpos = script_getnum(st,3); + + if( ( g = guild->search(guild_id) ) != NULL ) + { + script_pushint(st,g->position[gpos].exp_mode); + } + else + { + script_pushint(st,-1); + } + return true; +} + + +/*========================================== + * Return the title (guild, position) + * "" if not found + *------------------------------------------*/ +BUILDIN(getguildpostitle) +{ + int guild_id, gpos; + struct guild* g; + + guild_id = script_getnum(st,2); + gpos = script_getnum(st,3); + + if( ( g = guild->search(guild_id) ) != NULL ) + { + script_pushstrcopy(st, g->position[gpos].name); + } + else + { + script_pushstr(st,""); + } + return true; +} diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index fab271e..87d63f8 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -99,5 +99,7 @@ BUILDIN(getItemOptionValueByIndex); BUILDIN(getItemOptionParamByIndex); BUILDIN(setItemOptionByIndex); BUILDIN(isInstance); +BUILDIN(getguildpostax); +BUILDIN(getguildpostitle); #endif // EVOL_MAP_SCRIPT_BUILDINS |