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

Status
Not open for further replies.
Level 3
Joined
Jun 20, 2009
Messages
42
Quary #3: How do I get a unit to use a spell as an attack?

As in: A Tauren launching shockwave as it's "regular attack", or a hydra using forked lightning in place of it's normal attack.

EDIT: I am NOT looking for a change in projectile art, see my post below.
 
Last edited:
Level 3
Joined
Jun 20, 2009
Messages
42
Not the art, I.E. visual aspect, I want the mechanical aspect.

As in I want the Tauren to "cast" shockwave every time it attacks (with or without mana cost, would like to know both)

EDIT: sorry If I was not clear on this point.
 
Last edited:
Level 13
Joined
Nov 4, 2006
Messages
1,239
if you can use an orb effect, the easiest thing would be to modify Orb of lightning changing the chance for the ability to 100% aand changing the ability to whatever you like (remove manacosts and cooldowns if it should be a regular attack) the Unit still needs to have a basic damage 1-1.

then i'm not 100% sure, but i think it then only works if the unit is ordered to attack, so you will need the 2 following triggers

  • Events
    • Unit - A Unit learns an Ability
  • Conditions
    • (learned Hero Skill) equal to your ability (if its not a hero, change the events)
  • Actions
    • Trigger - Add to (trigger2) the event (Unit - (Triggering unit) acquires a target)

  • trigger2
  • Events
  • Conditions
  • Actions
    • Unit - order (Triggering Unit) to attack (targeted Unit)
i know how stupid these triggers might look if you never used them. however i suggest to use this only if its not too many units ( > 50 )
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Copy this trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable <Shockwave> for (Player((Integer A)))
          • Player - Disable <Forked Lightning> for (Player((Integer A)))
And this one:
  • Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to <Hydra>
        • Then - Actions
          • Player - Enable <Forked Lightning> for (Owner of (Attacking unit))
          • Unit - Order (Attacking unit) to Neutral Naga Sea Witch - Forked Lightning (Triggering unit)
          • Player - Disable <Forked Lightning> for (Owner of (Attacking unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to <Tauren>
        • Then - Actions
          • Player - Enable <Shockwave> for (Owner of (Attacking unit))
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Attacking unit) to Orc Tauren Chieftain - Shockwave TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Player - Enable <Shockwave> for (Owner of (Attacking unit))
        • Else - Actions
Note that icon won't show and ''block'' one button position.

It works fine for me.

___________________________________________________________________

Or you can create ''Orb of Lightning (New)'' and set chance to 100%, 0 mana cost. If you do this way, your unit won't be able to use orbs and spells like slow poison. This way isn't best because unit will still attack and cast ability. Unit won't cast spell if you don't implement this trigger:
Trygger by -JonNny

  • Events
    • Unit - A unit is attacked
  • Conditions
    • (Unit-type of (Attacking unit)) Equal To <Your Unit>
  • Actions
    • Unit - Order (Attacking unit) to attack (Attacked unit)
If you do this way, units won't play attack animation and triggers that order something when unit attacks won't work (like first way (Trigger named attack in this post)).
 
  • Trigger1
  • Events
    • Unit - A unit is issued an order targeting an object
  • Conditions
    • ((Issued Order) Equal to Smart)
  • Actions
    • Set Point1 = (Position of (Target unit of issued order))
    • Unit - Order (Ordered unit) to Orc Tauren Chieftain - Shockwave Point1
    • Custom script: call RemoveLocation (udg_Point1)
Disable attacks of the unit and add a shockwave to it.
 
Status
Not open for further replies.
Top