HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell Help: Invisibility Totem

05-25-2004, 02:26 AM#1
qmrcool
Im am creating a spell called Invisibility totem. It is a 15 level hero spell. What it does is creates a ward like unit on the ground that will cast invisibility on friendly units nearby. The order in which it casts invisibilty on units around the totem should not be random but go in the order of
1. Hero
2. Unit
3. Summon

I dont know where to begin on this trigger because all my attempts have been to no avail.
05-25-2004, 02:37 AM#2
Shimrra
Create a trigger that picks every unit belonging to the caster and add them to a unit group. Then do another action the picks every unit in that unit group matching the condition that it is a Hero and cast invisibility on it. Then remove the unit from the unit group. Next do the same as above except after the condition should be is a Hero equal to false. Underneath this, make an If\Then\Else with a condition of "Is summoned equal to false" and then do the same actions. Finally, just selsct every unit remaining in the group (as you should have removed the other ones by now) and cast invisiblilty on them. Hope this helps!
05-25-2004, 05:59 AM#3
logik
why not just give i an auto casting spell??? so it just casts it? keep it simple..

you can make a dummy autocast spell and then use a trigger to support the spell... like unit gets targeted with a spell. give casting unit invisibility, make casting unit cast inivisbility on targeted unit, then remove the ability...
05-25-2004, 12:30 PM#4
PatruX
Quote:
Originally Posted by logik
why not just give i an auto casting spell??? so it just casts it? keep it simple..

you can make a dummy autocast spell and then use a trigger to support the spell... like unit gets targeted with a spell. give casting unit invisibility, make casting unit cast inivisbility on targeted unit, then remove the ability...

The order in which it casts invisibilty on units around the totem should not be random but go in the order of
1. Hero
2. Unit
3. Summon
05-25-2004, 02:25 PM#5
Kamux
I hope you will understand this. I don't know for sure you can check if a unit is summoned, but you can always make a workaround for that.
It should look like this.

Trigger 1
Code:
Events:
A unit enters playable map area
Conditions:
Unit type of entering unit equals to <your unit>
Actions:
Run <trigger 2> ignoring conditions

Trigger 2
Code:
Events:
A unit finishes casting an ability
Conditions:
Unit type of casting unit equals to <your unit>
Actions:
Add units within 600 range of casting unit matching unit is a hero equal to true and unit belongs to an ally of owner of casting unit equals to true to temp_group<a group variable>

 If the number of units in temp_group equals then 0 then do actions:
 Add units within 600 range of casting unit matching unit is a summoned unit equal to false and unit belongs to an ally of owner of casting unit equals to true to temp_group<a group variable>
Else do nothing

If the number of units in temp_group equals then 0 then do actions:
 Add units within 600 range of casting unit matching unit is a summoned unit equal to true and unit belongs to an ally of owner of casting unit equals to true to temp_group<a group variable>
Else do nothing 

Order casting unit to night elf- feary fire random unit form temp_group.
05-26-2004, 12:32 AM#6
logik
i think your going for a bit of an overkill... making it to complex... who care is it select hero or what ever.
05-26-2004, 01:45 AM#7
Caidan
Quote:
Originally Posted by logik
i think your going for a bit of an overkill... making it to complex... who care is it select hero or what ever.
as patrux noted for you before, the spell was requested to specifically cast first on heroes, then normal units, then summoneds, thus the need to check for heroes. kind of obvious if u read the posts.
kamux: i tested your code and it worked for the heroes, then i hit a glitch, it wouldnt cast on anything but the heroes. however, i didnt have time to totally check it, and i think i might have copied it across badly. it seemed to work pretty well tho, ill test it more tonight.lookin good
05-26-2004, 01:50 AM#8
qmrcool
can you guys give me an exact trigger. Especially for logiks reply. I cannot get dummy casting to work.