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

Passive Cooldown System [GUI Friendly] v1.04

-----------------------------------------------------------------------------
Sysem Code with description of the System
-----------------------------------------------------------------------------
JASS:
//            ----------------------------------------------------------------                     //
//                    Passive Cooldown System [GUI Friendly] v1.04                                 //
//                                  by Flux                                                        //
//                  http://www.hiveworkshop.com/forums/members/flux/                               //
//            ----------------------------------------------------------------                     //
//                                                                                                 //
//    This system allows you to make any unit's ability goes into cooldown via trigger             //
//    Though written in Jass, it has GUI support and easy to use for GUI users                     //
//    Even if the name shows "Passive Cooldown", it can be applied on Active Abilities as well     //
//    (as show in Demo 3) but this system is mostly intended for Passive Abilities.                //
//                                                                                                 //
//    HOW TO IMPORT:                                                                               //
//       1. Copy the PCD_IndicatorStart and PCD_ValidTargetCheck Ability to your map               //
//       2. Copy the PCD_DummyCaster Unit to your map                                              //
//       3. Configure the PCD_DummyCasterId, PCD_IndicatorStartId, PCD_ValidTargetCheckId          //
//          and PCD_VTCBaseOrderId in PCD System Configuration Trigger.                            //
//       4. Copy PCD Variable Creator to your map to automatically create the system's variables.  //
//          Make sure you check the "Automatically create unknown variables while pasting trigger  //
//          data" in File->Preferences of World Editor. After the variables are created, you can   //
//          then delete the 'PCD Variable Creator' trigger.                                        //
//                                                                                                 //
//                                                                                                 //
//    HOW TO USE:                                                                                  //
//       1. Set the PCD_Unit variable. This refers to the unit that will have its ability          //
//          goes into cooldown via trigger.                                                        //
//       2. Set the PCD_Ability variable. This refers to the ability that will go into cooldown.   //
//       3. Set the PCD_DummyAbility variable. This refers to the ability based on Spell Shield    //
//          that you have created. It must have the same tooltip, manacost and icon.               //
//       4. Set the PCD_Time variable. This refers how long the PCD_Ability will be replaced by    //
//          the PCD_DummyAbility. It should match the 'Stats - Cooldown' of the PCD_DummyAbility.  //
//       5. Set the PCD_Manacost variable. This is the manacost of the PCD_Ability which should    //
//          match the manacost of the PCD_DummyAbility 'Stats - Manacost' if you don't want        //
//          the unit to lose mana when you trigger it's cooldown.                                  //
//       6. Execute by "Trigger - Run Trigger Cooldown System <gen> (checking conditions)"         //
//                                                                                                 //
//                                                                                                 //
//      Notes:                                                                                     //
//          - When triggering the cooldown of an active ability, it will reset the original        //
//            ability's cooldown. Example: Original Ability's  is on cooldown for 20 seconds but   //
//            the triggered cooldown only last 5 seconds, when that 5 seconds is finished,         //
//            the original ability is now ready to be use again.                                   //
//          - Can only trigger Unit ability so far, so to trigger a Hero's ability, a dummy hero   //
//            ability must be used and when the dummy ability is learned, add the real ability.    //
//            (As shown in Map Demo 3)                                                             //
//                                                                                                 //                               
//      Works on:                                                                                  //
//          - Invulnerable, Spell Immune, Structures, Ancient,                                     //
//            Mechanical, Invisible (but removes it)                                               //
//      Does not work on:                                                                          //
//          - Hidden, Cycloned                                                                     //
//                                                                                                 //
//    CREDITS:                                                                                     //
//       Xonok - for the Spell Block trick to simulate cooldown                                    //
//       Wietlol - for finding bugs and suggesting solutions to it.                                //


