• 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.

Spell Shield with buff and trigger help

Status
Not open for further replies.
Level 8
Joined
Apr 23, 2011
Messages
322
I made a spell block hero ability from item ability "Spell Shield" and some problems appeared.
1.You can activate ability and set it to cooldown.
2.Hero doesn't have "Spell Shield" buff in status.
So, all I need is a way to add a buff when it is not in cooldown and to make it "clickless".
Second, I need someone to check if my trigger is MUI/GUI and leakless since I have no idea how to know that:
  • Spell Block
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target unit of ability being cast) has buff Spell Shield) Equal to True
    • Actions
      • Set AAAEnemyCaster = (Triggering unit)
      • Set AABlocker = (Target unit of ability being cast)
      • Set aPosition = (Position of (Target unit of ability being cast))
      • Set aAbility = (Ability being cast)
      • Unit - Create 1 Blocker for (Owner of AABlocker) at aPosition facing 270.00 degrees
      • Set AAABlockUnit = (Last created unit)
      • Unit - Add aAbility to AAABlockUnit
      • Unit - Set level of aAbility for AAABlockUnit to 1
      • Unit - Order AAABlockUnit to Human Priest - Inner Fire AAAEnemyCaster
      • Unit - Order AAABlockUnit to Human Sorceress - Slow AAAEnemyCaster
      • Unit - Order AAABlockUnit to Human Sorceress - Polymorph AAAEnemyCaster
      • Unit - Order AAABlockUnit to Human Dragonhawk Rider - Aerial Shackles AAAEnemyCaster
      • Unit - Order AAABlockUnit to Human Blood Mage - Banish AAAEnemyCaster
      • Unit - Order AAABlockUnit to Human Mountain King - Storm Bolt AAAEnemyCaster
      • Unit - Order AAABlockUnit to Orc Raider - Ensnare AAAEnemyCaster
      • Unit - Order AAABlockUnit to Orc Shaman - Purge AAAEnemyCaster
      • Unit - Order AAABlockUnit to Orc Far Seer - Chain Lightning AAAEnemyCaster
      • Unit - Order AAABlockUnit to Orc Shadow Hunter - Hex AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Tree Of Life - Entangle AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Tree Of Life - Entangle (Instant) AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Dryad - Abolish Magic AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Druid Of The Talon - Faerie Fire AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Druid Of The Talon - Cyclone AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Keeper Of The Grove - Entangling Roots AAAEnemyCaster
      • Unit - Order AAABlockUnit to Night Elf Warden - Shadow Strike AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Crypt Fiend - Web AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Necromancer - Unholy Frenzy AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Necromancer - Cripple AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Banshee - Curse AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Crypt Lord - Impale AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Death Knight - Death Coil AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Dreadlord - Sleep AAAEnemyCaster
      • Unit - Order AAABlockUnit to Undead Lich - Frost Nova AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral - Firebolt AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral - Hurl Boulder AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral - Parasite AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral Naga Sea Witch - Forked Lightning AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral Pandaren Brewmaster - Drunken Haze AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral Alchemist - Acid Bomb AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral Fire Lord - Soul Burn AAAEnemyCaster
      • Unit - Order AAABlockUnit to Neutral Pit Lord - Doom AAAEnemyCaster
      • Unit - Add a 2.00 second Generic expiration timer to AAABlockUnit
      • Custom script: call RemoveLocation( udg_aPosition )
I'm not in a hurry...
 
Level 7
Joined
Jan 28, 2012
Messages
266
you get change your trigger to this, to make it look cleaner as well as more efficient.
  • Spell Block
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • ((Target unit of ability being cast) has buff Spell Shield) Equal to True
  • Actions
  • Set AAAEnemyCaster = (Triggering unit)
  • Set AABlocker = (Target unit of ability being cast)
  • Set aPosition = (Position of (Target unit of ability being cast))
  • Set aAbility = (Ability being cast)
  • Unit - Create 1 Blocker for (Owner of AABlocker) at aPosition facing 270.00 degrees
  • Set AAABlockUnit = (Last created unit)
  • Unit - Add aAbility to AAABlockUnit
  • Unit - Set level of aAbility for AAABlockUnit to 1
  • Custom Script: call IssueTargetOrderById(udg_AAABlocker,GetUnitCurrentOrder(udg_AAAEnemyCaster),udg_AAAEnemyCaster)

