Paste #52437: Untitled Paste

Date: 2019/02/16 12:41:15 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


###The Script below handles the basic functions of the PlayerData script###
starteritemsCMD:
  type: command
  name: startitems
  usage: /startitems
  script:
    - if <player.inventory.contains.scriptname[CharacterSheetIt].not>:
      - give i@CharacterSheetIt slot:36
    - if <player.inventory.contains.scriptname[travelpackIt].not>:
      - give i@travelpackIt slot:35

SetClassDataCMD:
  type: command
  name: setclassdata
  usage: /setclassdata
  script:
    - yaml id:<player.uuid> set Classes.Cleric:1
    - yaml id:<player.uuid> set Classes.Mage:1
    - yaml id:<player.uuid> set Classes.Rogue:1
    - yaml id:<player.uuid> set Classes.Scout:1
    - yaml id:<player.uuid> set Classes.Warrior:1
    - yaml id:<player.uuid> set Classes.Blacksmith:1
    - yaml id:<player.uuid> set Classes.Engineer:1
    - yaml id:<player.uuid> set Classes.Shaman:1
    - yaml id:<player.uuid> set Classes.Lumberjack:1
    - yaml id:<player.uuid> set Classes.Alchemist:1
    - yaml id:<player.uuid> set Classes.Prospector:1
    - yaml id:<player.uuid> set Classes.Crusader:1
    - yaml id:<player.uuid> set Classes.Arcanist:1
    - yaml id:<player.uuid> set Classes.ShadowDancer:1
    - yaml id:<player.uuid> set Classes.Sniper:1
    - yaml id:<player.uuid> set Classes.Berserker:1
    - yaml id:<player.uuid> set Classes.Assassin:1
    - yaml id:<player.uuid> set Classes.BloodMagus:1
    - yaml id:<player.uuid> set Classes.Bard:1
    - yaml id:<player.uuid> set Classes.Dragoon:1
    - yaml id:<player.uuid> set Classes.Ranger:1
    - yaml id:<player.uuid> set Classes.Druid:1
    - yaml id:<player.uuid> set Classes.Eldritch:1
    - yaml id:<player.uuid> set Classes.Monk:1
    - yaml id:<player.uuid> set Classes.Necromancer:1
    - yaml id:<player.uuid> set Classes.Oracle:1
    - yaml savefile:/PlayerData/<player.uuid>.yml id:<player.uuid>
