Reincarnation, Unit Casts War Stomp When He Revives

Running_dap

New Member
Reaction score
3
Why dont u just make a dummy unit, cast War Stomp at the place of where the Unit reincarnates? Do u want the reincarnated unit to display the spell or something? :/
 

saw792

Is known to say things. That is all.
Reaction score
280
@Running_dap

If you read the thread, the problem is detecting the reincarnation.

It is possible, but complicated. wraithseeker's link above is the best option.
 

Justice-BR

New Member
Reaction score
8
There is a easier way.


1) Base of in reincarnation

2) Trigger to create a dummy unit when the unit with reincarnation dies (check mana and cooldown is also nice to do, to avoid bugs)

3) add expiration timer to dummy unit

4) add war stomp to dummy unit

5) Wait x seconds (time for reincarnation, you need to test to get the right one)

6) order the dummy unit to cast the war stomp
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Did you even read the thread Justice-BR :confused: ?
That's exactly what my trigger does, however, it doesn't work.

Couldn't I just modify wraithseeker's JASS script to when the hero gets to 1HP?
 

Ghostwind

o________o
Reaction score
172
How about something like this:

Event:
A unit dies

Condition:
Unit has (your ability)

Actions:
Wait (time until revives) seconds.
<create dummy blah blah blah>
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to (==) Tauren Chieftain 0017 &lt;gen&gt;
    • Actions
      • Wait 3.00 seconds
      • Set tempPoint = (Position of (Triggering unit))
      • Unit - Create 1 DummyCaster for (Owner of (Triggering unit)) at tempPoint facing Default building facing (270.0) degrees
      • Unit - Add Frost Stomp to (Last created unit)
      • Unit - Order (Last created unit) to (Order((Name of Frost Stomp )))
      • Unit - Remove Frost Stomp from (Last created unit)
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)

Nope.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Unit - Remove Frost Stomp from (Last created unit)

Still not a good idea...


> Unit - A unit Dies

A unit on Reincarnation doesn't die...
If its health drops to less than 0.4 without dying, it's reincarnating.
 

Justice-BR

New Member
Reaction score
8
Yes a saw the whole thing, you were using "casting reincarnation"

anyway, i see, th trigger with "a unit dies" doenst work because (duh) the unit doesnt really dies.


edit: damn ace beat me

anyway

Unit - Life is a specified unit event
so you need a periodic trigger or set a variable with "reincarnation user"
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Code:
Untitled Trigger 002
    Events
        Unit - A unit Is attacked
    Conditions
        (Integer((Life of (Triggering unit)))) Less than or equal to (<=) 1
        (Triggering unit) Equal to (==) Tauren Chieftain 0017 <gen>
    Actions
        Wait 3.00 seconds
        Set tempPoint = (Position of (Triggering unit))
        Unit - Create 1 DummyCaster for (Owner of (Triggering unit)) at tempPoint facing Default building facing (270.0) degrees
        Unit - Add Frost Stomp  to (Last created unit)
        Unit - Order (Last created unit) to (Order((Name of Frost Stomp )))
        Unit - Remove Frost Stomp  from (Last created unit)
        Custom script:   call RemoveLocation(udg_tempPoint)
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Didn't work either.
 

Justice-BR

New Member
Reaction score
8
try it

make a global variable/array called "toReincarnate"
when the unit learn Reincarnation make a trigger

Event (hero learn a ability)
Condition (ability learned is Reincarnation)
toReincarnate == triggering unit

then


event Unit - "toReincarnate"'s life become less than 0.4

condition (check cooldown and mana? dunno)

action (your actins here)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
When the unit is attacked, it didn't take any damage yet.
And, if its health is too low, it won't be attacked anymore.

The dummy still needs the spell to actually cast it... though it obviously doesn't help to keep repeating that...
 

saw792

