Date: 2016/11/23 22:15:47 UTC-08: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
on player clicks in sp_buy_inv:
- if <context.raw_slot> < 55 {
- determine passively cancelled
- if <context.raw_slot> > 9 && <context.item> != <i@sp_glass> {
- define worth "<context.item.lore.get[<context.item.lore.size>].after[: ]>"
- define region "<yaml[sp].read[shops.<player.flag[shopinfo].get[1]>.currency]||default>"
- define money "<proc[emoney].context[<def[region]>]>"
- if <context.is_shift_click> {
- if <proc[invspace].sub[<context.item.quantity.mul[8].div[64].round_up>]> >= 0 {
- if <def[money]> >= <def[worth].mul[8]> {
- narrate "<&6><def[worth].mul[8]> <&f><s@g_var.constant[m_<def[region]>_pl]> entfernt."
- run s@emoney_take def:<def[region]>|<def[worth].mul[8]>
- adjust <context.item> "lore:<context.item.lore.remove[<context.item.lore.size>]>" save:item
- repeat 8 {
- give <entry[item].result>
}
}
else {
- narrate "<&4>Du hast nicht genug Geld !"
}
}
else {
- narrate "<&4>Du hast kein Platz!"
}
}
else {
- if <proc[invspace].sub[<context.item.quantity.div[64].round_up>]> >= 0 {
# todo - if <player.flag[sp_<npc.id>]||<yaml[sp].read[]>> >= <def[worth]> {
- if <def[money]> >= <def[worth]> {
- narrate "<&6><def[worth]> <&f><s@g_var.constant[m_<def[region]>_pl]> entfernt."
- run s@emoney_take def:<def[region]>|<def[worth]>
- adjust <context.item> "lore:<context.item.lore.remove[<context.item.lore.size>]>" save:item
- give <entry[item].result>
}
else {
- narrate "<&4>Du hast nicht genug Geld !"
# end of the if }
}
else {
- narrate "<&6><npc.name> <&4>nicht genug Geld um tauschen!"
}
}
else {
- narrate "<&4>Du has nicht genug Platz!"
}
}
}
}
else if <context.is_shift_click> {
- determine cancelled
}