Date: 2017/04/17 15:49:29 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
quest:
type: assignment
interact scripts:
- 1 Kill Quest
default constants:
npc_amount: 5
npc_target: 'zombies'
quest_cooldown: 3600
actions:
on assignment:
- trigger name:click toggle:true cooldown:0s
- trigger name:chat toggle:true radius:5
"Kill Quest":
type: interact
steps:
1:
click trigger:
script:
- run "Clicked NPC"
2:
chat trigger:
1:
trigger: /Si/, deseo aceptar tu aventura!
script:
- run "Accepted Quest"
2:
trigger: /No/, no tengo tiempo ahora.
script:
- run "Declined Quest"
3:
trigger: /REGEX:.+/
script:
- narrate "<&c><&o>Respuesta Invalida, por favor intentalo de nuevo."
click trigger:
script:
- zap "s@Kill_Quest" step:1
"Clicked NPC":
type: task
speed: 0
script:
- if <player.has_flag[cooldown_click]> queue clear
- flag player cooldown_click duration:5s
- if <player.has_flag[kill_cooldown]> {
- narrate format:cchat "Puedes repetir esta quest en <player.flag[kill_cooldown].expiration.formatted>"
- queue clear
}
- if <player.has_flag[kill_count]> {
- if <player.flag[kill_count]> < <npc.constant[npc_amount]> {
- narrate format:cchat "No has terminado la quest. Has matado <player.flag[kill_count].as_int> <npc.constant[npc_target]>, te falta matar <math.as_int:<npc.constant[npc_amount]>-<player.flag[kill_count]>>."
- queue clear
}
- if <player.flag[kill_count]> == <npc.constant[npc_amount]> {
- run "Complete Quest"
- queue clear
}
}
- narrate format:cchat "Buenos dias, te gustaria ganar un premio?"
- wait 10t
- narrate format:cchat "Si estas de acuerdo, necesito que mates a <npc.constant[npc_amount]> <npc.constant[npc_target]> para mi"
- wait 10t
- narrate format:cchat "Deseas aceptar la aventura?"
- wait 10t
- execute as_server 'tellraw <player.name> ["",{"text":"["},{"text":"Si","color":"green","bold":true,"italic":true,"clickEvent":{"action":"run_command","value":"si"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Me gustaria ayudarte","color":"green"}]}}},{"text":"/","color":"none","bold":false,"italic":false},{"text":"No","color":"red","bold":true,"italic":true,"clickEvent":{"action":"run_command","value":"no"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"No tengo tiempo actualmente","color":"red"}]}}},{"text":"]","color":"none","bold":false,"italic":false}]'
- zap "s@Kill Quest" step:2
"Accepted Quest":
type: task
script:
- narrate format:cchat "Genial!"
- narrate "[<&c>Mata <npc.constant[npc_amount]> <npc.constant[npc_target]><&f>]"
- flag player quest_started
- flag player kill_count:0
"Declined Quest":
type: task
script:
- random {
- narrate format:cchat "Que lastima!"
- narrate format:cchat "Si cambias de opinion, puedes volver a hablarme"
- narrate format:cchat "Aqui estare si deseas ayudarme"
}
- zap "s@Kill Quest" step:1
"Complete Quest":
type: task
script:
- narrate format:cchat "Buen trabajo! Has terminado la aventura. Toma tu recompensa"
- give i@diamond
- flag player kill_count:!
- flag player kill_cooldown duration:<npc.constant[quest_cooldown]>
# Editar el world script
Kill_listener_World:
type: world
events:
# Poner el tipo de NPC que hay que matar
on player kills zombie:
- if !<player.has_flag[quest_started]> queue clear
- flag player kill_count:++
# Poner la cantidad de NPC que hay que matar
- if <player.flag[kill_count]> == 5 {
- narrate "<&c><&o>[Vuelve con el NPC]"
- flag player quest_started:!
}
cchat:
type: format
format: "<&b><npc.name><&co> <&7><text>"