Paste #1799: Adventure Script

Date: 2014/02/05 08:13:31 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#----------------------------------
  # Adventure World Quest
  #
  # The world of Arcipolis
  #----------------------------------

"AdventureArcipolis":
    type: assignment
    actions:
        on assignment:
            - trigger name:proximity toggle:true
            - trigger name:chat toggle:true
            - trigger name:click toggle:true
            - lookclose state:true
            - RESET

    interact scripts:
        - 10 AdventurersTest

    default constants:
        #The step the player currently is in
        Zombies: 15
        Skeletons: 15
        Creepers: 15
        Spiders: 15
        Enderman: 5

#----------------------------------
  #  End of Assignments
  #----------------------------------

#----------------------------------
  # NPC format
  # used to control the chat with
  # the NPC 
  #----------------------------------
"Old Man Format":
    type: format
    format: "<&5>Adventurer<white><&co> <text>"

#----------------------------------
  # Adventurers Test
  # The npc will give the player some
  # small quests to test its strength
  #----------------------------------  
"AdventurersTest":
    type: interact
    steps:
        'theStart':  
            #When you come near the NPC it will ask you to chat
            proximity trigger:
                entry:
                    radius: 6
                    script:
                        - narrate "format:Old Man Format" "Hey there adventurer!"
                        - narrate "format:Old Man Format" "In for a little chat?"
                        - zap 'step:chatting'
                exit:
                    radius: 6
                    script:
                        - narrate "format:Old Man Format" "Bye sir!"
                        - zap 'step:theStart'
        'chatting':
            chat trigger:
                #If you accept the little chat, the NPC will tell you its story
                'acceptingQuestTalk':
                    trigger: "<red>/yes/ sure"
                    script:
                        - engage
                        - narrate "format:Old Man Format" "Far away there is a world full of mysteries!"
                        - wait 1
                        - narrate "format:Old Man Format" "I have lived there and i might just be the last survivor."
                        - wait 2
                        - narrate "format:Old Man Format" "It would be amazing if someone heroic would travel to the world and find out what happend there."
                        - wait 3
                        - narrate "format:Old Man Format" "Because i suffer a disease of tragic memory loss...."
                        - wait 2
                        - narrate "format:Old Man Format" "....all i remember is that something happend that caused me to leave that place."
                        - wait 3
                        - narrate "format:Old Man Format" "Are you the person i am looking for? If so say 'I am'"
                        - zap 'step:accepting'
                        - disengage
                #If you don't like long talks and deny the little chat
                'denyingQuestTalk':
                    trigger: "<red>/no/ I don't like long talks."
                    script:
                        - engage
                        - narrate "format:Old Man Format" "Would you perhaps like to hear the short version? If so type 'short'."
                        - zap 'step:short'
                        - disengage
        'accepting':
            chat trigger:
                #If you agree to be the person he thinks you are he will ask you to kill 15 zombies
                'acceptingQuest':
                    trigger: "<red>I think /I am/ the hero you are looking for!"
                    script:
                        - engage
                        - narrate "format:Old Man Format" "Then I shall test your strength!"
                        - narrate "format:Old Man Format" "<yellow> Kill  <npc.constant[Zombies]> and return to me."
                        - ^listen kill type:entity name:zombie qty:1 script:ZombieCheck
                        - flag ZombieCount:0
                        - disengage
                'denyingQuest':
                    trigger: "<red>/no/, you got the wrong guy!"
                    script:
                        - engage
                        - random {
                            - narrate "format:Old Man Format" "Sad to hear that you think of yourself as a weak individual."
                            - narrate "format:Old Man Format" "Come again when you are at full strength."
                            - narrate "format:Old Man Format" "Go now and show your face only when you feel like you need an adventure!"
                            }
                        - zap 'step:theStart'
                        - disengage
        'short':
            chat trigger:
                #When you accept to hear the shorter version
                'shortQuestTalk':
                    trigger: "<red>I would like to hear the /short/ version!"
                    script:
                        - engage
                        - narrate "format:Old Man Format" "Far away there is a world full of mysteries!"
                        - wait 1
                        - narrate "format:Old Man Format" "and i have been looking around for a true adventurer to go to this far away land."
                        - wait 2
                        - narrate "format:Old Man Format" "Are you interested in going there? If so type 'I am'."
                        - zap 'step:accepting'
                        - disengage
                'denyingShortTalk':
                    trigger: "<red>/no/ I do not like talks at all, especially the ones with older men!"
                    script:
                        - engage
                        - narrate "format:Old Man Format" "Get out of my sight young fool!"
                        - narrate "format:Old Man Format" "<&5>.... frowns at you..."
                        - zap 'step:theStart'
                        - disengage
        'secondChallange':
            click trigger:
                script:
                    - engage
                    - narrate "format:Guard Format" "Good that you are still alive, ready for the next challange?"
                    - ^flag ZombieCount:!
                    - wait 1
                    - narrate "format:Guard Format" "<yellow> Kill <npc.const[Skeletons]> and return to me."
                    - ^listen kill type:entity name:skeleton qty:1 script:SkeletonCheck
                    - ^flag SkeltonCount:0
                    - disengage
        'thirdChallange':
            click trigger:
                script:
                    - engage
                    - narrate "format:Guard Format" "I see you have not dropped out yet, I like that!"
                    - ^flag SkeletonCount:!
                    - wait 1
                    - narrate "format:Guard Format" "<yellow> Kill <npc.const[Spiders]> and return to me."
                    - ^listen kill type:entity name:spiders qty:1 script:SpiderCheck
                    - ^flag SpiderCount:0
                    - disengage
        'fourthChallange':
            click trigger:
                script:
                    - engage
                    - narrate "format:Guard Format" "Still up for it?"
                    - ^flag SpiderCount:!
                    - wait 1
                    - narrate "format:Guard Format" "<yellow> Kill <npc.const[Creepers]> and return to me."
                    - ^listen kill type:entity name:creepers qty:1 script:CreeperCheck
                    - ^flag CreeperCount:0
                    - disengage  
        'lastChallange':
            click trigger:
                script:
                    - engage
                    - narrate "format:Guard Format" "Okay one last challange"
                    - ^flag CreeperCount:!
                    - wait 1
                    - narrate "format:Guard Format" "<yellow> Kill <npc.const[Skeletons]> and return to me."
                    - ^listen kill type:entity name:skeleton qty:1 script:SkeletonCheck
                    - ^flag EndermanCount:0
                    - disengage
        'return':
            click trigger:
                script:
                    - engage
                    - narrate "format:Guard Format" "Wow, you are stronger then i thought, maybe you are capable of doing great things!"
                    - ^flag EndermanCount:!
                    - wait 1
                    - disengage                    
