• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] Attack System

Status
Not open for further replies.
Level 3
Joined
May 18, 2009
Messages
39
How can i make a nice Attack system with Ranged and Meele weapons, i mean when i maybe click a its attack in front of me, and if there is a units it hits it and deal Dmg, and who i can maybe it with ranged to so its cast a arrow :D
 
Level 4
Joined
Jun 10, 2009
Messages
67
I think most users uses the "Replace unit" action.
For example; Troll in DotA, he has a spell where he can either be Melee or Ranged.
To create this, you first make the spell, then a trigger like this:

A unit starts casting your spell, then you Replace the unit with another unit (of course, you must first create another unit that uses the same model and such as the casting unit). You must also set the levels, mana, hitpoints and such as variables, and then set the new units mana and such, to those values...

If u don't understand, or need an Example trigger, I'll fix it for you.
 
BaraBura, don't get yourself along with suppositions. DotA's Ranged and Melee form is based off "Bear Form" ability with an alternative unit type of main attack being ranged, but the model of the Troll, like the original one. Anyone can tell you this fact. Replace unit is really annoying and not that flexible to work with. I strongly recommend you used this function only in Single Player maps or custom "Charm" type spells that involve no timer.
 
Status
Not open for further replies.
Top