playerdata:
  type: world
  debug: off
  events:
    on player clicks end_crystal:
    - determine passively cancelled
    on server start:
    - yaml load:/ServerData/Skills.yaml id:Skills
    - yaml load:/ServerData/PathsInventory.yml id:PathsInventory
    - yaml load:/ServerData/QuestCompass.yml id:QuestCompass
    on player joins:
    - if <server.has_file[/PlayerData/<player.uuid>.yml]>:
      - yaml load:/PlayerData/<player.uuid>.yml id:<player.uuid>
    - if <player.inventory.contains.scriptname[CharacterSheetIt].not>:
      - give i@CharacterSheetIt slot:36
    - if <player.inventory.contains.scriptname[travelpackIt].not>:
      - give i@travelpackIt slot:35
    - if <server.has_file[/PlayerData/<player.uuid>.yml].not>:
      - yaml id:<player.uuid> set Name:<player.name>
      - yaml create id:<player.uuid>
      - yaml savefile:/PlayerData/<player.uuid>.yml id:<player.uuid>
      - yaml load:/PlayerData/<player.uuid>.yml id:<player.uuid>
      - yaml id:<player.uuid> set GlobalReputation:0
      - yaml id:<player.uuid> set UnsungReputation:0
      - yaml id:<player.uuid> set AquaReputation:0
      - yaml id:<player.uuid> set FrontFollyReputation:0
      - yaml id:<player.uuid> set GearworksReputation:0
      - yaml id:<player.uuid> set Deaths.Total:0
      - yaml id:<player.uuid> set PVPKills.Total:0
      - yaml id:<player.uuid> set Kills.Total:0
      - yaml id:<player.uuid> set OpenedChests.Total:0
      - yaml id:<player.uuid> set KeyItems.Total:0
      - yaml id:<player.uuid> set Mounts.Total:0
      - yaml id:<player.uuid> set ActiveQuests.Total:0
      - yaml id:<player.uuid> set CompletedQuests.Total:0
      - yaml id:<player.uuid> set Name:<player.name>
      - yaml id:<player.uuid> set PVPKills.Total:0
      - yaml id:<player.uuid> set Jobs.Total:0
      - yaml id:<player.uuid> set TotalCompletedQuests:!
      - yaml id:<player.uuid> set TotalActiveQuests:!
      - yaml id:<player.uuid> set Classes.Cleric:1
      - yaml id:<player.uuid> set Classes.Mage:1
      - yaml id:<player.uuid> set Classes.Rogue:1
      - yaml id:<player.uuid> set Classes.Scout:1
      - yaml id:<player.uuid> set Classes.Warrior:1
      - yaml id:<player.uuid> set Classes.Blacksmith:1
      - yaml id:<player.uuid> set Classes.Engineer:1
      - yaml id:<player.uuid> set Classes.Shaman:1
      - yaml id:<player.uuid> set Classes.Lumberjack:1
      - yaml id:<player.uuid> set Classes.Alchemist:1
      - yaml id:<player.uuid> set Classes.Prospector:1
      - yaml id:<player.uuid> set Classes.Crusader:1
      - yaml id:<player.uuid> set Classes.Arcanist:1
      - yaml id:<player.uuid> set Classes.ShadowDancer:1
      - yaml id:<player.uuid> set Classes.Sniper:1
      - yaml id:<player.uuid> set Classes.Berserker:1
      - yaml id:<player.uuid> set Classes.Assassin:1
      - yaml id:<player.uuid> set Classes.BloodMagus:1
      - yaml id:<player.uuid> set Classes.Bard:1
      - yaml id:<player.uuid> set Classes.Dragoon:1
      - yaml id:<player.uuid> set Classes.Ranger:1
      - yaml id:<player.uuid> set Classes.Druid:1
      - yaml id:<player.uuid> set Classes.Eldritch:1
      - yaml id:<player.uuid> set Classes.Monk:1
      - yaml id:<player.uuid> set Classes.Necromancer:1
      - yaml id:<player.uuid> set Classes.Oracle:1
      - yaml savefile:/PlayerData/<player.uuid>.yml id:<player.uuid>
    - yaml load:/PlayerData/<player.uuid>.yml id:<player.uuid>
    on player quits:
    - yaml savefile:/PlayerData/<player.uuid>.yml id:<player.uuid>
    - yaml unload id:<player.uuid>
    on shutdown:
    - foreach <server.list_online_players>:
      - yaml savefile:/PlayerData/<def[value].uuid>.yml id:<def[value].uuid>
      - yaml unload id:Skills
    on system time minutely:
    - foreach <server.list_online_players>:
      - yaml savefile:/PlayerData/<def[value].uuid>.yml id:<def[value].uuid>
 ###Action Listeners###
    on player dies:
    - yaml savefile:/PlayerData/<def[value].uuid>.yml id:<def[value].uuid>
    - if <context.cause> == ENTITY_ATTACK:
      - queue clear
    - yaml id:<player.uuid> set Deaths.<context.cause>:+:1
    - yaml id:<player.uuid> set Deaths.Total:+:1
    on player killed by entity:
    - if <context.damager.is_player>:
      - yaml id:<player.uuid> set PVPDeaths.<context.damager.name>:+:1
      - yaml id:<player.uuid> set PVPDeaths.Total:+:1
      - queue clear
    - if <context.damager.is_mythicmob>:   
      - yaml id:<player.uuid> set Deaths.<context.damager.mythicmob.internal_name>:+:1
      - yaml id:<player.uuid> set Deaths.Total:+:1
      - queue clear
    - yaml id:<player.uuid> set Deaths.<context.damager.name>:+:1
    - yaml id:<player.uuid> set Deaths.Total:+:1
    on player combusts:
    - yaml id:<player.uuid> set Combusted:+:1
    on mythicmob mob killed by player:
    - narrate <context.mob>
    - yaml id:<player.uuid> set Kills.<context.mob.internal_name>:+:1
    - yaml id:<player.uuid> set Kills.Total:+:1
    on entity killed by player:
    - if <context.entity.is_mythicmob>:
      - queue clear
    - if <context.entity.is_player>:
      - yaml id:<context.damager.uuid> set PVPKills.<context.entity.name>:+:1
      - yaml id:<context.damager.uuid> set PVPKills.Total:+:1
      - queue clear
    - yaml id:<player.uuid> set Kills.<context.entity.name>:+:1
    - yaml id:<player.uuid> set Kills.Total:+:1
