Resurrection spell and autoresurrect system - All in one.

dyablohunter

New Member
Reaction score
2
Ok i have a spell that revives allied heroes:
Code:
RedemptionTargetAlly
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
    Actions
        Set [COLOR="Red"]RedemptionTargetAlly[/COLOR][1] = (Dying unit)
        Trigger - Run Ally Rez <gen> (checking conditions)
        Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) +  |cffffcc00will be revived in 25 seconds.|r)

Code:
RedemptionAlly
    Events
        Unit - A unit Finishes casting an ability
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Redemption [Paladin]
                ([COLOR="#ff0000"]RedemptionTargetAlly[/COLOR][1] is dead) Equal to True
                ([COLOR="#ff0000"]RedemptionTargetAlly[/COLOR][1] belongs to an ally of Player 1 (Red)) Equal to True
            Then - Actions
                Hero - Instantly revive [COLOR="#ff0000"]RedemptionTargetAlly[/COLOR][1] at (Position of (Casting unit)), Show revival graphics
                Game - Display to (All players) the text: ((Name of (Owner of [COLOR="#ff0000"]RedemptionTargetAlly[/COLOR][1])) + ( |cffffcc00has been revived by|r  + (Name of (Owner of (Casting unit)))))
            Else - Actions
                Do nothing

Code:
Ally Rez
    Events
    Conditions
    Actions
        Wait 25.00 game-time seconds
        Hero - Instantly revive [COLOR="#ff0000"]RedemptionTargetAlly[/COLOR][1] at (Center of Ally Hero Spawn <gen>), Show revival graphics

What I want to know is how do I make a loop check to see what integer is available for use with the spell, because it only stores the last unit that dies.
logo.jpg
 
If each player can only have 1 Hero :

Change all RedemptionTargetAlly[1] variables to RedemptionTargetAlly[Player Number of (Owner of (Dying Unit))]
 
If each player can only have 1 Hero :

Change all RedemptionTargetAlly[1] variables to RedemptionTargetAlly[Player Number of (Owner of (Dying Unit))]

Ok let's say that works for the revive system, but for the spell? Will it work too?
Edit: Ok the rez system works... but the spell doesnt.. I need to implement another variable?
 
should this spell revive all allies or only one of them?
 
should this spell revive all allies or only one of them?

This is like a dota game, all players can only have 1 hero, and the spell should revive only the allies, all of them... so I need to store them somehow and than when I use the spell it should be able to revive them 1 by 1.
 
Code:
RedemptionAlly
    Events
        Unit - A unit Finishes casting an ability
    Conditions
    Actions
        Set tempPoint = (Position of (Casting Unit))
        For each Integer A from 1 to 12, do actions:
          If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Ability being cast) Equal to Redemption [Paladin]
                (RedemptionTargetAlly[Integer A] is dead) Equal to True
                (RedemptionTargetAlly[Integer A] belongs to an ally of Owner of Triggering Unit) Equal to True
              Then - Actions
                Hero - Instantly revive RedemptionTargetAlly[Integer A] at (tempPoint), Show revival graphics
                Game - Display to (All players) the text: ((Name of (Owner of RedemptionTargetAlly[Integer A])) + ( |cffffcc00has been revived by|r  + (Name of (Owner of (Casting unit)))))
              Skip remaining actions
              Else - Actions
           Custom Script: call RemoveLocation (tempPoint)
                Do nothing
 
Code:
RedemptionAlly
    Events
        Unit - A unit Finishes casting an ability
    Conditions
    Actions
        For each Integer A from 1 to 12, do actions:
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Redemption [Paladin]
                (RedemptionTargetAlly[Integer A] is dead) Equal to True
                (RedemptionTargetAlly[Integer A] belongs to an ally of Owner of Triggering Unit) Equal to True
            Then - Actions
                Hero - Instantly revive RedemptionTargetAlly[Integer A] at (Position of (Casting unit)), Show revival graphics
                Game - Display to (All players) the text: ((Name of (Owner of RedemptionTargetAlly[Integer A])) + ( |cffffcc00has been revived by|r  + (Name of (Owner of (Casting unit)))))
            Skip remaining actions
            Else - Actions
                Do nothing

Yeah i get it, but I don;t know how to set the target for the variable.. and the variable has to be of integer type no?
 
>>>Yeah i get it, but I don;t know how to set the target for the variable.. and the variable has to be of integer type no?

