HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

This spell trigger doesn't work...

09-15-2005, 02:05 AM#1
Ignitedstar
Yes, it's another one. I called this one Demi, becuase it has the effect of reducing a units current life by a percent. If the unit has more then the amount of HP, or in this case on level 1, 1000 HP, then they recieve 250 damage. The spell is based off of Storm Bolt.

Quote:
Demi
Events
Unit - HERO <gen> Starts the effect of an ability
Conditions
(Ability being cast) Equal to Demi
Actions
Set DemiTarget = (Target unit of ability being cast)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Demi for (Triggering unit)) Equal to 1
(Life of (Target unit of ability being cast)) Less than or equal to 1000.00
Then - Actions
Set DemiDamage = ((Life of (Target unit of ability being cast)) / 0.33)
Unit - Order (Casting unit) to damage DemiTarget for DemiDamage using attack type Spells and damage type Universal.
Else - Actions
Unit - Order (Casting unit) to damage (Target unit of ability being cast) for 250.00 using attack type Spells and damage type Universal.

Here's the problem: Whenever I cast the spell, it does hit them, but it instantly kills them, even when they have more life then the life capacity. I don't quite understand what exactly is wrong, only knowing that the damage triggering is not right. I have tried fixing the spell many times, but never got what I would have liked. Can someone help me please?

If I am being unclear, please say so.
09-15-2005, 03:45 AM#2
HexenLordX
Simple math error:

Quote:
Set DemiDamage = ((Life of (Target unit of ability being cast)) / 0.33)

If you divide something by an integer less than 1, it increased the value. Basically you set DemiDamage equal to the Life of the target unit x 3.

Try:
Quote:
Set DemiDamage = ((Life of (Target unit of ability being cast)) / 3.00)
09-15-2005, 04:15 AM#3
Ignitedstar
Hmm... it still isn't working. I tried removing the other condition, but the same thing happens...

I'm really confused. Nothing is wrong with the trigger. All that I see what's wrong is the damage.
09-15-2005, 09:36 AM#4
Anitarf
I suppose you have an if-then-else for every level, right?

In that case, your problem is a simple logical flaw: you put the level condition and the life condition in the same place so they decide about the same thing: will the damage be absolute or relative. The level condition should be above that, it should be deciding if damage from that part is to be dealt at all.
09-16-2005, 01:19 AM#5
Ignitedstar
I don't really understand what your talking about, Anitarf. Where exactly would I put the level condition and life condition then? Your explainations are really vague.