• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Weird bug with spell ability

Status
Not open for further replies.
Level 10
Joined
Apr 9, 2004
Messages
502
Ok, so here's the layout. I'm creating an "activate-able" ability that drains mana, but converts your hero;s attack into line based damage that will be able to hit multiple units.

I've used a dummy bear form to change my archer with exactly the same unit, except with an instant attack instead of a ranged one. I'm triggering all the missiles that fly out in a line to deal the actual damage. Anyways, it wall works out fine until I try attacking dwarven marksmen or human priests, the only ranged spawns i use on my map. It works fine on any melee that i've seen, namely footmen and the paladin computer controlled hero. For these units, it fires out the dummy arrow properly and re-heals the unit i had initially attacked so that it doesn't seem like I've hit them yet. However, for the ranged units, it won't create the dummy unit, EVEN THOUGH it re-heals them.

it's all one function so i don't get where it goes wrong. And if I move the healing part to another portion of the function, it won't fire either. still, I have no idea what's causing my trigger to skip over doing the proper actions when faced with these units.

  • Compensate Shot Damage Bonus
    • Events
    • Conditions
      • (Damage source) Equal to BoneClinkz
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of BoneClinkz) Equal to Skeletal Archer (Piercing Arrow Form)
        • Then - Actions
          • Set BC_PS_DamageDealt = ((Damage taken) + 0.00)
          • Set BC_PS_DelayedHealedUnit = CompShotTarget
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Life of BC_PS_DelayedHealedUnit) + (Damage taken)) Greater than or equal to (Max life of BC_PS_DelayedHealedUnit)
            • Then - Actions
              • Countdown Timer - Start BC_PS_heal_delay_timer as a One-shot timer that will expire in 0.00 seconds
            • Else - Actions
              • Unit - Set life of BC_PS_DelayedHealedUnit to ((Life of BC_PS_DelayedHealedUnit) + (Damage taken))
          • Set BC_PS_InitialLife = (Life of BC_PS_DelayedHealedUnit)
          • Unit - Cause PlayerDamager[(Player number of (Owner of BoneClinkz))] to damage BC_PS_DelayedHealedUnit, dealing 25.00 damage of attack type Chaos and damage type Normal
          • Set BC_PS_ArmorReduction = (1.00 - ((BC_PS_InitialLife - (Life of BC_PS_DelayedHealedUnit)) / 25.00))
          • Unit - Set life of BC_PS_DelayedHealedUnit to ((Life of BC_PS_DelayedHealedUnit) + (25.00 x (1.00 - BC_PS_ArmorReduction)))
          • Set BC_PS_ActualDamage = (BC_PS_DamageDealt / BC_PS_ArmorReduction)
          • Set BC_PS_FirePoint = (Position of BoneClinkz)
          • Set BC_PS_TargetPoint = (Position of BC_PS_DelayedHealedUnit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BC_PS_CurrentArrowInteger Less than 11
            • Then - Actions
              • Set BC_PS_CurrentArrowInteger = (BC_PS_CurrentArrowInteger + 1)
            • Else - Actions
              • Set BC_PS_CurrentArrowInteger = 1
          • Set BC_PS_Angle[BC_PS_CurrentArrowInteger] = (Angle from BC_PS_FirePoint to BC_PS_TargetPoint)
          • Set BC_PS_ArrowMovePoint[BC_PS_CurrentArrowInteger] = (BC_PS_FirePoint offset by 25.00 towards BC_PS_Angle[BC_PS_CurrentArrowInteger] degrees)
          • Set BC_PS_ArrowMovementInterval[BC_PS_CurrentArrowInteger] = 0
          • Unit - Create 1 Universal Arrow Unit for (Owner of BoneClinkz) at BC_PS_ArrowMovePoint[BC_PS_CurrentArrowInteger] facing BC_PS_Angle[BC_PS_CurrentArrowInteger] degrees
          • Set BC_PS_Arrow[BC_PS_CurrentArrowInteger] = (Last created unit)
          • Unit - Add Flying Trick to BC_PS_Arrow[BC_PS_CurrentArrowInteger]
          • Unit - Add Peircing Arrows Missile effect to BC_PS_Arrow[BC_PS_CurrentArrowInteger]
          • Unit - Remove Flying Trick from BC_PS_Arrow[BC_PS_CurrentArrowInteger]
          • Animation - Change BC_PS_Arrow[BC_PS_CurrentArrowInteger] flying height to 60.00 at 1000000000.00
          • Animation - Change BC_PS_Arrow[BC_PS_CurrentArrowInteger]'s animation speed to 500.00% of its original speed
          • Custom script: call SetUnitAnimationByIndex(udg_BC_PS_Arrow[udg_BC_PS_CurrentArrowInteger],90)
          • Unit - Turn collision for BC_PS_Arrow[BC_PS_CurrentArrowInteger] Off
          • Unit - Move BC_PS_Arrow[BC_PS_CurrentArrowInteger] instantly to BC_PS_ArrowMovePoint[BC_PS_CurrentArrowInteger], facing BC_PS_Angle[BC_PS_CurrentArrowInteger] degrees
          • Unit - Set the custom value of BC_PS_Arrow[BC_PS_CurrentArrowInteger] to BC_PS_CurrentArrowInteger
          • Set BC_PS_Arrow_Damage[BC_PS_CurrentArrowInteger] = BC_PS_ActualDamage
          • Unit Group - Add BC_PS_Arrow[BC_PS_CurrentArrowInteger] to BC_PS_ArrowsInMotion
          • Custom script: call RemoveLocation(udg_BC_PS_TargetPoint)
          • Custom script: call RemoveLocation(udg_BC_PS_FirePoint)
          • Custom script: call RemoveLocation(udg_BC_PS_ArrowMovePoint[udg_BC_PS_CurrentArrowInteger])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MoveArrows and deal damage <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on MoveArrows and deal damage <gen>
              • Countdown Timer - Start BC_PS_ArrowMotionTimer as a One-shot timer that will expire in 0.00 seconds
            • Else - Actions
        • Else - Actions
      • Trigger - Turn off (This trigger)
 
Last edited:
Level 4
Joined
Jul 30, 2007
Messages
79
why not do something like when your unit activates this form instead of going through all the damage stuff create a dummy that casts shockwave

create the dummy at your unit targeting his target and do it when he attacks at whatever speed u want

seems like it would simplify the whole thing a bit
 
Level 10
Joined
Apr 9, 2004
Messages
502
That would be nice, except for a few things:

1. I want the damage to be based off of his regular attack damage
2. I want damage to be precisely what he would have dealt with his normal attack.
3. I want it only to hit up to a certain number of units and not pass through structures
4. It has dynamic damage and buffs added on.
5. I'd have to make an arrow model that floats in mid air so that the effect doesn't look crappy.

Other then that, it would work to as much as dealing stock damage in a line, which is pretty close i guess. However It's not as flexible with the missile as my ability is. I'm planning on having it also transfer buffs from items (ie cold effect etc). So the shockwave missile cannot carry all the information I require. Besides, I've tested this and as soon as I get a bit of JASS help with the damage detection, it should work rather nicely.

Thanks for the suggestion though, but now that I've figured out the problem, there aren't any kinks.

BTW for some reason, I guess the fucntion stops all extra actions if it generates a number that's so exceedingly high that it can't handle it. My function was applying a value of infinity to a variable, I guess that's what screwed it up.
 
Status
Not open for further replies.
Top