- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleEdit of P#16259 - Edit of P#16257 - Edit of P#16255 - Edit of P#16253 - Edit of P#16251 - Edit of P#
TypeDenizen Script
Date2015/06/04 04:04:04 UTC-07:00
ByGuest
OtherEdit of paste #16259 - click here to see edit details
Paste
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
22500
Bounty:
    type: format
    format"<green>Bounty Officer<white><text>"

Bounty Kill Mobs:
    type: world
    debug: false
    events:
        on entity death:
            - if <context.damager.entity_type||none> == PLAYER {
                - define killer <context.damager>
                - define type <context.entity.entity_type>
                - define baby <context.entity.age.is[LESS].than[0]>
                - define burning <context.entity.fire_time.in_seconds.is[!=].to[0]>
                - if %type% == PIG {
                    - determine passively NO_XP
                    - if %baby% {
                        - determine NO_DROPS
                    } else if %burning% {
                        - determine li@i@grilled_pork
                    } else {
                        - determine li@i@pork
                    }
                } else if %type% == CHICKEN {
                    - determine passively NO_XP
                    - if %baby% {
                        - determine NO_DROPS
                    } else if %burning% {
                        - determine li@i@cooked_chicken
                    } else if <util.random.int[1].to[10]> < 6 {
                        - determine li@i@raw_chicken|i@feather
                    } else {
                        - determine li@i@raw_chicken
                    }
                } else if %type% == SHEEP {
                    - determine passively NO_XP
                    - if %baby% {
                        - determine NO_DROPS
                    }
                    else if %burning% {
                        - determine li@i@cooked_mutton
                    }
                    else if <util.random.int[1].to[10]> < 7 {
                        - define colour <context.entity.color>
                        - if %colour% == silver define colour light_gray
                        - determine li@i@mutton|i@%colour%_wool
                    } else {
                        - determine li@i@mutton
                    }
                } else if %type% == COW {
                    - determine passively NO_XP
                    - if %baby {
                        - determine NO_DROPS
                    } else if %burning% {
                        - determine li@i@cooked_beef
                    } else if <util.random.int[1].to[10]> < 4 {
                        - determine li@i@leather|i@raw_beef
                    } else {
                        - determine li@i@raw_beef
                    }
                } else if %type% == HORSE {
                    - determine NO_DROPS_OR_XP
                } else if %type% == RABBIT {
                    - determine passively NO_XP
                    - if %baby% {
                        - determine NO_DROPS
                    } else if %burning% {
                        - determine li@i@cooked_rabbit
                    } else if <util.random.int[1].to[10]> < 3 {
                        - determine li@i@rabbit|i@rabbit_foot
                    } else {
                        - determine li@i@rabbit
                    }
                } else if %type% == MUSHROOM_COW {
                    - determine passively NO_DROPS_OR_XP
                    - define drops li@
                    - if <util.random.int[1].to[10]> < 3 {
                        - define drops <%drops%.include[i@leather]>
                    }
                    - if <util.random.int[1].to[100]> < 85 {
                        - define drops <%drops%.include[i@red_mushroom]>
                    - if <util.random.int[1].to[100]> < 5 {
                        - define drops <%drops%.include[i@raw_beef]>
                    }
                    - if <%drops%.size> != 0
                        - determine %drops%
                    }
                } else if %type% == SQUID {
                    - determine passively NO_XP
                    - determine li@i@ink_sack
                } else if <def[type].contains_any[wolf|ocelot|bat|villager]> {
                    #- narrate format:Bounty "You killed a <context.entity.entity_type.to_lowercase> and gained no xp!" targets:%killer%
                    - determine NO_DROPS_OR_XP
                } else if %type% == SPIDER || %type% == CAVE_SPIDER {
                    - determine passively 5
                    - define drops li@
                    - if <util.random.int[1].to[100]> < 40 {
                        - define drops <%drops%.include[i@string]>
                    }
                    - if <util.random.int[1].to[100]> < 80 {
                        - define drops <%drops%.include[i@spider_eye]>
                    }
                    - if <%drops%.size> != 0 {
                        - determine %drops%
                    }
                } else if %type% == SKELETON {
                    - determine passively 5
                    - define drops li@i@bone
                    - if <util.random.int[1].to[100]> < 5 {
                        - define drops <%drops%.include[i@bow[durability=<util.random.int[195].to[300]>]]>
                    }
                    - determine %drops%
                } else if %type% == CREEPER {
                    - determine passively NO_DROPS
                    - determine passively 5
                    - if <util.random.int[1].to[100]> < 65 {
                        - determine li@i@sulphur
                    }
                } else if %type% == ZOMBIE {
                    - determine passively 5
                    - determine li@i@rotten_flesh
                } else if %type% == PIG_ZOMBIE {
                    - determine passively 7
                    - define drops li@i@rotten_flesh
                    - if <util.random.int[1].to[10]> < 2 {
                        - define drops <%drops%.include[i@gold_nugget]>
                    }
                    - determine %drops%
                } else if %type% == ENDERMAN {
                    - determine passively NO_DROPS
                    - determine passively 8
                    - if <util.random.int[1].to[10]> < 4 {
                        - determine li@i@ender_pearl
                    }
                } else if %type% == SILVERFISH {
                    - determine passively 5
                    - determine NO_DROPS
                } else if %type% == WITCH {
                    - determine 5
                    - random {
                        - determine li@i@stick|i@stick
                        - determine li@i@stick|i@stick
                        - determine li@i@stick|i@stick
                        - determine li@i@sugar|i@sugar
                        - determine li@i@spider_eye|i@stick
                    }
                }
                #- announce "<aqua><%killer%.name> <white>killed a <yellow>%type%" to_console
            } else {
                - determine NO_DROPS_OR_XP
            }

