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

[Spell] Spell Only Attack

Status
Not open for further replies.
Level 9
Joined
Mar 16, 2008
Messages
316
Hey all! I got a pretty quick, probably stupid, question, but I was wondering if there was a way to set it up so a particular unit can only attack through an autocast spell and have no normal attack otherwise, preferably without triggers though I'm totally willing to work with them if I must. Except Jass stuff. I have absolutely no idea how to work Jass XD

Ex. Human Wizard, has NO attack capabilities but starts with an ability called "Flame Bolts," based off of Searing Arrows that allows him to attack at the desired cost of mana, so he can only deal normal damage if he's willing to sacrifice the mana so he won't be able to cast his other, higher cost spells later down the line.

From what I've seen, I'm fairly convinced it can't be done, but thought I'd ask before totally giving up. Thanks in advance, and +Rep to any who help out ^.^
 
Level 9
Joined
Mar 16, 2008
Messages
316
What about making the unit deal 1-1 damage and give it Searing Arrow ?
Which is actually very ugly, a better solution will be to make teh unit have very low damage and have like 70-85% of its damage coming from Searing Arrow

I have considered both of those options, but wanted to know if I had any way to do my original plan before I went with that. I will probably end up doing that second option, unless someone manages to find a way to just remove the base damage completely XP

Thanks and +Rep anyways!
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Another thing you can do is to use the basic attack and the following trigger:
Event
Unit - Is attacked
Conditions
Unit-type of attacking unit == Human Wizard
Actions
If
Mana of Attacking unit less than 20
Then
Order Attacking unit to stop
Else
Mana of attacking unit = Mana of attacking unit - 20

Although it is very dangerous and can be abused... not recommended at all... just saying that this option exists.

You will have a dummy, passive spell, for visuals and description.
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
I haven't tested it, but I think I remember hearing something like setting the unit's classification to a worker will disable its auto-attack. I think this makes the only way to attack by using the attack ability. You could use triggers to trigger a spell instead on making it do a normal attack then.
 
Level 5
Joined
May 12, 2014
Messages
133
I think I got what you're looking for. Try checking out the test map. It sort of builds off of what nedio said. To disable someone's auto attack, add the cargo hold (orc burrow) ability to them. The archmage in the test map can cast the spell to "attack", or he can toggle it to just enable autoattacking.
There are a few triggers, but they are really simple.
The Debug trigger is what nedio was saying. Though I don't think in this case it's as dangerous.
If this isn't what you want, I could try working with it some more. :)

  • Enable autoattack
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(flamingarrows))
    • Actions
      • Unit - Remove Cargo Hold (Orc Burrow) from (Triggering unit)
  • Disable autoattack
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unflamingarrows))
    • Actions
      • Unit - Add Cargo Hold (Orc Burrow) to (Triggering unit)
  • Disable autoattack Debug
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Archmage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Triggering unit)) Less than (20.00 - (5.00 x (Real((Level of Searing Arrows for (Triggering unit))))))
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
Edit: I forgot to mention 2 important things.
1) The unit(s) with this can't have any other "orb effects" on it, otherwise it might not have to pay mana for the searing arrows ability and can have free autoattacks; not what you want.

2) The unit(s) using this can't have the cargo hold (orc burrow) and can't hold units like a zeppelin would. I don't know what possible problems this might cause, so I would try to avoid this case.
 

Attachments

  • Autoattacksthroughspells.w3x
    13.7 KB · Views: 25
Last edited:
Level 9
Joined
Mar 16, 2008
Messages
316
I think I got what you're looking for. Try checking out the test map. It sort of builds off of what nedio said. To disable someone's auto attack, add the cargo hold (orc burrow) ability to them. The archmage in the test map can cast the spell to "attack", or he can toggle it to just enable autoattacking.
There are a few triggers, but they are really simple.
The Debug trigger is what nedio was saying. Though I don't think in this case it's as dangerous.
If this isn't what you want, I could try working with it some more. :)

  • Enable autoattack
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(flamingarrows))
    • Actions
      • Unit - Remove Cargo Hold (Orc Burrow) from (Triggering unit)
  • Disable autoattack
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unflamingarrows))
    • Actions
      • Unit - Add Cargo Hold (Orc Burrow) to (Triggering unit)
  • Disable autoattack Debug
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Archmage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Triggering unit)) Less than (20.00 - (5.00 x (Real((Level of Searing Arrows for (Triggering unit))))))
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
Edit: I forgot to mention 2 important things.
1) The unit(s) with this can't have any other "orb effects" on it, otherwise it might not have to pay mana for the searing arrows ability and can have free autoattacks; not what you want.

2) The unit(s) using this can't have the cargo hold (orc burrow) and can't hold units like a zeppelin would. I don't know what possible problems this might cause, so I would try to avoid this case.

Great job, man, this works perfectly! Big kudos to ya and +Rep to all! :3

Mod can go ahead and close this thread, should they so desire.
 
Level 1
Joined
Aug 14, 2012
Messages
1
there is a way without triggers, first you set "combat-attacks enabled" to "none" (Put "combat-number of dice" to 0 so if you use it on heroes the attack icon won't show up when you get orb or ...)
for auto cast spell only "Parasite" will work which you should set duration to 1 sec set the "damage per sec" to the amount that you want fire ball deal, and remove the summoned unit.
when you fixed buff and missile art, it will become the auto cast fire ball spell.
sorry for my bad english, i attached test map for any ambiguity.
 

Attachments

  • test1.w3x
    16.7 KB · Views: 28
Status
Not open for further replies.
Top