• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Is there anyway to remove the attack ability ?

Status
Not open for further replies.
Level 17
Joined
Jul 1, 2010
Messages
720
Yes it works that way but I wanted after a unit casts an ability the target unit to have the Cargo Hold then after 30 seconds to remove it from the target unit. However if I use "Target Unit of Ability being Cast" it doesn't work...
 
you need it gui right?
do this:
  • Custom script: local unit u = GetSpellTargetUnit()
  • Custom script: call UnitAddAbility( u, 'Abun')
  • Custom script: call TriggerSleepAction( 30.00 )
  • Custom script: call UnitRemoveAbility( u, 'Abun')
  • Custom script: set u = null
I write this from my head, if don't work, replace u and ability raw code places.

JASS:
local unit u = GetSpellTargetUnit() // We store target unit into local variable
call UnitAddAbility( u, 'Abun')  // We add 'Abun' (Cargo Hold) to unit
call TriggerSleepAction( 30.00 ) // Trigger wait action (jass version)
call UnitRemoveAbility( u, 'Abun') // We remove 'Abun' (Cargo Hold) to unit
set u = null // We null local unit (cleaning leaks)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Chucky: You can test it and let us know if it's.

If it's not MUI (Multi Instanceable) you can create a unit group, a hashtable, and a loop trigger :p OR Work with custom values and some indexing system
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
MUI spells are those that works correctly even when multiple units casts them at the same time.

To create MUI abilities you have to create and handle things the most "generic" way, and leave the "hard work" to the game system. It's something like

· "Pick every Player in (All Players)" is better than doing 12 actions for Player 1, 2, 3...
· If you use "FlameStrike Caster = Triggering Unit" the variable will take a new value if some other unit casts it.
· Hashtables / JASS Locals / Avoiding Wait actions / A Good Indexing System / Using JASS Native Functions are suggestions (nearly "requirements") in order to create MUI Abilities.
· This is motly required for abilities with over time effect (Like Missile Moving, Damage over Time, Unit moving, etc.). Simple abilities like Finger of Death (Lion's Ultimate in DotA), Centaur's War Stomp, Panda's Clap, are instant and doesn't require anything to make them MUI.
 
Status
Not open for further replies.
Top