• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Trigger=Deal Damage

Status
Not open for further replies.
Level 4
Joined
Aug 20, 2004
Messages
65
Okay, this trigger isn't workin'

Events
Unit - A unit starts the effect of an ability
Conditions
(Ability being cast) Equal to (myspell)
Actions
Unit - Cause (Triggering unit) to damage (Targeted unit), dealing ((Max life of (Targeted unit)) -(thats a minus) ((Life of (Targeted unit)) X (Real((Level of (myspell) for (triggering unit))))) damage of attack type normal and damage type normal.

So it'll go like this
Units Max life = 1000
Minus Units life = 730
1000 - 730 = 270
Level of spell = 2
270 X 2 = 540
Unit takes 540 damage.

Or thats how it should work, but it doesn't.
 
Level 4
Joined
Aug 20, 2004
Messages
65
Okay, changed it to "Target of ability being cast," and set attack type to chaos. First time i used it in a map, it didn't work. In the same game, the second time i used it, it worked, then stopped working all together. Anything else i should try?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
chaos for direct damage, magic is magic damage and normal is Physical damage

UMMMM if im not mistaken chaos is for CHAOS attack type damage. . .
and normals is for NORMAL attack type damage
and spell is for SPELL type damage. . .

If you set it to chaos damage it will damage devine well but if you set it to normal it will be as if that damage was done by a unit attacking with normal attack type so it will deal awfull damage (awfull as in "OMG WTF 1 damage!!??")

Spell damage basicly simulates that damage being done by a spell like blizzard or stormbolt.
 
Level 4
Joined
Aug 20, 2004
Messages
65
Okay, I got the damage to be dealt by changing "Max life - Life X level of spell" to "Max life - Life X 0.70" or whatever number i want. Only problem is now it damages units with full life. No idea why because..

Max life = 1000
Life = 1000
1000 - 1000 = 0
0 X 0.70 = 0

I made sure the dummy spell doesn't deal any damage, by the way.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Code:
Unit - Cause (Casting Unit) to damage (Target Unit of Ability Being Cast), dealing ((Max life of (Target Unit of Ability Being Cast)) - ((Life of (Target Unit of Ability Being Cast)) X (Real((Level of (myspell) for (Casting Unit))))) damage of attack type normal and damage type normal.

I think what makes it stop working sometimes is the Triggering Unit. And as people have stated out, the Target Unit wouldn't work.

But you might have forgotten to change Triggering Unit so try again with Casting Unit. Re-check all the function.
 
Level 8
Joined
Sep 13, 2006
Messages
431
Code:
Unit - Cause (Casting Unit) to damage (Target Unit of Ability Being Cast), dealing ((Max life of (Target Unit of Ability Being Cast)) - ((Life of (Target Unit of Ability Being Cast)) X (Real((Level of (myspell) for (Casting Unit))))) damage of attack type normal and damage type normal.

Use of parentheses is vital. The editor uses order of operations, you must be sure that the different operations are grouped correctly. If you want a unit with full life to be unharmed by the spell, the "max life - life" must be grouped within parentheses and then multiplied by the level/whatever value. Otherwise, you are multiplying the current life by the level and then subtracting the result from the max life.

Try instead:
Code:
Unit - Cause (Casting Unit) to damage (Target Unit of Ability Being Cast), dealing (((Max life of (Target Unit of Ability Being Cast)) - (Life of (Target Unit of Ability Being Cast))) X (Real((Level of (Spell) for (Casting Unit))))) damage of attack type Spells and damage type normal.
 
Status
Not open for further replies.
Top