Date: 2016/08/13 14:50:18 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
TutorialMiner:
type: assignment
interact scripts:
- 10 TutorialMinerQuest
TutorialMinerQuest:
type: interact
steps:
1:
click trigger:
script:
- ^zap step:2 ## Remember to zap to stage 2 but all this is the same as before.
- narrate "<&a><&l>Miner: <&f>Hello there."
- wait 2
- narrate "<&a><&l>Miner: <&f>Go get me some Mithril Ore."
- wait 2
- zap step:3
2:
click trigger:
script:
- narrate "You can't do that right now."
- wait 5
3:
click trigger:
script:
- zap step:2
- if <player.flag[MithrilOre]> == 1 && <player.inventory.contains[iron_ore].qty[3]> { ## Simple IF..THEN..ELSE..
- ^take iron_ore qty:3 ## This is the command to take items from the player, note the ^ that means it happens instantly. Without that there will be a 0.5s delay.
- narrate "<&a><&l>Blacksmith: <&f>Perfect this will do, just a moment"
- wait 2
- narrate "<&o>The Blacksmith starts hammering on his anvil."
- wait 2
- narrate "<&a><&l>Blacksmith: <&f>There you go! A nice and sharp sword."
- give i@SteelSword ## This is the give command, it is a custom item which we will look at alter.
- wait 3
- zap step:4 ## And we go to the last stage, the final stage for this NPC.
} else {
- zap step:2
- narrate "<&a><&l>Blacksmith: <&f>Sorry I need 3 iron ore before I can make a sword."
- wait 4
- zap step:3 ## We zap back to step 3 as he has not cleared it yet.
}
4:
click trigger:
script:
- zap step:2
- random { ## This random command is very useful to make NPCs a little more interesting.
- narrate "<&a><&l>Blacksmith: <&f>Goodluck on your travels!" ## The rest of the script is just a basic textline and making sure to zap to stage 2 and back to stage 4 at the end.
- narrate "<&o>The Blacksmith is too busy to notice you."
- narrate "<&a><&l>Blacksmith: <&f>May my tools protect you."
}
- wait 3
- zap step:4
ClickMithrilOre:
type: world
events:
on player right clicks at ARMOR_STAND:
- if <context.entity> == e@141d286a-d697-4932-9441-a0232191b4c4 { ## This is the exact entity id of the Armorstand, Joey can enable a script that narrates this id when you right click Armorstands.
- if <player.flag[DwarfMithrilOre]> == 1 {
- narrate "<&o>I can't carry anymore."
- wait 1
} else {
- ^narrate "<&o>You gather some Mithril Ore."
- ^give i@MithrilOre qty:1
- ^flag player DwarfMithrilOre:1
}
}