• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Selective Spell Shield

Selective Spell shield allows you to have spells that bypass the Amulet of Spell Shield ability. Note that bypassing this way only works for spells that impact instantly. It won't work on Storm Bolt for example unless you set the missile speed to 0. I thought this would be ideal to be used alongside stun systems and such.

Import Instructions:

Import "Selective Spell Shield" trigger folder

Set SHIELD_ID to the ID of your spell shield ability.

Configure conditions as desired
Contents

Selective Spell Shield (Map)

Reviews
Wrda
So it's completely limited to instant spells, or missile speed 0, hm. I guess that's an interesting find. I would put the static method Filters before onPeriod, just for user convinience. The name 'onPeriod' implies the timer being periodic, which...

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
So it's completely limited to instant spells, or missile speed 0, hm. I guess that's an interesting find.
I would put the static method Filters before onPeriod, just for user convinience.
The name 'onPeriod' implies the timer being periodic, which isn't the case, I would rather rename that.

Approved
 

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,522
This looks decent. The code could use some tidying but it appears to work as expected. Here is some wurst code for a similar effect:

Wurst:
package SpellShieldWithCustom
import Abilities
import DamageEvent
import SoundUtils
import Castles

constant SHIELD_SOUND = new SoundDefinition(Sounds.spellShieldImpact1)

init
    DamageEvent.addListener(0) ->
        let target = DamageEvent.getTarget()
        let event_t = DamageEvent.getType()
        let damage = DamageEvent.getAmount()
        // To selectively spell shield, set the cooldown here to 999
        // Then use nullTimer() -> closure to unset it as desired
        if (
            target.getAbilityLevel(ID_EXASPERATION_SPELL_SHIELD) > 0
            and event_t != DamageType.ATTACK
            and target.getAbilityCooldownRemaining(ID_EXASPERATION_SPELL_SHIELD) <= 0.
            and damage > 0.
            // Your custom conditions here
        )
            DamageEvent.setAmount(0.)
            SHIELD_SOUND.playOnPoint(target.getPos3Real()).snd.setVolume(127)
            flashEffect(Abilities.spellShieldCaster, target.getPos())
            target.setAbilityCooldown(ID_EXASPERATION_SPELL_SHIELD, 1, EXASPERATION_SPELL_SHIELD_COOLDOWN)
 
Top