• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Active Spells

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Does each spell for each tower can be activated by Players ?
Or does it totally passive ?
(Triggered when enemy comes near it) ?

I mean like, you said that each Tower has a spell right ?
Does this spell is activate-able (Player activates it) ?
Or it just a dummy spell, where the spell can only be activated via enemy comes close ?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Make a trigger.

  • Autocast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Runecaster (Dwarf)
    • Actions
      • Set r = (Random percentage)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • r Less than or equal to 40.00
        • Then - Actions
          • Unit - Order (Attacking unit) to Night Elf Druid Of The Talon - Faerie Fire (Attacked unit)
        • Else - Actions
This is a trigger I'm currently using for basic AI in a map, it causes the cast to cast a derivative of the Faerie Fire spell on attack. The "r = random percentage" part is to induce a bit of "randomness" in the AI, so it won't always cast when available.

You can take the order part out of the If/Then/Else if you want it to always cast.

NOTE: The towers need to have an attack for this method to work.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
How if I got a lot of spells? I need to trigger it one by one?
Yes you have to, don't be lazy ;p
Unless you have a setup trigger (I prefer Hashtable).
Then you can combine the Event altogether instead creating 1 Event per Ability.

  • Custom script: call IssueImmediateOrder(whichunit, "faeriefireon")
Don't Faerie Fire by default (auto-cast enabled) targets allied units ?
The tower should be targeting enemies... ?
 
Status
Not open for further replies.
Top