Dying, exploding, dealing damage.

Stigoz

New Member
Reaction score
1
Okay, I'm (still) trying to make my custom spell, Dark Infusion, it goes like this:

A friendly target is infused with dark power, draining it's lif by 8% per second, but gives an high bonus damage. WHen the unit dies, it will restore mana to nearby friendly units, and deal damage to nearby enemy units equal 100 x the level of the ability.

But my "explode-trigger" won't seem to work.

Periodic Damage-Trigger ... works.
Code:
DarkInfusion
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Dark Infusion ) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - ((Max life of (Picked unit)) x 0.08))


Damage Bonus-Trigger ... works (Note that "DamageBonus (DarkInfusion)" is an item-aility)
Code:
DarkInfusionCast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Dark Infusion (Necrolord)
    Actions
        Unit - Add DamageBonus (DarkInfusion) to (Target unit of ability being cast)
        Unit - Set level of DamageBonus (DarkInfusion) for (Target unit of ability being cast) to (Level of (Ability being cast) for (Casting unit))


Explode-Trigger ... won't work.
Code:
DarkInfusionDead
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) has buff Dark Infusion ) Equal to True
    Actions
        Unit Group - Pick every unit in (Units within 450.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to (Owner of (Dying unit)))) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Mana of (Picked unit)) + (100.00 x (Real((Level of DamageBonus (DarkInfusion) for (Triggering unit))))))
        Unit Group - Pick every unit in (Units within 450.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Not equal to (Owner of (Dying unit)))) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (100.00 x (Real((Level of DamageBonus (DarkInfusion) for (Triggering unit))))))


Also, I'd like to have tips about making some cool graphics for it ... thank you!
 
H

hadha

Guest
i might be terrible wrong - (im probably terrible wrong)
Code:
DarkInfusionDead
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) has buff Dark Infusion ) Equal to True
    Actions
        Unit Group - Pick every unit in (Units within 450.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to (Owner of (Dying unit)))) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Mana of (Picked unit)) + (100.00 x (Real((Level of DamageBonus (DarkInfusion) for (Triggering unit))))))
        Unit Group - Pick every unit in (Units within 450.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Not equal to (Owner of (Dying unit)))) and do (Actions)
            Loop - Actions
               [B] Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (100.00 x (Real((Level of DamageBonus (DarkInfusion) for (Triggering unit))))))[/B]

Bold line seems to set life of the dying unit..?

if not, ignore my post :p
 

soulreaping

New Member
Reaction score
17
First:

Code:
        Unit Group - Pick every unit in (Units within 450.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to (Owner of (Dying unit)))) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Mana of (Picked unit)) + (100.00 x (Real((Level of DamageBonus (DarkInfusion) for (Triggering unit))))))
        Unit Group - Pick every unit in (Units within 450.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Not equal to (Owner of (Dying unit)))) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (100.00 x (Real((Level of DamageBonus (DarkInfusion) for (Triggering unit))))))

This leaks. Make sure you assign the group into a variable and then destroy it.

Second, if I'm not mistaken, the firelord has a passive ability that adds damage each attack and explodes the unit when the unit is killed and deals damage.

You can use that.

EDIT: This leaks also, didn't notice that:
Code:
 Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Dark Infusion ) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - ((Max life of (Picked unit)) x 0.08))
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
you cant check a buff of a dying unit
add in the casting trigger the action : add event to trigger DarkInfusionDead target unit of ability being cast dies and remove the cond
 

denmax

You can change this now in User CP.
Reaction score
155
You could set a variable unit to the target unit. Then, add a condition to the exploding thing that the dying unit is the variable.

Of course, this would fix the problem and you dun; have anything to worry cuz the dps isn't even MUI or even MPI..
 

Stigoz

New Member
Reaction score
1
I KNOW that there's leaks, I just don't wanna do them before I'm 90% sure what I'm doing is right, that way I don't have to change it all a million times.

Second: It's not supposed to be MUI, as only one of each type of hero can be active at a time.

Now; What would be the trigger to find out whether the dying unit has this buff or not?
 

Flare

Stops copies me!
Reaction score
662
Now; What would be the trigger to find out whether the dying unit has this buff or not?

you cant check if a dead unit has a buff as drunken_god said. you could either a) periodically check if the units health was below 1, and had the buff (unit is still alive until its health is below 0.405 i think) or b) use the event with units life [Unit's life becomes less than # i think]. you will have to add that event from the casting trigger with
Code:
Trigger - Add New Event
--Event is Target unit of ability being cast' life becomes less than 1--

then check (in the trigger to which you added the event) if the unit has the buff
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top