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

Make my Single-Target Buff Spell affect up to 2 units at a time.

Level 3
Joined
Mar 18, 2023
Messages
28
Hello. My problem seems like it should be very easy to fix but I'm new on WE and suck with it. I basically made this quick Buffing spell that adds bonus stats to a targeted unit. It works fine on its own. But I was thinking about changing it so the spell is able to buff up to 2 units at a time (currently have the spell/buff duration at 20 sec and the CD at 10 sec). But since recasting the spell a 2nd time on a different unit also changes the targeted Unit Variable, it leads to the previous target keeping its bonuses forever (and so on if I keep targeting a different unit). If someone can whip up a quick fix for me, I'd appreciate it a lot!

Inspired
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Inspiration
Actions
Set VariableSet InspiredUnit[1] = (Target unit of ability being cast)
Set VariableSet InspiredPos[0] = (Position of InspiredUnit[1])
Special Effect - Create a special effect at InspiredPos[0] using Abilities\Spells\Human\SunderingBlades\SunderingBlades.mdl
Special Effect - Set Scale of (Last created special effect) to 2.00
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_InspiredPos[0])
Unit - Add Inspired STATS to InspiredUnit[1]
Trigger - Turn on Inspired 2 <gen>


Inspired 2
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(InspiredUnit[1] has buff Inspiration Equal to False
Then - Actions
Unit - Remove Inspired STATS from InspiredUnit[1]
Trigger - Turn off (This trigger)
Else - Actions
 
Top