//-------------------------------------------------------------------------------------------------//
//-------------------------------------- SYSTEM CORE ----------------------------------------------//
//-------------------------------------------------------------------------------------------------//
function Trig_Passive_Cooldown_System_TimerExpires takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer id = GetHandleId(t)
    local unit u = LoadUnitHandle(udg_PCD_Hashtable, id, 0)
    local integer origAbil = LoadInteger(udg_PCD_Hashtable, id, 0)
    local integer fakeAbil = LoadInteger(udg_PCD_Hashtable, id, 1)
    local integer lvl = GetUnitAbilityLevel(u, fakeAbil)

    call UnitAddAbility(u, origAbil)
    if lvl > 1 then
        call SetUnitAbilityLevel(u, origAbil, lvl)
    endif
    call UnitRemoveAbility(u, fakeAbil)
    //Destroy the timer reference data
    call FlushChildHashtable(udg_PCD_Hashtable, id)
    //Destroy the unit reference data
    call FlushChildHashtable(udg_PCD_Hashtable, GetHandleId(u))
    call DestroyTimer(t)
    set t = null
    set u = null
endfunction

function Trig_Passive_Cooldown_System_Execute takes nothing returns boolean
    local timer t
    local integer id
    local integer unitId
    local integer lvl
    set lvl = GetUnitAbilityLevel(udg_PCD_Unit, udg_PCD_Ability)
    call SetUnitX(udg_PCD_DummyCaster, GetUnitX(udg_PCD_Unit))
    call SetUnitY(udg_PCD_DummyCaster, GetUnitY(udg_PCD_Unit))
    //For checking if it is castable
    call SetPlayerAlliance(Player(14), GetOwningPlayer(udg_PCD_Unit), ALLIANCE_PASSIVE, true)
    if IssueTargetOrder(udg_PCD_DummyCaster, udg_PCD_VTCBaseOrderId, udg_PCD_Unit) then
        if lvl > 0 then
            call UnitRemoveAbility(udg_PCD_Unit, udg_PCD_Ability)
        else
            set lvl = GetUnitAbilityLevel(udg_PCD_Unit, udg_PCD_DummyAbility)
            call UnitRemoveAbility(udg_PCD_Unit, udg_PCD_DummyAbility)
        endif
        //Add the fake ability
        call UnitAddAbility(udg_PCD_Unit, udg_PCD_DummyAbility)
        call SetUnitAbilityLevel(udg_PCD_Unit, udg_PCD_DummyAbility, lvl)
      
        call IssueTargetOrderById(udg_PCD_DummyCaster, 852075, udg_PCD_Unit)
      
        set unitId = GetHandleId(udg_PCD_Unit)
        //[unitId][5] is for timers
      
        //If there is already a timer, just reset it
        if HaveSavedHandle(udg_PCD_Hashtable, unitId, udg_PCD_Ability) then
            call TimerStart(LoadTimerHandle(udg_PCD_Hashtable, unitId, udg_PCD_Ability), udg_PCD_Time, false, function Trig_Passive_Cooldown_System_TimerExpires)
        else
            set t = CreateTimer()
            set id = GetHandleId(t)
            //Save the timer in reference to the unit
            call SaveTimerHandle(udg_PCD_Hashtable, unitId, udg_PCD_Ability, t)
            call TimerStart(t, udg_PCD_Time, false, function Trig_Passive_Cooldown_System_TimerExpires)
            set t = null
            //Save the unit
            call SaveUnitHandle(udg_PCD_Hashtable, id, 0, udg_PCD_Unit)
            //Save the original ability replaced
            call SaveInteger(udg_PCD_Hashtable, id, 0, udg_PCD_Ability)
            //Save the fake ability
            call SaveInteger(udg_PCD_Hashtable, id, 1, udg_PCD_DummyAbility)
        endif
      
        if udg_PCD_Manacost > 0 then
            call SetUnitState(udg_PCD_Unit, UNIT_STATE_MANA, GetUnitState(udg_PCD_Unit, UNIT_STATE_MANA) + udg_PCD_Manacost)
        endif
    endif
    call SetPlayerAlliance(Player(14), GetOwningPlayer(udg_PCD_Unit), ALLIANCE_PASSIVE, false)
  
    return false
endfunction

