HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Another Triggers Problem

12-14-2004, 05:38 PM#1
d4rkarch0n
Hi all =D

I basically need to make an ability just like "Freezing Field", from "Crystal Maiden" in DotA Allstars. But I don't have the triggering pretty much clear yet. How do I get random spots on the screen to send "Infernal" models. Perhaps change Peasants into these models and randomly spawn them around the screen?

And how'd I inflict the damage on the enemies? I picked every player.... but I stuck on the damage amount. I want it to change with the skill advance!

Here's what I did so far

Code:
ChuvaMeteoros
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chuva de Meteoros 
    Actions
        Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Triggering unit)) matching (((Picked unit) belongs to an ally of (Triggering player)) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to (Min((Life of (Picked unit)), 300.00))

Help plz!
12-14-2004, 07:15 PM#2
AntJAB
I know there is an ability that already spawns a certain amount of infernals at random locations within a selected AoE. At least I've seen it done... Check some campaign hero skills, like the dreadlords and the big boss guy (Kel'Jaden I think is his name...).

If you find it, just use it with edited damage, and remove the infernals when they land.
I'll try to look for it myself.

P.S. giving peasants the model of an infernal won't do it. They may have a landing animation, but I think the crashing meteor is its own model.

EDIT:
Found it - Rain of Chaos
Under neutral hostile hero spells.
12-14-2004, 08:19 PM#3
aaero
AntJAB is right, Rain of Chaos (or maybe Rain of Fire? I get them confused) will let you rain a lot of Infernals. No triggering required, just a simple spell edit.

As for your damage, I bet that you want to do it in pieces, instead of all at once. Take a look at this method, it does a set amount of damage every second, instead of trying to deal it all at once. You will need a couple triggers and variables.

Variables:
ChuvaCaster - Unit.
The unit casting the spell. This will only work if only one unit can have the ultimate active at a time. If not, you would need an array.
ChuvaUnitsAffected - Unit Group
To avoid memory leaks, we're going to use a variable to store all of the units that are affected by the spell.


1) Damage Trigger - Set to Initially Off
This trigger actually deals the damage to every unit that is around the casting unit. First it puts all the units that will be damage in the ChuvaUnitsAffected group, then it has the caster do 100 + 100 * Level of spell to the unit. That would be 200/second at level 1, 300/second at level 2, and so on.
Code:
Events -
      Every 1.00 second of game time
