• 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 went wrong when multi-casting, plz help

Status
Not open for further replies.
Level 2
Joined
Apr 17, 2008
Messages
20
hi, here is a spell that consume the caster's hp and then damage the target based on how much hp(random) it has consumed.
when i test it, it works perfectly when only 1 tower using this ability.
however when i test it with 2 or more tower, things went totally wrong!
first the floating text mess up, and the target got kill right away most of the time when the trigger execute the part [Unit - Cause (Triggering unit) to damage DeathRayTarget, dealing DeathRayDamage damage of attack type Chaos and damage type Normal]. note that my test target have 5000 hp, with 2 tower the max possible random hp that consume have no way to deal more than 5000 damage :cry:
can anyone plz help to make this work? thx
  • Untitled Trigger 004
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to |cffffcc00A|rutocast
          • (Unit-type of (Triggering unit)) Equal to Gnomish Death Ray Tower
          • (Life of (Triggering unit)) Greater than 10.00
    • Actions
      • Set DeathRayTarget = (Target unit of ability being cast)
      • Set DeathRayHP = 0.00
      • Set DeathRayDamage = 0.00
      • Set TempPoint = (Position of (Triggering unit))
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set DeathRayHP = ((Random real number between 0.01 and 0.24) x (Life of (Triggering unit)))
          • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing DeathRayHP damage of attack type Chaos and damage type Normal
          • Set DeathRayDamage = (DeathRayDamage + DeathRayHP)
          • Wait 1.00 seconds
      • Set DeathRayDamage = (DeathRayDamage x 2.00)
      • Wait 0.50 seconds
      • Unit - Cause (Triggering unit) to damage DeathRayTarget, dealing DeathRayDamage damage of attack type Chaos and damage type Normal
      • Floating Text - Create floating text that reads ((String(DeathRayDamage)) + !) at TempPoint with Z offset 5.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 3.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Custom script: call RemoveLocation(udg_TempPoint)
**i use loop b/c i want to make it look like the caster consuming its hp over time, then shoot out a laser/ray at the target afterward
 
Level 2
Joined
Apr 17, 2008
Messages
20
ty now works fine but how do i make the consume own hp over time effect?
if i make another trigger to check any unit cast the ability and it will result to the same problem because of [wait], cause there is more than 1 caster
 
Status
Not open for further replies.
Top