#Notable Creator Handler#
    on player left clicks with NotableCreatorIT:
    - determine passively cancelled
    - flag player NotePos1:<context.location.simple>
    - narrate "Notable Position 1 set: <context.location.simple>"
    on player right clicks with NotableCreatorIT:
    - flag player NotePos2:<context.location.simple>
    - narrate "Notable Position 2 set: <context.location.simple>" 
#Notable Creator Item#
NotableCreatorIT:
  type: item
  display name: Notable Creator Tool
  material: stone_axe
  lore:
  - "Use this item to set flags with coordinates for use in"
  - "the /note command or to otherwise easily call a set of" 
  - "coordinates."
  - "Left click sets the clicked location to NotePos1."
  - "Right click sets the clicked location to NotePos2."
  - "IMPORTANT: If setting a location NotePos1 is used."  
#Notable Creator Command#
NotableCreatorCMD:
  type: command
  name: note
  usage: /note
  description: "Use this command to create notable cuboids and locations. Syntax<&co> /note Name:(Name) (cuboid or location). Use /note GetTool to get a Notable Creator Tool."
  permission: denizen.note
  script:
    - if <context.args.contains[GetTool]>:
      - if <player.inventory.contains[i@NotableCreatorIT]>:
        - narrate "You already have a Notable Creator Tool!"
        - queue clear
      - else:
        - narrate "You received the Notable Creator Tool!"
        - give i@NotableCreatorIT
        - queue clear
    - if <context.args.contains[Cuboid].not> || <context.args.contains[Cuboid].not>:
      - narrate "You must designate whether the Notable is a Cuboid or a Location! Please add either Location or Cuboid as an argument."
      - queue clear
    - if <context.args.contains[Cuboid].not> && <context.args.contains[Cuboid].not>:
      - narrate "You must designate either Cuboid or Location, not both!"
      - queue clear
    - if <context.args.map_get[Name].split_by[<&co>]||null> == null:
      - narrate "You must specify a name for this Notable! Use Name:(Name)."
      - queue clear
    - else:
      - if <context.args.contains[Cuboid]>:
        - note cu@<player.flag[NotePos1]>|<player.flag[NotePos2]> as:<context.args.map_get[Name].split_by[<&co>]>
        - narrate "Notable Cuboid Set! Name: <context.args.map_get[Name].split_by[<&co>]>, Coordinates: <player.flag[NotePos1]> to <player.flag[NotePos2]>."
        - execute as_op "denizen save"
      - if <context.args.contains[Location]>:
        - note l@<player.flag[NotePos1]> as:<context.args.map_get[Name].split_by[<&co>]>
        - narrate "Notable Location Set! Name: <context.args.map_get[Name].split_by[<&co>]>, Coordinates: <player.flag[NotePos1]>."
        - execute as_op "denizen save"