- Joined
- Jun 20, 2017
- Messages
- 380
Hey,
I have this trigger that randomly drops some items!
My problem is that it should not drop items when your hero is still near the enemy!
Also does this leak?
I have this trigger that randomly drops some items!
My problem is that it should not drop items when your hero is still near the enemy!
-
Gold Drops
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
((Owner of (Dying unit)) is in PlayerGroup_Humans.) Equal to True
-
-
Actions
-
Set VariableSet KillingUnit = (Killing unit)
-
Set VariableSet DyingUnit = (Dying unit)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Boolean_IsHunterNear Equal to True
-
-
Then - Actions
-
Set VariableSet Boolean_IsHunterNear = False
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Owner of KillingUnit) is an enemy of (Owner of DyingUnit).) Equal to True
-
-
Then - Actions
-
Set VariableSet Integer_GoldDrops = (Random integer number between 1 and 100)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Integer_GoldDrops Less than or equal to 30
-
-
Then - Actions
-
Set VariableSet PositionOfUnit = (Position of DyingUnit)
-
Item - Create Small Gold Coin at PositionOfUnit
-
Set VariableSet Items_GoldDrops[1] = (Last created item)
-
Custom script: call RemoveLocation(udg_PositionOfUnit)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Integer_GoldDrops Less than or equal to 5
-
-
Then - Actions
-
Set VariableSet PositionOfUnit = (Position of DyingUnit)
-
Item - Create Large Gold Coin at PositionOfUnit
-
Set VariableSet Items_GoldDrops[2] = (Last created item)
-
Custom script: call RemoveLocation(udg_PositionOfUnit)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Boolean_IsHunterNear Equal to False
-
-
Then - Actions
-
Set VariableSet Boolean_IsHunterNear = True
-
-------- --------
-
Custom script: set bj_wantDestroyGroup = true
-
Set VariableSet PositionOfUnit = (Position of DyingUnit)
-
Unit Group - Pick every unit in (Units within 512.00 of PositionOfUnit.) and do (Actions)
-
Loop - Actions
-
Set VariableSet PickedUnit = (Picked unit)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of PickedUnit) Equal to Arthas Hunter
-
(Unit-type of PickedUnit) Equal to Original Hunter
-
-
-
-
Then - Actions
-
Item - Remove Items_GoldDrops[1]
-
Item - Remove Items_GoldDrops[2]
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation(udg_PositionOfUnit)
-
-
Else - Actions
-
-
-
-
-
Also does this leak?
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 512.00 of (Position of (Dying unit)).) and do (Actions)
-
Loop - Actions
-