HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggered Spell Question...

03-09-2004, 05:41 AM#1
Huois
I got a spell problem, when I use the trigger action "remove last replaced unit, it does not remove the last replaced unit. All the other actions before that action that incluse "last replaced unit" works fine. I'm wondering if there is another way you have to do this.

Also, I wanted to know if there is a condition to recognize a spell based off of Animate Dead for the event "A unit Spawns a summoned unit".

Here is the trigger:

Soul Steal
Events
Unit - A unit Spawns a summoned unit
Conditions
Actions
Set SSsummonedtotal = (SSsummonedtotal + 1.00)
Unit - Replace (Summoned unit) with a Wisp using The new unit's max life and mana
Special Effect - Create a special effect attached to the chest of (Last replaced unit) using Abilities\Spells\Other\Charm\CharmTarget.mdl
Unit - Turn collision for (Last replaced unit) Off
Unit - Order (Last replaced unit) to Move To (Position of (Summoning unit))
Wait 2.00 seconds
Unit - Move (Last replaced unit) instantly to ((Position of (Summoning unit)) offset by (200.00, -100.00)), facing (Position of (Summoning unit))
Wait 1.00 seconds
Unit - Move (Last replaced unit) instantly to (Position of (Summoning unit)), facing (Position of (Summoning unit))
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of (Last replaced unit)) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCaster.mdl
Wait 0.50 seconds
Unit - Remove (Last replaced unit) from the game
Special Effect - Destroy (Last created special effect)
Set SSb4heal = (Life of (Summoning unit))
Set SSheal = ((SSsummonedtotal x 100.00) + SSb4heal)
Unit - Set life of (Summoning unit) to SSheal
Special Effect - Create a special effect attached to the chest of (Summoning unit) using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
Wait 1.00 seconds
Special Effect - Destroy (Last created special effect)

Brief Description of what trigger does: When a unit is spawned (no condition yet), it will make a soul (or replace the animated unit with the soul) and the soul goes to the caster and will heal him 100 for each soul.
03-09-2004, 06:51 AM#2
Kamux
Maby it will work if you first store last replaced unit in a variable and then use the variable for the effect.
03-09-2004, 08:23 AM#3
RaeVanMorlock
Anytime you use the wait statement, you create the possibility for a variable to be over-written. In other words, variables (including event variables) aren't defined to the trigger that uses them. The best solution would be to learn a small bit of JASS to create local variables--search the forums.
03-09-2004, 08:18 PM#4
Huois
I just thought of something... could I pick all units of unit type "stolen soul"(i changed wisp to a custom unit) and remove picked unit... would that still work?
03-09-2004, 08:21 PM#5
ThyFlame
Yes, but realize that unless this spell is only castable by one person, it will have errors [if this is a multiplayer map and more than 1 person can be the hero with it, then you need to use arrays]

Otherwise, yes. That will work.