• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Borrowed Time

Status
Not open for further replies.
Level 15
Joined
Oct 16, 2010
Messages
941
I unfortunately can't think of a way to do this in less triggers and much of the parameters the ability needs to perform are map-specific. But here you go anyways:

________________________________________________________

You need to run these two functions whenever you originally create the hero and you need to set the unit parameter to your hero (right now its set to "last created unit").

  • Borrowed Time Setup
    • Events
    • Conditions
    • Actions
      • Trigger - Add to Borrowed Time Damage Reversal <gen> the event (Unit - (Last created unit) Takes damage)
      • Trigger - Add to Borrowed Time Proc <gen> the event (Unit - (Last created unit)'s life becomes Less than 400.00)
___________________________________________________

  • Borrowed Time Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Borrowed Time
    • Actions
      • Countdown Timer - Start BorrowedTime_timer as a One-shot timer that will expire in (2.00 + (Real((Level of Borrowed Time for (Triggering unit))))) seconds
      • Trigger - Turn on Borrowed Time Damage Reversal <gen>
  • Borrowed Time Finish
    • Events
      • Time - BorrowedTime_timer expires
    • Conditions
    • Actions
      • Trigger - Turn off Borrowed Time Damage Reversal <gen>
      • Trigger - Turn off Borrowed Time Proc <gen>
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- ------------change the following time to whatever the CD is on your ability (minus .1 for good measure)----------------- --------
      • -------- ------------------------------------------------------------------------------------------------ --------
      • Countdown Timer - Start BorrowedTime_reproctimer as a One-shot timer that will expire in 60.00 seconds
  • Borrowed Time Proc
    • Events
    • Conditions
    • Actions
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- ------------change the following ID to whatever your base ability is----------------- --------
      • -------- ------------------------------------------------------------------------------------------------ --------
      • Unit - Order (Triggering unit) to Orc Troll Berserker - Berserk
  • Borrowed Time Proc Act
    • Events
      • Time - BorrowedTime_reproctimer expires
    • Conditions
    • Actions
      • Trigger - Turn on Borrowed Time Proc <gen>
  • Borrowed Time Damage Reversal
    • Events
    • Conditions
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) x 2.00))
Hope that helps, GL
 
Level 11
Joined
Sep 30, 2009
Messages
697
As far as i know the ability in DotA bugs sometimes. The solution above will not work in some cases:
1.
  • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) x 2.00))
- is bigger than the units max life -> therefore the calculation is wrong
2. The unit has less max life than the damage -> the unit will still die

You have to remeber that the damage event runs before the unit actually takes the damage!
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I believe this is the correct trigger, try it:

  • Starting
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Trigger - Add to Calculation <gen> the event (Unit - (Triggering unit) Takes damage)
      • Trigger - Turn off (This trigger)
You must turn off the trigger to reset the damage back to 0, meaning it won't have to doubles up the Damage Taken value, resulting in x2, x4, x8, and so on.
The Condition was just for testing purposes, nothing is related to your problem.

  • Calculation
    • Events
    • Conditions
    • Actions
      • Set DamageReceive = ((Integer((Damage taken))) + (Integer((Damage taken))))
      • Unit - Set life of BorrowedUnit to ((Life of BorrowedUnit) + (Real(DamageReceive)))
You must use Integer-type variable to save the damage taken and give to the unit
 
Level 9
Joined
Jun 25, 2009
Messages
427
Hi guys, so i didn't read looots of stuff, i just made you this spell. This spell has 7 triggers, but that's not the problem, because it is perfectly made, you can be silenced, doomed or whatsoever, but it will still work. Cheers from me! Good luck with mapping.
 

Attachments

  • Map to help Hivers By Tiche3.w3x
    31.4 KB · Views: 184
Level 33
Joined
Mar 27, 2008
Messages
8,035
You just used up our ideas to fit into your map, how ORIGINAL eh ?
Plus, you used Wait action, which is NOT wise to use it, as it can cause the trigger to be non-MUI spell
Replace Wait action with Timer (as suggested by Raven0) for better efficiency
But, his trigger leaks of Timer
Destroy it by using this:

  • Custom script: call DestroyTimer(udg_variable)
 
Level 9
Joined
Jun 25, 2009
Messages
427
You just used up our ideas to fit into your map, how ORIGINAL eh ?
Plus, you used Wait action, which is NOT wise to use it, as it can cause the trigger to be non-MUI spell
Replace Wait action with Timer (as suggested by Raven0) for better efficiency
But, his trigger leaks of Timer
Destroy it by using this:

  • Custom script: call DestroyTimer(udg_variable)

Excuse me? WHAT? I actually "put" your ideas into a map, because i made it easier for him and "ready to chew". And it works perfectly so he doesn't need to take your ideas and put them together - that means moar and moar work for him. And please, i help the guy, spend 30 minutes doing the spell and you only say bad things to me :cry:

For the timer: eh, he didn't ask for the spell to be Multi Unit Instansable, therefore it is as it is, although if he needs it MUI, then it could be changed.

Tiche3
 
Level 9
Joined
Jun 25, 2009
Messages
427
Well, no need for war over here...
Thanks for the test map though, I'm just asking for a CREDITS or at least a proper "thank you" to us all who had given the basic ideas of the trigger, nothing more, really.
Do not plagiarism.

I'm sorry that i didn't mention you, although, don't take me wrong - i knew how to do everything and it was medium for me.

And a big thank you:grin:

Tiche3:wink:
 
Level 9
Joined
Jun 25, 2009
Messages
427
Don't get so rude :cry: I actually didn't copy your ideas or anything, i just "borrowed" them, because when i did the spell only we editor was the only program i was using and looking, and etc etc, that means that we just think - a like. I already explained why i did the spell and w/e, don't get so mad, that i used your ideas, i don't claim them as my own, as i already mentioned. I just put them in one place and added a bit of my work so it is good for the guy who wanted it.

