Paste #47355: Bodyguard

Date: 2018/05/04 22:06:56 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Wanderer_assignment:
  type: assignment
  actions:
    on assignment:
    - trigger name:chat state:true radius:100
  interact scripts:
  - 1 Wanderer
#----------------------------------
#  Start of the quest scripts, I
#  would not advise editing any-
#  thing beyond here if you are not
#  an experienced scripter.
#----------------------------------
Wanderer:
  Type: Interact
  Steps:
    1:
      Click trigger:
            Script:
            - ^engage
            - chat "Hey Stranger, need help?"
            - chat "It's <red>3333<white> gold"
            - narrate "<white>You can say, <green>yes<white> or <red>no<white>."
            - ^disengage
      Chat Trigger:
        1:
           Trigger: /yes/
           Script:
           - if p@player.has_flag companion_slot" {
             - narrate "You already have a companion!"                
             } else {
             - if <player.money> >= "3333" {
               - chat "Alright!!"
               - money take quantity:3333
               - narrate "<&c>A NPC joins you, 3333 gold removed."
               - EXECUTE as_op "npc create Companion --trait sentinel" (silent)
               - EXECUTE as_op "npc skin Parkour" (silent)
               - EXECUTE as_op "sentinel addtarget MONSTERS" (silent)
               - EXECUTE as_op "sentinel damage 10" (silent)
               - EXECUTE as_op "sentinel health 175" (silent)
               - EXECUTE as_op "sentinel speed 1.39" (silent)
               - EXECUTE as_op "sentinel respawntime 5" (silent)
               - EXECUTE as_op "npc assign script --set bodyguard1a" (silent)
               - narrate "right click your bodyguard to give him orders"
               - flag player companion_slot
               } else {
               - narrate "<&c>You do not have enough money!"
               }   
               }                
        2:
           Trigger: /no/ 
           Script:
           - ^engage
           - chat "As you want."
           - ^disengage