• 🏆 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!

Help with Hibernation ability

Status
Not open for further replies.
Level 9
Joined
Jun 10, 2013
Messages
473
Hey all happy post Christmas and Boxing day ! >:D I need help triggering the following type of ability:

Hibernation:
The Treant falls a sleep on the battlefield entering a state of hibernation and gaining 5 extra points per second to mana and hit point regeneration for 25 seconds.

If the Treant attacks, moves or casts a spell the hibernation will end, like wise if the Treant is attacked or casted upon.

While in hibernation mode the Treant will not auto attack nearby enemy units
nor will enemy units auto attack it.

Any trigger help/examples and dummy help/examples will be very much appreciated and will go along way to helping me wrap up my up coming and almost finish Treant race based map and I would gladly mention any one who helps in the credits and of course give wrap thanks and have a good afternoon/day/night ! :)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
"nor will enemy units auto attack it."
Why?

Not auto attacking nearby enemy units is going to be hard.
IIrc, setting acquisition range in the trigger editor doesnt do much.
So you would need something to replace the attacks as default or disable the attacks entirely (of that unit).
I prefer the first.

About the spell itself, you can add two abilities that increase hp and mana regen to the unit and remove them whenever the unit is issued an order or is damaged.
 
Level 9
Joined
Jun 10, 2013
Messages
473
"nor will enemy units auto attack it."
Why?

Not auto attacking nearby enemy units is going to be hard.
IIrc, setting acquisition range in the trigger editor doesnt do much.
So you would need something to replace the attacks as default or disable the attacks entirely (of that unit).
I prefer the first.

About the spell itself, you can add two abilities that increase hp and mana regen to the unit and remove them whenever the unit is issued an order or is damaged.

well units which are asleep aren't auto attack any ways nor do sleeping units attack enemies nearby....
 
Hmh, I assume (Without testing) that it uses a buff. The healing/mana part is only about looping until the caster no longer has the buff. The interrupting part again has to test for the buff, how you chose to interrupt it is up to you (dummy caster 0.01 duration stun / ordering the caster to move to a very close position / have no more ideas).
 
The hardest part is to get other unit not attacking it... Oh wait, use Sleep!

So, I would conclude you need several abilities as following :
1. Health Regeneration
2. Mana Regeneration
3. Hibernate (Base on Sleep)

With Sleep, you solved two issues in one stone : not attacking or attacked defaultly.

Then, when the spell is cast, a trigger will detect if the spell is equal to hibernate, add the first two ability, told a dummy to sleep it, and add it to an exclusive unit group and then another trigger loop every second to check the group if the buff still there (use a custom buff for the sleep, you need that to detect the hibernation).
 
Level 9
Joined
Jun 10, 2013
Messages
473
The hardest part is to get other unit not attacking it... Oh wait, use Sleep!

So, I would conclude you need several abilities as following :
1. Health Regeneration
2. Mana Regeneration
3. Hibernate (Base on Sleep)

With Sleep, you solved two issues in one stone : not attacking or attacked defaultly.

Then, when the spell is cast, a trigger will detect if the spell is equal to hibernate, add the first two ability, told a dummy to sleep it, and add it to an exclusive unit group and then another trigger loop every second to check the group if the buff still there (use a custom buff for the sleep, you need that to detect the hibernation).

so basically when the custom ability hibernation is activated have a dummy cast a custom Inner fire ( with its mana and life regen options) and a custom sleep on the triggering unit?
 
Level 9
Joined
Jun 10, 2013
Messages
473
Yes, and those abilities need their own buffs.

Be aware this causes them to be messed with another Inner Fire based abilities while they are hibernating. Unless you want to trigger it further to close this loophole, this one, IMO, is the simplest and most friendly way to go :)

well I ended up using sleep and a custom rejuvenation which all works well except it makes the treant invulnerable which I don't want :/ and thanks for your help
 
Level 9
Joined
Jun 10, 2013
Messages
473
alright I've got this as a trigger and although the unit gets the regens it isn't put to sleep

  • Hibernation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hibernation
    • Actions
      • Set Unit_Caster = (Triggering unit)
      • Set Player_Owner = (Owner of Unit_Caster)
      • Set Point_Caster_Position = (Position of Unit_Caster)
      • Set AbilityAdd2 = Hibernation Mana & Life regen
      • Set AbilityAdd3 = Sleep Hibernation
      • Unit - Create 1 Dummy Spellcaster for Player_Owner at Point_Caster_Position facing Default building facing degrees
      • Unit - Add AbilityAdd3 to (Last created unit)
      • Unit - Add AbilityAdd2 to (Last created unit)
      • Unit - Order (Last created unit) to Undead Dreadlord - Sleep Unit_Caster
      • Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Rejuvenation Unit_Caster
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Point_Caster_Position)
 
Level 9
Joined
Jun 10, 2013
Messages
473
The sleep ability needs to be allowed to target allies.

I've now corrected that however the unit now becomes invulnerable when a sleep

EDIT//I've gotten it to work by setting the stun duration of the sleep ability to 0.01, How ever if attack the sleep is cancelled which Is good but the rejuvenation isn't :/

EDIT2//To fix this I based the mana and hp regen on healing salve but now it doesn't work at all because of the order strings being non-existent I believe
 
Last edited:
Level 10
Joined
Jun 6, 2007
Messages
392
You could trigger the regeneration:

Code:
Events:
  every 1 second of game time

Conditions:
Actions:
  set TempGroup = Units in playable map area
  Pick units in TempGroup and do
    if picked unit has a buff (sleep) then
      set life of picked unit = life of picked unit + 5
      set mana of ...
  call DestroyGroup(udg_TempGroup)
 
Here, made a spell that works. Should be easy to import since it dosen't use dummy units, dummy spells or anything.

View attachment Hibernation.w3x

Here is the trigger, if you would rather see it than test it:
HibernationSpell.png

I based the spell on tranquility, as it allows you to stop the channeling. If you don't want that, use Channel instead.
Additionally it tests if the caster takes damage in between heals, and stops the spell if he does.
 
Level 9
Joined
Jun 10, 2013
Messages
473
Here, made a spell that works. Should be easy to import since it dosen't use dummy units, dummy spells or anything.

View attachment 151309

Here is the trigger, if you would rather see it than test it:
View attachment 151310

I based the spell on tranquility, as it allows you to stop the channeling. If you don't want that, use Channel instead.
Additionally it tests if the caster takes damage in between heals, and stops the spell if he does.

Thank you! soo much IT WORKS PERFECTLY ! >:D
 
Status
Not open for further replies.
Top