Date: 2019/12/31 12:24:09 UTC-08:00
Type: Denizen Script
#remove temp buffs
on system time minutely:
#define time so i can fkn exclude the bullshit ass colon
- define time:<util.date.time.hour>:<util.date.time.minute>
- announce <[time]>
#iterate through list of online players to check for expired buffs
- foreach <server.list_online_players> as:onlineplayer:
- foreach <[onlineplayer].flag[tempbuffs]>:
- announce <[onlineplayer]>
- announce <[value].after[\]>
- if <[value].after[\].before[<&co>]> == <[time].before[<&co>]> && <[value].after[\].after[<&co>]> == <[time].after[<&co>]>:
#removes added stat value by subtracting the value from affected stat, which is denoted by the first word of the buffs name
- flag <[onlineplayer]> player_<[value].before[_]>:-:<[value].after[/].before[\]>
#removes the buff from the list, pretty simple here. lol
- flag <[onlineplayer]> tempbuffs:<-:<[value]>
- announce "removed buff"
intbuff_cmd:
type: command
name: intbuff
description: used to test the temp buff feature.
usage: /intbuff <amount> <durationhours> <durationminutes>
script:
- if <util.date.time.minute.add[<context.args.get[3]>]> >= 60:
- flag <player> tempbuffs:|:intelligence_buff_test/<context.args.get[1]>\<util.date.time.hour.add[<context.args.get[2]>]>:0<util.date.time.minute.add[<context.args.get[3]>].sub[60]>
- announce <util.date.time.hour.add[<context.args.get[2]>]>:<util.date.time.minute.add[<context.args.get[3]>].sub[60]>
- flag <player> player_intelligence:+:<context.args.get[1]>
- else:
- announce <util.date.time.hour.add[<context.args.get[2]>]>:<util.date.time.minute.add[<context.args.get[3]>]>
- flag <player> tempbuffs:|:intelligence_buff_test/<context.args.get[1]>\<util.date.time.hour.add[<context.args.get[2]>]>:<util.date.time.minute.add[<context.args.get[3]>]>
- flag <player> player_intelligence:+:<context.args.get[1]>