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

[Trigger] Spell problem

Status
Not open for further replies.
Level 16
Joined
Jun 24, 2009
Messages
1,409
I'm making a spell for my map but it don't want to work correctly.
This is how it's supposed to work: Heals a target friendly unit then jumps to another unit 2 times. Every eney unit next to the units hit by the spell is entangled. Now it only sends the healing wave once and randomly entangles enemies.
Before anyone mention that I miss the event and the condition, I'm using a system that calls the spell most efficiently. The system works perfectly, all other spells work.

  • Natural Wave
    • Events
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempInt2 = (Spellpower[TempInt] - 9)
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set TempLoc = (Position of Caster)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for (Triggering player) at TempLoc facing Default building facing degrees
          • Unit - Add Natural Wave Dummy to (Last created unit)
          • Unit - Set level of Natural Wave Dummy for (Last created unit) to TempInt2
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave Target
          • Custom script: call RemoveLocation (udg_TempLoc)
          • Set TempLoc = (Position of Target)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 150.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player and do (Actions)
            • Loop - Actions
              • Unit - Create 1 Dummy for (Triggering player) at TempLoc facing Default building facing degrees
              • Unit - Add Amazon AoE Entangle to (Last created unit)
              • Unit - Set level of Amazon AoE Entangle for (Last created unit) to TempInt2
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)
          • Set TempGroup = (Units within 450.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player
          • Set Target = (Random unit from TempGroup)
          • Custom script: call DestroyGroup (udg_TempGroup)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
Does it have a Unit Cast Ability event? If yes then I think Triggering Player is not a good player coz it should return null. Correct me if I'm not right. Should use Owner of unit( Triggering Unit ).
Triggering player does work for that event amazingly.

Now it only sends the healing wave once and randomly entangles enemies.
Nowhere do you test when entangling a unit if the spell has already entangled the unit which might be causing some of the problems. Also make sure that your dummy units are not collidable so as not to push themselves out of range.

As the enumerator conditions are cut off I can not rule out the possibility of a mistake in their logic. Please check them that they are filtering enemies and allies where appropiate.
 
Status
Not open for further replies.
Top