What do you mean by "target for the variable"?

Btw, the if-then-else sentence of yours, it nees to be INSIDE the "for each integer A". Move it inside.
And it leaks, search after a leak-tutorial.
 
Drunken God, since you trigger will leak once per loop [Position of...], there is more than 10 leaks in there. Pay attention.
 
>>>Yeah i get it, but I don;t know how to set the target for the variable.. and the variable has to be of integer type no?

What do you mean by "target for the variable"?

Btw, the if-then-else sentence of yours, it nees to be INSIDE the "for each integer A". Move it inside.
And it leaks, search after a leak-tutorial.

I know it has to be inside, If you would look at the first post.. you can see that i need to store every dying unit with a variable, so I can resurrect all of them, If I don't do that I can only resurrect the last hero that died.
 
So you want to Ressurect all dead allies?
Drunken_God's triggers should work, but it still leaks.

Add:
Set L = Position of (Casting Unit)
Revive blahblah...... at L blahblah.....
call RemoveLocation(udg_L)

And you don't need to use 'Skip Remaining Actions' and 'Do Nothing' Just leave it empty.
 
i use skip remaining actions to only revive one hero

where are leaks :shades:
 
So you want to Ressurect all dead allies?
Drunken_God's triggers should work, but it still leaks.

Add:
Set L = Position of (Casting Unit)
Revive blahblah...... at L blahblah.....
call RemoveLocation(udg_L)

And you don't need to use 'Skip Remaining Actions' and 'Do Nothing' Just leave it empty.

Well you can see in my quote of his post before... he modified it. :p

So you are saying I don't need another trigger like this:
Code:
RedemptionTargetAlly
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
    Actions
        Set RedemptionTargetAlly[1] = (Dying unit)

??? BTW Drunken God ... is tempPoint a variable? if so... could you please tell me what type and what array size? and if it is a variable than won't it need an index? i mean if it doesn't have an array It would be the same thing as my initial trigger: If 2 or more allied heroes die, the spell will always revive only the last one that died, so I am thinking.. not sure.. that I need somehow an array. What u say? I can't find (Position of (Casting unit)) neither on Set variable.
 
tempPoint is a Point variable. This one doesn't need array because there is only one point you need, which is Position of Casting Unit.

Set Variable = Value
> Unit - Position of Unit
> Event Response - Casting Unit

The code in the post before me is still needed, but do not set the Dying Unit as RedemptionTargetAlly[1], instead set it as RedemptionTargetAlly[Player Number of (Owner of (Dying Unit))]
 
>Custom Script: call RemoveLocation (tempPoint)

This gives me error when I save the map: it disables the trigger because of it. But in rest it all works perfectly. Thank you both.

This is how it looks now and it works perfectly, for alliance... last question :D
Code:
RedemptionTargetAlly
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
    Actions
        Set RedemptionTargetAlly[(Player number of (Owner of (Dying unit)))] = (Dying unit)
        Set AutoReviveAlly[(Player number of (Owner of (Dying unit)))] = (Dying unit)
        Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) +  |cffffcc00will be revived in 25 seconds.|r)
        Wait 25.00 game-time seconds
        Hero - Instantly revive AutoReviveAlly[(Player number of (Owner of (Dying unit)))] at (Center of Ally Hero Spawn <gen>), Show revival graphics

Code:
RedemptionAlly
    Events
        Unit - A unit Finishes casting an ability
    Conditions
    Actions
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Ability being cast) Equal to Redemption [Paladin]
                        (RedemptionTargetAlly[(Integer A)] is dead) Equal to True
                        (RedemptionTargetAlly[(Integer A)] belongs to an ally of (Owner of (Casting unit))) Equal to True
                    Then - Actions
                        Hero - Instantly revive RedemptionTargetAlly[(Integer A)] at (Position of (Casting unit)), Show revival graphics
                        Game - Display to (All players) the text: ((Name of (Owner of RedemptionTargetAlly[(Integer A)])) + ( |cffffcc00has been revived by|r  + (Name of (Owner of (Casting unit)))))
                        Skip remaining actions
                    Else - Actions

If I use a different variable for the other faction (tempPointHorde) and use Integer A same as with alliance will it work? Or is it better to use Integer B?
 
y and watch out for spelling and case sensitivity (e.g. A is not equal a)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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