function Trig_Passive_Cooldown_System_LastInit takes nothing returns nothing
    set udg_PCD_DummyCaster = CreateUnit(Player(14), udg_PCD_DummyCasterId, 0, 0, 0)
    call SetHeroLevel(udg_PCD_DummyCaster, 6, false)
    call UnitAddAbility(udg_PCD_DummyCaster, udg_PCD_IndicatorStartId)
    call SelectHeroSkill(udg_PCD_DummyCaster, udg_PCD_IndicatorStartId)
    call UnitAddAbility(udg_PCD_DummyCaster, udg_PCD_ValidTargetCheckId)
    call DestroyTimer(GetExpiredTimer())
endfunction

//===========================================================================
function InitTrig_Passive_Cooldown_System takes nothing returns nothing
    set gg_trg_Passive_Cooldown_System = CreateTrigger()
    set udg_PCD_Hashtable = InitHashtable()
    call TimerStart(CreateTimer(), 0, false, function Trig_Passive_Cooldown_System_LastInit)
    call TriggerAddCondition(gg_trg_Passive_Cooldown_System, Condition(function Trig_Passive_Cooldown_System_Execute))
endfunction
-----------------------------------------------------------------------------
Using this System Sample
-----------------------------------------------------------------------------
This trigger will make all units with Hardened Skin to go into cooldown
  • Trigger Cooldown 1
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Level of Hardened Skin (Mountain Giant) for (Matching unit)) Greater than 0)) and do (Actions)
        • Loop - Actions
          • -------- Set the unit --------
          • Set PCD_Unit = (Picked unit)
          • -------- Set the original ability --------
          • Set PCD_Ability = Hardened Skin (Mountain Giant)
          • -------- Set the fake ability based on Spell Shield --------
          • Set PCD_DummyAbility = Hardened Skin (For PCD System)
          • -------- PCD_Time = How much time you want the spell to be on cooldown --------
          • -------- It must match the PCD_DummyAbility 'Stats - Cooldown' --------
          • Set PCD_Time = 5.00
          • -------- Set the manacost of the ability --------
          • Set PCD_Manacost = 0.00
          • Trigger - Run Passive Cooldown System <gen> (checking conditions)

-----------------------------------------------------------------------------
Changelog
-----------------------------------------------------------------------------
v1.00 - [10 October 2015]
- Initial Release

v1.01 - [15 October 2015]
- Changed the name to "Passive Cooldown System" from "Trigger Cooldown System"
- Added a new system ability that will check if PCD_Unit is targetable instead of using PCD_IndicatorStart for that. That way, the buff will no longer be applied and removed.
- Fixed a handle reference leak.
- Made the configuration GUI.
- System Core is added as a condition in a trigger for faster execution.

v1.02 - [17 October 2015]
- Made the system works on Invulnerable Units.
- No longer pause the timer before destroying it.

v1.03 - [8 January 2016]
- Now works on all types of Invulnerability, Spell Immune, Structures, Mechanical and Ancient units.

v1.04 - [20 August 2016]
- Activating the system no longer poses a threat/alert to the unit.




Keywords:
passive cooldown system
Contents

Passive Cooldown System 1.04 (Map)

Reviews
17th Oct 2015 Bribe: Approved. Works very smoothly! This is a nice way to standardize triggered cooldowns. (Please remove the shadow from your dummy unit, it is quite distracting in the demo).

Moderator

M

Moderator

17th Oct 2015
Bribe: Approved. Works very smoothly! This is a nice way to standardize triggered cooldowns.

(Please remove the shadow from your dummy unit, it is quite distracting in the demo).
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
After reading the name of the system I thought it was a a system that disabled a trigger and enabled it after X seconds.

I am not the biggest fan of this system as I hate everything that requires object editor work.
To begin with, I don't even get the point of a dummy ability here.
If the spell is triggered, it is not needed. If the spell is made in the object editor, I think you can work around that by using the event "begins casting a spell" and then order the unit to stop if spell is on cooldown.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
To begin with, I don't even get the point of a dummy ability here.
The point of the dummy ability is to make the Ability go into cooldown. If I just removed the ability for a period of time, it looks ugly. So I needed to make the ability appears it is on cooldown and this is the solution.
If the spell is triggered, it is not needed. If the spell is made in the object editor, I think you can work around that by using the event "begins casting a spell" and then order the unit to stop if spell is on cooldown.
It won't show the cooldown indicator.