Is known to say things. That is all.
Reaction score
280
Here, I vJASSED it up for you. I tested it thoroughly, and it definitely works.
JASS:
scope StompOnRez initializer Init

  globals
    private integer UNIT_TYPE = &#039;H000&#039;  //Rawcode of reincarnating unit-type
    private integer DUMMY_ID = &#039;h000&#039;  //Rawcode of dummy unit
    private integer ABILITY_ID = &#039;A000&#039;  //Rawcode of stomp ability
    private string STOMP_ORDER_STRING = &quot;stomp&quot; //Order string of base ability
    private boolean USE_DUMMY = true //Have dummy cast or hero cast
                                     //Recommended true
  endglobals
  
  private function Conditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit()) == UNIT_TYPE
  endfunction
  
  private function AltActions takes nothing returns nothing
    local unit rez = GetReincarnatingUnit()
    call TriggerSleepAction(0.0) //Required
    call IssueImmediateOrder(rez, STOMP_ORDER_STRING)
    set rez = null
  endfunction
  
  private function Actions takes nothing returns nothing
    local unit rez = GetReincarnatingUnit()
    local unit u = CreateUnit(GetOwningPlayer(rez), DUMMY_ID, GetUnitX(rez), GetUnitY(rez), 0)
    call UnitAddAbility(u, ABILITY_ID)
    call IssueImmediateOrder(u, STOMP_ORDER_STRING)
    call UnitApplyTimedLife(u, &#039;BTLF&#039;, 3)
    call DestroyEffect(AddSpecialEffectTarget(&quot;Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdx&quot;, rez, &quot;origin&quot;))
    set rez = null
    set u = null
  endfunction
  
  private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterReincarnationEvent(t, true)
    call TriggerAddCondition(t, Condition(function Conditions))
    if USE_DUMMY then
      call TriggerAddAction(t, function Actions)
    else
      call TriggerAddAction(t, function AltActions)
    endif
  endfunction
  
endscope


That requires two libraries, RemovalDetection and TimerUtils. Both are included in the testmap.
 

Attachments

  • StompOnReincarnate.w3x
    34.4 KB · Views: 97

saw792

Is known to say things. That is all.
Reaction score
280
It frustrates me greatly when things don't work, so I feel compelled to make them work.

It really wasn't much work, seeing as the event handling had already been taken care of.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
It worked!
JASS:
scope StompOnRez initializer Init

  globals
    private integer UNIT_TYPE = &#039;Otch&#039;  //Rawcode of reincarnating unit-type
    private integer DUMMY_ID = &#039;n000&#039;  //Rawcode of dummy unit
    private integer ABILITY_ID = &#039;A001&#039;  //Rawcode of stomp ability
    private string STOMP_ORDER_STRING = &quot;stomp&quot; //Order string of base ability
    private boolean USE_DUMMY = true //Have dummy cast or hero cast
                                     //Recommended true
  endglobals
  
  private function Conditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit()) == UNIT_TYPE
  endfunction
  
  private function AltActions takes nothing returns nothing
    local unit rez = GetReincarnatingUnit()
    call TriggerSleepAction(0.0) //Required
    call IssueImmediateOrder(rez, STOMP_ORDER_STRING)
    set rez = null
  endfunction
  
  private function Actions takes nothing returns nothing
    local unit rez = GetReincarnatingUnit()
    local unit u = CreateUnit(GetOwningPlayer(rez), DUMMY_ID, GetUnitX(rez), GetUnitY(rez), 0)
    call UnitAddAbility(u, ABILITY_ID)
    call IssueImmediateOrder(u, STOMP_ORDER_STRING)
    call UnitApplyTimedLife(u, &#039;BTLF&#039;, 3)
    call DestroyEffect(AddSpecialEffectTarget(&quot;war3mapImported\\FrostStomp.mdx&quot;, rez, &quot;origin&quot;))
    set rez = null
    set u = null
  endfunction
  
  private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterReincarnationEvent(t, true)
    call TriggerAddCondition(t, Condition(function Conditions))
    if USE_DUMMY then
      call TriggerAddAction(t, function Actions)
    else
      call TriggerAddAction(t, function AltActions)
    endif
  endfunction
  
endscope

Thanks so much saw792!
+rep for life ;) .
 
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