- Joined
- Mar 14, 2021
- Messages
- 43
This is for a plugin for missile systems and use of in-game attack range changers, using the Web ability method that Dat-C3 found.
The method
As Dat-C3 explains here Changing Attack Range in-game in this case a similar ability like Ensnare that does the same thing.
JASS:
call IssueTargetOrderById(Dummy,OrderEnsnare_ID,TesUnit)// 852106 -> OrderEnsnare_ID, Ensnare spell is cast on TestUnit
call TriggerSleepAction(0.) //Wait for it to take effect Ensnare to the TesUnit unit
call UnitRemoveAbility(TesUnit,'Amov')//Remove Amov to reset the counter that makes the unit unable to move to 0.
call UnitAddAbility(TesUnit,ExMorph) //Add Form Destroyer skill, to recover the Amov skill
call SetUnitAbilitySilenced(TesUnit,ExMorph,false)//Unsilence Morph into Destroyer (On condition that this spell has 1 mana)
call IssueImmediateOrderById(TesUnit,String2OrderIdBJ(OrderMorph)) // "avengerform" -> OrderMorph, The unit is made to transform
//And that's it, at the end of the Ensnare effect, the counter for immobilizing a
//unit from 0 will be subtracted and will remain at -1, now the unit does not move,
//because only the value 0 will be taken as the unit can move.
Once we have the unit not moving due to the -1 counter another Ensnare spell or web ability will be cast which will change the attack range value this will add the immobilize counter by 1 making the current value 0 this will do that the unit can move again, this way you would have a unit able to change its range using these spells and not be immobilized.
Its uses
Reforged is currently used for this as it comes with functions that alter a unit's range normally. But this does not happen in previous versions, in addition to giving a utility to the range change and especially to the missile system that uses normal type attacks, to generate dummy projectiles, which will be the missiles that will damage the attacked unit.
Note 1: Heroes using Morph into Destroyer with their normal form value empty tend to increase their base damage due to Stats, so I guess leaving them at 0 before swapping a unit would have to be considered for this trick to work.
Note 2: When you cast Ensnare twice the buff disappears, so it would be a way to not get in the way of this in the game interface. (the same happens with web)
Note 3: Oddly enough, the Ensnare or Web buff will not be removed by buff dispels, or avatar. Only with data can it be eliminated or the unit dies. So if a unit dies I could add this buff again (taking into account that its duration must be permanent, and this is put in the editor in the item editor of the ability with value 0). The Bribe library GUI Unit Event v2.5.3.0 can be useful when a normal unit resurrects and you want to put the Ensnare effect back on.
Note 4: Naturally, since everything is a counter, if the unit already has a buff that makes it move, another buff that immobilizes them will have an effect because the counter will go from 0 to 1, so other immobilize will continue to work, unless it is the same buff from the same skill as these are replaced and will keep the counter at 0.
Note 5: The immobilize counter will return to 0 if Amov is removed and a transformation is used to make Amov recover so the counter will return to 0.
Note 6: The counter is permanent in its values and can only be altered by these spells (also with the Root spell) or by using Note 5.
- Credits to leandrotp and Dat-C3.
I leave a map with the explained
Attachments
Last edited: