Paste #49619: le convoi

Date: 2018/09/07 10:21:50 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


########################################################################################################################################
#--------------------------------------------------------------------------------------------------------------------------------------#
#|                                                      Le convoi perdu                                                               |#
#|                                                           Phrébor                                                                  |#
#|                                                       Categorie: Quest                                                             |#                                                            
#|                                                        Author: Littlepork1                                                         |#
#|                                                           Time: 1H                                                                 |#
#|                                                         Version: 2.0                                                               |#
#|                                                                                                                                    |#
#|                                      Copyright (C) Les Royaumes d'Eredrim - All Rights Reserved                                    |#
#|                               Unauthorized copying of this file, via any medium is strictly prohibited                             |#
#|                                                  Proprietary and confidential                                                      |#
#--------------------------------------------------------------------------------------------------------------------------------------#
########################################################################################################################################

#-----------------------------------------------------------------------------------------------------------------#
# COMMANDS:                                                                                                       #
#     - npcq scripts add LeConvoiPerduQuest#Yu_choice : premier NPC sur la plage                                  #  
#     - /npcq scripts add LeConvoiPerduQuest#proxy PROXIMITY                                                      #
#     - npcq scripts add LeConvoiPerduQuest#Kiwan_choice : deuxième NPC à Phrébor                                 #
#     - npcq scripts add LeConvoiPerduQuest#Voleur_choice: Voleur                                                                                                            #
# PERMISSIONS :                                                                                                   #
#                                                                                                                 #
#-----------------------------------------------------------------------------------------------------------------#


#-----------------------------------------------------------------#
#                                                                 #
#                           EVENTS                                #
#                                                                 #
#-----------------------------------------------------------------#

leConvoiPerduQuestEvents:
    type:  world
    debug: false
    events:
        on reload scripts:
            # reload -a
            - if <context.all> {
                # create notable cuboids if not exist
                - if <farmerquest_cow.as_cuboid.notable_name||nope> == nope {
                    - note cu@123,65,186,delerorn|164,67,214,delerorn as:farmerquest_cow
                }
                - if <Yuquest_enclosure.as_cuboid.notable_name||nope> == nope {
                    - note cu@102,65,51,delerorn|104,65,55,delerorn as:Yuquest_enclosure
               }
            }
            # No reapetable quest
            - if <player.flag[QUESTS.ACTIVE_QUESTS].as_list.contains[Le convoi perdu].not||true> {
                - queue clear
            }
            - define objectiveNumber "<player.flag[QUESTS.Le convoi perdu.CURRENT_OBJECTIVE]||0>"

            # objective 2
            - if <def[objectiveNumber]> != 2 {
                - queue clear
            }
            - run instantly s@QuestWorld p:updateObjective def:farmerquest|3 delay:1t player:<player>
            - flag <player> Quests.Farmer.Cow:<c.entity>

#-----------------------------------------------------------------#
#                                                                 #
#                           QUEST                                 #
#                                                                 #
#-----------------------------------------------------------------#

LeConvoiPerduQuestData:
  type: yaml data
  debug: false

  icon: i@leash

  #----------------------------
  #         Conditions
  #----------------------------
  # Conditions nécessaires pour que la quête soit marquée comme DISPONIBLE

  # la quête est t'elle répétable ?
  repeatable: false

  # Cooldown de la quête si répétable.
  cooldown: ""

  hide_ifLocked: true

  hide_description: true

  title: Le convoi perdu

  description: ramener la marchandise a Yu

#----------------------------------------------------------------------
  required_rep:
    # REPUTATION;MONTANT;COMPARATEUR
    # MORE => Réputation du joueur supérieure à montant = pas de quête
    # LESS => Réputation du joueur inféieure à montant = pas de quête
    # Le nom de la réputation doit être le même que la réputation définie dans ReputationsAndLevels.Reputations
    - phrebor;+1;MORE
    - voleur;0;MORE
