diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index de00f66be..64b794ba0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -22744,6 +22744,19 @@ static BUILDIN(setfont) return true; } +static BUILDIN(getfont) +{ + struct map_session_data *sd = script->rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return true; + } + + script_pushint(st, sd->status.font); + return true; +} + static int buildin_mobuseskill_sub(struct block_list *bl, va_list ap) { struct mob_data *md = NULL; @@ -25891,6 +25904,36 @@ static void script_run_item_unequip_script(struct map_session_data *sd, struct i script->current_item_id = 0; } +static void script_run_item_rental_start_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull(1, 2))); + +/** + * Run item rental start script + * @param sd player session data. Must be correct and checked before. + * @param data rental item data. Must be correct and checked before. + * @param oid npc id. Can be also 0 or fake npc id. + **/ +static void script_run_item_rental_start_script(struct map_session_data *sd, struct item_data *data, int oid) +{ + script->current_item_id = data->nameid; + script->run(data->rental_start_script, 0, sd->bl.id, oid); + script->current_item_id = 0; +} + +static void script_run_item_rental_end_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull(1, 2))); + +/** +* Run item rental end script +* @param sd player session data. Must be correct and checked before. +* @param data rental item data. Must be correct and checked before. +* @param oid npc id. Can be also 0 or fake npc id. +**/ +static void script_run_item_rental_end_script(struct map_session_data *sd, struct item_data *data, int oid) +{ + script->current_item_id = data->nameid; + script->run(data->rental_end_script, 0, sd->bl.id, oid); + script->current_item_id = 0; +} + #define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args, false } #define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args, false } #define BUILDIN_DEF_DEPRECATED(x,args) { buildin_ ## x , #x , args, true } @@ -26326,6 +26369,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(mercenary_set_faith,"ii"), BUILDIN_DEF(readbook,"ii"), BUILDIN_DEF(setfont,"i"), + BUILDIN_DEF(getfont, ""), BUILDIN_DEF(areamobuseskill,"siiiiviiiii"), BUILDIN_DEF(progressbar,"si"), BUILDIN_DEF(progressbar_unit,"si?"), @@ -27443,4 +27487,6 @@ void script_defaults(void) script->run_use_script = script_run_use_script; script->run_item_equip_script = script_run_item_equip_script; script->run_item_unequip_script = script_run_item_unequip_script; + script->run_item_rental_start_script = script_run_item_rental_start_script; + script->run_item_rental_end_script = script_run_item_rental_end_script; } |