Date: 2015/06/25 22:04:56 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Use this to give points
# - run task_points def:POINTS
task_points:
type: task
definitions: points
script:
- ^if <global.flag[point_cooldown]> queue clear
- ^flag global point_cooldown duration:10s
- ^if <player.flag[point_cooldown]> queue clear
- ^flag player point_cooldown duration:10m
- ^flag player points_waiting:+:%points%
- ^if <player.flag[points_waiting]> < 50 {
- ^queue clear
}
- ^if <player.flag[points_waiting]> < 10 {
- ^execute as_server "enjin removepoints <player.name> <player.flag[points_waiting].abs.as_int>"
- ^queue clear
}
- ^execute as_server "enjin addpoints <player.name> <player.flag[points_waiting].as_int>"
- flag player points_waiting:0
enjin_points_listener:
type: world
events:
on entity death:
- if <context.entity.location.world.name> == TrappeChest queue clear
- if <context.damager> !matches player queue clear
- run enjin_entity_death delay:1t def:<context.damager>|<context.entity>
on player death:
- if <context.entity.location.world.name> == TrappeChest queue clear
- run enjin_player_death delay:1t def:<context.damager>|<context.entity>
on server start:
- run enjin_points_loop delay:1m
enjin_entity_death:
type: task
script:
- if li@creeper|skeleton|zombie contains <def[2].entity_type> {
- run task_points as:%1% def:5
- announce to_console "<def[1].name> gains 5 points for killing a weak mob"
}
- if li@silverfish|pig_zombie|spider|witch|blaze|magma_cube contains <def[2].entity_type> {
- run task_points as:%1% def:10
- announce to_console "<def[1].name> gains 10 points for killing a big mob"
}
- if <def[2].entity_type> == wither {
- run task_points def:250 as:%1%
- announce to_console "<def[1].name> gains 250 points for killing a wither"
}
- if <def[2].entity_type> == ender_dragon {
- run task_points def:500 as:%1%
- announce to_console "<def[1].name> gains 500 points for killing an ender_dragon"
}
enjin_player_death:
type: task
script:
- run task_points as:%2% def:-10
- if <def[1].entity_type> == player {
- run task_points as:%1% def:10
- announce to_console "<def[1].name> gains 10 points for killing a player"
}
enjin_points_loop:
type: task
script:
- foreach <server.list_online_players> {
- flag %value% time_online:++
- if <def[value].flag[time_online]> >= 60 {
- run task_points as:%value% def:25
- flag %value% time_online:0
- announce to_console "<def[value].name> gains 25 points for being online 60 minutes"
}
}
- run enjin_points_loop delay:1m