• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Is it possible to temporarily reduce Sight Range?

Status
Not open for further replies.
Hmm... What about by creating a function to replace that unit with the exact same unit but with a different sight range?
 
I have attached a test map

Targeted units will get its sight vision reduced by 500, lasts 10 seconds.

If you doesn't know what each function of those custom script, you can ask me, or even the senior here, good luck :)

TRIGGER
  • Target
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reducing Sight Ability
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • Custom script: call UnitAddAbility(Target, 'A002')
      • Custom script: call TriggerSleepAction(10.00)
      • Custom script: call UnitRemoveAbility(Target, 'A002')
      • Custom script: set Target = null
Gonna explain all of those function:
1. local unit Target = GetSpellTargetUnit() is setting local variable of "Target" by setting Target = (Target unit of ability being cast)
2. call UnitAddAbility(Target, 'A002') is giving the spell book ability to the "Target" (A002 is the Spell Book ability ID)
3. call TriggerSleepAction(10.00) is Wait for 10 seconds (this will make the trigger MUI because we use local variable
4. call UnitRemoveAbility(Target, 'A002') is removing the spell book ability from the "Target"
5. set Target = null is cleaning "leak" in JASS (even setting a unit variable, we will need to null/clean it)
 

Attachments

Last edited:
...but, since it doesn't stack with itself, you will need: http://www.wc3c.net/showthread.php?t=107940

Different abilities of this type stack up and it also has the same glitch as max life/max mana bonus where you can set the ability's level on a unit without it updating the bonus but subtracting the new level's value when the ability is removed.
 
Status
Not open for further replies.
Back
Top