Unit - Add a 2.00 second Generic expiration timer to AAABlockUnit
Custom script: call RemoveLocation( udg_aPosition )[/trigger]

now onto your original questions, for how to make it clickless, just add a trigger that detects when a unit is issued order spellshield and order that unit to stop, and then display some sort of Warning message to the player.
 
Level 8
Joined
Apr 23, 2011
Messages
322
you get change your trigger to this, to make it look cleaner as well as more efficient.
  • Spell Block
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • ((Target unit of ability being cast) has buff Spell Shield) Equal to True
  • Actions
  • Set AAAEnemyCaster = (Triggering unit)
  • Set AABlocker = (Target unit of ability being cast)
  • Set aPosition = (Position of (Target unit of ability being cast))
  • Set aAbility = (Ability being cast)
  • Unit - Create 1 Blocker for (Owner of AABlocker) at aPosition facing 270.00 degrees
  • Set AAABlockUnit = (Last created unit)
  • Unit - Add aAbility to AAABlockUnit
  • Unit - Set level of aAbility for AAABlockUnit to 1
  • Custom Script: call IssueTargetOrderById(udg_AAABlocker,GetUnitCurrentOrder(udg_AAAEnemyCaster),udg_AAAEnemyCaster)

Unit - Add a 2.00 second Generic expiration timer to AAABlockUnit
Custom script: call RemoveLocation( udg_aPosition )[/trigger]

now onto your original questions, for how to make it clickless, just add a trigger that detects when a unit is issued order spellshield and order that unit to stop, and then display some sort of Warning message to the player.

Thanks for help, except
  • Custom script: call IssueTargetOrderById(udg_AAABlocker,GetUnitCurrentOrder(udg_AAAEnemyCaster),udg_AAAEnemyCaster)
doesn't work for some reason.It says:"Line 1680: Expected a name" and if I use custom script in my new trigger it would look like this (instead of a buff, there is a chance):
  • Spell Blocknew
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Target unit of ability being cast))) Equal to True
      • ((Target unit of ability being cast) has buff Magic Sentry buff) Equal to True
      • (Random real number between 1.00 and 100.00) Less than or equal to (10.00 + (4.00 x (Real((Level of Magic Sentry - [|cffffcc00Z|r] new for (Target unit of ability being cast))))))
    • Actions
      • Hero - Create Rune of Shielding and give it to (Target unit of ability being cast)
      • Set AAAEnemyCaster = (Triggering unit)
      • Set AABlocker = (Target unit of ability being cast)
      • Set aPosition = (Position of (Target unit of ability being cast))
      • Set aAbility = (Ability being cast)
      • Unit - Create 1 Blocker for (Owner of AABlocker) at aPosition facing 270.00 degrees
      • Set AAABlockUnit = (Last created unit)
      • Unit - Add aAbility to AAABlockUnit
      • Unit - Set level of aAbility for AAABlockUnit to (Level of (Ability being cast) for AAAEnemyCaster)
      • Custom script: call IssueTargetOrderById(udg_AAABlocker,GetUnitCurrentOrder(udg_AAAEnemyCaster),udg_AAAEnemyCaster)
      • Unit - Add a 2.00 second Generic expiration timer to AAABlockUnit
      • Custom script: call RemoveLocation( udg_aPosition )
.
 
Last edited:
Level 7
Joined
Jan 28, 2012
Messages
266
  • Custom script: call IssueTargetOrderById(udg_AAABlockUnit,GetUnitCurrentOrder(udg_AAAEnemyCaster),udg_AAAEnemyCaster)
the problem was variable name i was using, i wasn't using one of your ones, if you use the above script it should work
 
Status
Not open for further replies.
Top