Date: 2018/02/19 03:45:27 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
Builder_npc:
type: assignment
actions:
on assignment:
- trigger name: click state:true
- trigger name:proximity toggle:true radius:3
- flag <npc> list:li@i@stone|
- flag <npc>
on enter proximity:
- narrate "[Bob]->[you]: Hey toi! Oui toi! On a encore besoin de plein de chose" targets:<player>
- foreach <npc.flag[list]>:
- narrate "On a besoin de <npc.flag[<def[value]>]> <def[value]>"
on click:
- if <player.item_in_hand.simple> == i@air {
- narrate "[Bob]->[you]: Hey toi! Oui toi! On a encore besoin de plein de chose" targets:<player>
- foreach <npc.flag[list]> :
- narrate "On a besoin de <npc.flag[<def[value]>].after[@]> <def[value].after[@]>"
- queue clear
}
- if !<npc.flag[list].contains[<player.item_in_hand.simple]> {
- narrate "[Bob]->[you]: Hey toi! Oui toi! On a encore besoin de plein de chose" targets:<player>
- foreach <npc.flag[list]>:
- narrate "On a besoin de <npc.flag[<def[value]>]> <def[value].after[@]>"
- queue clear
}
- define q <player.item_in_hand.quantity>
- if %q% > <npc.flag[<player.item_in_hand.simple>]> {
- take iteminhand quantity:<math.as_int:%q%-<npc.flag[<player.item_in_hand.simple>]>>
- flag <npc> <player.item_in_hand.simple>:!
- flag <npc> list:<-:<player.item_in_hand.simple>
- if <npc.flag[list].size> == 0 {
- flag npc list:!
- narrate "Nous avons tous qu'il nous faut! Merci."
- queue clear
}
- narrate "Merci nous avons assez de <player.item_in_hand.formatted>"
- queue clear
}
- take iteminhand quantity:%q%
- flag <npc> <player.item_in_hand.simple>:<math.as_int:<npc.flag[<player.item_in_hand.simple>]>-%q%>
- narrate "Merci, nous avons encore besoin de <npc.flag[<player.item_in_hand.simple>]> <player.item_in_hand.simple>"