HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Autocast - Buffing enemy

01-15-2008, 02:59 AM#1
SockSquirrelMouthwash
I am attempting to create a building tower with no attack that is supposed to autocast bloodlust on enemies that come near it. So far no luck - I've tried setting the targetable fields to enemy, ground etc. What's the best way to approach this obstacle? I'm also trying the same thing with heal and inner fire.

Thanks in advance

EDIT: I've come to realize that some autocast abilities only autocast under certain conditions (i.e. units being attacked or attacking) Is there any way around this? There's got to be a way to autocast something when a unit is within casting range
01-15-2008, 03:54 AM#2
StRoNgFoE_2000
Buildings won't autocast most abilities without using triggers. If the building is preplaced on the map u could use something like "Unit - Unit Within Range" but if its created after the map has started then you'll probably have to use unit groups and a timer event.

Edit: Heres a small example. Just replace Guard Tower with ur type of unit.

Trigger:
TowerBloodlust
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Set GroupA = (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Equal to Guard Tower))
Custom script: loop
Custom script: exitwhen udg_UnitA == null
Custom script: set udg_UnitA = FirstOfGroup(udg_GroupA)
Set GroupB = (Units within 500.00 of (Position of UnitA))
Set UnitB = (Random unit from GroupB)
Unit - Order UnitA to Orc Shaman - Bloodlust UnitB
Unit Group - Remove UnitA from GroupA
Unit Group - Remove all units from GroupB
Custom script: endloop

Probably a few leaks here, been awhile since I used gui.
01-15-2008, 05:01 AM#3
xombie
Or you could use JASS and you could use that Unit in range event with a unit created at any time.
01-15-2008, 09:24 AM#4
Rechosen
Quote:
Originally Posted by xombie
Or you could use JASS and you could use that Unit in range event with a unit created at any time.
That can also be done using the GUI. Just use "Trigger - Add New Event" after creating the unit.
01-15-2008, 10:40 AM#5
SockSquirrelMouthwash
Quote:
Originally Posted by xombie
Or you could use JASS and you could use that Unit in range event with a unit created at any time.

What's an example?

I'm leaning towards a GetUnitsEnumInRange whenever a tower casts a warstomp ability and then having another trigger order the towers with the warstomp ability to cast it when they attack - of course the warstomp has a cooldown. Another question - would that affect performance when many towers of that type are in the map?
01-15-2008, 01:59 PM#6
rain9441
Probably wouldn't hinder performance all that much to do a groupenum whenever you cast warstomp. My Autocast system does groupenum like crazy, they are pretty fast. Just make sure to use the same global group every time and use a filter so you don't leak :P.

Just to give you a headsup, my Autocast System was designed for stuff like this. Unfortunately its all vJass and has no documentation yet. If your good you might be able to decypher through the code and maybe use it. It lets you autocast pretty much any spell at any target given any conditions you want. (I personally have a Soul Burn ability that specifically target units with high mana first, dispels which target buffed units/summoned units, and even warstomp that only activates when X number of enemies are in Y range). These are all Towers that do this, in a TD.

Using Bloodlust on enemies would be basic use of the system.
http://www.wc3campaigns.net/showthread.php?t=98408
01-15-2008, 02:04 PM#7
moyack
Important rule: don't base positive abilities on negative ones and the opposite.

Why do you need to apply bloodlust to enemies?? if you want to modify speed movement, then use a custom ability based on slow.
01-15-2008, 08:44 PM#8
SockSquirrelMouthwash
Quote:
Originally Posted by rain9441
Probably wouldn't hinder performance all that much to do a groupenum whenever you cast warstomp. My Autocast system does groupenum like crazy, they are pretty fast. Just make sure to use the same global group every time and use a filter so you don't leak :P.

Just to give you a headsup, my Autocast System was designed for stuff like this. Unfortunately its all vJass and has no documentation yet. If your good you might be able to decypher through the code and maybe use it. It lets you autocast pretty much any spell at any target given any conditions you want. (I personally have a Soul Burn ability that specifically target units with high mana first, dispels which target buffed units/summoned units, and even warstomp that only activates when X number of enemies are in Y range). These are all Towers that do this, in a TD.

Using Bloodlust on enemies would be basic use of the system.
http://www.wc3campaigns.net/showthread.php?t=98408

Thanks for the info bro, I'll look into the system. I managed to get the groupenum method working perfectly, but I'll look into your system to gain some more insight.

Quote:
Originally Posted by moya
Why do you need to apply bloodlust to enemies?? if you want to modify speed movement, then use a custom ability based on slow.

It's part of a map I'm working on.