#---------------------------------------------+ #Created: 05.01.17 | #Last change: 06.01.17 | #dGraveyards by BloodEko | # | # Let your players spawn on the nearest | # of your predefined locations | # | # spawning: no permission required | # defining graveyards: op / dgrave.admin | # | #---------------------------------------------+ # Usage: /dgrave | #---------------------------------------------+ # When a player dies in of the defined worlds | # and one/multiple graveyards exist in this | # world, he will respawn on the nearest one | # to him and get affected by the defined | # settings(loose items/xp, message) , else | # he would just respawn normally and don't | # get affected by dGraveyards. | #---------------------------------------------+ # # Only edit settings in the config documented # with a [] arround. # # dGraveyards_config: type: version - version: 0.2 + version: 0.4 id: 124 link: http://one.denizenscript.com/denizen/repo/entry/124 # #[When a player dies in these worlds, he will get teleported.] # affected_worlds: - world - world_nether - world_end # #[Whether he respawns with his items on a graveyard, or drops them normally.] # loose_items_on_death: true # #[Whether he respawns with his XP on a graveyard, or drops them normally.] # loose_xp_on_death: true # #[When a player respawns he will get this message] # respawn_message: "You respawned on a safe place." # # # # # ############################ #BELOW INTERNAL PLUGIN CODE# #EDITS ARE NOT RECOMMED # ############################ dGraveyards_handler: type: world events: # # #RESPAWN EVENT # on player respawns: - define player_location "" - define location_list ].as_list||x> - define respawn_location "]].get[1]||x>" - if == x { - queue clear } - choose "": - case "items": - inventory set d: o: - adjust "equipment:" - case "xp": - experience give player: - case "all": - experience give player: - inventory set d: o: - adjust "equipment:" - narrate "" - determine # # #DIE EVENT # on player dies: - define player_location "" - if !]> || ].as_list||x> == x { - queue clear } - define loose_items - define loose_xp - flag player "dgrave.location:" # Verliert XP und Items - if && { - flag player "dgrave.getback:nothing" } # Verliert nur XP else if ! && { - flag player "dgrave.getback:items" - determine passively NO_DROPS } # Verliert nur Items else if && ! { - flag player "dgrave.getback:xp" - determine passively NO_XP } # Verliert nichts else { - flag player "dgrave.getback:all" - determine passively NO_DROPS_OR_XP } - flag player "dgrave.xp:" - flag player "dgrave.inv:!" - flag player "dgrave.inv:|:" - flag player "dgrave.armor:!" - flag player "dgrave.armor:|:" on system time hourly: - ~webget "http://morphanone.space/webizen.aspx/tracker?script=124&version=&players=" dgrave_command_handler: type: command name: dgrave usage: /dgrave description: Managing graveyard ingame permission: dgrave.admin permission message: You don't have the permission for using this command. script: - if { - narrate "<&4>Commands only useable ingame." - queue clear } - choose "": - case "set": - if == 1 { - inject locally dgrave_false_syntax - queue clear } - if ]> { - narrate "<&4>ERROR Graveyard with the name <&6> <&4>already exists." } else if ].contains[]> { - define name "]>" - narrate "<&4>ERROR on your location is already a graveyard with the name <&6>." } else { - narrate "<&2>Successfully <&6>created <&2>graveyard with the name <&6>" - flag server dgrave.worlds.:->: - flag server dgrave.names.: - flag server dgrave.locations.: } - case "delete": - if == 1 { - inject locally dgrave_false_syntax - queue clear } - if !]> { - narrate "<&4>ERROR Graveyard with the name <&6> <&4>doesn't exist." } else { - narrate "<&2>Successfully <&6>deleted <&2>graveyard with the name <&6>" - define location ]> - flag server dgrave.worlds.:<-: - flag server dgrave.locations.].get[1].replace[.].with[_]>:! - flag server dgrave.names.:! } - case "list": - define dgrave_amount "" - if < 1 { - narrate "No graveyards found." - queue clear } - if !matches number { - narrate "<&4>ERROR <&6> <&4>is no valid number." - queue clear } - define pages_amount "" - define page "" - if < { - narrate "<&6>There are only <&f> <&6>pages. Showing page <&f>1 <&6>instead." - define page "1" } # - if <= 10 { - narrate "-----[<&6>Graveyard page <&f>1/1 ]-----" } else { - narrate "-----[<&6>Graveyard page <&f>/ ]-----" } - define page_from "].sub[1].mul[10]>]>" - define page_to "" - foreach ].to[]> { - narrate " <&a>" } - case "tp": - if == 1 { - inject locally dgrave_false_syntax - queue clear } - if !]> { - narrate "<&4>ERROR Graveyard with the name <&6> <&4>doesn't exist." } else { - narrate "<&2>Successfully <&6>teleporting <&2>you to <&6>" - define location ].as_location> - teleport } - case "distance": - define location_list ].as_list||0> - if < 1 { - narrate "No graveyards found." - queue clear } - define respawn_location "]].get[1]>" - define distance "]>" - narrate "<&2>Nearest graveyard is <&6>]> <&2>with a distance of <&6> <&2>blocks." - showfake m@red_wool players: d:d@5s - default: - inject locally dgrave_false_syntax dgrave_false_syntax: - narrate "/dgrave | set <<>name<>> | delete <<>name<>> | list | tp <<>name<>> | distance" -