Date: 2017/08/11 22:39:36 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
73
74
75
76
77
78
79
80
81
82
83
84
85
#
#This file uses - if !<player.has_flag[erpg_region]> queue clear
#This file uses - [REQ]env_player-closes-inv.yml
#
pl_inv_small:
type: inventory
inventory: chest
title: Loot Kiste
size: 27
procedural items:
- determine <player.flag[inv_data]>
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
pl_inv_big:
type: inventory
inventory: chest
title: Loot Kiste
size: 54
procedural items:
- determine <player.flag[inv_data]>
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
lc_emptytask:
type: task
script:
- define 1 1
#- narrate "<&6>THIS IS A EXAMPLE TASK SCRIPT MESSAGE"
lc_chesthandler:
type: world
debug: false
events:
on player right clicks chest:
- if <yaml[lt].contains[<context.location.simple>]||false> {
- if !<player.has_flag[erpg_region]> {
- narrate "<&4>Access denied."
- queue clear
}
- determine passively cancelled
- define region "<yaml[lt].read[chest.loc.<context.location.simple>.name]||default>"
- define id "<yaml[lt].read[chest.loc.<context.location.simple>.id]>"
- flag player "lc_lastchestid:<def[id]>"
- run s@sound def:custom_chest_open
- if <yaml[lt_<player>].contains[inv.id.<def[id]>]> {
- flag player inv_data:<yaml[lt_<player>].read[inv.id.<def[id]>.items]>
} else {
- narrate "<&6>Du hast eine neue Kiste gefunden!"
- define locname "<yaml[lt].read[chest.loc.<context.location.simple>.name]>"
- define invname "<yaml[lt].read[chest.loc.<context.location.simple>.inv]>"
- flag player "inv_data:<yaml[lt].read[inv.<def[region]>.name.<def[invname]>]>"
- inject <yaml[lt].read[chest.<def[region]>.id.<def[id]>.script]>
- yaml id:lt set "chest.<def[region]>.id.<def[id]>.finders:->:<player>"
- yaml id:lt_<player> set "inv.<def[region]>.name:->:<def[locname]>/<def[invname]>"
- yaml id:lt_<player> set "inv.<def[region]>.id_list:->:<def[id]>"
- define money "<yaml[lt].read[chest.<def[region]>.id.<def[id]>.money]>"
- if <def[money]> != 0 {
- run s@emoney_give def:<def[region]>|<def[money]>
- narrate "Du hast beim Fund dieser Kiste <&6><def[money]> <s@g_var.constant[m_<def[region]>_pl]> <&f>erhalten."
}
}
#Open Chest
- inventory open d:in@pl_inv_<yaml[lt].read[chest.<def[region]>.loc.<context.location.simple>.size]>
- queue clear
} else if <player.flag[erpg_region]||x> == erpg {
- narrate "This is a public chest!"
}