Here are some of the reasons why I made this system.
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/passive-ability-cooldown-121471/

Passive skill with cooldown

Trigger cooldown on passive ability

http://www.hiveworkshop.com/forums/triggers-scripts-269/can-passive-ability-has-cooldown-179885/
 
Level 11
Joined
Dec 3, 2011
Messages
366
The point of the dummy ability is to make the Ability go into cooldown. If I just removed the ability for a period of time, it looks ugly. So I needed to make the ability appears it is on cooldown and this is the solution.

It won't show the cooldown indicator.

Here are some of the reasons why I made this system.
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/passive-ability-cooldown-121471/

Passive skill with cooldown

Trigger cooldown on passive ability

http://www.hiveworkshop.com/forums/triggers-scripts-269/can-passive-ability-has-cooldown-179885/

No No. Use timer and remove/re-add ability to reset its cooldown.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Fixes:

local unit u needs to be nulled at the end of the expire function.
I think this will cause micro-slows on the cooldown unit, but I could be wrong there.

Should be configurable:

- owning player of dummy unit
- order ID of dummy spell
- The buff 'Bslo'

Recommendations:

Since you intend for this to be used by GUI users, I recommend making the configurables in a GUI trigger so users can select the unit type and ability ID without looking up the rawcode.

The trigger should use a condition instead of action as it's faster. Have the GUI user do "checking conditions" instead of ignoring them.

Overall, this has potential to be a decent cooldown simulator. However, it requires massive amounts of user configuration and that's not that awesome. I don't think this will get more than a 3/5 rating as it's not sufficient to break the mold.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
No No. Use timer and remove/re-add ability to reset its cooldown.

This system's aim is not to reset a cooldown.
Known bug: all buffs diappear when you trigger the cooldown of a spell
Would be a perfect system if you fixed that.

I'll take a look.


Fixes:

local unit u needs to be nulled at the end of the expire function.
Yep, I should have double checked.
I think this will cause micro-slows on the cooldown unit, but I could be wrong there.
Not at all, I instantly removed ithe Buff.

Should be configurable:

- owning player of dummy unit
- order ID of dummy spell
- The buff 'Bslo'
- why? For the Spell Shield to activate, the caster must be an enemy
- Slow is one of the best spell to trigger Spell Shield because it has no projectile so I don't see why you would configure that.
- Same reason as above

Since you intend for this to be used by GUI users, I recommend making the configurables in a GUI trigger so users can select the unit type and ability ID without looking up the rawcode.!
Make sense, though it will require another trigger.

The trigger should use a condition instead of action as it's faster. Have the GUI user do "checking conditions" instead of ignoring them.
I thought using action would make it more GUI friendly. Ok, will change that too.

