- Reaction score
Chains of Ice sould be named Howling Blast, because you says it does AoE... Just nitpicking
library GetLastDamagedUnit requires AIDS // Don't forget requirements. Implicit requirements are bad practices private struct DamageData extends array // array structs are more efficient than regular structs. If possible, you should use Alloc <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" data-shortname=":)" /> // Our inner variables unit damagedUnit private trigger t // Set the unit variable private static method OnDamage takes nothing returns boolean set thistype[GetEventDamageSource()].damagedUnit = GetTriggerUnit() return false endmethod // Huzzah! No need for any init functions OR Damage! private method AIDS_onCreate takes nothing returns nothing set this.t = CreateTrigger() call TriggerAddCondition( this.t, Condition(function thistype.OnDamage) ) call TriggerRegisterUnitEvent( this.t, this.unit, EVENT_UNIT_DAMAGED ) set this.damagedUnit = null endmethod // Let's clean up our act private method AIDS_onDestroy takes nothing returns nothing call DestroyTrigger(this.t) set this.damagedUnit = null set this.t = null endmethod //! runtextmacro AIDS() endstruct // Lastly, let's make a pretty function wrapper function GetLastDamagedUnit takes unit whichUnit returns unit return DamageData[whichUnit].damagedUnit endfunction endlibrary
Agreed.It is fully possible to make these types of abilities without using Autocast buff placers. If you are using Damage, it is fully possible to simply trigger the effect on the next attack following having activated the ability.
Besides, the druid has no such ability at the moment, one wouldn't hurt.