- Joined
- Mar 16, 2008
- Messages
- 721
EDIT: meant to post in world editor help zone
trying to make a trigger that 'crafts' an item if the hero has at least twenty charges sum of two items > or = 20 then the trigger goes off and it works. But i was wondering how i could make it remove a total of twenty of either item, but not more incase they have an excess. So it would need to remove 20 of one type if it was using solely reagent A but what if it's say 10 of A and 11 of B any other combination? I think someone with a better understanding of math could figure out how to express this more elegantly. Can anyone think of any solution that wouldn't involve making a trigger for every possible combination in excess of a sum of 20?
Does this make any sense?
Reagent A is called Artifact Shard and reagent B is called Midnight Ankh.
trying to make a trigger that 'crafts' an item if the hero has at least twenty charges sum of two items > or = 20 then the trigger goes off and it works. But i was wondering how i could make it remove a total of twenty of either item, but not more incase they have an excess. So it would need to remove 20 of one type if it was using solely reagent A but what if it's say 10 of A and 11 of B any other combination? I think someone with a better understanding of math could figure out how to express this more elegantly. Can anyone think of any solution that wouldn't involve making a trigger for every possible combination in excess of a sum of 20?
Does this make any sense?
Reagent A is called Artifact Shard and reagent B is called Midnight Ankh.
-
Create Black Artifact
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Unit-type of (Hero manipulating item)) Not equal to Wagon
- (Unit-type of (Hero manipulating item)) Not equal to King's Castle
- ((Hero manipulating item) has an item of type Black Orb) Equal to True
- ((Charges remaining in (Item carried by (Hero manipulating item) of type Artifact Shard)) + (Charges remaining in (Item carried by (Hero manipulating item) of type Midnight Ankh))) Greater than or equal to 20
- ((Hero manipulating item) has an item of type Corrupted Ashbringer, Black Artifact Blade) Equal to False
-
Actions
- Custom script: call DestroyInteger(udg_Shards_plus_Midnightankhs)
- Set VariableSet Shards_plus_Midnightankhs = ((Charges remaining in (Item carried by (Hero manipulating item) of type Artifact Shard)) + (Charges remaining in (Item carried by (Hero manipulating item) of type Midnight Ankh)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Shards_plus_Midnightankhs Equal to 20
-
Then - Actions
- Item - Set charges remaining in (Item carried by (Hero manipulating item) of type Artifact Shard) to ((Charges remaining in (Item carried by (Hero manipulating item) of type Artifact Shard)) - 20)
- Item - Remove (Item carried by (Hero manipulating item) of type Artifact Shard)
- Item - Set charges remaining in (Item carried by (Hero manipulating item) of type Midnight Ankh) to ((Charges remaining in (Item carried by (Hero manipulating item) of type Midnight Ankh)) - 20)
- Item - Remove (Item carried by (Hero manipulating item) of type Midnight Ankh)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Shards_plus_Midnightankhs Greater than 20
-
Then - Actions
- Item - Set charges remaining in (Item carried by (Hero manipulating item) of type Midnight Ankh) to (Shards_plus_Midnightankhs - 20)
- Item - Set charges remaining in (Item carried by (Hero manipulating item) of type Artifact Shard) to ((Charges remaining in (Item carried by (Hero manipulating item) of type Artifact Shard)) - 20)
- Item - Remove (Item carried by (Hero manipulating item) of type Artifact Shard)
-
Else - Actions
- Do nothing
-
If - Conditions
- Hero - Create Corrupted Ashbringer, Black Artifact Blade and give it to (Hero manipulating item)
- Quest - Display to (All players) the Quest Update message: A |cff333333Black K...
- Neutral Building - Enable Way Gate 0688 <gen>
- Animation - Reset Way Gate 0688 <gen>'s animation
- Neutral Building - Enable Way Gate 0690 <gen>
- Animation - Reset Way Gate 0690 <gen>'s animation
- Neutral Building - Enable Way Gate 0691 <gen>
- Animation - Reset Way Gate 0691 <gen>'s animation
- Neutral Building - Enable Way Gate 0259 <gen>
- Animation - Reset Way Gate 0259 <gen>'s animation
- Destructible - Open Iron Gate (Vertical) 4193 <gen>
- Destructible - Open Gate (Vertical) 1093 <gen>
- Destructible - Open Elven Gate (Horizontal) 1652 <gen>
- Destructible - Open Ice Rock Gate (Vertical) 3260 <gen>
- Destructible - Open Ice Rock Gate (Horizontal) 3202 <gen>
- Destructible - Open Ice Rock Gate (Vertical) 3203 <gen>
- Destructible - Open Ice Rock Gate (Horizontal) 3259 <gen>
- Cinematic - Ping minimap for Winning_Group_Var at (Center of NE Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Winning_Group_Var at (Center of NW Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Winning_Group_Var at (Center of SE Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Winning_Group_Var at (Center of SW Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Losing_Group_Var at (Center of NE Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Losing_Group_Var at (Center of NW Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Losing_Group_Var at (Center of SE Gateway <gen>) for 5.00 seconds
- Cinematic - Ping minimap for Losing_Group_Var at (Center of SW Gateway <gen>) for 5.00 seconds
- Trigger - Turn on Black Artifact Already Made <gen>
- Trigger - Turn off (This trigger)
-
Events
Last edited: