reincarnation

3plX

New Member
Reaction score
3
spell

Unit start effect of an ability
Ability being cast = Inner fire
Add reincanation to (target unit of ability being cast)
wait 10 sec.
remove Reincrnation from (target unit of ability being cast)

need help on removing reincrnation when unit dies.
i tried everything :(
 

Emu.Man00

New Member
Reaction score
41
Just taking a stab at it, but have u tried checking for 'unit stats the effect of an ability'
&& 'ability being cast == reincarnation'
 

Genkora

Frog blast the vent core!
Reaction score
92
Just taking a stab at it, but have u tried checking for 'unit stats the effect of an ability'
&& 'ability being cast == reincarnation'

reincarnation isn't really cast, it's a passive. That's like saing ability being cast == to critical strike. Reincarnation is a tricky thing, you could figure out how long it takes for reincarnation to work, then remove the ability after so much time.

I am at school and can't open WE, so i'll try my best

Event
A unit dies
Conditions
no conditions
Actions
wait (6 seconds) //or however many seconds it takes to revive
Remove (reincarnation) from (triggering unit)


that might work, but it's untested and could lead to trouble, assuming you have an error of a second and a unit dies immediatly after it revives, thus reviving again. The problem with revive spells is that you can't remove an ability from something that is dead.
 

3plX

New Member
Reaction score
3
Event
A unit dies
Conditions
no conditions
Actions
wait (6 seconds) //or however many seconds it takes to revive
Remove (reincarnation) from (triggering unit)

doesnt work

i tried

Event
every 10 sec of the game
Conditions
((Target unit of ability being cast) has buff Inner Fire Equal to false
Actions
Remove Reincarnation from (Target of ability being cast)

doesnt work either :confused:
 

Emu.Man00

New Member
Reaction score
41
Event
every 10 sec of the game
Conditions
((Target unit of ability being cast) has buff Inner Fire Equal to false
Actions
Remove Reincarnation from (Target of ability being cast)
The event is a timer; target unit of ability being cast is null.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
Your gona need to set the unit to a variable. Otherwise the trigger loses track of Triggering unit after 10 seconds. I've got a spell that does something similar and I'll post it here, but its both incomplete and in VJass.

JASS:
scope Resurrection initializer init

    globals
        private constant integer SPELLID = 'A005'
        private constant integer BOOKID = 'A012'
        private constant string SFX = "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl"
        
        private unit caster
    endglobals
    
    private struct ss
        unit r
    endstruct
    
    private function timeout takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local ss s = GetCSData(t)
        call UnitRemoveAbility(s.r, BOOKID)
    endfunction
    
    private function Duration takes integer lvl returns integer
        return 6 + (4 * lvl)
    endfunction
    
    
    private function ishero takes nothing returns boolean
        local unit u = GetEnumUnit()
        return IsUnitType(u, UNIT_TYPE_HERO) == true and IsUnitAlly(u, GetOwningPlayer(caster)) == true
    endfunction
    
    private function actions takes unit u returns nothing
        local ss s = ss.create()
        local group g = CreateGroup()
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        local real x2
        local real y2
        local integer lvl = GetUnitAbilityLevel(u, SPELLID)
        local timer t = CreateTimer()
        local unit fog
        
        set caster = u
        
        call GroupEnumUnitsInRange(g, x, y, 1000, Filter( function ishero))
        call GroupAddUnit(g, u)
        
        loop 
            set fog = FirstOfGroup(g)
            exitwhen fog == null
            set x2 = GetUnitX(fog)
            set y2 = GetUnitY(fog)
            call DestroyEffect(AddSpecialEffect(SFX, x2, y2))
            call UnitAddAbility(fog, BOOKID)
            call SetPlayerAbilityAvailable(GetOwningPlayer(fog), BOOKID, false)
            set s.r = fog
            call SetCSData(t,s)
            call TimerStart(t, I2R(Duration(lvl)), false, function timeout)
            call GroupRemoveUnit(g, fog)
        endloop
    endfunction
            

    private function conditions takes nothing returns boolean
        if GetSpellAbilityId() == SPELLID then
            call actions(GetTriggerUnit())
        endif
        return false
    endfunction

    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t, Condition( function conditions))
    endfunction
endscope


This is an area resurrection spell that gives all friendly hero's in range a single instance of reincarnation. I'm using an attached timer to keep track of the unit, each unit gets a timer. I'm at a loss to how you would replicate this in GUI though.
 

Genkora

Frog blast the vent core!
Reaction score
92
off topic, sorry, but it loses track of triggering unit after 10 seconds? I wasn't aware of this.
 

Pyroflame

New Member
Reaction score
4
off topic, sorry, but it loses track of triggering unit after 10 seconds? I wasn't aware of this.

Me neither, it seems I've used it longer than that without trouble.

I always thought when you say something like "triggering unit" it recording it for you, and that's why there is leaks.
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Group all units, if they have buff and no timer then give timer. When timer expires you remove thing. If have timer then don't give timer. Shouldn't be too hard with an attachment system and PUI.
 

Faust

You can change this now in User CP.
Reaction score
123
With reincarnation, the unit does not die. Use the event Unit - Life becomes 0 instead (or less than 1)
 

Flow

New Member
Reaction score
4
The game does tend to lose track of it after 10 seconds, yes. Although I've heard that Triggering Unit is kept in memory longer than the SPECIFIC ACTIONing Unit (target unit of ability being cast, attacking unit etc.)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top