Paste #56367: Baraek Interact Script

Date: 2019/08/05 11:49:22 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# | ███████████████████████████████████████████████████████████
# | ██   /npc assignment --set Baraek 
# | ██ 
# $ ██ [ NPC Assignment ] ██
BaraekNew:
  type: assignment
  debug: true 
  actions: 
    on assignment: 
    - trigger name:click state:true 
    - trigger name:proximity state:true radius:4
    on exit proximity: 
    - zap 1 Baraek_interact
  interact scripts: 
    - Baraek_interact

Baraek_interact:
  type: interact
  Option_Selection: 
    - foreach <[OptList]>:
      - define Message "<&6>[<&a>Click<&6> <&a><[value]>"
      - define SendMessage <[TriggerList].get[<[loop_index]>]>
      - define Hover "<&6>[<&a>Select<&6>]<&a> <[value]>"
      - narrate <proc[MsgChat].context[<def[Message]>|<def[SendMessage]>|<def[Hover]>]>
  GlobalTrigger: 
    - narrate format:cgf "Hello there."
    - wait 2s
    - define OptList "li@Can you sell me some furs?|I'm in search of a quest."
    - define TriggerList "li@Sell|Quest|Gang"
    - if <player.flag[Quest.SoA.Stage]> == 2:
      - define OptList "<[OptList].include[Can you tell me where I can find the Phoenix Gang?]>"
    - inject Option_Selection instantly
    - zap 1
  steps: 
    #| SellMeFur | QuestPlx | WheretheGang
    1: 
      click trigger: 
        script: 
          - inject GlobalTrigger instantly
      chat trigger: 
        1: 
          trigger: "/Sell/"
          script: 
            - narrate format:cgf "Yeah, sure. They're 100 gold coins each."
            - define TriggerList "li@FurSell|FurDecline"
            - define OptList "li@Yeah, okay, here you go.|100 gold coins? that's an outrage!"
            - inject Option_Selection instantly
            - zap 2
        2: 
          trigger: "/Quest/"
          script: 
            - narrate format:cgf "Sorry kiddo, I'm a fur trader not a damsel in distress."
        3: 
          trigger: "/Gang/"
          script: 
            - narrate format:cgf "Sh sh sh, not so loud! You don't want to get me in trouble!"
            - define TriggerList "li@Bye|Where"
            - define OptList "li@Nevermind|So DO you know where they are?"
            - inject Option_Selection instantly
            - zap 3
    #| FurSell | FurDecline
    2: 
      click trigger: 
        script: 
          - inject GlobalTrigger instantly
      chat trigger: 
        1: 
          trigger: "/FurSell/"
          script: 
            - take money quantity:100
            - give <player> i@leather
            - zap 1
        2: 
          trigger: "/FurDecline/"
          script: 
            - narrate format:cgf "Well, I can't go any cheaper than that mate. I have a family to feed."
            - zap 1
    #| Bye | Kwherethen
    3: 
      click trigger: 
        script: 
          - inject GlobalTrigger instantly
      chat trigger: 
        1: 
          trigger: "/Bye/"
          script: 
            - narrate format:cgf "Okay then."
            - zap 1
        2: 
          trigger: "/Where/"
          script: 
            - narrate format:cgf "I may do. But I don't want to get into trouble for revealing their hideout. Of course, if I was, say 100 gold coins richer I may happen to be more inclined to take that sort of risk..."
            - wait 2s
            - if <player.money> >= 100:
              - define TriggerList "li@yes|okay|no"
              - define OptList "li@Yes, I'd like to be 100 gold coins richer too.|Okay. Have 100 gold coins.|No, I don't like things like bribery."
            - else:
              - define TriggerList "li@yes|much|no"
              - define OptList "li@Yes, I'd like to be 100 gold coins richer too.|I haven't got that much.|No, I don't like things like bribery."
            - inject Option_Selection instantly
            - zap 4
    #| MeRichToo | IgotTheMoney | ImBrokeLol | NoBribes
    4: 
      click trigger: 
        script: 
          - inject GlobalTrigger instantly
      chat trigger: 
        1: 
          trigger: "/yes/"
          script: 
            - narrate format:cgf "What? I thought you were meant to bribe me, not the other way around... oh, forget it!"
            - zap 1
        2: 
          trigger: "/okay/"
          script: 
            - narrate format:cgf "Ok, to get to the gang hideout, enter Varrock through the south gate. Then, if you take the first turning east, somewhere along there is an alleyway to the south. The door at the end of there is the entrance to the Phoenix Gang. They're operating there under the name of the VTAM Corporation. Be careful. The Phoenixes ain't the types to be messed about."
            - flag <player> Quest.SoA.Stage:3
            - wait 2s
            - define TriggerList "li@Directions|Thanks"
            - define OptList "li@You're really bad at giving directions.|Thanks!"
            - inject Option_Selection instantly
            - zap 5
        3: 
          trigger: "/no/"
          script: 
            - narrate format:cgf "Well, I can't go any cheaper than that mate. I have a family to feed."
            - zap 1
        4: 
          trigger: "/much/"
          script: 
            - narrate format:cgf "In that case I wouldn't dare tell you anything about the Phoenix Gang."
            - zap 1
    #| BadDirections | Bye
    5: 
      click trigger: 
        script: 
          - inject GlobalTrigger instantly
      chat trigger: 
        1: 
          trigger: "/Directions/"
          script: 
            - narrate format:cgf "Hey now ... the Phoenix Gang make it their business to not be easy to find. Look, if you get lost, talk to Charlie the tramp near the Varrock south gate. He can give you better directions."
            - zap 1
        2: 
          trigger: "/Thanks/"
          script: 
            - narrate format:cgf "No problem."
            - zap 1