Date: 2014/12/28 16:18:15 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
PetShopPuppyAssignment:
type: assignment
debug: false
actions:
on assignment:
- trigger "name:click" "state:true"
interact scripts:
- 10 PetShopPuppyInteract
PetShopPuppyInteract:
type: interact
debug: false
steps:
1:
click trigger:
script:
- inventory open "d:in@PetShopPuppyInventory"
PetShopKittenAssignment:
type: assignment
debug: false
actions:
on assignment:
- trigger "name:click" "state:true"
interact scripts:
- 10 PetShopKittenInteract
PetShopKittenInteract:
type: interact
debug: false
steps:
1:
click trigger:
script:
- inventory open "d:in@PetShopKittenInventory"
PetShopEvents:
type: world
debug: false
events:
on player clicks in in@PetShopPuppyInventory:
- determine passively cancelled
- if <context.raw_slot> >= 1 && <context.raw_slot> <= 18 && <context.item||i@air> != i@air {
- define loreline <context.item.lore.size||0>
- if %loreline% == 0 {
- narrate "That item randomly doesn't have a fking price!"
}
- define price "<context.item.lore.get[%loreline%].after[Price<&co> $]>"
- if <player.flag[morpheconomy.money].as_money||0.00> >= %price% {
- flag global "PetShop.Confirm.Title:Dog w/<context.item.display_name>"
- flag global "PetShop.Confirm.Size:18"
- flag global "PetShop.Confirm.Price:%price%"
- flag global "PetShop.Confirm.ExtraData:<context.item.material.name.replace[_wool]>"
- inventory open "d:in@PetShopConfirmationWindow"
}
else {
- narrate "<red>You don't have enough money for that!"
}
}
on player clicks in in@PetShopKittenInventory:
- determine passively cancelled
- if <context.raw_slot> >= 1 && <context.raw_slot> <= 9 && <context.item||i@air> != i@air {
- define loreline <context.item.lore.size||0>
- if %loreline% == 0 {
- narrate "That item randomly doesn't have a fking price!"
}
- define price "<context.item.lore.get[%loreline%].after[Price<&co> $]>"
- if <player.flag[morpheconomy.money].as_money||0.00> >= %price% {
- flag global "PetShop.Confirm.Title:Kitten (<context.item.display_name>)"
- flag global "PetShop.Confirm.Size:9"
- flag global "PetShop.Confirm.Price:%price%"
- flag global "PetShop.Confirm.ExtraData:<context.item.display_name.to_lowercase.replace[ ].with[_]>"
- inventory open "d:in@PetShopConfirmationWindow"
}
else {
- narrate "<red>You don't have enough money for that!"
}
}
on player clicks in in@PetShopConfirmationWindow:
- determine passively cancelled
- if <context.raw_slot> >= 1 && <context.raw_slot> <= <context.inventory.size> && <context.item||i@air> != i@air {
- if <context.item.display_name> == "<red>No" {
- inventory open "d:in@PetShopPuppyInventory"
- determine cancelled
}
- define price "<context.item.lore.get[2].after[Price<&co> $]>"
- if <player.flag[morpheconomy.money].as_money||0.00> >= %price% {
- define title <context.inventory.title>
- if "<def[title].starts_with[Dog w/]>" {
- spawn "e@wolf[age=baby;color=<context.item.lore.get[1]>;tame=true|<player>;sitting=true]" <player.location>
}
else if "<def[title].starts_with[Kitten (]>" {
- spawn "e@ocelot[age=baby;color=<context.item.lore.get[1]>;tame=true|<player>;sitting=true]" <player.location>
}
- flag "morpheconomy.money:--:%price%"
- inventory close
}
else {
- narrate "<red>You don't have enough money for that!"
}
}
PetShopPuppyInventory:
type: inventory
debug: false
size: 18
title: <dark_green>Choose your collar color<&co>
definitions:
red: i@red_wool[display_name=<red>Red Collar;lore=Price<&co> $10]
orange: i@orange_wool[display_name=<gold>Orange Collar;lore=Price<&co> $10]
yellow: i@yellow_wool[display_name=<yellow>Yellow Collar;lore=Price<&co> $10]
green: i@green_wool[display_name=<dark_green>Green Collar;lore=Price<&co> $10]
blue: i@blue_wool[display_name=<dark_blue>Blue Collar;lore=Price<&co> $10]
light_blue: i@light_blue_wool[display_name=<blue>Light Blue Collar;lore=Price<&co> $10]
magenta: i@magenta_wool[display_name=<light_purple>Magenta Collar;lore=Price<&co> $10]
pink: i@pink_wool[display_name=<light_purple>Pink Collar;lore=Price<&co> $10]
white: i@white_wool[display_name=<white>White Collar;lore=Price<&co> $10]
light_gray: i@light_gray_wool[display_name=<gray>Light Gray Collar;lore=Price<&co> $10]
black: i@black_wool[display_name=<black>Black Collar;lore=Price<&co> $10]
brown: i@brown_wool[display_name=<dark_red>Brown Collar;lore=Price<&co> $10]
cyan: i@cyan_wool[display_name=<dark_aqua>Cyan Collar;lore=Price<&co> $10]
purple: i@purple_wool[display_name=<dark_purple>Purple Collar;lore=Price<&co> $10]
gray: i@gray_wool[display_name=<dark_gray>Gray Collar;lore=Price<&co> $10]
lime: i@lime_wool[display_name=<green>Lime Collar;lore=Price<&co> $10]
slots:
- "[red] [orange] [yellow] [green] [blue] [light_blue] [magenta] [pink] []"
- "[white] [light_gray] [black] [brown] [cyan] [purple] [gray] [lime] []"
PetShopKittenInventory:
type: inventory
debug: false
size: 9
title: <dark_green>Choose your kitten type<&co>
definitions:
black: i@black_wool[display_name=Black Cat;lore=Price<&co> $10]
red: i@orange_wool[display_name=Red Cat;lore=Price<&co> $10]
siamese: i@light_gray_wool[display_name=Siamese Cat;lore=Price<&co> $10]
wild: i@yellow_wool[display_name=Wild Ocelot;lore=Price<&co> $10]
slots:
- "[black] [red] [siamese] [wild] [] [] [] []"
PetShopConfirmationWindow:
type: inventory
debug: false
size: <server.flag[PetShop.Confirm.Size]>
title: <server.flag[PetShop.Confirm.Title]>
definitions:
accept: i@green_wool[display_name=<green>Yes;lore=<server.flag[PetShop.Confirm.ExtraData]>|Price<&co> <&ds><server.flag[PetShop.Confirm.Price]>]
deny: i@red_wool[display_name=<red>No]
slots:
- "[] [] [] [] [] [] [] <tern[<server.flag[PetShop.Confirm.Size].is[==].to[9]>]:[accept] [deny]||[] [accept]>"
- "<tern[<server.flag[PetShop.Confirm.Size].is[==].to[9]>]:||[] [] [] [] [] [] [] [] [deny]>"