Date: 2014/10/15 18:47:03 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
On Death Body Generation Event:
#
# Please keep all flags for the class under a <script.name>.<def[name of yur flag]>
#
type: world
events:
on player death:
- create player <context.entity.name.display> <context.entity.location> traits:inventory save:body
- define npc <entry[body].created_npc>
- wait d@10t
- adjust <def[npc]> "set_assignment:s@dead body assignment"
- announce "%npc% <def[npc]>"
- inventory swap d:<%npc%.inventory> o:<player.inventory>
- determine NO_DROPS_OR_XP
#todo: mor
#on npc death:
#- determine NO_DROPS_OR_XP
tie:
type: assignment
actions:
on assignment:
- animate <npc> animation:sleep
on click:
- inventory open d:<npc.inventory>
swp:
type: task
script:
- inventory swap d:<player.selected_npc.inventory> o:<player.inventory>
dead body assignment:
type: assignment
actions:
on assignment:
-
- flag npc date_of_death:<server.current_time_millis>
- flag npc deadbody
- wait d@3t
- animate <npc> animation:sleep
- run remove def:<npc> delay:d@10m
#todo:
#right click loot
#shift right click pickup body
on click:
- define age_millis <server.current_time_millis.sub_int[<npc.flag[date_of_death]>]>
- narrate "The body appears to be <def[age_millis].div[1000].as_duration.formatted> old..."
- announce "<npc.name> <npc.inventory>"
- inventory open d:<npc.inventory>
#3 days
on spawn:
- if <util.date.time.duration.in_ticks.sub_int[<d@3d.in_ticks>]> > <npc.flag[date_of_death]> remove <npc>
on remove:
- announce "The body of <npc.name> is decaying."
#maybe one day put a gravestone there with a chest underneath with date and name and reason of death
# Gravestone? maybe a temp gravestone then....