Paste #13117: error on script

Date: 2015/01/19 16:47:26 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"Kurisok":
    type: assignment

    interact scripts:
    - 1 Boss

    default constants:    
      WarningRange: 35 
      WarningMessage: "Any closer and I will kill you."      
      Health: 100
      MeleeEquipment: Diamond_Sword 
      RangeEquipment: book
      Helmet: 310
      ChestPlate: 311
      Leggins: 312
      Boots: 313
      Retaliate: true
      Strength: 4
      Armor: 8
      MeleeRange: 3
      RangeAttackRange: 15
      AttackSpeed: 1      
      Speed: 1
      RegenRate: 1
      Respawn: 120
      Nightvision: 5 
      Drop Loot on Death: "Yes"
      Loot Quantity: 1
      Loot Distribution: player

    actions:
      on assignment:
      - ^execute as_npc "npc select <npc.id>"
      - ^execute as_npc "Trait Sentry"
      - trigger name:chat toggle:true
      - trigger name:click toggle:true
      - trigger name:damage toggle:true
      - trigger name:proximity toggle:true radius:<cons:MeleeRange>
      - execute as_npc "sentry Health <cons:Health>"
      - execute as_npc "sentry Armor <cons:Armor>"
      - execute as_npc "sentry Strength <cons:Strength>"
      - execute as_npc "sentry Range <cons:RangeAttackRange>"
      - execute as_npc "sentry Speed <cons:Speed>"
      - execute as_npc "sentry Attackrate <cons:AttackSpeed>"
      - execute as_npc "sentry HealRate <cons:RegenRate>"
      - execute as_npc "sentry Nightvision <cons:Nightvision>"
      - execute as_npc "sentry Respawn <cons:Respawn>"
      - execute as_npc "sentry equip <cons:Helmet>"
      - execute as_npc "sentry equip <cons:Leggins>"
      - execute as_npc "sentry equip <cons:ChestPlate>"
      - execute as_npc "sentry equip <cons:Boots>"      
      - execute as_npc "sentry retaliate <cons:Retaliate>"
      - execute as_npc "sentry Warning <cons:WarningMessage>"
      - execute as_npc "sentry target add entity:player"
      - execute as_npc "npc vulnerable"
      - execute as_npc "sentry invincible false"

      on death:
      - chat "Arrgghhh!"
      - flag npc in_pursuit:!
      - if "<cons:Drop Loot on Death>" == "Yes" run "BossName Drop the Loot" instantly

      on enter proximity:
      - lookclose toggle:true
      - if <flag.npc[inpursuit]> queue clear
      - flag npc in_pursuit:true
      - attack

"Kurisok Drop the Loot":
    type: task

    script:
    - if "<cons:Loot Distribution>" == "player" {
        - flag <npc> Looter:%value%
        - repeat "<cons:Loot Quantity>" {
          - give to:<player[<npc.flag[looter]>].inventory> "i@<proc:Kurisok Determine Loot>"
          }
        }
      }

"Kurisok Determine Loot":
    type: procedure

    script:
    - define roll <util.random.int[1].to[100]>
    - if %roll% >= 0 && %roll% < 40 define quality "Common"
      else if %roll% >= 40 && %roll% < 70 define quality "Uncommon"
      else if %roll% >= 70 && %roll% < 85 define quality "Rare"
      else if %roll% >= 85 && %roll% < 95 define quality "Epic"
      else if %roll% >= 95 define quality "Legendary"

    - if %quality% == Common random 1{
        - determine "Kurisok Bow" }

      else if %quality% == Uncommon random 1{
        - determine "Kurisok Bow" }

      else if %quality% == Rare random {
        - determine "Kurisok Bow" }

      else if %quality% == Epic random 3{
        - determine "Kurisok Bow" }

      else if %quality% == Legendary random 5{
        - determine "Kurisok Bow" }

      "Kurisok Bow":
      type: item
      material: bow
      display name: "Kurisok's Bow"
      lore:
      - Coated arrow tips set alight even
      - with the slightest wind friction.
      - Epic Item
      enchantments:
      - arrow_fire:2
      - damage_all:5
      - durability:3

      on exit proximity:
      - if !<flag.npc[in_pursuit]> queue clear
      - lookclose toggle:false

      on despawn:
      - flag npc in_pursuit:!

      on spawn:
      - announce "<&4><npc.name.nickname> has respawned."
      - execute as_npc "sentry Health <cons:Health>"


'Boss':
    type: interact
    steps:
        '1':
            proximity trigger:
              entry:
                script:
                - ^Execute as_npc "Sentry equip <Cons:MeleeEquipment>"
                - run Cast delay:<cons:SpellTimeOut>
                - attack
              #If player is out of range the Boss will switch to a ranged weapon specified above to start attacking                
              exit:
                script:               
                - ^Execute as_npc "Sentry equip <Cons:RangeEquipment>"
#If you add more spells please make sure to edit the 7 to the new count.
'Cast':
    type: task
    script:
    - run Spell "context:<util.random.int[1].to[7]>"

'Spell':
    type: task
    context: id
    script:
    - narrate "<&c><npc.name.nickname> has casted <cons:spell<context.id>> on you."
    - cast <cons:spell<context.id>> duration:<cons:Spell<context.id>Duration> Power:<cons:Spell<context.id>Power>