- Joined
- Jul 5, 2014
- Messages
- 556
Is there a way to make boss-like neutral hostiles regenerate faster while they're out of combat? (enemy runs away or defeated).
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
On map Initialization, mark all units with a flag that indicates that they are not in combat. They would have their own individual timers.
On an is unit attacked event or a spell cast event, you would start that timer instance, letting it expire after n seconds, where n is the attack cool down of the unit. Of course, that timer is refreshed on subsequent attacked events or spell events. This affects both the attacker and the target.
When the timer expires, if ever, enumerate nearby enemies within n units from the unit in question. If there are any, restart the timer. Otherwise, mark it as idle. (Not in combat)
You can check out Combat Systems in HIVE to see which one suits you best.
Events

Time - Every 1.00 seconds of game time
Conditions
Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)


If - Conditions



OrcBossInCombat Equal to True


Then - Actions



Unit - Unpause Rag'Thon <gen>



Unit - Remove Super heal (Boss) from Rag'Thon <gen>



Countdown Timer - Start BossTimer as a One-shot timer that will expire in 10.00 seconds


Else - Actions
Events
Time - BossTimer expires
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions


(Number of units in (Units within 600.00 of (Position of Rag'Thon <gen>))) Equal to 0

Then - Actions


Set OrcBossInCombat = False


Unit - Add Super heal (Boss) to Rag'Thon <gen>


Unit - Pause Rag'Thon <gen>

Else - Actions


Countdown Timer - Start BossTimer as a One-shot timer that will expire in 10.00 second
Events

Unit - A unit Is attacked
Conditions

(Attacked unit) Equal to Rag'Thon <gen>
Actions

Set OrcBossInCombat = True
Set noUnit = True
Set point = (Position of unit)
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 600.00 of point) and do (Actions)

Loop - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




((Picked unit) belongs to an enemy of (Owner of unit)) Equal to True




((Picked unit) is dead) Equal to False



Then - Actions




Set noUnit = False



Else - Actions
Custom script: call RemoveLocation(udg_point)
Events

Unit - A unit Is attacked
Conditions

(Attacked unit) Equal to Rag'Thon <gen>
Actions

Set OrcBossInCombat = True
Events

Time - timer expires
Conditions
Actions

Set noUnit = True

Set point = (Position of unit)

Custom script: set bj_wantDestroyGroup = true

Unit Group - Pick every unit in (Units within 600.00 of point) and do (Actions)


Loop - Actions



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





((Picked unit) belongs to an enemy of (Owner of unit)) Equal to True





((Picked unit) is dead) Equal to False




Then - Actions





Set noUnit = False




Else - Actions

Custom script: call RemoveLocation(udg_point)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)


If - Conditions



noUnit Equal to True


Then - Actions



Unit - Add Item Life Regeneration to unit


Else - Actions



Countdown Timer - Start timer as a One-shot timer that will expire in 1.00 seconds