Passive skill with cooldown.

zero9x

Active Member
Reaction score
1
Hi guys, i got a spell like this:

When HERO has been target by a spell, creat a dummy and order dummy to use that spell to CASTER.

But this spell is so strong, then i want make it cooldown-able, can you guys help me :( ?

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of SPELL for (Target unit of ability being cast)) Greater than or equal to (>=) 1
    • Actions
      • Set AACaster = (Casting unit)
      • Set AAUnit = (Target unit of ability being cast)
      • Set AALoc1 = (Position of AAUnit)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Ability being cast) Equal to (==) Knock Shot
          • Then - Actions
            • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Unit - Add Knock Shot to (Last created unit)
            • Unit - Set level of Knock Shot for (Last created unit) to (Level of Knock Shot for AACaster)
            • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt AACaster
          • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Ability being cast) Equal to (==) Lightning Strike
              • Then - Actions
                • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Unit - Add Lightning Strike to (Last created unit)
                • Unit - Set level of Lightning Strike for (Last created unit) to (Level of Lightning Strike for AACaster)
                • Unit - Order (Last created unit) to Neutral Naga Sea Witch - Forked Lightning AACaster
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Ability being cast) Equal to (==) Electron Shock
                  • Then - Actions
                    • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                    • Unit - Add Electron Shock to (Last created unit)
                    • Unit - Set level of Electron Shock for (Last created unit) to (Level of Electron Shock for AACaster)
                    • Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn AACaster
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Ability being cast) Equal to (==) Lightning Storm
                      • Then - Actions
                        • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                        • Unit - Add Lightning Storm to (Last created unit)
                        • Unit - Set level of Lightning Storm for (Last created unit) to (Level of Lightning Storm for AACaster)
                        • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning AACaster
                      • Else - Actions
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Ability being cast) Equal to (==) Storm Hammer
                          • Then - Actions
                            • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                            • Unit - Add Storm Hammer to (Last created unit)
                            • Unit - Set level of Storm Hammer for (Last created unit) to (Level of Storm Hammer for AACaster)
                            • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt AACaster
                          • Else - Actions
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • (Ability being cast) Equal to (==) Telekinetic Grasp
                              • Then - Actions
                                • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                                • Unit - Add Telekinetic Grasp to (Last created unit)
                                • Unit - Set level of Telekinetic Grasp for (Last created unit) to (Level of Telekinetic Grasp for AACaster)
                                • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt AACaster
                              • Else - Actions
                                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • If - Conditions
                                    • (Ability being cast) Equal to (==) Wrath of Nature
                                  • Then - Actions
                                    • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                                    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                                    • Unit - Add Wrath of Nature to (Last created unit)
                                    • Unit - Set level of Wrath of Nature for (Last created unit) to (Level of Wrath of Nature for AACaster)
                                    • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning AACaster
                                  • Else - Actions
      • Custom script: call RemoveLocation(udg_AALoc1)
      • Set AAUnit = No unit
      • Set AACaster = No unit


Knock Shot, Lightning Strike, Electron Shock, Lightning Storm, Storm Hammer..... are spells in my map ;)
Help me plz :(
 

jnZ

I
Reaction score
64
MUI: save information in the units custom value indicating whether the spell is on cooldown or not (set it to 1 after the ability triggered, run a wait, set it to 0 at the end of the wait). Also add a integer condition to only cast the ability when the custom value of the casting unit is 0. NOTE: use a local variable to refer to the casting unit after the wait

MPI: use a boolean that indicates whether the spell is on cooldown or not (set it to true after the ability triggered, run a wait, set it to false at the end of the wait). Also add a boolean condition to only cast the ability when this boolean is false.
 

zero9x

Active Member
Reaction score
1
If i put
Trigger:
  • Then - Actions
    • A
    • B
    • C
    • D
    • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning AACaster
    • Trigger - Turn off (This trigger) <-
    • Wait 1.00 seconds <-
    • Trigger - Turn on (This trigger) <-


So, the skill will has cooldown, and it dont has any bug ?
 

jnZ

I
Reaction score
64
but it would only work with a single unit. as soon as there are at least 2 units with that spell it won't work.
 

vypur85

Hibernate
Reaction score
803
> MUI: save information in the units custom value...

Just add the Triggering unit into a Unit Group, and remove Triggering unit from the group few seconds later. In the primary condition, add a Boolean check to see if the Triggering unit is not in the unit group. I guess this will be simpler.


Then again, no matter how I see this, I can't in any way possible relate this to Passive Skill Cooldown....
 

jnZ

I
Reaction score
64
My impression was that its some kind of passive double-cast ability.
unit group, hash table, custom values, whatever works. well i guess custom value always could cause problems when you also use them in some other way.
 

jnZ

I
Reaction score
64
I'm not sure if I'm right, but you can also use a hashtable for this, isn't it? (I'm kinda new with hashtables)

yeah i already mentioned that in my post earlier. well in my opinion custom values are the easiest solution.
 

Ayanami

칼리
Reaction score
288
yeah i already mentioned that in my post earlier. well in my opinion custom values are the easiest solution.

Various indexing systems use Custom Values to index/deindex units. Thus, Custom Value isn't really the best solution.
 

jnZ

I
Reaction score
64
Various indexing systems use Custom Values to index/deindex units. Thus, Custom Value isn't really the best solution.

i never said its the best. i also mentioned that custom values can easily cause problems when they are already used in other triggers. i simply meant that in my opinion custom values are the user-friendliest to use in terms of difficulty.

well i guess his question was more than answered so lets stop here - it almost sounds like people bitching at each other already.
 

Inflicted

Currently inactive
Reaction score
63
You will want to avoid turning on and off the trigger.

It would be alot easier to suggest solutions if we knew how many units would be using the ability.

It will most probably be MUI in which use a Hashtable or Custom Values as mentioned above.
However I do forsee a problem with using Custom Values in this case, you have quite a handful of abilities there and if you use Custom Values they would have a shared cooldown.

Also another quick comment on making your trigger more efficient, you could just make one IF/ELSE with many conditions and creating the units but then changing the cast order and added ability depending on ability cast. That would make your code abit shorter. Just a thought.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top