Skeleton King Revive

Laiev

Hey Listen!!
Reaction score
188
when an unit dies, start a timer... then when the timer expire, slow units around (this simulate the delay of reincarnation)
 

keychup

Active Member
Reaction score
34
probably not, because a reincarnating hero doesn't die. i bet that reincarnation can be detected with "unit starts the effect of an ability"
 

Arberden

Active Member
Reaction score
0
So what you are saying is that if I use unit starts the effect of an ability and put the condition to ability being cast = reincarnation,then wait for time then slow the area.Is that how it is done?
 

Carnerox

The one and only.
Reaction score
84
You can try triggering it. Just make sure to work around stuff that checks when a unit dies.

Here's an example.
JASS:

scope Reincarnation initializer onInit
    globals
        private constant integer ABIL_ID = 'A000'
        private constant integer UNIT_ID = 'H000'
        private constant integer DUMMY_ID = 'hpea'
        private constant integer SLOW_ID = 'A001'
        private constant string CAST_ID = "thunderclap"
        private constant string EFFECT_ID = "Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.mdl"
        group Revive_Group = CreateGroup()
    endglobals
    
    private struct Reincarnation
        static thistype this
        unit caster
        player owner
        integer level
        real casterX
        real casterY
        timer reviveTimer
        
        private static method Delay takes integer level returns real
            return 5.00-I2R(level)
        endmethod
        
        private static method Cooldown takes nothing returns real
            return 180.00
        endmethod
        
        private static method onCooldown takes nothing returns nothing
            call GroupRemoveUnit(Revive_Group,this.caster)
            call PauseTimer(this.reviveTimer)
            call DestroyTimer(this.reviveTimer)
        endmethod
        
        private static method onTimer takes nothing returns nothing
            local unit d
            call PauseTimer(this.reviveTimer)
            call DestroyTimer(this.reviveTimer)
            call ShowUnit(this.caster,true)
            call DestroyEffect(AddSpecialEffect(EFFECT_ID,this.casterX,this.casterY))
            set d=CreateUnit(this.owner,DUMMY_ID,this.casterX,this.casterY,0.00)
            call UnitApplyTimedLife(d,'BTLF',2.00)
            call UnitAddAbility(d,SLOW_ID)
            call SetUnitAbilityLevel(d,SLOW_ID,this.level)
            call IssueImmediateOrder(d,CAST_ID)
            set this.reviveTimer=CreateTimer()
            call TimerStart(this.reviveTimer,Cooldown,false,function thistype.onCooldown)
            set d=null
        endmethod
        
        private static method actions takes nothing returns nothing
            set this.caster=GetTriggerUnit()
            set this.owner=GetTriggerPlayer()
            set this.casterX=GetUnitX(this.caster)
            set this.casterY=GetUnitY(this.caster)
            set this.level=GetUnitAbilityLevel(this.caster,ABIL_ID)
            set this.reviveTimer=CreateTimer()
            if (GetUnitTypeId(this.caster)==UNIT_ID) and (this.level>0) then
                if (IsUnitInGroup(this.caster,Revive_Group)==false) then
                    call ReviveHero(this.caster,this.casterX,this.casterY,false)
                    call ShowUnit(this.caster,false)
                    call TimerStart(this.reviveTimer,Delay(this.level),false,function thistype.onTimer)
                    call GroupAddUnit(Revive_Group,this.caster)
                endif
            endif
        endmethod

        //===========================================================================
        private static method onInit takes nothing returns nothing
            local trigger trig = CreateTrigger()
            local integer index = 0
            set thistype.this=this.allocate()
            loop
                exitwhen index>=bj_MAX_PLAYER_SLOTS
                call TriggerRegisterPlayerUnitEvent(trig,Player(index),EVENT_PLAYER_UNIT_DEATH,null)
                set index=index+1
            endloop
            call TriggerAddAction(trig,function thistype.actions)
        endmethod
    endstruct
endscope
 

keychup

Active Member
Reaction score
34
Just did a couple of tests and here's what i found out:

1-Reincarnation is not detected by "Event - A unit starts the effect of an ability"
2-Reincarnation is not detected by "Event - A unit dies"
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I had a problem with this a long time ago too..
Try searching some of my posts/threads around a year ago maybe.
 

NotInTheFace

Member
Reaction score
17
You can use an ability based on spawn hydra. It summons a unit when the hero dies, even if it will reincarnate. Then you can check a "Unit spawns a summoned unit" event.

Here are some rough triggers (NOT MUI! :p ) that should give you an idea of how to get this working. (I had the dummy unit use a thunderclap spell for the slow. You would have to create a custom thunderclap with the slow and damage values and effects you want and give it to the dummy as a unit ability)


Trigger:
  • Reincarnation
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Reincarnation Dummy
    • Actions
      • Set ReincarnationDummy = (Summoned unit)
      • Set ReincarnationHero = (Summoning unit)
      • Countdown Timer - Start ReincarnationTimer as a One-shot timer that will expire in 3.00 seconds


Trigger:
  • Reincarnation Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to ReincarnationHero
    • Actions
      • Countdown Timer - Pause ReincarnationTimer
      • Unit - Remove ReincarnationDummy from the game
      • Set ReincarnationDummy = No unit
      • Set ReincarnationHero = No unit


Trigger:
  • Reincarnation Slow
    • Events
      • Time - ReincarnationTimer expires
    • Conditions
    • Actions
      • Unit - Order ReincarnationDummy to Human Mountain King - Thunder Clap
      • Unit - Add a 1.00 second Generic expiration timer to ReincarnationDummy
      • Set ReincarnationDummy = No unit
      • Set ReincarnationHero = No unit
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top