Cooldown

FoxWizzy

New Member
Reaction score
3
Hi i need some help whit a spell..
Ok so i have a spell thet replaces the casting unit whit a new unit...adds a life time and then gives back the old unit when it expires...my problen is that the spells has no cooldown...how can i fix this?
It is GUI...i am not that good whit jass.
 

Rushhour

New Member
Reaction score
46
If it isn't a passive ability you don't have to (can't ) trigger it, just look in the object manager under abilities for your spell.
Nearly every spell has a cooldown^^

If it is passive then try to add a condition, for example if a boolean is true for a unit/player/whatever, depends on what you want^^
 

FoxWizzy

New Member
Reaction score
3
This is my trigger it is not passive
Trigger:
  • Ability
    • Event
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Ability
    • Actions
      • Unit - Replace (Casting unit) whit a Footman using the new unit's max life and mana
      • Set U(1) = (Last replaced unit)
      • Selection - Select U(1) for (Owner of U(1))
      • Unit - Add a 135.00 second Generic expiration time to U(1)
      • Wait 136.00 seconds
      • Unit - Replace U(1) whit a Blademaster using the new unit's max life and mana
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
      • Hero - Learn skill for (Last replaced unit): Ability


But the skill "Ability" he learns has no cooldown and if i dont add Hero - learn skill the player needs to add it again

Neven mind i found a way :)
Player disable ability
Wait XX
Player enableability
 

Moridin

Snow Leopard
Reaction score
144
^ The other way you found might not be MUI or even MPI unless you use arrays.
MUI -> Multi-unit instance-able -> Meaning many units can use it at the same time.
MPI -> Multi-player instance-able -> Meaning ONE unit of each player can use it at the same time.

Though...your ability trigger isn't MUI or MPI either.
 

FoxWizzy

New Member
Reaction score
3
Moridin please explain...arrays?

"Set U(2) = Last replaced unit after the replace(from FM to BM)"
And change Last replaced unit whit U(2)...or?
 

BlueMirage

Trust, but doubt.
Reaction score
39
First problem:

Assuming you're removing a Blademaster and replacing it with a footman...

First, the Blademaster you're removing isn't the same as the one you're creating. It's not wierd that they don't have the same cooldowns and hero skills.

Solution:

Save the Blademaster in a unit variable, hide the unit, and when the durarition expires, unhide him.

2nd problem:

You're using ''A unit Begins casting an ability''.
By the time your trigger activates, the cooldown won't have activated.
Instead of using ''A unit Begins casting an ability'', use ''A unit starts the effect of an ability'', because when that event fires, the cooldown has started (Do however note that manacost hasn't, so if your Blademaster comes back with the same amount of mana, then forcibly set his mana to (Current Mana - Mana of the spell being cast) before hiding him).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top