Date: 2018/11/08 16:15:42 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
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
NPCSwordRepairman1:
type: assignment
actions:
on assignment:
- trigger name:click state:true
- trigger name:proximity state:true radius:3
#items price
- flag npc m@wooden_sword:!|:50
- flag npc m@stone_sword:!|:100
- flag npc m@iron_sword:!|:200
- flag npc m@golden_sword:!|:500
- flag npc m@diamond_sword:!|:1000
on enter proximity:
- narrate format:sword "Вы повредили свой меч? Я тот, кто вам нужен"
Interact Scripts:
- 10 NPCSwordRepairman1_interact
NPCSwordRepairman1_interact:
type: Interact
Steps:
1:
click trigger:
Script:
- engage
#if in the hands of the material from the list, reports its price, if not, says that it can repair for a small amount
- if <npc.has_flag[<player.item_in_hand.material>]> = true {
- narrate format:sword "Здравствуй, меня зовут <npc.name>, я могу починить твой меч за <npc.flag[<player.item_in_hand.material>]> рублей"
} else {
- narrate format:sword "Здравствуй, меня зовут <npc.name>, я могу починить твой меч за небольшую сумму"
}
- narrate format:sword "Если вы согласны, передайте мне меч ПКМ"
#if in the hands of the material from the list, reports its price, if not, says that it can repair for a small amount
- if <npc.has_flag[<player.item_in_hand.material>]> != true {
- zap 4
} else {
- if <player.item_in_hand.durability> != 0 {
- if <player.money> >= <npc.flag[<player.item_in_hand.material>]> {
- zap 2
} else {
- zap 3
}
} else {
- zap 6
}
}
- disengage
#zap 2 repair
#zap 3 no money
#zap 4 checking on: item from the list; enough money; need to repair
#zap 5 re-check
#zap 6 item does not need to be repaired
2:
click trigger:
Script:
- engage
- money take quantity:<npc.flag[<player.item_in_hand.material>]>
- narrate format:economy "Вы заплатили <&f><npc.flag[<player.item_in_hand.material>]><&e> рублей."
- ^adjust <player.item_in_hand> durability:<player.item_in_hand.durability.add[-1000]> save:myitem
- ^take iteminhand
- ^equip npc.name <entry[myitem].result> hand
- random {
- wait 3s
- wait 5s
- wait 7s
}
- equip npc.name hand:i@air
- drop <entry[myitem].result> <npc.locations>
- random {
- narrate format:sword "Пока!"
- narrate format:sword "Рад буду видеть снова!"
}
- disengage
- zap 1
- queue clear
3:
click trigger:
Script:
- narrate format:sword_red "Вам нечем платить"
- zap 1
- queue clear
4:
click trigger:
Script:
- narrate format:sword_red "Я чиню только мечи"
- narrate format:sword "Передай мне свой меч пожалуйста."
- if <npc.has_flag[<player.item_in_hand.material>]> != true {
- zap 5
} else {
- if <player.item_in_hand.durability> != 0 {
- if <player.money> >= <npc.flag[<player.item_in_hand.material>]> {
- zap 2
} else {
- zap 3
}
} else {
- zap 6
}
}
5:
click trigger:
Script:
- if <npc.has_flag[<player.item_in_hand.material>]> != true {
- narrate format:sword "Не хочешь? ну и ладно"
- zap 1
- queue clear
} else {
- if <player.item_in_hand.durability> != 0 {
- if <player.money> >= <npc.flag[<player.item_in_hand.material>]> {
- zap 2
} else {
- zap 3
}
} else {
- zap 6
}
}
6:
click trigger:
Script:
- narrate format:sword_green "Друг, твой меч в полном порядке"
- zap 1
- queue clear