HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Death Counter spell

11-27-2007, 01:57 AM#1
burningice95
So I'm making a spell...and it works like this...


Quote:
The reaper feeds on death. Whenever he kills something, he grows stronger. Gives a minor strength bonus for each unit killed, and a bigger one for each hero killed. When he kills enough units, he gains access to the Reapers Scythe, an ability that instantly kills the target unit.

Level 1 - +.1 strength for each unit killed, 1 for each hero. Can use Reapers Scythe every 80 kills.
Level 2 - +.5 strength for each unit killed, 1.3 for each hero. Can use reapers Scythe every 70 kills.
Level 3 - +.8 strength for each unit killed, 1.6 for each hero. Can use Reapers Scythe every 60 kills.

The strength part is easy to trigger...But I'm having trouble with the reapers scythe part. I know that if I knew JASS I could just I could just attach an integer to the unit, but since I don't I'm using custom values. This is what I have:

Trigger:
Reapers Scyte
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Killing unit)) Equal to Reaper
Collapse Actions
Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
Pretty simple...keep track of the kills

Trigger:
Reaper Give Remove Ability
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Set Reaper = (Units of type Reaper)
Collapse Unit Group - Pick every unit in Reaper and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Custom value of (Picked unit)) Greater than or equal to 80) and ((Level of Death for (Picked unit)) Equal to 1)
Collapse Then - Actions
Unit - Add Death to (Picked unit)
Unit - Set the custom value of (Picked unit) to 0
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Custom value of (Picked unit)) Greater than or equal to 70) and ((Level of Death for (Picked unit)) Equal to 2)
Collapse Then - Actions
Unit - Add Death to (Picked unit)
Unit - Set the custom value of (Picked unit) to 0
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Custom value of (Picked unit)) Greater than or equal to 60) and ((Level of Death for (Picked unit)) Equal to 3)
Collapse Then - Actions
Unit - Add Death to (Picked unit)
Unit - Set the custom value of (Picked unit) to 0
Else - Actions

For some reason, even when the unit has a custom value of 80, and the ability is level 1, the actions don't happen....any ideas why?

If someone wants to tell me a different way to code it, or write me a version in JASS, that would be cool too.

Thanks for any help
11-27-2007, 02:06 AM#2
Jazradel
((Level of Death for (Picked unit)) Equal to 1)
And
Unit - Add Death to (Picked unit)

You're only adding the ability if it already has it?
11-27-2007, 02:21 AM#3
burningice95
+rep for not laughing at me.....I guess thats what i guess for coding when I'm tired. I had changed the name of the ability several times, and i got mixed up ><

Anyway, one more question. Is this spell MUI? I'm pretty sure that it is, just want to make sure.
11-27-2007, 04:01 AM#4
Ignitedstar
I don't see any waits, so it should be MUI. Unless a lot of players cast the spell at the same instance. (Probably impossible, but still)
11-27-2007, 04:16 AM#5
Dil999
Yes, its MUI.
Also, instead of using an If statement for each level, you can simply use a math formula:
If the custom value > 90 - (10 * Level of Death for unit) then

To find the 'Level of Death for unit' part, find 'Integer to Real' in the list of possible real values, to convert an integer value into real.
11-27-2007, 07:38 AM#6
Pyrogasm
You don't need two triggers either:
Trigger:
Reapers Scyte
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Killing unit)) Equal to Reaper
Collapse Actions
Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Custom value of (Killing unit)) Greater than or equal to (90 - ((Level of (Death) for (Killing Unit)) x 10))) and ((Level of Death for (Killing unit)) Greater than to 0)
Collapse Then - Actions
Unit - Add Reaper's Scythe to (Killing unit)
Unit - Set the custom value of (Killing unit) to 0
Else - Actions