Actions - 
      Set ChuvaUnitsAffected = Units within 1000 of (Position of (ChuvaCaster)) matching (((Matching unit) belongs to an ally of (Triggering player)) Equal to False)) 
      Pick Every Unit in ChuvaUnitsAffected and do Actions
             Actions -
                      Order Chuva Casting Unit to Damage Picked Unit for ((100 * Level of Chuva de Meteoros for (ChuvaCaster)) + 100
      Custom scripts: Set udg_ChuvaUnitsAffected = null;

2) Trigger to turn on Damage Trigger
Triggers 2 and 3 are simple. They just turn the Damage Trigger on and Off depending on whether or not the spell is being cast.
Code:
Events
        Unit - A unit Starts casting an ability
    Conditions
        (Ability being cast) Equal to Chuva de Meteoros 
    Actions
        Set ChuvaCaster = Triggering Unit
        Trigger - Turn On (Trigger #1)
3) Turn off Damage Trigger
Code:
Events
        Unit - A unit stops casting an ability
    Conditions
        (Ability being cast) Equal to Chuva de Meteoros 
    Actions
        Trigger - Turn Off (Trigger #1)


Does all that make sense? The values for the damage trigger now are probably WAY too high, but you can adjust as you see necessary. The formula there is a pretty good way to get variable damage, as long as there is a consistent relationship between the numbers (ie 50 damage level 1, 100 level 2, 150 level 3 works, while 50 / level 1, 79 level 2, 1000000 level 3 doesn't really work).
12-14-2004, 09:59 PM#4
AntJAB
Or you can just edit TWO spells and leave out those triggers. :)
Rain of Chaos infact creates the infernals based of an already made infernal spell.
It just multi-casts the spell for you randomly within your AoE.
One of the data fields is filled in with a neutral hostile infernal spell.
Simply go to that spell (or one of your own) and edit the fall damage and stun length.
For higher damage make copies of the infernal spell and change the data for each level.

Happy hunting!
12-14-2004, 11:21 PM#5
Kishe
Just to let you know, Guinsoo triggered that spell so that a bunch of wisps spawned randomly around the caster, and then they cast frost nova on each other, with the nova blast being the damage taken by surrounding units. ^_^
12-15-2004, 12:39 AM#6
aaero
Hmm I didn't know that you could edit the damage and stun length...Thanks Antjab, that's useful info. Personally, I like AntJab's method better because damage corresponds to when units are hit by the falling, uh, objects rather than just being a consistent loss of HP even when you aren't being hit. You can go with whichever method you like better.

Note that in general, this spell will be a little annoying because everyone in the AoE is going to have to deal with stun, even if you set it to .01 there will still be stun (because it's based off of Rain of Chaos).
12-15-2004, 01:28 AM#7
d4rkarch0n
Thanks a lot! So far, so good. How do I make a unit that has not been created yet to be removed?

Event: Unit - Unit Spawns a Summoned Unit
Conditions: If (summoned unit) equal to Infernal?????

I can't pick him, for he hasn't been created. How do I do it, please?

-> As it uses a second ability to bring the meteors down, I changed this ability from "Inferno (Neutral Hostile)" to "Meteoro". Then I created a trigger like this:

Code:
Meteoro
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Meteoro
    Actions
        Unit - Remove (Last created unit) from the game

But it didn't work =[

And btw, is there a way to make this spell needs not the user to "aim"? Cast automatically around the hero.

Sorry for noob questions... I guess it's hard for everyone in the begginning hehe.

U guys are GREAT!
12-15-2004, 05:22 AM#8
sc_freek
The infernal is actually spawned before the spell starts casting(before the meteor hits) but it doesn't come out until a second later...
12-15-2004, 12:00 PM#9
AntJAB
I would suggest editing the infernal spell to spawn a different unit, yet I believe it still leaves the crashing effect. Make it something small, with locust, and invis, and then after the spell remove them all.

I'm playing with multi-casting different versions of Rain of Chaos, if anyone ever played Super Mario RPG - I'm attempting to make it look like the Water Blast spell the enemies have. It speeds up to become faster and faster until one big boom.

And yes, you will unfortunately have to deal with a 0.01 interuption.
12-15-2004, 02:10 PM#10
d4rkarch0n
The "spell being cast" must be the "Rain of Chaos" or the "Inferno" for removing the Infernals? Cuz Rain of Chaos "casts" Infernos, right? I'm trying with Infernos and didn't make it. I'll keep trying, thanks for the help!
12-15-2004, 06:37 PM#11
AntJAB
The spell being cast will be Rain of Chaos. (Rain of Chaos just makes several instances of the Infernal spell, it doesn't "cast" infernal. ;) )
12-15-2004, 07:59 PM#12
aaero
You mentioned making it so the spell didn't have a target....if you want the spell to not be targeted, you will actually need to use triggers. I'm not mistaken this time!

First you would need to make a new dummy spell, and base it off a spell that doesn't have a target, like roar. You would need a trigger to detect when your unit cast roar, and then you would need to create a dummy unit that would cast the real ability through a trigger (at the position of the casting unit). Your ingame unit would have a dummy ability that just causes a dummy unit to cast the real spell at his location.

It's not as complicated as it sounds, hopefully it makes sense.

Edit: One more thing. I think it is possible to make it so that rain of chaos has no unit in the summoned unit field. As usual, I could be wrong.
12-16-2004, 02:47 PM#13
d4rkarch0n
Quote:
Originally Posted by aaero
Edit: One more thing. I think it is possible to make it so that rain of chaos has no unit in the summoned unit field. As usual, I could be wrong.

I couldn't, but I did something nice. I did set the time of the summoned units for 0.01s, so they don't even appear on the map. That was great! Now I'll do this "roar-like" thing - if I can - and implement the "random damage around the unit" thing. And I'll try to add a loop animation, and my meteor swarm shall be done!

Thanks everybody who posted, and special thanks to aaero and AntJAB, really great help!
12-16-2004, 03:38 PM#14
Ryude
The spell is taken from wc3sear.ch and edited slightly. So is just about every other spell in allstars.
12-16-2004, 09:32 PM#15
AntJAB
Quote:
Originally Posted by d4rkarch0n
Thanks everybody who posted, and special thanks to aaero and AntJAB, really great help!

No problem. Rep for all! *throws around x-mas rep cheer*