Date: 2018/11/02 22:29:52 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
# +----------------------
# | GraveSpawn
# |
# | Spawn in the nearest predefined location(s) (Graveyard)!
# +----------------------
#
# @author ShadyMac
# @denizen-version 1.0.3-snapshot (BUILD 448-dev)
# @version 1.0
#
# Usage: /gravespawn
# When a player dies in of the defined worlds
# and one/multiple graveyards exist in this
# world, he will respawn in the nearest one
# to him.
# +----------------------
#
GraveSpawn:
type: world
events:
###Die Event
on player dies:
#Define Player Location
- define player_location "<player.flag[gravespawn.location] .as_location>"
#Flag Player location when die
- flag player "gravespawn.location:<player.location>"
#Keep Inventory
- determine passively KEEP_INV
#Keep Level
- determine KEEP_LEVEL
###
###
###Respawn Event
###
on player respawns:
#Define returned Death Location
- define player_location "<player.flag[gravespawn.location].as_location>"
#Define Location of Graveyards on map
- define location_list <s@graveyard_list.yaml_key[WORLD_NAME]>
#Define Respawn Location Chosen
- define respawn_location "<def[location_list].sort_by_number[distance_squared[<player.location>]].get[1]>"
#Sends Respawn Message
- narrate "You have respawned in a safe location."
#Determine which Graveyard is closest and send player
- determine <def[respawn_location]>
#
###Graveyard Coords###
graveyard_list:
type: yaml data
WORLD_NAME:
- l@-1758,59,-1621,QCX1
- l@-1758,59,1621,QCX1