- Joined
- Jun 10, 2007
- Messages
- 557
Well, a while ago I made a thread on a similar topic, but I ditched the method I was inquiring about there for a more clunky method that I hoped would work. However...
Here is my trigger. What I am trying to accomplish is when the hero uses a spell called Open Chest, the chest will play it's Morph Animation (ie it will appear to open), it will get two random level 1 items, it will get a special effect attached to it, and have a 25% chance to be trapped, and if it is trapped, a random trap will be picked and used on the opening hero. And finally, it will give the chest to the opening hero so that they can do with it's contents as they wish. I'm making it vulnerable but giving it godly hp regeneration so it cannot be targeted by the spell again.
Here is my trigger. What I am trying to accomplish is when the hero uses a spell called Open Chest, the chest will play it's Morph Animation (ie it will appear to open), it will get two random level 1 items, it will get a special effect attached to it, and have a 25% chance to be trapped, and if it is trapped, a random trap will be picked and used on the opening hero. And finally, it will give the chest to the opening hero so that they can do with it's contents as they wish. I'm making it vulnerable but giving it godly hp regeneration so it cannot be targeted by the spell again.
-
Chests
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Unit-type of (Target unit of ability being cast)) Equal to Chest
- (Ability being cast) Equal to Open Chest (Neutral Hostile)
-
Actions
- Set ChestUnit = (Target unit of ability being cast)
- Set TempCaster = (Casting unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 4) Equal to 1
-
Then - Actions
- Set TrapNumber = (Random integer number between 1 and 4)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TrapNumber Equal to 1
-
Then - Actions
- Unit - Order ChestUnit to Neutral - Firebolt TempCaster
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TrapNumber Equal to 2
-
Then - Actions
- Unit - Order ChestUnit to Neutral Dark Ranger - Silence TempLoc
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TrapNumber Equal to 3
-
Then - Actions
- Unit - Order ChestUnit to Undead Necromancer - Unholy Frenzy TempCaster
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TrapNumber Equal to 4
-
Then - Actions
- Unit - Order ChestUnit to Neutral Alchemist - Acid Bomb TempCaster
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Else - Actions
-
If - Conditions
- Animation - Play ChestUnit's morph animation
- Special Effect - Create a special effect attached to the origin of ChestUnit using Doodads\Dungeon\Props\TreasurePile\TreasurePile0.mdl
- Unit - Change ownership of ChestUnit to (Owner of (Casting unit)) and Retain color
- Unit - Make ChestUnit Vulnerable
- Unit - Remove Curse Trap (Neutral Hostile) from (Triggering unit)
- Unit - Remove Fire Trap (Neutral Hostile) from (Triggering unit)
- Unit - Remove Mute Trap (Neutral Hostile) from (Triggering unit)
- Unit - Remove Senility Trap from (Triggering unit)
-
Events
Last edited: