Paste #34627: Lucius Quest

Date: 2016/07/08 03:57:15 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


########################################################################################################################################
#--------------------------------------------------------------------------------------------------------------------------------------#
#|                                                       Lucius Quest 1                                                               |#
#|                                                  Les Pirates du soleil bleu                                                        |#
#|                                                       Categorie: Quest                                                             |#
#|                                                        Author: Oruss7                                                              |#
#|                                                           Time: 5H                                                                 |#
#|                                                         Version: 0.1                                                               |#
#--------------------------------------------------------------------------------------------------------------------------------------#
########################################################################################################################################

#-----------------------------------------------------------------------------------------------------------------#
# COMMANDS:                                                                                                       #
#     - npc assignment --set LuciusQuest_1 : Set Lucius NPC script                                                #
#     - npc assignment --set LuciusHint_1 : Set First Hint NPC script                                             #
#     - npc assignment --set LuciusHint_2 : Set Second Hint NPC script                                            #
#     - npc assignment --set LuciusHint_3 : Set Third Hint NPC script                                             #
#                                                                                                                 #
# PERMISSIONS :                                                                                                   #                                          
#                                                                                                                 #                 
#-----------------------------------------------------------------------------------------------------------------#

# Icon script
LuciusQuest_1_Icon:
  type: item
  debug: true
# Unused in the gui
  display name: Journal des Quêtes

# The material used as the gui icon for this quest
  material: i@boat

# A flag required to mark the quest as Available or LOCKED.
# Leave this empty '' if you do not want your quest to be repeatable.
  quest_unlocked_flag: ''

# Set to true to not display this quest if the player does not have the specified unlock flag.
# Set to false to show the quest as LOCKED if the player does not have the specified unlock flag.
  hide_ifLocked: true

# A flag for repeatable quests. Flag must store the number of times the quest has been completed.
# Once completed, repeatable quests will only show up in the quest journal if they are in the
# Active_Quests player flag, but will always display in the completed gui after the first completion.
# There's potential for stale data to display in the Objectives view, so we might need to address that in the future.
  times_completed_flag: QuestGUI.Lucius.Quest.1.Completed

# What to display the quest title as
  quest_title: Les pirates du soleil bleu

# What to display for the description of this quest
  quest_desc: Neutralise les pirates du soleil bleu

# A flag to store the number value for the players current objective
# If the player is currently doing objective 3 than the value of this flag should be 3
  quest_progress_flag: QuestGUI.Lucius.Quest.1.Objective

# Define your quest objectives here. Must use a numbered node structure.
# Number corresponds to quest_progress_flag
  objectives:
    1:
    # The text to display as the name of this objective
      name: Enquêter

    # A long description of this objective
      description: Enquête sur l'île et trouve des indices.

    # Set to true to remove this objective from the list until the player is at this objective
    # Set to false to allow this objective to be displayed before they reach this objective
      hide: false

    # Set to true to show this objective as LOCKED hiding all info about it until the player reaches this objective
    # Set to false to show all info about this objective even if the player hasn't reached it yet
      lockDisplay: false

    # Set the icon to display for this objective
      icon: i@paper

    # A list of flags that hold stats for this objective.
    # Value must be set as a split list in the format statname/flagname
    # statname is the phrase displayed as the title of this stat
    # flagname is the flag that holds the value to display
      progress_flags:
      -

# Script run when an admin resets this quest for a player
  reset:
    - flag %player% QuestGUI.Lucius.Quest.1:!
    - flag %player% QuestGUI.QuestsCompleted:<-:LuciusQuest_1
    - flag %player% QuestGUI.Active_Quests:<-:LuciusQuest_1

# Script run when an admin completes this quest for a player
  complete:
    - if <def[player].flag[QuestGUI.QuestsCompleted].as_list> !contains LuciusQuest_1 {
      - flag %player% QuestGUI.QuestsCompleted:->:LuciusQuest_1
      }
    - flag %player% QuestGUI.Lucius.Quest.1.Completed:++
    - flag %player% QuestGUI.Active_Quests:<-:LuciusQuest_1

# Script run when an admin activates this quest for a player
  activate:
    - run player:%player% MyQuestGUIQuest_1_Dialogue_2

# Script run when an admin deactivates this quest for a player
  deactivate:
    - narrate "stub"
#
#
# END Icon script
#--------------------------------------
#
#  Quest Trophies
#   - Item script containers for all obtainable quest trophies
#   - Must have the quest: node with the scriptname of the quest it belongs to
#


