• 🏆 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!

[Spell] Adding a Turret to a Building

Status
Not open for further replies.
Level 3
Joined
Sep 10, 2008
Messages
26
Hi Everyone,

In the custom faction that I'm creating (discussed here, if you are interested) I am creating an ability that adds to any building the ability to attack nearby enemy units. This ability is cast by a unit, which is consumed in the process.

I am looking for insights as the best way to go about this.

I am considering the following possible options:
  • Permanent Immolation-based ability that only affects one target at a time.
  • Giving every building an attack, but disabling them by default, then using triggers to enable the attack once its been granted it.
I'm wondering whether anyone has experience with something similar and could advise on what direction is best?

Thank you.
 
Level 13
Joined
Oct 12, 2016
Messages
769
Do you want it to activate for all related building at the same time (like for research),
or do you want a spell you can cast on a building to give it a temporary attack?

I suggest looking into the Phoenix Fire ability as well, since it's a ranged projectile auto-attack.
Lightning Shield could be used for a constant AoE damage shield cast on a building.
Although, it does spell damage, like Immolation.

For some research thing, you just enable the attack in the research,
and have it set to "none" for attacks used in the object data for the building beforehand.
You'll also have to set the damage, range, projectile stuff, etc. for each building affected.
 
Last edited:
Level 3
Joined
Sep 10, 2008
Messages
26
Do you want it to activate for all related building at the same time (like for research),
or do you want a spell you can cast on a building to give it a temporary attack?

No, I want the ability to grant buildings their attack individually. This is basically this race's static defense mechanic.

I'll have a look at Phoenix Fire, thanks very much.
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
I have found that determining the actual DPS Phoenix Fire outputs to be kind of a pain, so if that annoys you too you might be able to use an orb effect on buildings to enable attacks on a per-building basis.

As Wark said, set up the attack values for Attack 1 in the OE but set attacks enabled to "none". Make a new copy of the ability that Orb of Flame has (item flame bonus I think), make it a unit ahility, remove all bonus damage/effects/whatever and set its "enabled attack index" to 1.

When a unit uses the ability on the building to allow it to attack, add that custom ability to the targeted building. You shouldn't even have to put it in a disabled Spellbook or anything because item abilities don't show up on units' command cards.
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,510
I'll do ya one better (in part because I'm doing nearly the exact same thing for *my* custom Troll race, lol)... Just add/remove "Cargo Hold" (the one for the Burrow, I think?) with triggers as needed (of course setting the proper Attack stats as needed for each affect-able building).

Simple Passive which, with everything else zeroed out, disables the attack of the thing that has it. Give it the icon placement of [X:0, Y:-11] & it'll be hidden as well (Blizzard-provided trick as of 1.26(?); No disabled Spellbooks needed!).
 
Level 8
Joined
Mar 19, 2017
Messages
248
If you have 1.29/1.30 and you're going for the enable/disable attack, then BlzSetUnitAttackCooldown to a value of 0 disables attack for the given attack index. Here you will not use anything else, except knowing the base attack cooldown to revert the process by enabling the attack with a value other than 0. SIDENOTE: In theory this approach could allow to disable just one attack while keeping the other, on units that have 2 different attacks.
 
Level 8
Joined
Mar 19, 2017
Messages
248
I think the best method is the good old Cargo Hold one (plus making the ability permanent), because the attack cooldown function will not be transfered if the unit morphs, so you will need to deal with that issue yourself.
 
Status
Not open for further replies.
Top