I don't like to argue about good things we do to other people :cry:

Tiche3:cry:
 
Level 9
Joined
Jun 25, 2009
Messages
427
my personal opinions to some people of your type ;D Heh, what? Some people of your type? EXCUSE ME? I am a helper to people who needs help and i'm soooooo offended. Dude, have you even checked my map? It's full of spells i did for other people, it's the first spell that anybody said it's using other people ideas and bro, i couldn't even do the spell "originaly", because you guys mentioned almost 4/7 triggers of the spell that are UNAVOIDABLE :cry:

Tho, the other spells might be similar to DotA's or something, but that's because people asked for them to be like that :cry:
 
Level 9
Joined
Jun 25, 2009
Messages
427
I'm just saying, if the answer has already been given (you said it yourself, 4/7 triggers), JUST let the thread goes on, don't repeat other people's answer as it will show you're a copy-cat

Dude, don't you get it? It's not about the ideas, i made the spell for the guy to be ready to use and only copy-paste and it works and dude would it be easier for you to write a request and get some ideas of the spell, or to get fully working, perfect spell that you asked for? Just pointing out that when you post your ideas and if somebody "USES" them as "THEIR OWN", please make sure that the spell can be done without those ideas and work even better or perfectly, and if it doesn't, don't insult or go mad on somebody, as i said i didn't even look at your ideas. If you check my code twice or trice, you will notice that only some parts are similar.

Anyway, good luck:wink:

Tiche3:cry:

BTW, your post count is evil >:)
 
Level 15
Joined
Oct 16, 2010
Messages
941
As far as i know the ability in DotA bugs sometimes. The solution above will not work in some cases:
1.
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) x 2.00))

- is bigger than the units max life -> therefore the calculation is wrong
2. The unit has less max life than the damage -> the unit will still die

You have to remeber that the damage event runs before the unit actually takes the damage!

Your right, my bad.

Just change it to 'current life' and it will work fine.
 
Level 9
Joined
Jun 25, 2009
Messages
427
is the trigger GUI in the map? (cause i can't load vjass maps into my warcraft 3 even when saving it with JNGP) and it has to be MUI.

The triggers in map is pure GUI and well, do you really want multiple units to have the same ability? I mean. Will you really use this spell on more units in your map? If no, then MUI isn't nessecary. But it you REALLY need it for multiple units usage, then i could try.

Another question: Will there be two heroes for one player, or the spell for multiple players, because if you need the spell for multiple players, then it is MPI and it's easier to make :)
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
As far as i know the ability in DotA bugs sometimes. The solution above will not work in some cases:
1.
  • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) x 2.00))
- is bigger than the units max life -> therefore the calculation is wrong
2. The unit has less max life than the damage -> the unit will still die

You have to remeber that the damage event runs before the unit actually takes the damage!

that's right
as far as I can see the spell right now is neither MUI nor bugless
dota's isn't as well as axarion pointed out alreay, it is based on windwalk with unlimited fading time (there were several bugs with this) and axe's ultimate can cut through abadons ulti because it does more dmg than his max life -> killing the unit
you can fix this by adding an ability with lots of bonus hp and removing it with a 0-sec-duration-timer
I've got an example on how to properly block dmg attached to this post:
http://www.hiveworkshop.com/forums/submissions-414/snippet-rangedaccuracy-181374/#post1738725
(it's jass but it can be converted to GUI easily)
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
i believe i made it MUI in it

dont trust yourself :grin:

  • Borrowed Time Initialization
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Borrowed Time
    • Actions
      • Set Borrower = (Triggering unit)
      • Trigger - Add to Borrowed Time Checking <gen> the event (Unit - Borrower Takes damage)
      • Trigger - Add to Borrowed Time Damage <gen> the event (Unit - Borrower Takes damage)
      • Trigger - Turn off (This trigger)
  • Borrowed Time Checking
    • Events
    • Conditions
      • (Life of Borrower) Less than or equal to 400.00
      • Borrowed_Cooldown Equal to False
    • Actions
      • Unit - Remove Negative buffs from Borrower
      • Unit - Order Borrower to Special - Channel
  • Borrowed Time Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Borrowed_Cooldown Equal to False
      • (Ability being cast) Equal to Borrowed Time
    • Actions
      • Special Effect - Create a special effect attached to the origin of Borrower using Abilities\Spells\Undead\Unsummon\UnsummonTarget.mdl
      • Set Borrowed_Effect = (Last created special effect)
      • Trigger - Turn on Borrowed Time Damage <gen>
      • Set Borrowed_Cooldown = True
      • Unit - Remove Negative buffs from Borrower
      • Trigger - Run Borrowed Time Timer <gen> (ignoring conditions)
      • Trigger - Turn on Borrowed Time Seconds <gen>
  • Borrowed Time Timer
    • Events
    • Conditions
    • Actions
      • Wait 10.00 seconds
      • Set Borrowed_Cooldown = False
      • Trigger - Turn off (This trigger)
  • Borrowed Time Damage
    • Events
    • Conditions
      • (Damage source) Not equal to Borrower
    • Actions
      • Unit - Set life of Borrower to ((Life of Borrower) + ((Damage taken) x 2.00))
  • Borrowed Time Seconds
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set Borrowed_Time = (Borrowed_Time + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Borrowed_Time Greater than or equal to (50 + (25 x (Level of Borrowed Time for Borrower)))
        • Then - Actions
          • Set Borrowed_Time = 0
          • Special Effect - Destroy Borrowed_Effect
          • Trigger - Turn off Borrowed Time Damage <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
this is not MUI
 
Status
Not open for further replies.
Top