#----------------------------------------------------------------------

  experience: 1
  reputations: li@

  objectives:
    1:
        name: Le Convoi
        description: Recherche du convoi


    2:
        name: trouver des indices
        description: Retrouver 4 indices
    3:
        name: Repaire des voleurs
        description:
    4:
        name: Marchandise
    description: Tuer et ramener la marchandise a Yu

    5:
        name: Yu
        description: aller voir Yu


LeconvoiperduQuest:
  type: task
  debug: false

  #-----------------------------------------------------------------#
  # Fermier de Phrébor                                              #
  #-----------------------------------------------------------------#

  # choix qui sont disponibles auprès du PNJ Yu
  Yu_choice:
    - if <player.flag[QUESTS.ACTIVE_QUESTS].as_list.contains[<script.name>].not||true> {
        - narrate format:choice_format "<proc[msgcommand].context[<aqua>Salutations. Auriez-vous besoin de mon aide ?|quest answer <script.name>#Yu_start <npc>|Cliquez pour choisir cette option]>"
        - queue clear
    }
    - define objectiveNumber "<player.flag[QUESTS.<script.name>.CURRENT_OBJECTIVE]||0>" {
    - narrate format:choice_format "<proc[msgcommand].context[<aqua> a propos de votre marchandise|quest answer <script.name>#Yu_objective_<def[objectiveNumber]> <npc>|Cliquez pour choisir cette option]>"
        - queue clear  
    }


  proxy:
    - define activeQuests <player.flag[QUESTS.ACTIVE_QUESTS].as_list||li@>
    - if <def[activeQuests].contains[<script.name>].not||false> && <proc[QuestIsAvailable].context[<script.name>|<player>]||false> {
        - narrate format:npc_talk_format "Aurevoir."
    }

  # début de la quête
  Yu_start:
    - narrate format:npc_talk_format "Bonjour,j'attend un convoi de marchandise"
    - wait 4
    - narrate format:player_talk_format "Ah bon ?"
    - wait 2
    - narrate format:npc_talk_format "Oui,mais je n'ai toujours rien reçu ."
    - wait 4
    - narrate format:npc_talk_format "Pourriez vous m'aider? !"
    - wait 3
    # donne l'objective 1
    - run instantly s@QuestWorld p:acceptation def:<script.name>#Yu_acceptation delay:1t player:<player> npc:<npc>
    - queue clear

  # le joueur accepte ou refuse
  Yu_acceptation:
    - define answer <def[1]>
    - define activesQuests <player.flag[QUESTS.ACTIVE_QUESTS].as_list||li@>
    - if <def[activesQuests].contains[<script.name>]> {
        - narrate format:error_format "Vous faites déjà cette quête."
        - queue clear
    }
    - if <def[answer]> == "accepter" {
        - narrate format:player_talk_format "D'accord, mais je ne sais pas  chercher."
        - wait 5
        - narrate format:npc_talk_format "la marchandise vien du Nord allé voir pret de la route au Nord."
        - wait 3
        - flag <player> RespawnPoint:<npc.location>
        - run instantly s@QuestWorld p:start def:<script.name> delay:1t player:<player>
        - queue clear
    } else {
        - narrate format:player_talk_format "Non, je ne vous aiderais pas."
        - wait 3
        - narrate format:npc_talk_format "S'il vous plait, je vous offrirai quelques pièces !"
    }

  #-----------------------------------------------------------------#
  # PNJ (kiwan)  à Phrèbor                                      #
  #-----------------------------------------------------------------#

  # choix qui sont disponibles auprès de Kiwan 
  Kiwan_choice:
    - if <player.flag[QUESTS.ACTIVE_QUESTS].as_list.contains[<script.name>].not||true> {
        - queue clear
    }
    - define objectiveNumber "<player.flag[QUESTS.<script.name>.CURRENT_OBJECTIVE]||0>"
    - narrate format:choice_format "<proc[msgcommand].context[<aqua>A propos des hommes|quest answer <script.name>#Kiwanobjective_<def[objectiveNumber]> <npc>|Cliquez pour choisir cette option]>"

  # objectif 1 second Kiwan
  Kiwan_objective_1:
    - narrate format:player_talk_format "Bonjour messieur,Auriez-vous vue se qui c'est passé?."
    - wait 4
    - narrate format:npc_talk_format "Bonjour . Oui j'ai vue ce qui c'est passé"
    - wait 3
    - narrate format:npc_talk_format "Il y avais 3 hommes qui ont attaqué ce convoi tué ce pauvre et sont reparti vers la ville après "
    - wait 5
    - narrate format:player_talk_format "D'accord merci"
    - give i@KiwanQuestLeash
    - narrate format:narration_format "Vous recevez <i@KiwanQuestLeash.display_name>"
    - flag <player> RespawnPoint:<l@80.5,65.0,1.0,2.0,-61.0,delerorn>
    - run instantly s@QuestWorld p:updateObjective def:<script.name>|2 delay:1t player:<player>
    - queue clear 
    }
    - narrate format:npc_talk_format "Aurevoir."
  #-----------------------------------------------------------------#
  # PNJ voleur  à Phrèbor                                      #
  #-----------------------------------------------------------------#

  # choix qui sont disponibles auprès du voleur
  voleur_choice:
    - if <player.flag[QUESTS.ACTIVE_QUESTS].as_list.contains[<script.name>].not||true> {
        - narrate format:npc_talk_format "Bonjour, quelle belle journée !"
        - queue clear
    }
    - define objectiveNumber "<player.flag[QUESTS.<script.name>.CURRENT_OBJECTIVE]||0>"
    - narrate format:choice_format "<proc[msgcommand].context[<aqua>A propos de cette marchandise|quest answer <script.name>#Voleur_objective_1<def[objectiveNumber]> <npc>|Cliquez pour choisir cette option]>"

  # objectif 1 second Kiwan
  voleur_objective_1:
    - narrate format:player_talk_format "Bonjour,ou avez vous trouve cette marchandise?."
    - wait 4
    - narrate format:npc_talk_format "Bonjour <player.name>. Nous avons trouvé cette marchandise sur le bord de la route. "
    - wait 3
    - narrate format:npc_talk_format "Nous avons pense la mettre en lieu sur pour eviter la pluie "
    - wait 5
    - narrate format:player_talk_format "D'accord merci.Je vais la ramener maintenant"
    - equip <npc> hand:i@VoleurQuestItemVoleurSword
    - wait 4
    - narrate format:player_talk_format "Que faites vous ?!"
    - wait 4
    - narrate format:npc_talk_format "C'est regrettable  si on apprend qu'on a volé cette marchandise..."
    - wait 5
    - run instantly s@QuestWorld p:updateObjective def:VoleurQuest|3 delay:1t player:<player>
    - run instantly Quester p:fight delay:1t def:VoleurQuest#Voleurclone_death player:<player> npc:<npc>
    - equip <npc> hand:i@air
    - Voleurclone_death:
    - if <player.flag[QUESTS.ACTIVE_QUESTS].as_list.contains[<script.name>].not||true> {
        - narrate "quête pas activée "
        #- queue clear
    }
    - narrate format:npc_talk_format "Arrgghhh !!!"
    - playsound <player.location> sound:ENTITY_HOSTILE_DEATH
    - wait 1
    - narrate "<green><npc.name><gray> est mort."
    - drop item:i@LuciusQuestItemVoleurSword qty:1 location:<npc.location>
    - run instantly s@QuestWorld p:end def:VoleurQuest delay:1t player:<player>
    - give i@VoleurQuestLeash
    - narrate format:narration_format "Vous recevez <i@voleurQuestLeash.display_name>"
    - flag <player> RespawnPoint:<l@80.5,65.0,1.0,2.0,-61.0,delerorn>
    - run instantly s@QuestWorld p:updateObjective def:<script.name>|2 delay:1t player:<player>
    - queue clear 
    }

#
#  END LeconvoiperduQuest
#