regeneration rate based on currently missing HP

snmiglight

Active Member
Reaction score
3
how can i make a spell (a passive one) that regenerates a unit's missing hp... lets say: "... regenerates 1/2/3/4% of the unit's missing HP per second. i think it has.. somewhat similarity to healing ward's... am i correct? i know that it is codeable 'cause i've encountered such skill before...
 

istar

New Member
Reaction score
31
healing wards heal by a fixed % of max hp, amount healed per unit is constant unless its max hp changes
it seems that it needs to be triggered healing
in GUI
event unit cast ability
ability is 'that'
add unit to unitgroup
turn on 2nd trigger
2nd trigger-
event every 1 sec
action pick every unit in unitgroup and do
set unit current hp = ((unit maxhp-unit current's)X0.01)+current's
JASS is better
 

DiFm

New Member
Reaction score
35
you dont need 2 triggers for that just use the last one.

every 1 second of game time.


actions
set Group = unit group all unit that has (Regen) buff
pick every unit unitgroup
set units hp.....
call DestroyGroup(Udg_Group)
 

istar

New Member
Reaction score
31
1st trigger
event unit cast ability
ability is 'that'
add unit to unitgroup
turn on 2nd trigger

2nd trigger-
event every 1 sec
action pick every unit in unitgroup and do
set unit current hp = ((unit maxhp-unit current's)X0.01)+current's

this is in GUI...
but i said JASS is better as i used 2 triggers here(inelegant), where as i can create in in JASS with 1 trigger
 

snmiglight

Active Member
Reaction score
3
so i see... so how do you do it in JASS? is it okay?

EDIT: what if... per level i want it to be 1/2/3% regen (per level respectively)
how can i do that?
like this??

((unit maxhp-unit current's)X0.01)+current's
((unit maxhp-unit current's)X0.02)+current's
((unit maxhp-unit current's)X0.03)+current's


(sounds funny, sorry im such a beginner)
 

DiFm

New Member
Reaction score
35
for this spell i see No benefit from using Jass. it works just as good as with GUI since its a passive.

if it's only for 1 person You can just use the trigger i posted and change this.


set picked unit's life to (((max life) - (current life)) x ((0.01) x (level of (regen) abilty for (picked unit))) + units current life.
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
he's right jass is not required

Code:
every 1 second

     set unit group = units with regen buff
     pick every unit in unit goup and do
        lopp actions
         set real_variable= (max life of triggering unit)-((current life of picked)) x 0.01))
        set life of picked unit to life of picked unit +real variable
 

snmiglight

Active Member
Reaction score
3
hey... it doesnt seem to work... is there something wrong with these?

Resilience
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set ResiliencedUnit = (Units owned by (Owner of (Triggering unit)) matching (((Triggering unit) has buff Resilience ) Equal to True))
Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Triggering unit) is in ResiliencedUnit) Equal to True)) and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((((Max life of (Picked unit)) - (Life of (Picked unit))) x 0.05) + (Life of (Picked unit)))
Do nothing
 

istar

New Member
Reaction score
31
theres no TriggeringUnit in a periodic time event
use pick all units of player
 

istar

New Member
Reaction score
31
action - player
i prefer if you use a unitgroup or something to record units with that ability
then pick units matching condition around unit with ability
instead of picking the player
 

istar

New Member
Reaction score
31
generally i would ignore you
but i am nice
right-click>new action>the first drop down menu>player>second drop drop menu>pick units belonging to player

BUT, like i said
i rather you make this
event-unit learns ability
condition-ability is resilence
action-add unit to unitgroupA

event-periodically
action-pick all units in unitgroupA and do
pick units in 256 radius arund picked units and do
the regen stuff
 

snmiglight

Active Member
Reaction score
3
yes i know... now how can i fix that?? didnt i told that im am not that very familiar with this?



generally i would ignore you
but i am nice
right-click>new action>the first drop down menu>player>second drop drop menu>pick units belonging to player

BUT, like i said
i rather you make this
event-unit learns ability
condition-ability is resilence
action-add unit to unitgroupA

event-periodically
action-pick all units in unitgroupA and do
pick units in 256 radius arund picked units and do
the regen stuff
ok i'll try thanks... the above message is for the flamer
 

istar

New Member
Reaction score
31
ok i'll try thanks... the above message is for the flamer
isnt the flamer me?
anyway, please exsplore the trigger editor and familiarise yourself
we cant help you if you dont know half the thing we talking about
 

istar

New Member
Reaction score
31
ok, the message is erased apparently
just a small misunderstanding, its cleared up
have fun modding
currently making a intelligent/dynamic trade system, argh... tough
 

snmiglight

Active Member
Reaction score
3
yes.. and thank you very much, it really helped.. actually i solved the problem by this:

Resilience
Trigger:
  • Events
    • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Resilience ) Equal to True
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((((Max life of (Picked unit)) - (Life of (Picked unit))) x 0.01) + (Life of (Picked unit)))
            • Else - Actions


anyways, do you see any leaks in here? thank you again.
PS: ignore the 0.25 seconds on event... i intend it to work that way. (5% missing HP regen)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top