#
#  END Quest Trophies
#--------------------------------------
#
#  END Requisite Data for QuestGUI
#  - The actual quest is upto you!
#
################################################################################
#
# Lucius Quest 1
# - Assign this to an NPC and click on him. He'll walk you through the rest.
#
LuciusQuest_1:
  type: assignment
  debug: true
  actions:
    on spawn:
      - inject locally init instantly
    on assignment:
      - inject locally init instantly
    on click:
      - inject locally click instantly
    on death:
      - inject locally death instantly

  init:
    - trigger name:chat state:false
    - trigger name:click state:true cooldown:1 radius:8
    - trigger name:proximity state:true cooldown:5 radius:5
    - trigger name:damage state:true cooldown:3
    - lookclose true range:5 realistic
    - vulnerable state:false
    - execute as_npc "npc select <npc.id>"
    - execute as_npc "Trait Health"
    - wait 1
    - ^execute as_npc "Trait sentinel"
    - execute as_npc "sentinel Health 30"
    - execute as_npc "sentinel invincible"
    - execute as_npc "sentinel Armor 1.0"
    - execute as_npc "sentinel Strength 2"
    - execute as_npc "sentinel Range 18"
    - execute as_npc "sentinel Speed 0.8"
    - execute as_npc "sentinel Attackrate 1"
    - execute as_npc "sentinel HealRate 0"
    - execute as_npc "sentinel Nightvision 5"
    - execute as_npc "sentinel Respawn 30"     
    - execute as_npc "sentinel ignore add entity:monster"
    - execute as_npc "npc targetable"
    - execute as_npc "npc respawn 60"
    - equip <npc> hand:i@air
    - if <npc.name> != 'Lucius' {
      - adjust <npc> 'name:Lucius'
      }

  click:
    # No reapetable quest
    - if <player.flag[QuestGUI.Lucius.Quest.1.Objective]> == 'Complete' {
      - queue clear
      }
    - if <player.flag[QuestGUI.Active_Quests].as_list||li@> contains 'LuciusQuest_1' {
      - define objective "<player.flag[QuestGUI.Lucius.Quest.1.Objective]||null>"
      # objective 2
      - if %objective% == 2 {
        - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow>Vous avez trouvé notre taupe ?"
        - wait 3
        - narrate "<green><player.name><white> -> <green><npc.name><white>: J'ai trouvé tous les indices qu'il nous fallait."
        - wait 2
        - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow> Très bien, donnez les moi."
        - wait 2
        - take 'item:i@LuciusQuest_1_Item_Hints' "from:<player.inventory>"
        - wait 3
        - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow> Excellent. Je n'ai plus besoin de vous maintenant."
        - wait 3
        - equip <npc> hand:i@LuciusQuest_1_Item_Lucius_Sword
        - wait 3
        - narrate "<green><player.name><white> -> <green><npc.name><white>: Que faites vous ?!"
        - wait 3
        - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow> C'est regrettable mais si on apprend que je vous ai fait faire mon travail, on se passera de mes services.."
        - wait 4
        - execute as_npc "npc select <npc.id>"
        # now vulnerable =)
        - execute as_npc "sentinel invincible"
        - vulnerable state:true
        - execute as_npc "sentinel addTarget player:<player.name>"
        - attack
        }
      - queue clear
      }
    # objective 1
    - flag <player> QuestGUI.Active_Quests:->:LuciusQuest_1
    - flag <player> QuestGUI.Lucius.Quest.1.Objective:1
    - narrate "<green>Inconnu<white><&co> <green><player.name><yellow>, je viens te faire sortir d'ici."
    - wait 2
    - narrate "<green><player.name><white> -> <green>Inconnu<white>: Que c'est-il passé ? Pourquoi je suis dans ce cachot ?!"
    - wait 3
    - narrate "<green>Inconnu<white><&co> <yellow>Le navire marchand sur lequel tu voyagais a été attaqué par les Pirates du Soleil Bleu."
    - wait 3
    - narrate "<green>Inconnu<white><&co> <yellow>Ils ont tué tout le monde sauf toi. Un voyageur de ta prestence, ils préfèrent t'échanger contre de l'or." 
    - wait 4
    - narrate "<green><player.name><white> -> <green>Inconnu<white>: Mais qui êtes vous ?"
    - wait 3
    - narrate "<green>Inconnu<white><&co> <yellow>Je suis <green><npc.name><yellow>, je suis un espion du Roi, et vous allez m'aider à anéantir ses pirates !"
    - wait 3
    - narrate "<green><player.name><white> -> <green><npc.name><white>: Très bien, que dois-je faire ?"
    - wait 2
    - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow>Les pirates du soleil bleu ont toujours un coup d'avance sur nous."
    - wait 3
    - narrate "<green><player.name><white> -> <green><npc.name><white>: Et vous pensez qu'il y a une taupe."
    - wait 2
    - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow>Ce n'est pas une hypothèse, c'est une certitude."
    - wait 3
    - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow>Enquêtez sur l'île et trouvez des indices qui pourront m'aider à démasquer cette taupe."
    - wait 3
    - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow>Retrouvez moi au nord de la rivière quand vous aurez terminé."
    - wait 3
    - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow>Vous n'avez pas le choix, ou vous restez enfermé ici ou vous m'aider et je vous présenterais au Roi."
    - wait 3
    - narrate "<green><player.name><white> -> <green><npc.name><white>: Marché conclu."
    - wait 3
    - cast blindness duration:2s hide_particles
    - ^give 'item:Steak' "to:<player.inventory>" qty:7
    - ^playsound <player.location> sound:BLOCK_IRON_DOOR_CLOSE
    - teleport <player> <l@1286.5,40.0,-1205.5,3.2,0.0,delerorn>
    - wait 3
    - title 'title:<yellow>Nouvelle Quête' 'subtitle:<white>Les Pirates du Soleil Bleu' targets:<player> 
    - wait 2
    - narrate "<yellow><&lb>QUETE<&rb><white> Trouvez des indices sur la taupe des pirates du soleil bleu. (0/3)"
    - ^playsound <player.location> sound:ENTITY_EXPERIENCE_ORB_TOUCH
    - wait 10
    - title 'title: ' 'subtitle:Un aventure proposée par' targets:<player>
    - wait 5
    - title 'title: ' 'subtitle:<blue>Les Royaumes d<&chr[00B4]>Eredrim' targets:<player>
    - flag <player> QuestGUI.Lucius.Quest.1.Timer:<server.current_time_millis>

  death:
    - narrate "<green><npc.name><white> -> <green><player.name><white>: <yellow> Arrgghhh !!!"
    - equip <npc> hand:i@air
    - ^playsound <player.location> sound:ENTITY_HOSTILE_DEATH 
    - wait 1
    - ^narrate "<green><npc.name><gray> est mort."
    - drop item:i@LuciusQuest_1_Item_Lucius_Sword qty:1 location:<npc.location>
    - flag <%player%> QuestGUI.Lucius.Quest.1.Objectives.2:<server.current_time_millis.sub_int[<%player%.flag[QuestGUI.Lucius.Quest.1.Timer]>].div[1000].as_duration.formatted>
    # quest finished
    - run LuciusQuestEnd def:<player>

