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

Enable Attack 1 - Attack 2

Status
Not open for further replies.
Level 3
Joined
Jun 16, 2005
Messages
36
I see only one way – dark way :) - trigger way. You must turn on this triggers when you have requested items (items themselves are dummy items – they do nothing). Try something like this:

Trigger for melee attack

Events – unit is attacked
Conditions – attacking unit = your hero {NOTICE! You can also ‘put’ here a condition ‘has item of type’, but I strongly recommend you to use turn on trigger/turn of trigger}
Actions – set life of triggering unit = life of triggering unit – (here must be your bonus damage; use variables for different items)

Trigger for ranged attack

Event – unit is attacked
Conditions – attacking unit = your hero
Actions – (here goes custom script)
Code:
 local location loc1
   local location loc2
   local unit u
   set u = GetTriggerUnit()
   set loc1 = GetUnitLoc (u)
   set loc2 = GetUnitLoc(GetAttacker())
   call PolledWait (DistanceBetweenPoints(loc1, loc2))
   call SetUnitLifeBJ( u, ( GetUnitStateSwap(UNIT_STATE_LIFE, u) - 25.00 ) ) (for example) 
   call RemoveLocation(loc1)
   call RemoveLocation(loc2)
 
Level 13
Joined
Dec 29, 2004
Messages
597
I think that's not what he means..

Try to use orb item, it will enable attack 1 or 2 to the carrier. Or try custom upgrade, to enable/disable attack 1 or 2. apply this upgrade to the unit that you want. Then, make a 'trigger on' to set the research level of this upgrade to 1 and 'trigger off' to set research level of this upgrade to 0.
 
Status
Not open for further replies.
Top