diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-10-20 18:29:10 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-10-20 18:29:10 -0300 |
commit | 3216025edc23a371baa596c23288ac3467630282 (patch) | |
tree | b14f43b4cab69031103acbd28f19a1c632116a48 /src/emap/script_buildins.c | |
parent | 7b7ff83feaef6e5a94889e3dc506f1518733c2ca (diff) | |
download | plugin-3216025edc23a371baa596c23288ac3467630282.tar.gz plugin-3216025edc23a371baa596c23288ac3467630282.tar.bz2 plugin-3216025edc23a371baa596c23288ac3467630282.tar.xz plugin-3216025edc23a371baa596c23288ac3467630282.zip |
Add a function to retrieve EXP tax for a certain guild role,
and another function to retrieve the role title. (I think the role title function
may be used more times, as it makes prettier scripts)
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r-- | src/emap/script_buildins.c | 48 |
1 files changed, 48 insertions, 0 deletions
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; +} |