Overall, this has potential tobe a decent cooldown simulator. However, it requires massive amounts of user configuration and that's not that awesome. I don't think this will get more than a 3/5 rating as it's not sufficient to break the mold.
Well, you only need to make Dummy Abilities for spells that you want to trigger the cooldown. Example in your map, you have overall 20 spells but only two of those needs to have it's cooldown triggered, then only 2 extra Dummy Ability. The point is, it is a workaround to the links I gave in my earlier post.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
Known bug: all buffs diappear when you trigger the cooldown of a spell
Actually I was a bit wrong about this, if in any game a player slows an enemy unit for 60 seconds and then that unit has an active/passive spell that triggers cooldown (ex:critical strike), it will be triggered, but the slow's effects and buff are already done even if the unit didn't have the slow effects for 60 seconds, so that is broken.
Cannot trigger a cycloned/hidden unit's ability to cooldown
Yes you can.(tested it) Any "units in region" and "units in range"...
  • Unit Group - Pick every unit in (Units in (Region) and do (Actions)
  • Unit Group - Pick every unit in (Units within X of Region) and do (Actions)
...won't detect locusted and hidden units. But cycloned units can be detected.

You can detect the former by "units of type" or any "units owned by player" function.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Hmm, if I made a custom Buff based on slow, I think the original 'Bslo' won't get affected. I might be wrong though. I think I will also change the name to Passive Cooldown System.

EDIT:
The other things you mentioned Bribe. I need to have all issues clear to have it all fixed in one update. If you don't tell me the reason of some of your suggestion (the configurable part), then I won't follow it. But most likely scenario is after updating it without following the configurable part, you won't approve it and I will end up updating again.

Is this system really not useful? If that's the case I will just remove it. No point in putting effort to something useless.

Yes you can.(tested it) Any "units in region" and "units in range"...
  • Unit Group - Pick every unit in (Units in (Region) and do (Actions)
  • Unit Group - Pick every unit in (Units within X of Region) and do (Actions)
...won't detect locusted and hidden units. But cycloned units can be detected.

You can detect the former by "units of type" or any "units owned by player" function.
You can detect it via trigger but if it is a cycloned unit, you cannot target it so the cooldown won't start. That is why there is an initial check to see if it is targetable first before doing the necessary actions.
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Ah I see now that you edited your post before this. Don't worry, you fixed the main thing which was the leaky handle index. Tomorrow morning (European morning) I will run more tests. The code looks good and any further changes to it won't affect the upcoming revised mod review. As long as the slow ability doesn't get cut short by this any more, then this is ready for prime time.

And you're right about the setup of the ability. Only a small number of dummy abilities would need to get copied tooltips and icons, most likely.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
There is no castable buff-placer that doesn't override others based on the same one. So you will inevitably risk collisions with at least 1 ability.

I like that you made this system for general use. I've been wanting to make something like this for a long time, but never bothered enough. Also, I would probably not make mine GUI-friendly.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
There is no castable buff-placer that doesn't override others based on the same one. So you will inevitably risk collisions with at least 1 ability.
Not at all. I tested it placing a Slow Buff first before triggering the cooldown and it works fine.. It doesn't remove the initial Slow Buff.

I like that you made this system for general use. I've been wanting to make something like this for a long time, but never bothered enough. Also, I would probably not make mine GUI-friendly.

This was fairly easy to do in JASS or vJass in my opinion because of timer's ease of use in Jass so that's why I made it GUI-friendly.


Spell updated to v1.02 to make it work on Invulnerable units and removed the PauseTimer(t) before destroying it.

EDIT:
Please remove the shadow from your dummy unit, it is quite distracting in the demo
Will do. Done
 
Last edited:
Level 29
Joined
Mar 9, 2012
Messages
1,557
In the test map after commanding the hardskin to cooldown multiple times, Sorceress suddenly begin to slow everyone else, our own troops. Up until that point she never cast a thing unless ordered. Dont know what exactly happent.
Another thing is where giant getting attacked with magic dmg whilst spell resist skin is in cd can reset it's cd but is happening randomly, i believe its only when under constant fire and having slow debuff.

Can this be used with offensive passives like catapult's Flaming Boulder or wyvern rider's Envenomed Spears ?
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Hmmm, I tried to recreate both of what you said, but it doesn't happen to me. It works fine as intended. The only issue I know is, some graphic/visual glitch when the Blink is supposed to be on cooldown but it doesn't appear so, then after a few millisecond, it eventually goes into cooldown but it is already halfway to completion. It's like the cooldown visuals got delayed.

I can't recall those abilities you mentioned, but try this if it is attack-based.
 
Last edited:
Level 22
Joined
Feb 6, 2014
Messages
2,466
how to make passive crit back to the icons
If you mean making an passive critical ability with cooldown, then you need to trigger the critical itself using a DDS.
When damage is receive and damage type is PHYSICAL, ability level of crit ability from damage source > 0 and when the chance value meets the requirement, manipulate the damage (e.g. damageTaken*critFactor) then apply this system to make it go on cooldown. While on cooldown, it will never proc because ability level of crit ability from damage source will always be zero at that time (This system temporarily removes the ability then re-add it when the cd is finished).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Gotta come back to be nitpicking... but this causes units to be "under attack".
So if I use this to activate a cooldown of my passive ability (which is activated by moving for example), and my unit is off screen, the game assumes that my unit is under attack and gives the warnings.
Same for the hero icons that start to flicker red. (Which you cant really notice in your test map as you activate the warden ability by attacking).

To fix it, set the ALLIANCE_PASSIVE from the dummie's perspective to true (not the other way around).
To avoid problems with whatever people may come up with, you set it to true just before you order him to use the spell and set it to false immdiately after that.

This brings us another problem. The dummy cant target allied units.
Now I think I said this before, but if I am not mistaken "air,ground,hero,nonhero,structure,invulnerable,vulnerable,ward" is the best way to make something be able to target EVERYTHING. (Your settings cant hit ward classified units either.)

Hmm... lets see, that is 1 for finding the problem, 1 for solving the problem, 1 for mentioning the underlying glitch and 1 for the fix...
You owe me 4 reps.

@Moderator
#unapprove
 
Last edited:
Level 22
Joined
Feb 6, 2014
Messages
2,466
Hmmm, I wonder how I missed to noticed that.
EDIT: Oh wait, I test my maps with no sound. But the flickering in the minimap is unforgivable to miss.

Will update this soon, no need to rush into putting this in the Substandard section.

You owe me 4 reps.
I must spread first.

EDIT:
Done! Thanks Wietlol for the suggested solution, you saved me some time. Also added Xonok to the Credit lists.
 
Last edited:
Level 8
Joined
Jun 24, 2016
Messages
30
Flux
released a new version of this system, in phantom assiasin always retraces icon pack and get rid of these global variables are disgusting to look at, choose either hash or global variables


Flux
get global variables, and make the ability to Crete I need.
 
Last edited by a moderator:
  • Venerable Vintage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • (Current research level of Venerable Vintage for (Owner of DamageEventSource)) Equal to 1
      • (Unit-type of DamageEventSource) Equal to Brawler
      • (Level of Venerable Vintage for DamageEventSource) Equal to 1
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource)) Equal to True
    • Actions
      • Set TempUnit = DamageEventSource
      • Set TempPoints[1] = (Position of TempUnit)
      • -------- Cooldown --------
      • Set PCD_Unit = TempUnit
      • Set PCD_Ability = Venerable Vintage
      • Set PCD_DummyAbility = (COOLDOWN) Venerable Vintage
      • Set PCD_Time = 20.00
      • Set PCD_Manacost = 0.00
      • Trigger - Run Passive Cooldown System <gen> (checking conditions)
      • -------- Cooldown --------
      • Unit - Create 1 Dummy Caster for (Owner of TempUnit) at TempPoints[1] facing Default building facing degrees
      • Unit - Add Dummy - Venerable Vintage to (Last created unit)
      • Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy TempUnit
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Animation - Play TempUnit's stand victory animation
      • Animation - Queue TempUnit's stand ready animation
      • Special Effect - Create a special effect attached to the overhead of TempUnit using Chen_BrawlersDrink.mdx
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoints[1])
This trigger gives "Brawler" units a minor regen boost every few seconds after landing an attack. However, the cooldown didn't happen on the first time the trigger fires, but works on the second time. After that, it still doesn't work on the first time, but successfully start the cooldown again on the second time.
Why?
 
