HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger problems for AOE spell

05-15-2004, 03:23 AM#1
LuciusSilencius
I just started trigger editing about one week ago, so I need help on this fairly basic spell trigger. I've spent about 4 hours trying to figure it out, so I think it's about time to post it here.

I want a spell that drains Hp from surrounding enemy units in an area, feeds the hp to the caster, creates an effect on the targets, is only castable on enemies (being players 7-12 in this map), and is interrupted when the player moves the unit. Variables are in red to make things easier. So far I have:

Trigger 1:
Events:
Unit -The Tree Herder Begins casting an ability
Conditions:
(Ability being cast) Equal to My Custom Spell
Actions:
Set Caster= (casting unit)
Set TargetGroup = (Units withing 500 of (position of The Tree Herder))
If(((picked player) is an ally of player 1 (Red)) Equal to True) then do (Do nothing) else do (Unit Group- pick every unit in TargetGroup and do (Special Effect- create a special effect attached to origin of (picked unit) using blah blah blah.mdl

Trigger 2:
Events:
Time- Every 1.00 seconds of game time
Conditions:
Actions:
Unit- Set life of Caster to ((life of Caster) + 50.00)
If (((Picked player) is an enemy of player 1 (red)) Equal to True) Then do (Unit Group- Pick every unit in TargetGroup and do (Unit- set life of (picked unit) to ((life of (picked unit)) - 50))) Else do (Do Nothing)

Any help on any part of my question would be appreciated. The spell as is, doesn't do damage or create a special effect, and I think it has something to do with my incorrect use of the "picked" unit, but I'm not certain. I'll be sure to post it in the "downloads" section, if I ever get it working.
05-15-2004, 05:15 AM#2
ThyFlame
...If owner of picked unit isn't an ally of player 1... -- there is no picked player

Also your spell will assign every unit w/in 500 of the caster into a group, and subtract 50 life from them forever, only creating SFX in the first trigger.
05-15-2004, 08:47 AM#3
chuayw2000
Perhaps you want to change your trigger to become like this

Trigger 1:
Events:
Unit -The Tree Herder Begins Channeling an Ability an ability
Conditions:
(Ability being cast) Equal to My Custom Spell
Actions:
Set Caster= (casting unit)
Set SpellCancelled = false
Trigger turn on (Trigger 2)
Trigger turn on (Trigger 3)
//The next line will cause the trigger to wait for a certain amount of time which is the spell's duration and then turn off the appropriate trigger to mark an end to the spell
Wait 15 Seconds
if (SpellCancelled equals false)
Trigger Turn off (Trigger 2)
Trigger Turn off (Trigger 3)
End IF

Trigger 2:
Event:
Every 1 Second of game time
Condition:
SpellCancelled equals false
Actions:
Unit Group: Pick every unit within 500 of Caster Matching ((Matching Unit) belongs to an enemy of (Owner of (caster)) equal true)) and Do Multiple Actions:
Special Effect- create a special effect attached to origin of (picked unit) using blah blah blah.mdl
Unit: Set Life of (Picked Unit) to ((Life of (Picked Unit)) - 50.0)

Trigger 3:
Event:
A Unit Dies
A unit is issued an order with no target
A unit is issued an order targetting a point
A unit is issued an order targetting an object
Conditions:
SpellCancelled not equal true
((Triggering Unit) equals caster) or ((Dying Unit) equals caster)
Actions:
Trigger Turn off (This Trigger)
Trigger Turn off (Trigger 2)
Set SpellCancelled = true
05-17-2004, 11:54 PM#4
LuciusSilencius
Thank you, I believe that is exactly what I'm looking for, although I'm going to mess with the special affects a little. *Bows humbly to much greater trigger editors*. I'll post it as soon as I've finished.
05-21-2004, 09:35 AM#5
LuciusSilencius
I've got everything working fine thanks to Chuay's advice. I added some SFX and a couple more commands. But, now I'm having trouble making the casting unit stop moving and stop attacking, while the spell is in affect. I'm trying to create a spell that works like starfall, in which the caster stops everything that its doing and can't move or attack or the spell will cancel. Chuay pretty much set this up with this trigger line:

Events:
Unit "my hero" dies
Unit "my hero" is issued an order targeting a point
Unit "my hero" is issued an order targeting a unit
Unit "my hero" is issued an order with no target

Conditions:
Drinking cancelled Not equat to true
((triggering unit) equal to DrinkingCaster) OR ((Dying unit) equal to DrinkingCaster)

Actions:
Special Effect- destroy drinkingeffect1
Trigger- turn off Draindrinking
Trigger- turn off this trigger
Set DrinkingCancelled Equal to True
---------------------------------------

Now I've tried inserting stopping the casting unit after the spell starts and changing his target acquisition to "0", but that has no affect. I've tried holding position with the same. I've tried starting the unit's casting animation with loops, but the caster always starts attacking nearby units. I've tried pausing, but no orders can be issued, so the casting unit can't cancel the spell if he wants to. How do I get that starfall unit pause?
05-21-2004, 12:27 PM#6
chuayw2000
Base the spell your caster is casting on a channelling ability like Starfall. Just be sure to change the stats-target to none and the effect to none also. That way, the caster will be chanelling the spell.
05-21-2004, 01:18 PM#7
xGT4x
I would say that triggers are a bit "primitive" because:
1. If the unit dies under the effect it won't give exp/bounty.
2. The hero gets the same amount of life if there is 1 unit or even if there are 20 units.
3. Spell Immune units will be effected.
4. All unit types will be effected by the same amount.(Heroes,Units,Aetheral)

I could change that all but I'm to lazy ATM and it would be completely changed triggers.
05-21-2004, 09:50 PM#8
Anitarf
Couldn't this be done with a spell like monsoon or negative tranquility (not sure if that spell would give you experience for killed units, as it actually negative-heals them) that takes care of all the damage and effects, and all you have to do with triggers is check how many units are in the target area that don't have spell immunity and give the appropriate ammount of life to the hero (set tempgroup (unit in area matching condition (level of ability (spell immunity) for matching unit not equal to 1)); set life of casting unit to ((real(count units in unti group(tempgroup))*50).

That's a good rule to follow, do as much as possible with the spell and as little as possible with triggers.
05-22-2004, 12:17 PM#9
LuciusSilencius
Yes, you're absolutely correct. The reason I didn't do this before was that I thought the starfall effect couldn't be removed, and it can, so that makes things alot easier, but in this discussion we have pretty much created a AOE spell tutorial, and I will probabally never ask a spell question again, unless I'm trying to do something insane. Thanks all.