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

Penance-like spell refuses to send more than 1 missile.

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
772
I have a spell like the Penance spell in WoW that should send 3 missiles to the target, if the target is an enemy it should damage the enemy for each missile and if the target is an ally or self then it should heal it for each missile. I have this spell as a hero ability on one of my other maps and there is works like it should but now I want it on my other map but it should be an unit ability instead but then it doesn't work, it only sends 1 missile to the targets or self and nothing more. I can't understand what's wrong. I have checked everything on the dummy abilities and everything is like it should be. If would be very thankful if someone could help me solve this problem.

Spell triggers.
  • Penance 1
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Penance
    • Actions
      • Set VariableSet MoonHealingCaster = (Casting unit)
      • Set VariableSet MoonHealingTarget = (Target unit of ability being cast)
      • Set VariableSet MoonHealingHitCount = 0
      • Trigger - Turn on Penance 2 <gen>
  • Penance 2
    • Events
      • Time - Every 0.66 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MoonHealingHitCount Less than or equal to 3
        • Then - Actions
          • Set VariableSet MoonHealingPoint = (Position of MoonHealingCaster)
          • Unit - Create 1 Spell Cast Dummy (Penance) for (Owner of MoonHealingCaster) at MoonHealingPoint facing Default building facing degrees
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_MoonHealingPoint)
          • Set VariableSet MoonHealingDummy = (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MoonHealingTarget belongs to an ally of (Owner of MoonHealingCaster).) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of MoonHealingCaster) Equal to (Unit-type of MoonHealingTarget)
                • Then - Actions
                  • Unit - Set life of MoonHealingCaster to ((Life of MoonHealingCaster) + (50.00 x 1.00))
                  • Special Effect - Create a special effect attached to the origin of MoonHealingCaster using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
                • Else - Actions
                  • Unit - Add Penance Heal to MoonHealingDummy
                  • Unit - Order MoonHealingDummy to Human Mountain King - Storm Bolt MoonHealingTarget
            • Else - Actions
              • Unit - Add Penance Damage to MoonHealingDummy
              • Unit - Order MoonHealingDummy to Human Mountain King - Storm Bolt MoonHealingTarget
          • Set VariableSet MoonHealingHitCount = (MoonHealingHitCount + 1)
        • Else - Actions
          • Trigger - Turn off (This trigger)
  • Penance 3
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Penance
    • Actions
      • Trigger - Turn off Penance 2 <gen>
      • Unit - Remove MoonHealingDummy from the game
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
biridius is actually mostly correct: your dummy unit is not properly configured to be able to cast instantly, so the trigger is ordering it more quickly than it can cast. You need these settings:
Abilities: Locust, Art - Cast Point: 0.00, Art - Cast Backswing: 0.00, Attacks enabled = None, Death type: Can't raise, does not decay, Speed base = 0, Movement type = None, Food used = 0
Then the dummy can instantly cast anywhere in range without turning to do so.
 
Level 14
Joined
Jul 19, 2007
Messages
772
biridius is actually mostly correct: your dummy unit is not properly configured to be able to cast instantly, so the trigger is ordering it more quickly than it can cast. You need these settings:

Then the dummy can instantly cast anywhere in range without turning to do so.
I tried to do that but it still doesn't work... Anyway I solved the problem to reduce the looping timer to 0.30 instead and then it works.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
You’re right, I thought you were using one dummy unit not one per target. Dummy settings wouldn’t affect if that works or not.

Changing the timer period should not affect whatever is going on. I expect that the issue is still present, you just think it has been fixed.

Also the special effect you create is never destroyed so it is a permanent (but very small) memory leak.
 
Status
Not open for further replies.
Top