Level 16
Joined
May 2, 2011
Messages
1,345
If the spell is made in the object editor, I think you can work around that by using the event "begins casting a spell" and then order the unit to stop if spell is on cooldown.
This might be cool except for Auto cast abilities. Necrmonacer raise dead and shaman bloodlust will probably be spammed forever. Their cast animation will be played again and again.

Edit: not probably, but definitely; just tried.
 
Last edited:
a question, I am using this with DAMAGE ENGINE, I have been able to use the system normally. How do I go about extending the dummy skill CD? I'm considering DamageEvent = 1.00, but I have no idea how to increase the dummy skill CD.

Can I do it with the "set CD" action of the WE, or I need to alter some system variable (could it be that the system has its own counter?)
 
Level 3
Joined
Aug 25, 2018
Messages
29
Heya! Lookin for some pro help:

I have imported the system successfully, it's awesome thank you! great work!

Im still working on my Morale system which is basically GUI and I'm gonna upload it soon here so you all can take a look and help me if you want.. but i'd like to keep swinging at it myself as I learn...

It's heavily based on the Warhammer Fantasy (6th edition) Leadership system.

It's basically a passive ability most units will have that has 10 levels... and certain events cause a Morale Test which will "roll (a % chance) against their current [Morale] level" to determine if the unit has the will to keep fighting or not. The higher their [Morale] level the higher their odds of succeeding. If the unit fails, it becomes neutral for a period of time and is ordered a move command to a random point, before becoming rescuable.

