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

[Trigger] Need an ability lock

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I have a trigger command -Lock

WHAT IT DOES: (1)Locks all abilites on all the hero the trigger player controls.
(2)Gives the triggering player an additional 2 gold per kill income.
(3)Halves Respawn time.
WHAT I NEED: Was hoping i could get help on how to lock all abilites owned by all heros of the triggering player. I dont want to remove them. Just disable them. Possible?
 
Level 9
Joined
Jun 7, 2008
Messages
440
uh i was kinda hoping it would be greyed out, like when the hero is entagled. certain spells wont work. But i would want that for all of them. Its also gotta work for passive abilites, such as evasion, poison sting, critical strike, E.T.C
 
Level 11
Joined
Nov 15, 2007
Messages
781
Just make all the spells require a dummy unit which is removed when the trigger is run or created when unlocked. And make sure to turn "Check Dependencies" on.
 
Level 9
Joined
Jun 7, 2008
Messages
440
I have alot of spells in this map. Including many customised/trigger enhanced abilites. Will this still work? If it does what tutorial would i need to view in order to find out how to do this?
 
Level 11
Joined
Nov 15, 2007
Messages
781
Making it the base spell require a unit would gray it out and make it completely uncastable unless you had that unit. So it'd work for all spells you set to require that unit, but it wouldn't disable it for a single hero; all units owned by that player will be unable to cast the abilities that require said dummy unit. The triggering is simple; just go to the spell in the object editor, and make it require a dummy unit. Then when you want the hero to be able to cast the spell, make sure they own that type of unit; otherwise, remove it.

Edit: Oh, and for the income and respawn things just create a boolean variable that turns "True" when the lock is put in place or "False" when it's disabled. Then for the bonus income/respawn time, check that the boolean is true or false for the added effects.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Use silence, perhaps? Spawn a dummy unit and silence that hero (if you don't want a specific duration, you can keep that unit silenced permanently by setting the duration to 0). If you do choose to have infinite duration, you can remove the silence buff at any time by trigger.

In GUI, there's a remove buff function.
In JASS, it's UnitRemoveAbility().
 
Level 11
Joined
Nov 15, 2007
Messages
781
Silence is the simplest solution if you want every ability disabled. And you need a secondary trigger to re-silence periodically for when the unit respawns/is dispelled/anything similar.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Well, you COULD also use Doom, which could be specified to be un-dispellable. Didn't they do something like that in DotA?
 
Level 11
Joined
Nov 15, 2007
Messages
781
Doom also disables some passive abilities, though.

Edit: Actually that's probably a plus. I notice he didn't specify spells, so if all passives also need to be disabled doom and silence might both be inadequate.
 
Level 12
Joined
Mar 16, 2006
Messages
992
I recommend the requirements approach.

Or swapping a passive disabled icon ability that does nothing temporarily.
 
Level 9
Joined
Jun 7, 2008
Messages
440
How doi create the unit when the lock is off?
  • Events
    • Player - Player 1 (red) types -lockoff as an exact match
  • Conditions
  • Actions
    • Unit - Create 1 dummy for (triggering player) at region1 facing default building
Like this?
 
Status
Not open for further replies.
Top