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

[Wurst] Execute, a high-level library for making flashy spells

link

Execute is a library for making flashy/cinematic style abilities, typically where a caster kills a target in some devastating/spectacular way.

Encoding such spells usually requires to manage a state machine, where each instance of the spell effect has a series of sub-effects that compose together. Along the way, the author must handling things like premature death of the target, or perhaps interruption is something encoded into the sequence itself, which is useful for boss fights.

Example code looks like the following:

Wurst:
constant seq = new LinkedList<ExecuteExecutable>()
   ..add(new ExecuteLockTarget())
   ..add(new ExecuteLockCaster())
   ..add(new ExecuteAnimate(UnitAnimations.HeroBloodElf.spellChannel.idx))
   ..add(new ExecuteLightning(3.5, "AFOD"))
   ..add(new ExecuteFxTarget(Abilities.soulBurnbuff))
   ..add(new ExecuteWait(.5))
   ..add(new ExecuteFxCaster(Abilities.obsidianRegenAura))
   ..add(new ExecuteKnockup(1500.))
   ..add(new ExecuteWait(.65))
   ..add(new ExecuteForgetTargetVelocity())
   ..add(new ExecuteWait(.1))
   ..add(new ExecuteFxTarget(Abilities.darkPortalTarget))
   ..add(new ExecuteKnockArcToCaster(1400.))
   ..add(new ExecuteAnimate(UnitAnimations.HeroBloodElf.spell.idx))
   ..add(new ExecuteWait(.1))
   ..add(new ExecuteUnlockCaster())
   ..add(new ExecuteFxTarget(Abilities.bloodImpact))
   ..add(new ExecuteWait(1.))
   ..add(new ExecuteFxTarget(Abilities.bloodImpact))
   ..add(new ExecuteWait(1.))
   ..add(new ExecuteFxTarget(Abilities.bloodImpact))

init
   EventListener.add(EVENT_PLAYER_UNIT_SPELL_EFFECT) ->
       let target = EventData.getSpellTargetUnit()
       EventData.getTriggerUnit().issueImmediateOrder("stop")

       if EventData.getSpellAbilityId() == 'AHbn' or EventData.getSpellAbilityId() == 'AHhx'
           new Execute(
               EventData.getTriggerUnit(),
               target,
               seq
           )

Demo:



To use this library, just add execute-wurst to your wurst.build:

Code:
$ cat MyProject/wurst.build
---
projectName: WurstProject
dependencies:
- https://github.com/wurstscript/wurstStdlib2
- https://github.com/Cokemonkey11/execute-wurst
 
Top