- 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
can anyone plz help to make this work? thx
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
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
-
Conditions
-
And - All (Conditions) are true
-
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
-
Loop - Actions
- 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)
-
Events