# Check player discover 3 hint    
LuciusCheckHint:
  type: task
  debug: true
  definitions: player
  script:
      - if ( <%player%.flag[QuestGUI.Lucius.Quest.1.Objective]||null> == 1 ) {
        # All 3 hint reached
        - if ( <%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.1]||false> && <%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.2]||false> && <%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.3]||false> ) {
          - narrate "<yellow><&lb>QUETE<&rb><white>  Trouvez des indices sur la taupe des pirates du soleil bleu (3/3)." targets:<%player%>
          - flag <%player%> QuestGUI.Lucius.Quest.1.Objectives.1.hint.1:!
          - flag <%player%> QuestGUI.Lucius.Quest.1.Objectives.1.hint.2:!
          - flag <%player%> QuestGUI.Lucius.Quest.1.Objectives.1.hint.3:!
          - narrate "<yellow><&lb>QUETE<&rb><white> Retrouvez <green>Lucius<white> au nord de la rivière." targets:<%player%>
          - flag <%player%> QuestGUI.Lucius.Quest.1.Objectives.1:<server.current_time_millis.sub_int[<%player%.flag[QuestGUI.Lucius.Quest.1.Timer]>].div[1000].as_duration.formatted>
          - flag <%player%> QuestGUI.Lucius.Quest.1.Timer:<server.current_time_millis>
          - flag <%player%> QuestGUI.Lucius.Quest.1.Objective:2
          - ^playsound <%player%.location> sound:ENTITY_EXPERIENCE_ORB_TOUCH
          - ^give 'item:i@LuciusQuest_1_Item_Hints' "to:<%player%.inventory>" qty:1
          } 
          else {
          # not all hint reached
          - define count 0
          - if <%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.1]||false> {
            - define count <def[count].add[1]>
            }
          - if <%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.2]||false> {
            - define count <def[count].add[1]>
            }
          - if <%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.3]||false> {
            - define count <def[count].add[1]>
            }
          - narrate "<yellow><&lb>QUETE<&rb><white> Trouvez des indices sur la taupe des pirates du soleil bleu (%count%/3)." targets:<%player%> 
          }
      }

