• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Autocast spell

Status
Not open for further replies.
How can i make an Autocast, let's say a ''Boss'' casts an ability for example: Rain of Fire, on enemy unit? Normaly if you add spells to the unit/hero/boss he doesn't cast it auto, you cast it right? so my point is to make it like this:unit/hero/boss does cast it auto, you dont cast it.

Can it be done in Object editor and how?
Can it be done in Trigger editor and how?

Rep+ to the guy who helps me!
 
Level 11
Joined
Feb 16, 2009
Messages
760
Ninja, leaks and not efficient( If you contantly stop/attack you will drain his mana in no time)
Trigger 1:
Event
Unit enters Boss region(A region in the boss room)

Condition
Unit type of (Triggering unit) not equal to (Unit type of the boss)

Actions
Pick every unit in region Boss Region matching unit type of (matching unit) is equal to (Boss unit type) and add (matching unit) to TempGroup(A unit group variable)
Set Boss(A unit variable) = Random unit from TempGroup
Custom script:call DestroyGroup(udg_TempGroup)

Second trigger
Events
Every 25 seconds

Condition
Mana of Boss greater than (SOme minimum value, prevents using all the bosses mana)

Action
Set TempGroup = Units in Boss region matching Unit type of matching unit is not equal to (Unit type of boss)
Order Boss to (Some skill) on random unit from TempGroup
Custom script:call DestroyGroup(udg_TempGroup)
 
Last edited:
Level 8
Joined
Aug 19, 2007
Messages
294
Ninja, leaks and not efficient( If you contantly stop/attack you will drain his mana in no time)
Trigger 1:
Event
Unit enters Boss region(A region in the boss room)

Condition
Unit type of (Triggering unit) not equal to (Unit type of the boss)

Actions
Pick every unit in region Boss Region matching unit type of (matching unit) is equal to (Boss unit type) and add (matching unit) to TempGroup(A unit group variable)
Set Boss(A unit variable) = Random unit from TempGroup
Custom script: DestroyGroup(udg_TempGroup)

You can give the spell CD?
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
add ability PHOENIX FIRE to unit u want to auto cant your ability
PHOENIX FIRE must have 1-0 damage (it is auto casting
ability)

so make it in trigger that when unit starts to cast that ability
EVENT -unit starts casting an ability
CONDITION-ability being cast eguall to PHOENIX FIRE
ACTION-order casting unit to (orc- chain lightning) on target of ability being cast

now you can order casting unit anything you want)not just (orc-chain lightning)
 
Level 8
Joined
Nov 9, 2008
Messages
502
add ability PHOENIX FIRE to unit u want to auto cant your ability
PHOENIX FIRE must have 1-0 damage (it is auto casting
ability)

so make it in trigger that when unit starts to cast that ability
EVENT -unit starts casting an ability
CONDITION-ability being cast eguall to PHOENIX FIRE
ACTION-order casting unit to (orc- chain lightning) on target of ability being cast

now you can order casting unit anything you want)not just (orc-chain lightning)

If that works it's very usefull. +rep
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
There is one problem phoenix fire cannot be an event xD But you can do it with other auto casting spells like cold arrows or...
  • Auto cast spell
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set UNITGROUP = (Units of type Electric Tower WARNING)
      • Unit Group - Pick every unit in UNITGROUP and do (Actions)
        • Loop - Actions
          • Set UNITGROUP = (Units within 512.00 of (Position of (Picked unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))
          • Unit - Order (Picked unit) to Orc Far Seer - Chain Lightning (Random unit from UNITGROUP)
          • Custom script: call DestroyGroup(udg_UNITGROUP)
      • Custom script: call DestroyGroup(udg_UNITGROUP)
 
Level 9
Joined
Feb 19, 2006
Messages
115
I'd have to go with Ninja_Duels solution with this (except that it's a little wrong)

  • Events
    • Unit - A unit Is Attacked
  • Conditions
    • Unit Type of (Attacking Unit) Equal to (Boss Unit)
  • Actions
    • Set TempPoint = Position of (Attacked Unit)
    • Unit - Order (Attacking Unit) to (Use ability) TempPoint
    • Custom script: call RemoveLocation(TempPoint)
Just give the ability a cooldown time and mana cost and it'll work fine.
 
Level 9
Joined
Feb 19, 2006
Messages
115
You do know that Ninja_Duels solution can easily be abused becuase of the event? Use a damage detection system

If you add the condition I added, you can't abuse it, because it will only go off when the Boss unit attacks, and the spell is ready. Also it can make sure that the boss is actually in range of the target, so you can't kite it around while the rest of the group kills it (if its a group boss type thing), which can be a problem with using a random unit in an array.

So really I guess it just boils down to this:
If your boss is in a large area against a group of players (like a WoW style boss fight) Ninja/my solution is best (because it prevents kiting exploits).
But if the area is small (or if the boss's ability can fire across the arena) then M4stah's solution will be best (because it allows randomness, makes tanking harder, and creates a problem for healers).

Also, I'd like to add that you should put in some sort of random chance as well. So the boss only has like a 25% chance to use its ability (so you can't time it so easily).
 
Status
Not open for further replies.
Top