Ability Help

theXact

New Member
Reaction score
0
Hey guys, the following trigger is a little disastrous but I was hoping I could get some help!

The triggers are for 2 spells working together, The first spell 'Haunt' sends out a banshee type thing (storm bolt based), when it hits a target the target is put to sleep and takes damage over time until it wakes up. Once it has awoken the banshee flies back to the caster and heals it for 50% of the damage done (based of deathcoil, each level of deathcoil increases health by 25, level used is determined by custom value of the unit). The problem lies in a passive spell used to make it better, for each level of 'everlasting horrors' the the banshee will bounce once. The problem is 4/5 times it will work fine, but sometimes it will screw up and will only bounce twice when it should have bounced 4 times or any variation.

I was hoping you guys could take a look and shed some light on it cos I just can't figure it out.

Trigger:
  • Haunt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Haunt
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Set HauntCaster = (Triggering unit)
          • Set HauntTarget = (Target unit of ability being cast)
          • If ((Level of Everlasting Horrors for (Triggering unit)) Greater than or equal to 1) then do (Trigger - Turn on Everlasting Horrors <gen>) else do (Do nothing)
          • If ((Level of Everlasting Horrors for (Triggering unit)) Greater than or equal to 1) then do (Set EverlastingJumpCount = 1) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • Trigger - Turn on HauntSleep <gen>
      • Trigger - Turn on HauntSpread <gen>
      • Trigger - Turn on HauntSleepDamage <gen>
      • Trigger - Turn on HauntEnd <gen>


Trigger:
  • HauntSleep
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Haunt (Pause)) Equal to True
              • ((Picked unit) has buff Sleep Haunter) Equal to False
            • Then - Actions
              • Unit - Create 1 Dummy Caster for (Owner of HauntCaster) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit - Add a 0.25 second Generic expiration timer to (Last created unit)
              • Unit - Make (Last created unit) Invulnerable
              • Unit - Add Sleep Haunter to (Last created unit)
              • Unit - Set level of Sleep Haunter for (Last created unit) to (Level of Haunt for HauntCaster)
              • Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
              • Unit Group - Add (Picked unit) to HauntGroup
            • Else - Actions
              • Do nothing


Trigger:
  • HauntSleepDamage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Sleep Haunter) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer((Life of (Picked unit)))) Less than or equal to 50
                • Then - Actions
                  • Unit - Create 1 Dummy Caster for (Owner of HauntCaster) at (Position of (Picked unit)) facing Default building facing degrees
                  • Unit - Add a 0.25 second Generic expiration timer to (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                  • Unit - Add HauntKillBlow to (Last created unit)
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
                  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
                • Else - Actions
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
                  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
            • Else - Actions
              • Do nothing


Trigger:
  • HauntEnd
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HauntGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Sleep Haunter) Equal to False
              • ((Picked unit) has buff Haunt (Pause)) Equal to False
            • Then - Actions
              • Unit - Set life of HauntCaster to ((Life of HauntCaster) - 1.00)
              • Unit - Create 1 Dummy Caster for (Owner of HauntCaster) at (Position of (Picked unit)) facing Default building facing degrees
              • Animation - Change (Last created unit)'s size to (130.00%, 130.00%, 130.00%) of its original size
              • Unit - Add a 0.25 second Generic expiration timer to (Last created unit)
              • Unit - Make (Last created unit) Invulnerable
              • Unit - Add HauntReturn to (Last created unit)
              • Unit - Set level of HauntReturn for (Last created unit) to (Custom value of (Picked unit))
              • Unit - Order (Last created unit) to Undead Death Knight - Death Coil HauntCaster
              • Unit Group - Remove (Picked unit) from HauntGroup
              • Unit - Set the custom value of (Picked unit) to 0
            • Else - Actions
              • Do nothing


Trigger:
  • Everlasting Horrors On
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Everlasting Horrors
    • Actions
      • If ((Level of Everlasting Horrors for (Triggering unit)) Equal to 1) then do (Set EverlastingJumpCount = 1) else do (Do nothing)
      • If ((Level of Everlasting Horrors for (Triggering unit)) Equal to 1) then do (Set EverlastingCount = 2) else do (Do nothing)
      • If ((Level of Everlasting Horrors for (Triggering unit)) Equal to 2) then do (Set EverlastingCount = 3) else do (Do nothing)
      • If ((Level of Everlasting Horrors for (Triggering unit)) Equal to 3) then do (Set EverlastingCount = 4) else do (Do nothing)
      • If ((Level of Everlasting Horrors for (Triggering unit)) Equal to 4) then do (Set EverlastingCount = 5) else do (Do nothing)


Trigger:
  • Everlasting Horrors
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (HauntTarget has buff Haunt (Pause)) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 800.00 of (Position of HauntTarget)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Sleep Haunter) Equal to False
                  • ((Picked unit) has buff Haunt (Pause)) Equal to False
                  • ((Picked unit) belongs to an enemy of (Owner of HauntCaster)) Equal to True
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Unit Group - Add (Picked unit) to EverlastingGroup
                • Else - Actions
                  • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (EverlastingGroup is empty) Equal to True
            • Then - Actions
              • Set EverlastingJumpCount = 1
              • Trigger - Turn off (This trigger)
              • Trigger - Clear the trigger queue
            • Else - Actions
              • Do nothing
          • Unit - Create 1 Dummy Caster for (Owner of HauntCaster) at (Position of HauntTarget) facing Default building facing degrees
          • Animation - Change (Last created unit)'s size to (130.00%, 130.00%, 130.00%) of its original size
          • Unit - Add a 0.25 second Generic expiration timer to (Last created unit)
          • Unit - Make (Last created unit) Invulnerable
          • Unit - Add Haunt to (Last created unit)
          • Unit - Set level of Haunt for (Last created unit) to (Level of Haunt for HauntCaster)
          • Set HauntTarget = (Random unit from EverlastingGroup)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt HauntTarget
          • Set EverlastingJumpCount = (EverlastingJumpCount + 1)
          • Unit Group - Remove all units from EverlastingGroup
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EverlastingCount Equal to EverlastingJumpCount
        • Then - Actions
          • Set EverlastingJumpCount = 1
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing


Thanks again!

If you have any suggestions for cleaning it up or a more efficient way of doing it let me know! (other than JASS :) )
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
take away the do noothing in the first trigger is useless
 

theXact

New Member
Reaction score
0
Please if you have any suggestions let me know! I've been bashing my head agaist the wall trying to figure this out!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top