# Secret Reports on the harbor office (hint 1)
LuciusHint_1:
  type: assignment
  debug: true
  actions:
    on spawn:
      - inject locally init instantly
    on assignment:
      - inject locally init instantly
    on click:
      - inject locally click instantly
    on enter proximity:
      - inject locally click instantly
  init:
    - trigger name:chat state:false
    - trigger name:click state:true cooldown:1 radius:8
    - trigger name:proximity state:true cooldown:8 radius:2
    - vulnerable state:false

  click:
    - if ( <player.flag[QuestGUI.Lucius.Quest.1.Objective]||null> == 1 && !<player.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.1]||false> ) {
      - if !<player.has_flag[QuestGUI.Lucius.Quest.1.Completed]||false> {
        - flag <player> QuestGUI.Lucius.Quest.1.Objectives.1.hint.1:true
        - ^NARRATE target:<player> "<gray>Toutes les routes commerciales sont indiquées dans ce livre."
        - run LuciusCheckHint def:<player>
        }
      }

# Boat's Chest
LuciusHint_2:
  type: task
  debug: true
  definitions: player
  script:
      - if ( <%player%.flag[QuestGUI.Lucius.Quest.1.Objective]||null> == 1 && !<%player%.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.2]||false> ) {
        - if !<player.has_flag[QuestGUI.Lucius.Quest.1.Completed]||false> {
          - flag <%player%> QuestGUI.Lucius.Quest.1.Objectives.1.hint.2:true
          - ^NARRATE target:<%player%> "<gray>Il y a quelque chose dans ce coffre. Il s'agit d'une carte maritime avec le cachet du Roi."
          - run LuciusCheckHint def:<%player%>
          }
        }

# Blacksmith Armor (hint 3)
LuciusHint_3:
  type: assignment
  debug: true
  actions:
    on spawn:
      - inject locally init instantly
    on assignment:
      - inject locally init instantly
    on click:
      - inject locally click instantly
    on enter proximity:
      - inject locally click instantly
  init:
    - trigger name:chat state:false
    - trigger name:click state:true cooldown:1 radius:8
    - trigger name:proximity state:true cooldown:8 radius:2
    - vulnerable state:false

  click:
    - if ( <player.flag[QuestGUI.Lucius.Quest.1.Objective]||null> == 1 && !<player.flag[QuestGUI.Lucius.Quest.1.Objectives.1.hint.3]||false> ) {
      - if !<player.has_flag[QuestGUI.Lucius.Quest.1.Completed]||false>  {
        - flag <player> QuestGUI.Lucius.Quest.1.Objectives.1.hint.3:true
        - ^NARRATE target:<player> "<gray>Cette armure n'appartient pas à un pirate, c'est sûr."
        - run LuciusCheckHint def:<player>
        }
      }

# Quest end   
LuciusQuestEnd:
  type: task
  debug: true
  definitions: player
  script:
    - title 'title:<yellow>Quête Terminée' 'subtitle:<white>Les Pirates du Soleil Bleu' targets:<%player%>
    - ^playsound <%player%.location> sound:ENTITY_PLAYER_LEVELUP
    - flag <%player%> QuestGUI.Lucius.Quest.1.Objective:Complete
    - if <%player%.flag[QuestGUI.QuestsCompleted].as_list||li@> !contains LuciusQuest_1 {
      - flag <%player%> QuestGUI.QuestsCompleted:->:LuciusQuest_1
      }
    - flag <%player%> QuestGUI.Lucius.Quest.1.Completed:++
    - flag <%player%> QuestGUI.Active_Quests:<-:LuciusQuest_1
    - flag <%player%> QuestGUI.Lucius.Quest.1.Timer:!
    - title 'title:<yellow>Merci d<&chr[00B4]>avoir joué !' 'subtitle:<red>>>> <white>play.eredrim.fr<red> <<<' targets:<%player%>
    - wait 5
    - execute 'mv spawn <%player%.name>'

#
#  END Lucius Quest 1
#
################################################################################