Bounty Command:
    type: command
    debug: false
    name: bounty
    usage: /bounty [player] [amount]
    description: Allows you to check and place bounty on a player.
    allowed help:
        - determine <player.flag[verified]||<context.server>>
    tab complete:
        - if <player.has_flag[verified]||<context.server>> determine <server.list_online_players.parse[name].filter[starts_with[<context.args.first>]]>
    script:
        - if <context.args.size> == 0 || <context.args.size> > 2 {
            - narrate format:ServerChat "Invalid number of arguments. <&nl>     Correct command syntax<white>/bounty [player] [amount]"
            #- narrate format:ServerChat "Correct command syntax: <white>/bounty [player] [amount]"
        }
        else if <context.args.size> == 1 {
            - define selPlayer <server.match_player[<context.args.get[1]>]||none>
            - if %selPlayer% != none {
                - define amount <%selPlayer%.flag[bounty]||0>
                - narrate format:ServerChat "<Yellow><%selPlayer%.name> <blue>has <white>$%amount% <blue>bounty on them"
                - log "<player.name||Console> checked the bounty of <%selPlayer%.as_player.name>Bounty: $<%selPlayer%.as_player.flag[bounty]||0>" file:plugins/Denizen/logs/bounty.log
            }
            else {
                - narrate format:ServerChat "No player found by that name!"
            }
        }
        else if <context.args.size> == 2 {
            - define selPlayer <server.match_player[<context.args.get[1]>]||none>
            - if %selPlayer% != none {
                - define amount <context.args.get[2].as_int||none>
                - if %amount% != none && %amount% > 0 {
                    - if <context.server> || <player.money> >= %amount% {
                        - flag <%selPlayer%.as_player> bounty:<t[<%selPlayer%.has_flag[bounty]>]:<%selPlayer%.flag[bounty].add[%amount%]>||%amount%>
                        - if !<context.server> {
                            - take money qty:<def[amount]>
                        }
                        - narrate format:ServerChat "You added <white>$%amount% <blue>bounty to <yellow><%selPlayer%.as_player.name><&nl>                   <blue>Total bounty<white>$<%selPlayer%.as_player.flag[bounty]>" targets:<player>
                        - narrate format:ServerChat "<yellow><player.name||Console> <blue>placed a bounty on <yellow><%selPlayer%.as_player.name><&nl>                   <blue>They now have a total bounty of<white>$<%selPlayer%.as_player.flag[bounty]>" targets:<server.list_online_players.exclude[<player||none>|<%selPlayer%.as_player>]>
                        - narrate format:ServerChat "<yellow><player.name> <blue>placed a bounty on you for <white>$%amount%<&nl>                   <blue>You now have <white>$%amount% <blue>in bounty on your head!"
                        - log "<player.name||Console> added $%amount% bounty to <%selPlayer%.as_player.name>. Total bounty<%selPlayer%.as_player.flag[bounty]>" file:plugins/Denizen/logs/bounty.log
                    }
                    else {
                        - narrate format:ServerChat "You do not have enough money!" targets:<player>
                        - log "<player.name> attempted to add $%amount% bounty to <%selPlayer%.as_player.name> but did not have enough funds." file:plugins/Denizen/logs/bounty.log
                    }
                }
                else {
                    - narrate format:ServerChat "Invalid amount. Enter a whole, positive number. <&nl>                   e.g. 500"
                }
            }
            else {
                - narrate format:ServerChat "No player found by that name!"
            }
        }

Bounty Reward:
    type: world
    events:
        on player kills player:
            - define killed <context.entity>
            - if <%killed%.has_flag[bounty]> {
                - define bounty <%killed.flag[bounty]>
                - give money qty:%bounty%
                - flag <%killed%.as_player> bounty:!
                - narrate format:ServerChat "<yellow><player.name> <blue>killed <yellow><%killed%.as_player.name> <blue>and retrieved <white>$%bounty% <blue>in bounty!" targets:<server.list_online_players.exclude[<player>|<%killed%.as_player>]>
                - narrate format:ServerChat "You killed <yellow><%killed%.as_player.name> and gained <white>$%amount% from their bounty!" targets:<player>
                - narrate format:ServerChat "<yellow><player.name> <blue>killed you and collected your bounty!" targets:<%killed%.as_player>
            }
            else {
                - narrate format:ServerChat "You have been killed by <yellow><player.name><&nl>                   <blue>You can place a bounty on them using <white>/bounty"
            }




RawRaw



Pastes made: 66918