Date: 2019/09/15 21:36:54 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
Altar_prayer_start:
type: world
events:
on player right clicks diamond_block in altar:
- if !<player.has_flag[Religious]>:
- narrate "Only religious leaders can start prayers."
- stop
- if <player.has_flag[Religious]>:
- if <context.location.cuboids.get[1].list_npcs.size> > 1:
- narrate "There are too many NPCs in the altar area! Only the cleric is allowed inside during prayer."
- stop
- if <context.location.cuboids.get[1].list_npcs.size> < 1:
- narrate "Your altar is missing a cleric NPC."
- stop
- if !<context.location.cuboids.get[1].list_npcs.get[1].has_flag[Cleric]>:
- narrate "The NPC in the altar area is not a cleric."
- stop
- define players <context.location.cuboids.get[1].list_players>
- define npc <context.location.cuboids.get[1].list_npcs.get[1]>
- define list li@
- if <context.location.cuboids.get[1].list_players.size> >= 1:
- if <def[npc].flag[Worship]> >= 0 && <def[npc].flag[Worship]> < 1000:
- if <context.location.cuboids.get[1].list_players.size> > 10:
- narrate "This altar hasn't been used enough to allow more than 10 players to pray at a time!"
- stop
- if <def[npc].flag[Worship]> >= 1000 && <context.location.cuboids.get[1].list_players.size> > 15:
- if <context.location.cuboids.get[1].list_players.size> > 10:
- narrate "Only 15 players can pray at once!"
- stop
- foreach <def[players]>:
- flag <def[npc]> Worship:+:1
- define quantity:+:1
- foreach <def[players]>:
- if <player.item_in_hand.contains_text[leather]>:
- if !<player.has_flag[CattleAnimist]>:
- flag player CattleAnimist:+:1
- if <player.flag[CattleAnimist]> >= 0 && <player.flag[CattleAnimist]> < 50:
- if <util.random.int[1].to[12]> != 12:
- define item leather
- else:
- define item milk_bucket
- define list:->:<[item]>
- drop <[item]> <player.location.above[2]> quantity:<[quantity]>
- flag server AnimismCattle:+:1
- flag player CattleAnimist:+:1
- flag <def[npc]> AnimismCattle:+:1
- narrate "Ritual starts"
- drop <[list]> <player.location.above[2]> quantity:<def[quantity]>
- stop