Cannonbuilder Sentry 1.3


Author: davidcernat
Created: 2012-09-16T14:01:16-0400
Edited: 2013-09-21T16:06:51-0400
Denizen Version: 0.76
Views: 912
Downloads: 872
Likes: 8


WGET
Description: [For Denizen 0.76]

A Denizen/Sentry/Builder combination that follows you around, can be asked to wait and respawn in a spot, can equip armor and weapons that you give it, and most importantly can build cannons and repeating turrets of different sizes in different directions and repair them - and reload the cannons with TNT!

Make sure you get the Cannonbuilder required schematics from: http://dl.dropbox.com/u/22987227/cannonbuilder%20schematics.zip

Put the required schematics in plugins/Builder/schematics (or wherever you've set your Builder schematics folder)

Make sure the NPC you want to use has the Builder, Sentry and Denizen traits and that you are its owner.

And use the following lines in plugins/Denizen/assignments.yml for the NPC you want to turn into a Cannonbuilder:

    Interact Scripts:
    - 10 Cannonbuilder Sentry Stranger
    - 20 Cannonbuilder Sentry Friendly Fire
    - 20 ^Cannonbuilder Sentry Orders
    - 30 ^Cannonbuilder Sentry Equipment
    - 40 ^Cannonbuilder Sentry Request Materials
    - 50 ^Cannonbuilder Sentry Building Type
    - 60 ^Cannonbuilder Sentry Building Size
    - 70 ^Cannonbuilder Sentry Building Direction
    - 80 ^Cannonbuilder Sentry Building Placement
    - 90 ^Cannonbuilder Sentry Building Progress
    - 100 ^Cannonbuilder Sentry Repairing
    Texts:
      Denizen Unavailable: ""

And optionally, if you want players to have to supply the Cannonbuilder with materials before it can build, use the "/builder supply true" command on it.

It uses so many different scripts because every Cannonbuilder has its own variables that don't affect other Cannonbuilders, which means you can have as many of them at once as you want, with - for instance - one of them building a huge cannon facing south while another is building a tiny turret facing east while another is guarding a spot and another is asking you for materials.

One issue exists at the moment:
- Medium, large and huge turrets facing north and south have some of the dispensers facing the wrong way. jrbudda has said this will be fixed in a future version of Builder.

Version history:

1.3 - Made the script seamlessly compatible with the new RequireMaterials option from Builder. There is a new assignment for when the Cannonbuilder needs materials.
1.2 - Expanded "Equip" option to let you equip the Cannonbuilder with weapons and armor, and to have it remember its current melee and ranged weapons. Shortened rest of script substantially using replaceable tags.
1.1 - Added conversation option to build the same thing that was built the last time.
1.0 - Changed all flags to newly-introduced DENIZEN flags.
0.9 - First release.

Enjoy, and let me know if you have any suggestions.

Cannonbuilder Sentry Stranger:
  Type: Interact
  Requirements:
    Mode: None
  Steps:
    1:
      Click Trigger:
        Script:
        - CHAT "I don't know who you are."
      Damage Trigger:
        Script:
        - CHAT "You shall pay for your insolence."
        - ENGAGE 5

Cannonbuilder Sentry Friendly Fire:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
  Steps:
    1:
      Damage Trigger:
        Script:
        - RANDOM 5
        - CHAT "Do not attack me."
        - CHAT "Why do you strike your ally?"
        - CHAT "You should save your blows for the enemy."
        - CHAT "It is not kind of you to hit your friend."
        - CHAT "I am not your foe."
        - ENGAGE 5

Cannonbuilder Sentry Orders:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
  Steps:
    1:
      Click Trigger:
        Script:
        - RANDOM 6
        - CHAT "What are your orders?"
        - CHAT "Need something?"
        - CHAT "Yes?"
        - CHAT "What should I do?"
        - CHAT "What's the plan?"
        - CHAT "Where are we going?"
        - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /Follow/ me.
          Script:
          - RANDOM 4
          - CHAT "Let's go."
          - CHAT "Lead the way."
          - CHAT "I am coming."
          - CHAT "I'll be close behind you."
          - EXECUTE ASSERVER "sentry <NPCID> guard <PLAYER>"
       '2':
          Trigger: /Wait/ here.
          Script:
          - RANDOM 4
          - CHAT "I'll remain in this area then."
          - CHAT "Alright, I'll guard this spot."
          - CHAT "Very well. I shall stay here."
          - CHAT "I will await your return."
          - EXECUTE ASSERVER "sentry <NPCID> guard"
          - EXECUTE ASSERVER "sentry <NPCID> spawn"
       '3':
          Trigger: /Equip/ something.
          Script:
          - ^RUNTASK 'SCRIPT:Cannonbuilder Set Equipment State'
       '4':
          Trigger: /Build/ something here.
          Script:
          - ^FLAG DENIZEN State:3
          - CHAT "What should I build? A cannon or a turret?"

Cannonbuilder Remember Previous State:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'Previous State:<FLAG.DENIZEN:State:0>'

Cannonbuilder Set Equipment State:
  Type: Task
  Script:
  - ^RUNTASK 'SCRIPT:Cannonbuilder Remember Previous State'
  - ^FLAG DENIZEN State:1
  - RANDOM 4
  - CHAT "Do you want me to take a weapon?"
  - CHAT "What do you want me to equip?"
  - CHAT "Shall I switch to a different weapon?"
  - CHAT "Need me to take and wear a certain kind of armor?"

Cannonbuilder Set Materials State:
  Type: Task
  Script:
  - ^RUNTASK 'SCRIPT:Cannonbuilder Remember Previous State'
  - ^FLAG DENIZEN State:2

Cannonbuilder Sentry Equipment:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:1
  Steps:
    1:
      Click Trigger:
        Script:
        - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /Melee/ weapon.
          Script:
          - ^IF DENIZEN 'FLAG:Has Melee' 'SCRIPT:Cannonbuilder Found Melee' ELSE 'SCRIPT:Cannonbuilder Did Not Find Melee'
       '2':
          Trigger: /Ranged/ weapon.
          Script:
          - ^IF DENIZEN 'FLAG:Has Ranged' 'SCRIPT:Cannonbuilder Found Ranged' ELSE 'SCRIPT:Cannonbuilder Did Not Find Ranged'
       '3':
          Trigger: Here. /Take/ what I'm holding.
          Script:
          - ^FLAG DENIZEN 'Check Item Valid:false'
          - ^FLAG DENIZEN 'Check Item ID:<PLAYER.ITEM_IN_HAND.ID>'
          - ^FLAG DENIZEN 'Check Item Material:<PLAYER.ITEM_IN_HAND.MATERIAL>'
          - ^FLAG DENIZEN 'Check Item Name:<^PLAYER.ITEM_IN_HAND.NAME>'
          - ^IF DENIZEN 'FLAG:Check Item ID:298' 'SCRIPT:Cannonbuilder Check Armor'
          - ^IF DENIZEN 'FLAG:Check Item Material:PUMPKIN' 'SCRIPT:Cannonbuilder Wear Pumpkin'
          - ^IF DENIZEN 'FLAG:Check Item Material:JACK_O_LANTERN' 'SCRIPT:Cannonbuilder Wear Pumpkin'
          - ^IF DENIZEN 'FLAG:Check Item Material:WOOD_SWORD' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:GOLD_SWORD' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:STONE_SWORD' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:IRON_SWORD' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:DIAMOND_SWORD' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:WOOD_AXE' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:GOLD_AXE' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:STONE_AXE' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:IRON_AXE' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:DIAMOND_AXE' 'SCRIPT:Cannonbuilder Take Melee'
          - ^IF DENIZEN 'FLAG:Check Item Material:BOW' 'SCRIPT:Cannonbuilder Take Ranged'
          - ^IF DENIZEN 'FLAG:Check Item Material:BLAZE_ROD' 'SCRIPT:Cannonbuilder Take Ranged'
          - ^IF DENIZEN 'FLAG:Check Item Material:BOOK' 'SCRIPT:Cannonbuilder Take Ranged'
          - ^IF DENIZEN 'FLAG:Check Item Material:EGG' 'SCRIPT:Cannonbuilder Take Ranged'
          - ^IF DENIZEN 'FLAG:Check Item Material:ENDER_PEARL' 'SCRIPT:Cannonbuilder Take Ranged'
          - ^IF DENIZEN 'FLAG:Check Item Material:SNOW_BALL' 'SCRIPT:Cannonbuilder Take Ranged'
          - ^IF DENIZEN 'FLAG:Check Item Material:AIR' 'SCRIPT:Cannonbuilder No Item'
          - ^IF DENIZEN 'FLAG:Check Item Valid:false' 'SCRIPT:Cannonbuilder Invalid Item'
       '4':
          Trigger: /Nevermind/, keep using the same.
          Script:
          - ^FLAG DENIZEN 'State:<FLAG.DENIZEN:Previous State:0>'
          - CHAT "Alright then."

Cannonbuilder Sentry Request Materials:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:2
  Steps:
    1:
      Click Trigger:
        Script:
          - ^WAIT 1
      Chat Trigger:
       '1':
          Trigger: /Cancel/.
          Script:
          - ^FLAG DENIZEN 'State:<FLAG.DENIZEN:Previous State:0>'
          - ^EXECUTE ASSERVER "builder <NPCID> cancel"
          - CHAT "As you wish."

Cannonbuilder Sentry Building Type:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:3
  Steps:
    1:
      Click Trigger:
        Script:
        - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /Cannon/.
          Script:
          - ^FLAG DENIZEN State:4
          - ^FLAG DENIZEN 'Type:cannon'
          - CHAT "Alright. How large should it be?"
       '2':
          Trigger: /Turret/.
          Script:
          - ^FLAG DENIZEN State:4
          - ^FLAG DENIZEN 'Type:turret'
          - CHAT "Sure. How large should it be?"
       '3':
          Trigger: /Same/ as before, same size, same direction.
          Script:
          - ^IF DENIZEN 'FLAG:Building Finished' 'SCRIPT:Cannonbuilder Found Previous Build' ELSE 'SCRIPT:Cannonbuilder No Previous Build'
       '4':
          Trigger: /Nevermind/, this is not the right spot.
          Script:
          - ^FLAG DENIZEN State:0
          - CHAT "Very well."

Cannonbuilder Sentry Building Size:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:4
  Steps:
    1:
      Click Trigger:
        Script:
        - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /Tiny/.
          Script:
          - ^FLAG DENIZEN 'Size:tiny'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Size Chosen'
       '2':
          Trigger: /Small/.
          Script:
          - ^FLAG DENIZEN 'Size:small'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Size Chosen'
       '3':
          Trigger: /Medium/.
          Script:
          - ^FLAG DENIZEN 'Size:medium'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Size Chosen'
       '4':
          Trigger: /Large/.
          Script:
          - ^FLAG DENIZEN 'Size:large'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Size Chosen'
       '5':
          Trigger: /Huge/.
          Script:
          - ^FLAG DENIZEN 'Size:huge'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Size Chosen'
       '6':
          Trigger: /Nevermind/, I've reconsidered.
          Script:
          - ^FLAG DENIZEN State:0
          - CHAT "Fair enough."

Cannonbuilder Size Chosen:
  Type: Task
  Script:
  - ^FLAG DENIZEN State:5
  - CHAT "What direction should it face?"

Cannonbuilder Sentry Building Direction:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:5
  Steps:
    1:
      Click Trigger:
        Script:
        - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /North/.
          Script:
          - ^FLAG DENIZEN 'Direction:north'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Direction Chosen'
       '2':
          Trigger: /West/.
          Script:
          - ^FLAG DENIZEN 'Direction:west'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Direction Chosen'
       '3':
          Trigger: /East/.
          Script:
          - ^FLAG DENIZEN 'Direction:east'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Direction Chosen'
       '4':
          Trigger: /South/.
          Script:
          - ^FLAG DENIZEN 'Direction:south'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Direction Chosen'
       '5':
          Trigger: /Nevermind/, we need to put it somewhere else.
          Script:
          - ^FLAG DENIZEN State:0
          - CHAT "Fair enough."

Cannonbuilder Direction Chosen:
  Type: Task
  Script:
  - ^FLAG DENIZEN State:6
  - CHAT "Take me to the spot where you want it."
  - EXECUTE ASSERVER "sentry <NPCID> guard <PLAYER>"

Cannonbuilder Sentry Building Placement:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:6
  Steps:
    1:
      Click Trigger:
        Script:
          - ^RUNTASK 'SCRIPT:Cannonbuilder Set Materials State'
          - ^EXECUTE ASSERVER "sentry <NPCID> guard"
          - ^EXECUTE ASSERVER "builder <NPCID> origin"
          - ^RUNTASK 'SCRIPT:Cannonbuilder Build Gun'

Cannonbuilder Sentry Building Progress:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:7
  Steps:
    1:
      Click Trigger:
        Script:
          - CHAT "I'm building. Do you need something?"
          - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /Cancel/.
          Script:
          - ^EXECUTE ASSERVER "builder <NPCID> cancel"
          - ^FLAG DENIZEN State:0
          - ^CHAT "As you wish."

Cannonbuilder Sentry Repairing:
  Type: Interact
  Requirements:
    Mode: All
    List:
      - OWNER
      - FLAGGED DENIZEN State:8
  Steps:
    1:
      Click Trigger:
        Script:
          - ^RANDOM 2
          - CHAT "Now what?"
          - CHAT "What next?"
          - HINT SHORT
      Chat Trigger:
       '1':
          Trigger: /Restore/ this gun.
          Script:
          - ^RUNTASK 'SCRIPT:Cannonbuilder Set Materials State'
          - ^RUNTASK 'SCRIPT:Cannonbuilder Repair Gun'
       '2':
          Trigger: /Follow/ me, let's leave this place.
          Script:
          - ^FLAG DENIZEN State:0
          - CHAT "Fair enough, let's go."
          - ^EXECUTE ASSERVER "sentry <NPCID> guard <PLAYER>"
       '3':
          Trigger: /Equip/ something.
          Script:
          - ^RUNTASK 'SCRIPT:Cannonbuilder Set Equipment State'

Cannonbuilder Invalid Item:
  Type: Task
  Script:
  - ^RANDOM 4
  - CHAT "Sorry, but I don't know what you want me to do with that."
  - CHAT "I wouldn't know exactly what to do with that. Keep it."
  - CHAT "I don't understand how you want me to use the <FLAG.DENIZEN:Check Item Name:thing>."
  - CHAT "I have no idea what I'm supposed to do with the <FLAG.DENIZEN:Check Item Name:thing>."

Cannonbuilder No Item:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'Check Item Valid:true'
  - ^RANDOM 5
  - CHAT "You know, you're not actually holding anything."
  - CHAT "Is that some kind of joke?"
  - CHAT "What, are you holding something invisible and intangible?"
  - CHAT "There's nothing in your hand."
  - CHAT "It must have slipped out of your hand before you could give it to me."

Cannonbuilder Finish Equipping:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'State:<FLAG.DENIZEN:Previous State:0>'

Cannonbuilder Found Melee:
  Type: Task
  Script:
  - ^RUNTASK 'SCRIPT:Cannonbuilder Finish Equipping'
  - ^FLAG DENIZEN 'Current Weapon:<FLAG.DENIZEN:Melee Weapon Material:unknown>'
  - ^RANDOM 2
  - CHAT "Very well, I shall cut our foes in half with my <FLAG.DENIZEN:Melee Weapon Name:thing>."
  - CHAT "So be it. I will slay whoever stands in our way with my <FLAG.DENIZEN:Melee Weapon Name:thing>."
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Current Weapon:unknown>"

Cannonbuilder Did Not Find Melee:
  Type: Task
  Script:
  - CHAT "Alas, I have neither an axe nor a sword. Give me one."

Cannonbuilder Found Ranged:
  Type: Task
  Script:
  - ^RUNTASK 'SCRIPT:Cannonbuilder Finish Equipping'
  - ^FLAG DENIZEN 'Current Weapon:<FLAG.DENIZEN:Ranged Weapon Material:unknown>'
  - ^RANDOM 2
  - CHAT "Alright, I will attack our enemies from afar with my <FLAG.DENIZEN:Ranged Weapon Name:thing>."
  - CHAT "Understood. I shall keep my distance and dispatch our adversaries with my <FLAG.DENIZEN:Ranged Weapon Name:thing>."
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Current Weapon:unknown>"

Cannonbuilder Did Not Find Ranged:
  Type: Task
  Script:
  - CHAT "But I have no bow or magical item."

Cannonbuilder Take Melee:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'Check Item Valid:true'
  - ^FLAG DENIZEN 'Melee Weapon Material:<FLAG.DENIZEN:Check Item Material:unknown>'
  - ^FLAG DENIZEN 'Melee Weapon Name:<FLAG.DENIZEN:Check Item Name:unknown>'
  - ^FLAG DENIZEN 'Has Melee'
  - ^RUNTASK 'SCRIPT:Cannonbuilder Finish Equipping'
  - ^RUNTASK 'SCRIPT:Cannonbuilder Equip Weapon'

Cannonbuilder Take Ranged:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'Check Item Valid:true'
  - ^FLAG DENIZEN 'Ranged Weapon Material:<FLAG.DENIZEN:Check Item Material:unknown>'
  - ^FLAG DENIZEN 'Ranged Weapon Name:<FLAG.DENIZEN:Check Item Name:unknown>'
  - ^FLAG DENIZEN 'Has Ranged'
  - ^RUNTASK 'SCRIPT:Cannonbuilder Finish Equipping'
  - ^RUNTASK 'SCRIPT:Cannonbuilder Equip Weapon'

Cannonbuilder Check Armor:
  Type: Task
  Script:
  - ^IF DENIZEN '-FLAG:Check Item ID:318' 'SCRIPT:Cannonbuilder Equip Armor'

Cannonbuilder Equip Armor:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'Check Item Valid:true'
  - ^TAKE ITEMINHAND
  - ^RUNTASK 'SCRIPT:Cannonbuilder Finish Equipping'
  - CHAT "Thanks, I'll wear the <FLAG.DENIZEN:Check Item Name:thing> then."
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Check Item Material:unknown>"

Cannonbuilder Equip Weapon:
  Type: Task
  Script:
  - ^TAKE ITEMINHAND
  - ^FLAG DENIZEN 'Current Weapon:<FLAG.DENIZEN:Check Item Material:unknown>'
  - CHAT "Alright, I'll use this <FLAG.DENIZEN:Check Item Name:thing>."
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Current Weapon:unknown>"

Cannonbuilder Wear Pumpkin:
  Type: Task
  Script:
  - ^FLAG DENIZEN 'Check Item Valid:true'
  - ^TAKE ITEMINHAND
  - ^RUNTASK 'SCRIPT:Cannonbuilder Finish Equipping'
  - ^RANDOM 3
  - CHAT "Fine. But I'm definitely not happy about this."
  - CHAT "What, do you want me to blend in among snow golems?"
  - CHAT "I don't get paid enough for this."
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Check Item Material:unknown>"

Cannonbuilder Found Previous Build:
  Type: Task
  Script:
  - ^FLAG DENIZEN State:6
  - CHAT "A <FLAG.DENIZEN:Size:unknown> <FLAG.DENIZEN:Type:unknown> facing <FLAG.DENIZEN:Direction:unknown>, then. Take me to the spot where you want it."
  - EXECUTE ASSERVER "sentry <NPCID> guard <PLAYER>"

Cannonbuilder No Previous Build:
  Type: Task
  Script:
  - ^RANDOM 2
  - ^CHAT "Huh? I've never built anything for you before. Tell me what you need, exactly."
  - ^CHAT "I've never built for you before, <PLAYER>. You must be mistaking me for someone else."

Cannonbuilder Check Building Materials:
  Type: Task
  Script:
  - IF DENIZEN '-FLAG:Building Started:true' 'SCRIPT:Cannonbuilder Request Building Materials'

Cannonbuilder Check Repairing Materials:
  Type: Task
  Script:
  - IF DENIZEN '-FLAG:Building Started:true' 'SCRIPT:Cannonbuilder Request Repairing Materials'

Cannonbuilder Request Building Materials:
  Type: Task
  Script:
  - CHAT "Now I need all the materials for the <FLAG.DENIZEN:Size:unknown> <FLAG.DENIZEN:Type:unknown>. Give them to me one by one, if you will. If you change your mind about building here, tell me to cancel."

Cannonbuilder Request Repairing Materials:
  Type: Task
  Script:
  - CHAT "Sure, once you give me everything I need to restore it."
  
CannonbuilderStartedBuilding:
  Type: Task
  Script:
  - FLAG DENIZEN State:7
  - FLAG DENIZEN 'Building Started:true'
  - CHAT "Very well. Protect me while I build."

CannonbuilderStartedRepairing:
  Type: Task
  Script:
  - FLAG DENIZEN 'Building Started:true'
  - CHAT "I'm on it."

CannonbuilderFinishedBuilding:
  Type: Task
  Script:
  - FLAG DENIZEN State:8
  - FLAG DENIZEN 'Building Started:false'
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Current Weapon:unknown>"
  - EXECUTE ASSERVER "sentry <NPCID> spawn"
  - SHOUT NOPLAYER "I've finished building."
  - FLAG DENIZEN 'Building Finished'

CannonbuilderFinishedRepairing:
  Type: Task
  Script:
  - FLAG DENIZEN State:8
  - FLAG DENIZEN 'Building Started:false'
  - EXECUTE ASSERVER "sentry <NPCID> equip <FLAG.DENIZEN:Current Weapon:unknown>"
  - EXECUTE ASSERVER "sentry <NPCID> spawn"
  - SHOUT NOPLAYER "I've finished restoring the gun."

Cannonbuilder Build Gun:
  Type: Task
  Script:
  - EXECUTE ASSERVER "builder <NPCID> load <FLAG.DENIZEN:Type:unknown>-<FLAG.DENIZEN:Size:unknown>-<FLAG.DENIZEN:Direction:unknown>"
  - EXECUTE ASSERVER "builder <NPCID> build layers:2 onstart:CannonbuilderStartedBuilding oncomplete:CannonbuilderFinishedBuilding"
  - RUNTASK 'SCRIPT:Cannonbuilder Check Building Materials'

Cannonbuilder Repair Gun:
  Type: Task
  Script:
  - EXECUTE ASSERVER "builder <NPCID> build layers:2 onstart:CannonbuilderStartedRepairing oncomplete:CannonbuilderFinishedRepairing"
  - RUNTASK 'SCRIPT:Cannonbuilder Check Repairing Materials'
 




Comments
2012-09-28 22:18:07 - tickleman:

Great job, fun as it could be !