- Joined
- Sep 25, 2013
- Messages
- 716
Ive created a system in which a unit moves continually in one direction for a duration and kills every unit in its path. While the unit is moving, the player looses control of that unit.
I have 2 separate versions of this unit. Version 1 has a collision size and does not kill units in its way. Version 2 has its collision size set to 0 so it can move through units easily and crush them.
In the trigger, when the unit casts it ability, "Rampage", the Version 1 unit is replaced by the Version 2 unit and then its ownership is changed to neutral extra and it is ordered to move to the target point of the casting ability.
The problem arises when the duration runs out and I want to return the unit to its original owner after returning that unit to a Version 1 unit. I have just started with hashtables so I don't exactly know whats going on. Any help would be much appreciated.
I have 2 separate versions of this unit. Version 1 has a collision size and does not kill units in its way. Version 2 has its collision size set to 0 so it can move through units easily and crush them.
In the trigger, when the unit casts it ability, "Rampage", the Version 1 unit is replaced by the Version 2 unit and then its ownership is changed to neutral extra and it is ordered to move to the target point of the casting ability.
The problem arises when the duration runs out and I want to return the unit to its original owner after returning that unit to a Version 1 unit. I have just started with hashtables so I don't exactly know whats going on. Any help would be much appreciated.
-
Mamukil Rampage Cast
-
Events
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Rampage (Mamukil)(Newer Yet)
-
-
Actions
-
Hashtable - Save Handle Of(Owner of (Casting unit)) as 0 of (Key (Owner of (Casting unit))) in MamukilPlayerHashtable
-
Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
-
Wait 1.00 seconds
-
Unit - Replace (Casting unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
-
Set Mamukil = (Last replaced unit)
-
Set RampagePoint = (MamukilTargetPoint offset by 1000.00 towards (Angle from (Position of Mamukil) to MamukilTargetPoint) degrees)
-
Unit - Change ownership of Mamukil to Neutral Extra and Retain color
-
Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
-
Special Effect - Destroy (Last created special effect)
-
Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
-
Special Effect - Destroy (Last created special effect)
-
Special Effect - Create a special effect attached to the origin of Mamukil using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Order Mamukil to Move To RampagePoint
-
Unit Group - Add Mamukil to MamukilUnitGroup
-
Hashtable - Save 7 as 0 of (Key (Last replaced unit)) in MamukilHashtable
-
-
-
Mamukil Rampage
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in MamukilUnitGroup and do (Actions)
-
Loop - Actions
-
Set MamukilRemainingTime = (Load 0 of (Key (Picked unit)) from MamukilHashtable)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MamukilRemainingTime Greater than 0
-
-
Then - Actions
-
Hashtable - Save (MamukilRemainingTime - 1) as 0 of (Key (Picked unit)) in MamukilHashtable
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
Unit - Change ownership of (Picked unit) to (Load 0 of (Key (Owner of (Picked unit))) in MamukilPlayerHashtable) and Change color
-
Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
-
Unit Group - Remove (Picked unit) from MamukilUnitGroup
-
Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
-
Custom script: call RemoveLocation (udg_RampagePoint)
-
-
-
-
-
-