#----------------------------------
  #  This section below will be 
  #  checks if the player has killed
  #  the right ammount of monsters
  #----------------------------------

#----------------------------------
  #  Zombies
  #----------------------------------
ZombieCheck:
  Type: Task
  Script:
    # check if the player has killed a zombie
    - ^flag ZombieCount:++
    - ^if <flag.p:ZombieCount.asint> >= <npc.constant[Zombies]> run ZombieReward
      else run ZombieContinue

ZombieContinue:
  Type: Task
  Script:
    # everytime a player kills a zombie
    - ^narrate "<&5>*** <white>Kill Zombies - <flag.p:ZombieCount.asint>/<npc.constant[Zombies]> <&5>***"
    - ^listen kill type:entity name:zombie qty:1 script:ZombieCheck

ZombieReward:
  Type: Task
  Script:
    # if the player succeeds in killing all the zombies
    - ^narrate "<&5>*** <white>Kill Zombies - <flag.p:ZombieCount.asint>/<npc.constant[Zombies]> <&5>***"
    - wait 1
    - ^narrate "You've killed <npc.constant[Zombies]> Zombies, return to <npc.name> at the PvP Guild."
    - ^zap script:AdventurersTest step:secondChallange

#----------------------------------
  #  Skeletons
  #----------------------------------
SkeletonCheck:
  Type: Task
  Script:
    # check if the player has killed a skeleton
    - ^flag SkeletonCount:++
    - ^if <flag.p:SkeletonCount.asint> >= <npc.constant[Skeletons]> run SkeletonReward
      else run SkeletonContinue

