Custom Spell

Post Reply
Blake
Terran Goliath Dome Polisher
Terran Goliath Dome Polisher
Posts: 106
Joined: Fri Feb 15, 2008 12:02 pm

Custom Spell

Post by Blake »

I made a spell that casts a buff on a unit and if that unit is killed while being being under the buff, the unit is resurrected, the buff can be dispelled...

Here are the triggers:

Rebirth
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Rebirth
    Actions
        Set RUnit = (Target unit of ability being cast)
        Trigger - Turn on Rebirth Buff Destroyed

Rebirth Buff Destroyed
    Events
        Time - Every 0.50 seconds of game time
    Conditions
        ((RUnit is alive) Equal to True) and ((RUnit has buff Rebirth (Custom)) Equal to False)
    Actions
        Set RUnit = NoUnit
        Trigger - Turn off (This trigger)


Raise Rebirth Unit
    Events
        Unit - A unit Dies
    Conditions
        (Dying unit) Equal to RUnit
    Actions
        Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Unit - Create 1 (Unit-type of RUnit) for Player 1 (Red) at (Position of (Dying unit)) facing Default building facing degrees

Now I was wondering if there was a better way this can be done...

Also I know that I can make a dummy unit with a modified ability of resurrection appear and cast it to bring back the fallen unit...
Last edited by Blake on Thu Apr 24, 2008 7:12 pm, edited 1 time in total.
tipereth
Zerg Hydralisk Nail Stylist
Zerg Hydralisk Nail Stylist
Posts: 597
Joined: Tue Sep 19, 2006 7:37 pm

Re: Custom Spell

Post by tipereth »

Uh.


Raise Rebirth Unit
    Events
        Unit - A unit Dies
    Conditions
        (Dying unit) has buff Rebirth equal to True.
    Actions
        Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Unit - Create 1 Unit-type of dying unit at position of Dying Unit.

And you should only need the one trigger.
Blake
Terran Goliath Dome Polisher
Terran Goliath Dome Polisher
Posts: 106
Joined: Fri Feb 15, 2008 12:02 pm

Re: Custom Spell

Post by Blake »

tipereth wrote: Uh.


Raise Rebirth Unit
    Events
        Unit - A unit Dies
    Conditions
        (Dying unit) has buff Rebirth equal to True.
    Actions
        Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Unit - Create 1 Unit-type of dying unit at position of Dying Unit.

And you should only need the one trigger.
I'm pretty sure that any buffs a unit has are removed once the unit dies, so this trigger alone will not work.
tipereth
Zerg Hydralisk Nail Stylist
Zerg Hydralisk Nail Stylist
Posts: 597
Joined: Tue Sep 19, 2006 7:37 pm

Re: Custom Spell

Post by tipereth »

Try it.
User avatar
Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 771
Joined: Mon Oct 23, 2006 3:29 pm

Re: Custom Spell

Post by Xenon »

It's a really bad idea to create special effects and not destroy them. Just destroy the (last created special effect) immediately; it won't just disappear immediately but will be removed after 5 seconds, which is usually enough for short-term animated ones.
Blake
Terran Goliath Dome Polisher
Terran Goliath Dome Polisher
Posts: 106
Joined: Fri Feb 15, 2008 12:02 pm

Re: Custom Spell

Post by Blake »

I've tried it, it doesn't seem to work, I've also tried it with a slightly altered trigger...

Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) has buff Rebirth of the Phoenix ) Equal to True
    Actions
        Set rebirth = (Dying unit)
        Set RevivePoint = (Position of (Dying unit))
        Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Unit - Create 1 (Unit-type of rebirth) for Player 1 (Red) at RevivePoint facing Default building facing degrees

Doesn't seem to work either...

Xenon wrote: It's a really bad idea to create special effects and not destroy them. Just destroy the (last created special effect) immediately; it won't just disappear immediately but will be removed after 5 seconds, which is usually enough for short-term animated ones.
What's wrong with not destroying special effects? Do they lag the game up later?
User avatar
Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 771
Joined: Mon Oct 23, 2006 3:29 pm

Re: Custom Spell

Post by Xenon »

Yes, and there's a limit to the number of special effects that can be in the game at a time. If you don't destroy them they add up.
Blake
Terran Goliath Dome Polisher
Terran Goliath Dome Polisher
Posts: 106
Joined: Fri Feb 15, 2008 12:02 pm

Re: Custom Spell

Post by Blake »

Xenon wrote: Yes, and there's a limit to the number of special effects that can be in the game at a time. If you don't destroy them they add up.
Oh, thanks for telling me, I thought that just because they're not visible means they ceased to exist..
User avatar
RazorclawX
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 2080
Joined: Thu Aug 24, 2006 7:19 pm

Re: Custom Spell

Post by RazorclawX »

Couldn't you use the triggers to temporarily add a variant of Reincarnate to the unit, then remove it later?
Image
-- Razorclaw X
Creator of Wanderers of Sorceria and Vision of the Future
Blake
Terran Goliath Dome Polisher
Terran Goliath Dome Polisher
Posts: 106
Joined: Fri Feb 15, 2008 12:02 pm

Re: Custom Spell

Post by Blake »

RazorclawX wrote: Couldn't you use the triggers to temporarily add a variant of Reincarnate to the unit, then remove it later?
Trouble is, I was trying to make it so that even if an enemy unit was put under this spell it would be reborn as your unit...there's an item called "ruin of rebirth" I believe, if i remember correctly that does just that, however the ability wont work unless a dead unit actually drops that item...

Thing is to make this spell dispel-able you need to make another trigger, because  buffs are automatically removed from a dead unit upon death...
Last edited by Blake on Fri Apr 25, 2008 7:04 pm, edited 1 time in total.
Post Reply