Date: 2018/04/01 07:59:57 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
cchat:
type: format
format: "<green><npc.name>: <white><text>"
skeletonkillquestten:
type: assignment
actions:
on assignment:
- trigger name:click state:true
- trigger name:chat state:true
- trigger name:proximity state:true radius:5
interact scripts:
- 10 skeletonKillQuestTenInteract
skeletonKillQuestTenInteract:
type: interact
steps:
1:
proximity trigger:
entry:
script:
- random {
- narrate format:cchat "<white>Hello <aqua><player.name>!"
- narrate format:cchat "<white>Can you help me?!"
- narrate format:cchat "<white>Up for hunting?"
}
click trigger:
script:
- engage
# check if player have completed the quest.
- if <player.flag[killSkeletonTenQuestCount]> == 10 {
- narrate format:cchat "Great work! Take this for your trouble..."
- narrate "[You recieved a <aqua>Sword of Fire<white>!]"
- give i@SwordOfFire qty:1
- disengage
# if quest completed, remove quest count.
- flag player killSkeletonTenQuestCount:!
- queue clear
}
# if the player is currently doing the quest.
- if <player.has_flag[killSkeletonTenQuestCount]> {
- narrate format:cchat "Did you kill 10 skeletons yet?"
- disengage
- queue clear
}
# if the player has not started and has not completed the quest.
# check if the player has talked to the npc or not.
- if <player.has_flag[killSkeletonTenTalked]> {
- narrate format:cchat "Can you kill 10 skeletons for me?"
- wait 5t
- narrate "[Will you accept? Type <aqua>accept <white> or <aqua>deny]"
- disengage
- queue clear
}
# if the player has not talked to the npc.
- narrate format:cchat "Hello there <aqua><player.name><white>. Would you care for a special prize?"
- wait 5t
- narrate format:cchat "If so, can you kill 10 skeletons for me?"
- wait 5t
- narrate "[Will you accept? Type <aqua>accept <white> or <aqua> deny]"
- flag player killSkeletonsTenTalked
- disengage
chat trigger:
1:
trigger: /accept/
script:
# if player is already doing the quest, do nothing.
- if <player.has_flag[killSkeletonTenQuestCount]> {
- queue clear
}
# if player is not currently doing the quest...
- engage
- narrate format:cchat "Great!"
- wait 5t
- narrate "[You have accepted the quest!]"
- wait 5t
- narrate "[Kill 10 skeletons and then return.]"
# assign the quest and count.
- flag player killSkeletonTenQuestCount:0
- disengage
- flag player killSkeletonTenTalked:!
2:
trigger: /deny/
script:
# if player is already doing the quest, do nothing.
- if <player.has_flag[killSkeletonTenQuestCount]> {
- queue clear
}
- engage
- narrate format:cchat "Fine then..."
- disengage
- flag player killSkeletonTenTalked:!
# World scripts
killskeletontenworld:
type: world
events:
on player kills skeleton:
- if !<player.has_flag[killSkeletonTenQuestCount]> queue clear # checks if player has the quest.
# if the player has the quest...
# Gain a kill count
- flag player killSkeletonTenQuestCount:++
# check if the kill count is less than 10.
- if <player.flag[killSkeletonTenQuestCount]> < 10 {
- narrate "[Skeletons killed <player.flag[killSkeletonTenQuestCount]>/10]"
}
# check if the kill count is equal to 10.
- if <player.flag[killSkeletonTenQuestCount]> == 10 {
- narrate "[Skeletons killed <player.flag[killSkeletonTenQuestCount]>/10]"
- wait 5t
- narrate "[Quest completed! Return to the NPC]"
}
# check if the kill count is greater than 10.
- if <player.flag[killSkeletonTenQuestCount]> > 10 {
- flag player killSkeletonTenQuestCount:10
}
# Custom Items
SwordOfFire:
type: item
material: diamond_sword
display name: Sword of Sword
lore:
- A sword forged by fire.
enchantments:
- FIRE_ASPECT: 2