SkeletonContinue:
  Type: Task
  Script:
    # everytime a player kills a skeleton
    - ^narrate "<&5>*** <white>Kill Skeletons - <flag.p:SkeletonCount.asint>/<npc.constant[Skeletons]> <&5>***"
    - ^listen kill type:entity name:skeleton qty:1 script:SkeletonCheck

SkeletonReward:
  Type: Task
  Script:
    # if the player succeeds in killing all the skeletons
    - ^narrate "<&5>*** <white>Kill Skeletons - <flag.p:SkeletonCount.asint>/<npc.constant[Skeletons]> <&5>***"
    - wait 1
    - narrate "You've killed <npc.constant[Skeletons]> Skeletons, return to <npc.name> at the PvP Guild."
    - zap script:AdventurersTest step:thirdChallange

#----------------------------------
  #  Spiders
  #----------------------------------
SpiderCheck:
  Type: Task
  Script:
    # check if the player has killed a spiders
    - ^flag SpiderCount:++
    - ^if <flag.p:SpiderCount.asint> >= <npc.constant[Skeletons]> run SpiderReward
      else run SpiderContinue

SpiderContinue:
  Type: Task
  Script:
    # everytime a player kills a spiders
    - ^narrate "<&5>*** <white>Kill Spiders - <flag.p:SpiderCount.asint>/<npc.constant[Spiders]> <&5>***"
    - ^listen kill type:entity name:Spiders qty:1 script:SpiderCheck

SpiderReward:
  Type: Task
  Script:
    # if the player succeeds in killing all the spiders
    - ^narrate "<&5>*** <white>Kill Spiders - <flag.p:SpiderCount.asint>/<npc.constant[Spiders]> <&5>***"
    - wait 1
    - narrate "You've killed <npc.constant[Spiders]> Spiders, return to <npc.name> at the PvP Guild."
    - zap script:AdventurersTest step:fourthChallange

#----------------------------------
  #  Creepers
  #----------------------------------
CreeperCheck:
  Type: Task
  Script:
    # check if the player has killed a creepers
    - ^flag CreeperCount:++
    - ^if <flag.p:CreeperCount.asint> >= <npc.constant[Creepers]> run CreeperReward
      else run CreeperContinue

CreeperContinue:
  Type: Task
  Script:
    # everytime a player kills a creepers
    - ^narrate "<&5>*** <white>Kill creeper - <flag.p:CreeperCount.asint>/<npc.constant[Creepers]> <&5>***"
    - ^listen kill type:entity name:creeper qty:1 script:CreeperCheck

CreeperReward:
  Type: Task
  Script:
    # if the player succeeds in killing all the creepers
    - ^narrate "<&5>*** <white>Kill Creepers - <flag.p:CreeperCount.asint>/<npc.constant[Creepers]> <&5>***"
    - wait 1
    - narrate "You've killed <npc.constant[Creepers]> creepers, return to <npc.name> at the PvP Guild."
    - zap script:AdventurersTest step:fourthChallange

#----------------------------------
  #  Enderman
  #----------------------------------
EndermanCheck:
  Type: Task
  Script:
    # check if the player has killed a enderman
    - ^flag EndermanCount:++
    - ^if <flag.p:EndermanCount.asint> >= <npc.constant[Enderman]> run EndermanReward
      else run EndermanContinue

EndermanContinue:
  Type: Task
  Script:
    # everytime a player kills a enderman
    - ^narrate "<&5>*** <white>Kill enderman - <flag.p:EndermanCount.asint>/<npc.constant[Enderman]> <&5>***"
    - ^listen kill type:entity name:enderman qty:1 script:EndermanCheck

EndermanReward:
  Type: Task
  Script:
    # if the player succeeds in killing all the enderman
    - ^narrate "<&5>*** <white>Kill Enderman - <flag.p:EndermanCount.asint>/<npc.constant[Enderman]> <&5>***"
    - wait 1
    - narrate "You've killed <npc.constant[Enderman]> enderman, return to <npc.name> at the PvP Guild."
    - zap script:AdventurersTest step:fourthChallange