I am at a bit of an impasse here. The spell works, but it's got a pretty glaring holes that could make things messy if not addressed.
The spell is "Anti-Magic", which dispels all buffs from a unit and additionally gives it a one-time Spell Shield. Right now it goes something like this.
And on an unrelated note, am I doing this "preventing memory leaks" thing right?
The spell is "Anti-Magic", which dispels all buffs from a unit and additionally gives it a one-time Spell Shield. Right now it goes something like this.
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Anti-Magic (Neutral Hostile)
- ((Casting unit) belongs to an ally of (Owner of (Target unit of ability being cast))) Equal to True
- ((Target unit of ability being cast) has buff Spell Shield) Equal to False
-
Actions
- Set AntiMagicTempPoint = (Position of (Target unit of ability being cast))
- Unit - Create 1 GhostCastingHero for Player 10 (Light Blue) at AntiMagicTempPoint facing (Center of (Playable map area))
- Item - Create Rune of Shielding at AntiMagicTempPoint
- Unit - Order (Last created unit) to Right-Click (Last created item)
- Wait until (((Target unit of ability being cast) has buff Spell Shield) Equal to True), checking every 0.10 seconds
- Unit - Remove (Last created unit) from the game
- Custom script: call RemoveLocation(udg_AntiMagicTempPoint)
And on an unrelated note, am I doing this "preventing memory leaks" thing right?