Door Key System

Status
Not open for further replies.
Level 6
Joined
May 26, 2010
Messages
212
I'm looking for a system that uses an item [The Key] to open a door. You use it by using the item on the door and it opens it then it closes it after about 5 seconds. Below is my attempt at it.
  • House 1
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to |cffffcc00Buy House|r
      • (Selling unit) Equal to Home Dealership [House] 0003 <gen>
    • Actions
      • Item - Remove (Sold Item)
      • Hero - Create Key and give it to (Buying unit)
      • Set Key[1] = (Last created item)
      • Unit - Hide Home Dealership [House] 0003 <gen>
  • House 1 Key
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Key
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item being manipulated) Equal to Key[1]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target destructible of ability being cast) Equal to Door (Horizontal) 0315 <gen>
            • Then - Actions
              • Wait 0.15 seconds
              • Destructible - Open Door (Horizontal) 0315 <gen>
              • Wait 5.00 seconds
              • Destructible - Close Door (Horizontal) 0315 <gen>
            • Else - Actions
              • Destructible - Close Door (Horizontal) 0315 <gen>
        • Else - Actions
  • Key Bug Fix
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Key
    • Actions
      • Wait 0.10 seconds
      • Destructible - Close (Target destructible of ability being cast)
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I think its ok except the third trigger try disabling it and see what happens :)
And it could be done a bit easier by 2 triggers for all the houses you have. Like this you will have to do 2 triggers for each house.
 
Status
Not open for further replies.
Top