• 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.

Disable/Enable Auto attack

Status
Not open for further replies.
Level 9
Joined
Jul 10, 2011
Messages
562
hey guys :D

i need your help.

i need a small system and i neither know how to do it nor how to start.

i need the following :

i need to disable/enable the auto attack via chat command for the player entering the command. with auto attack i mean that the hero automatically attacks an enemy in range/an enemy which is attack the hero.


thanks in advance

greetz clapto
 
Level 9
Joined
Jul 10, 2011
Messages
562
that way it just ignores enemies in range or when its attacked?

i asked because afaik it just ingnores enemies in range then but it still runs to enemies attacking it.
 
Level 9
Joined
Jul 10, 2011
Messages
562
okay i should have mentioned that i need it to completely ingnore enemies and attacks when the auto attack is disabled and i need the effect to be reversable.

changing the classification to worker makes the units to flee whenever they are attacked or?

and making another version of each hero would be bad because i have 81 heroes and thats a too high number for that.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
what does a fade duration of -1.00 do?
It doesn't allow the unit to be invisible, also, it is an advantage to use Permanent Invisibility because it has the field Data - Auto-Acquire Attack Targets, just set it to False.
It will only react if the unit received damage - if that unit has 100% Evasion or simply the unit "miss" an attack, the unit will still ignore the (Attacking unit), the condition is that the unit must receive damage first before auto-attacking the target.
 
Level 9
Joined
Jul 10, 2011
Messages
562
so if i use permanent invisibility it ignores enemies in range....okay...thats one part.

but how can i also make him ignore attacks without 100% evasion (no damage anymore = bad) or stop attacks?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Set YourUnitVariable = (Triggering unit)
  • Custom script: call UnitAddAbility(udg_YourUnitVariable, 'Abun')
  • Wait 5.00 seconds
  • Custom script: call UnitRemoveAbility(udg_YourUnitVariable, 'Abun')
This will make the unit to have a disabled Physical Attack for 5 seconds.
Basically 'Abun' is Cargo Hold (Orc Burrow) ability which will disarm Physical attack of a unit.
 
Level 9
Joined
Jul 10, 2011
Messages
562
never used cargo hold before so sorry for the questions...

is cargo hold shown with an icon?
how the unit will act when it has cargo hold? (when it is attacked, when it sees an enemy)


[offtopic] seems like i have to request the spells again....-.-[/offtopic]
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Cargo Hold (Orc Burrow) does show not itself on the UI (no icon).

how the unit will act when it has cargo hold? (when it is attacked, when it sees an enemy)
Are you asking for "side-effect" of adding this ability or something ?
Well, first you asked how to not make a unit attack if it is attacked, well removing the attack works.
Then you ask "how the unit will act if it has cargo hold?" lol.

When you have cargo hold, you can't perform Physical Attack, that's it.
 
Level 9
Joined
Jul 10, 2011
Messages
562
i ask how the unit will act because it it was mentioned 'late' and so i assume that the unit wont act exactly like i want/need it. also yes the question was also meant to get possible side effects (like the damage isnt shown as long as the unit has cargo hold, the attack button is gone, whatever).

also another question. do i have to add cargo hold and a custom permanent invisibility to make it work like i want it to or is cargo hold enough?
 
Status
Not open for further replies.
Top