One of the events that will cause a Morale Test for a unit is simply the unit being attacked. However, I do not want every single attack to cause a Morale Test, this would be a lot... I want an attack on a unit to trigger a single Morale Test, and then put the unit's passive [Morale] ability on a cooldown. While on cooldown, other events that might cause a Morale Test for a unit will still do so, but attacks will not.

Here is the Number breakdown I'm working with:

Morale Test Stats:
if unit Morale = 10 - 3% fail chance - unit becomes rescuable after 3 sec
if unit Morale = 9 - 4.5% fail chance - unit becomes rescuable after 4 sec
if unit Morale = 8 - 6% fail chance - unit becomes rescuable after 5 sec
if unit Morale = 7 - 7.5% fail chance - unit becomes rescuable after 6 sec
if unit Morale = 6 - 9% fail chance - unit becomes rescuable after 7 sec
if unit Morale = 5 - 10.5% fail chance - unit becomes rescuable after 8 sec
if unit Morale = 4 - 12% fail chance - unit becomes rescuable after 9 sec **if a non-Hero unit breaks/(becomes neutral) with Morale of 4 or lower, it can be rescued by all players (choosing to betray it's previous owner).
if unit Morale = 3 - 13.5% fail chance - unit becomes rescuable after 10 sec
if unit Morale = 2 - 15% fail chance - unit becomes rescuable after 11 sec
if unit Morale = 1 - 20% fail chance - unit becomes rescuable after 12 sec

The cooldowns:
if unit Morale = 10 - [Morale] goes on 12 sec cooldown.
if unit Morale = 9 - [Morale] goes on 11 sec cooldown.
if unit Morale = 8 - [Morale] goes on 10 sec cooldown.
if unit Morale = 7 - [Morale] goes on 9 sec cooldown.
if unit Morale = 6 - [Morale] goes on 8 sec cooldown.
if unit Morale = 5 - [Morale] goes on 7 sec cooldown.
if unit Morale = 4 - [Morale] goes on 6 sec cooldown.
if unit Morale = 3 - [Morale] goes on 5 sec cooldown.
if unit Morale = 2 - [Morale] goes on 4 sec cooldown.
if unit Morale = 1 - [Morale] goes on 3 sec cooldown.

I initially thought that the Blink ability in this test map for the Passive Cooldown System was actually very similar to what I wanted to do. Unfortunately it is not an easy copy-pasta. I am struggling with the Variable: MapDemo_Lvl. I don't understand what it is doing, and am now wondering if I will have to create one for each unit that undergoes a Morale Test since different units might be at different levels of [Morale] simultaneously.

I'd apprecieate any thoughts on how I would go about starting to make a trigger that would accomplish what I have mentioned above...
 
Level 10
Joined
Mar 4, 2016
Messages
186
This trigger gives "Brawler" units a minor regen boost every few seconds after landing an attack. However, the cooldown didn't happen on the first time the trigger fires, but works on the second time. After that, it still doesn't work on the first time, but successfully start the cooldown again on the second time.
Why?

I have the same problem with Yours Truly, is there something wrong with the importation?
 
Top