• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Using Spells As Basic Attacks

Level 5
Joined
Mar 15, 2008
Messages
35
This tutorial will show you how to use spells to replace the basic attack ability. This system can be a useful way to make an arena map more interesting.

Difficulty - Moderate


There are 2 ways of doing this. You can either use a short range AOE attack to make it alot simpler for the player. Or you can use a targeting spell. I prefer the Targeting Spell, to make it more interesting.


Step 1: The Ability

Data & Stats.
Open up the object editor and go to abilities. Make a new one using the template "Finger of Death (Archimonde)" Of course, call it Attack

If you want to make your attack spell better try adding something like Metal Medium Bash to the sound effects.
Make the Hotkey preferably "A" (since that is the default hotkey of "Attack"), but you can choose whatever you'd like.
We now need to make sure that any unit can use it. Can be used by heroes = NO.
Now we need to make it a melee attack so change the Cast Range to 75.
Now change the damage to whatever you want a basic attack to be. I use 100.
It needs to be a quick attack or else the combat will get boring. Make the cooldown 1.00 seconds.

Now for a very important part. Targets
As this is a melee attack untick Air. We still want to be able to attack gates and crates so tick Debris. Tick Organic and Mechanical as some units come under both of these. Tick Hero or you won't be able to kill each other. If you want to be able to attack buildings thats up to you.
attachment.php

Mana cost is already at 0 so we don't need to bother with that.

Art.

Add attack to the animation names or the unit won't animate as it attacks.
Change the Button Positions to X=3 and Y=0 This is where attack is normaly.
Now go down to Art - Icon - Normal tick the box Custom and type
ReplaceableTextures\CommandButtons\BTNAttack.blp So that it looks the same as normal attack.
attachment.php

Now delete the Lightning effect.
Go down to Art - Target and delete that too.
If you want to add a comedic/ott effect tick custon and type Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl This will make it so when you attack someone with our new attack spell blood will burst out of them. You will need to add an attachment point called chest


The Unit

Make your unit. It doesn't matter whether it is a hero or not.
Open up Abilities - Normal and add our Attack Ability. There are 2 so change the filter to custom.
Go down to the unit's Combat stats. Search for the line Combat - Attack 1 - Show UI. Untick it. If you don't the generic attack button will override our new attack spell.
Disable the attack. Otherwise the generic attack will still be there.

Now when you go into the game you will see our Attack spell is where the old attack used to be. Use your hotkey, instead of clicking the spell, and you'll be king of your arena in no time.
 

Attachments

  • ticks.jpg
    ticks.jpg
    54.6 KB · Views: 5,709
  • attackicon.jpg
    attackicon.jpg
    49.6 KB · Views: 5,226
Last edited by a moderator:
Nice tutorial thougth there is a few things to mentod.

1) Instead of setting all damage to zero, just disable their attacks.
2) This abillity will now give all units the same damage and attackspeed. That means you will have to make one abillity for each unit in the map.
3) Set the hotkey to A instead of Q. A is the hotkey of the originally attack.
4) I would suggest you to set the attackrange to 75, as many units (espicially heroes) have a big collision size that makes them unable to use their attack -.-'

Other than that, nice tutorial. Not a very new idea, but you described it well. Good job.
 
Level 5
Joined
Mar 15, 2008
Messages
35
In a real game, units attack hostiles automatically. Tell us how to make the "Attack" spell automatic.

What's the usage of changing the normal attack to a spell really?


The Idea is that you use it for arena style maps, where there is only a few non player hostiles. The player would have to use their "Attack Spell" whereas the NPC would be using a default attack.
 
Level 3
Joined
Jun 9, 2010
Messages
59
Do you have to keep selecting the enemy over and over with the spell to attack or does it attack by itself (like the defualt attack of a unit)? *nevermind found it out by myself lol*

Other than that this could be useful for games where heros/units change attacks according to the items(like attachable wepons) they have, of course players would have to make tweaks of there own through jass or gui to change some attack aspects (like targets, automatic attacking, ect..) but could be a useful new technique that can skip over some of the triggers required to do what i mentioned before.
 
Level 9
Joined
Feb 15, 2013
Messages
372
Why not use trigger to make the damage dealt to (random number between x to y) or (random number between (x + (1.5 x Level of Hero)) to (y + (1.5 x Level of Hero))??
Then the damage will different
Or maybe the damage is 1.5 x primary attributes of hero??
the cooldown remains 1...
Im just gving ideas and suggestions lol
 
Top