PDA

View Full Version : Autocast spell


Oziris
03-29-2009, 02:55 PM
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!

Ninja_Duels
03-29-2009, 03:02 PM
Maybe this one will work:
Untitled Trigger 001
Events
Unit - A unit Is attacked
Conditions
Actions
Unit - Order (Triggering unit) to Special Doom Guard - Rain Of Fire (Position of (Attacking unit))

M4stah
03-29-2009, 03:14 PM
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)

Ninja_Duels
03-29-2009, 03:17 PM
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?

ALiEN95
03-29-2009, 10:03 PM
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)

XPQJ
03-30-2009, 02:25 AM
very nice M4stah, your trigger is very effective system to contain the bosses mana and use spells spread out effictivly on a group of enemies +rep

toofless
03-30-2009, 09:53 AM
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

ALiEN95
03-30-2009, 11:21 AM
If that works it's very usefull. +rep
ok,just tell me what ability you want unit to cast?
when unit staarts to cast PHONEX FIRE than you need to order that unit(casting unit) to cast YOUR ABILITY on TARGET of "PHONEX FIRE"
if you have some proplems just tell me...


(phonex fire-race human)

ALiEN95
04-24-2009, 04:06 PM
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)

M4stah
04-24-2009, 04:28 PM
AliEN95, That is bugged. The towers might want to target units that are out of range. Best use a soltion with a unit group(Use a array) For every tower

ALiEN95
04-24-2009, 09:51 PM
AliEN95, That is bugged. The towers might want to target units that are out of range. Best use a soltion with a unit group(Use a array) For every tower


(Units within 512.00 of (Position of (Picked unit)) means that he will never want to target unit out of 512 of himself (it workt good on my map)

Oziris
04-25-2009, 07:32 AM
I took a break from my project, but now i am back and i will try to do what Alein95 said, if works +rep.

KingBob
04-25-2009, 08:21 AM
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.

M4stah
04-25-2009, 09:43 AM
You do know that Ninja_Duels solution can easily be abused becuase of the event? Use a damage detection system

Kercyn
04-25-2009, 04:33 PM
Autocasting Tutorial (http://www.hiveworkshop.com/forums/f279/making-any-spell-autocasting-6255/)

KingBob
04-25-2009, 07:39 PM
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).

M4stah
04-25-2009, 07:52 PM
I suggest you also put in a little condition to make sure the boss doesn't spill ALL mana. Soem Ulti spell when eh has 25% HP would we awesome