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

[Solved] Spell not working

Status
Not open for further replies.
Level 3
Joined
Jan 4, 2009
Messages
45
Hello guys. I just made a spell for my blademaster, and it is not working and I can't figure out why.

  • Twisting Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Twisting Slash
    • Actions
      • Set Tshalsh_loc = (Position of (Casting unit))
      • Unit Group - Pick every unit in (Units within 240.00 of Tshalsh_loc matching ((((Picked unit) is alive) Equal to True) and (((Owner of (Picked unit)) is an ally of (Owner of (Casting unit))) Equal to False))) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Casting unit) to damage (Picked unit), dealing (4.00 + ((Real((Strength of (Casting unit) (Include bonuses)))) / 2.00)) damage of attack type Normal and damage type Normal
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\NightElf\NightElfBlood\NightElfBloodArcher.mdl
          • Special Effect - Destroy (Last created special effect)
      • Animation - Queue (Casting unit)'s stand animation
      • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) - 3.00)
Yes, I know that the trigger leaks, I will fix that later. Now I need help to make this spell function. Thx very much.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
  • Unit Group - Pick every unit in (Units within 240.00 of Tshalsh_loc matching ((((Picked unit) is alive) Equal to True) and (((Owner of (Picked unit)) is an ally of (Owner of (Casting unit))) Equal to False))) and do (Actions)
This line should actually looks like:
  • Custom script: sec bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 240.00 of Tshalsh_loc matching ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an ally of (Triggering player) Equal to False))) and do (Actions)
As you can see (Picked unit) should be replaced with (Matching unit), if you don't, all conditions will return false.
Follow Bribe's mention to improve efficiency, plus remove location leak after performing actions with RemoveLocation().
 
Level 3
Joined
Jan 4, 2009
Messages
45
It works now. I remade the spell in a different way and it works. Thanks for your help +rep.
 
Status
Not open for further replies.
Top