GFreak45
I didnt slap you, i high 5'd your face.
- Reaction score
- 130
problem with my damage system +rep for helping
sssssssoooooo ya i made a damage system that uses crit chance evasion crit dmg crit chance reduction and evasion chance reduction and it works with my version of "resilience" like wow and its all working correctly except whenever a unit crits it displays both the crit dmg and the base dmg before crit instead of just displaying the crit dmg... help plz? garunteed +rep if u figure out what is wrong
PS. its so long cuz it has absorbtion and different damage systems for each type of unit: computer, player owned non heros, and heros. this is about 2/3 of the system but a lot of it was done through copy+past of floating text actions
this isnt the entire code, it was too long so i took off the npc/pet part
sssssssoooooo ya i made a damage system that uses crit chance evasion crit dmg crit chance reduction and evasion chance reduction and it works with my version of "resilience" like wow and its all working correctly except whenever a unit crits it displays both the crit dmg and the base dmg before crit instead of just displaying the crit dmg... help plz? garunteed +rep if u figure out what is wrong
PS. its so long cuz it has absorbtion and different damage systems for each type of unit: computer, player owned non heros, and heros. this is about 2/3 of the system but a lot of it was done through copy+past of floating text actions
Trigger:
- Damage System
- Events
- Conditions
- Actions
- -------- Sets the roll for crit and evasion chances --------
- Set Crit_Chance_Roll = (Random real number between 1.00 and 100.00)
- Set Miss_Chance_Roll = (Random real number between 1.00 and 100.00)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- And - All (Conditions) are true
- Conditions
- (Owner of (Damage source)) Not equal to Player 12 (Brown)
- (Owner of (Damage source)) Not equal to Neutral Hostile
- Conditions
- And - All (Conditions) are true
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Damage source) is A Hero) Equal to True
- Then - Actions
- -------- Sets crit chance/dodge dodge chance/crit dmg if the damage source is a hero --------
- Set Crit_Chance = ((5.00 - Crit_Chance_Reduction[(Player number of (Owner of (Triggering unit)))]) + (Crit_Chance_from_Items[(Player number of (Owner of (Damage source)))] + (((Real((Agility of (Damage source) (Include bonuses)))) / (Square root((Real((Hero level of (Damage so
- Set Crit_Damage = (1.50 x ((Real((Strength of (Damage source) (Include bonuses)))) / ((Square root((Real((Hero level of (Damage source)))))) x 5.00)))
- Set Miss_Chance = (10.00 + (Miss_Chance_from_Items[(Player number of (Owner of (Triggering unit)))] - Miss_Chance_Reduction_Items[(Player number of (Owner of (Damage source)))]))
- Else - Actions
- -------- Sets crit chance/dodge dodge chance/crit dmg if the damage source is a hero's pet --------
- Set Crit_Chance = (10.00 + (Crit_Chance_from_Items[(Player number of (Owner of (Damage source)))] - Crit_Chance_Reduction[(Player number of (Owner of (Triggering unit)))]))
- Set Crit_Damage = 1.50
- Set Miss_Chance = (10.00 + (Miss_Chance_from_Items[(Player number of (Owner of (Triggering unit)))] - Miss_Chance_Reduction_Items[(Player number of (Owner of (Damage source)))]))
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Owner of (Damage source)) Equal to Neutral Hostile
- Then - Actions
- -------- Sets crit chance/dodge dodge chance/crit dmg if the damage source is a non-elite npc --------
- Set Crit_Chance = (10.00 - Crit_Chance_Reduction[(Player number of (Owner of (Damage source)))])
- Set Crit_Damage = 1.50
- Set Miss_Chance = (10.00 + (Miss_Chance_from_Items[(Player number of (Owner of (Triggering unit)))] - Miss_Chance_Reduction_Items[(Player number of (Owner of (Damage source)))]))
- Else - Actions
- -------- Sets crit chance/dodge dodge chance/crit dmg if the damage source is an elite npc --------
- Set Crit_Chance = (30.00 - Crit_Chance_Reduction[(Player number of (Owner of (Damage source)))])
- Set Crit_Damage = 3.00
- Set Miss_Chance = (10.00 + (Miss_Chance_from_Items[(Player number of (Owner of (Triggering unit)))] - Miss_Chance_Reduction_Items[(Player number of (Owner of (Damage source)))]))
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- -------- Checks for evasion/dodge --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Miss_Chance_Roll Greater than Miss_Chance
- Then - Actions
- -------- Checks for a crit --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Crit_Chance Greater than or equal to Crit_Chance_Roll
- Then - Actions
- -------- checks for absorbtion buff --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Triggering unit) has buff Absorbtion ) Equal to True
- Then - Actions
- -------- determines damage taken if the unit has absorbtion --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Damage taken) Greater than or equal to Absorbtion_Life[(Custom value of (Triggering unit))]
- Then - Actions
- Trigger - Turn off (This trigger)
- Unit - Cause (Damage source) to damage (Triggering unit), dealing (((Damage taken) x Crit_Damage) - (Damage taken)) damage of attack type Spells and damage type Normal
- Trigger - Turn on (This trigger)
- Set Damage_Taken = ((Damage taken) x Crit_Damage)
- Floating Text - Create floating text that reads (((|c00ccbb44 + Absorb) + (( + ((String((Integer(Absorbtion_Life[(Custom value of (Triggering unit))])))) + )|r))) + ( + (String((Integer((((Damage taken) x Crit_Damage) - Absorbtion_Life[(Custom value of (Triggering unit))]))))))) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (((|c00ccbb44 + Absorb) + (( + ((String((Integer(Absorbtion_Life[(Custom value of (Triggering unit))])))) + )|r))) + ( + (String((Integer((((Damage taken) x Crit_Damage) - Absorbtion_Life[(Custom value of (Triggering unit))]))))))) at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Set Absorbtion_Life[(Custom value of (Triggering unit))] = 0.00
- Unit - Remove Absorbtion buff from (Triggering unit)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Damage taken) x Crit_Damage) Greater than or equal to Absorbtion_Life[(Custom value of (Triggering unit))]
- Then - Actions
- Trigger - Turn off (This trigger)
- Unit - Cause (Damage source) to damage (Triggering unit), dealing ((((Damage taken) x Crit_Damage) - (Damage taken)) - Absorbtion_Life[(Custom value of (Triggering unit))]) damage of attack type Spells and damage type Normal
- Trigger - Turn on (This trigger)
- Set Damage_Taken = ((Damage taken) x Crit_Damage)
- Floating Text - Create floating text that reads (((|c00ccbb44 + Absorb) + (( + ((String((Integer(Absorbtion_Life[(Custom value of (Triggering unit))])))) + )|r))) + (String((Integer((((Damage taken) x Crit_Damage) - Absorbtion_Life[(Custom value of (Triggering unit))])))))) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (((|c00ccbb44 + Absorb) + (( + ((String((Integer(Absorbtion_Life[(Custom value of (Triggering unit))])))) + )|r))) + (String((Integer((((Damage taken) x Crit_Damage) - Absorbtion_Life[(Custom value of (Triggering unit))])))))) at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Set Absorbtion_Life[(Custom value of (Triggering unit))] = 0.00
- Unit - Remove Absorbtion buff from (Triggering unit)
- Else - Actions
- Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) x Crit_Damage))
- Set Damage_Taken = ((Damage taken) x Crit_Damage)
- Floating Text - Create floating text that reads (|c00ccbb44Absorb ( + ((String((Integer(((Damage taken) x Crit_Damage))))) + ))) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (|c00ccbb44Absorb ( + ((String((Integer(((Damage taken) x Crit_Damage))))) + ))) at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Set Absorbtion_Life[(Custom value of (Triggering unit))] = (Absorbtion_Life[(Custom value of (Triggering unit))] - ((Damage taken) x Crit_Damage))
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Else - Actions
- -------- Displays damage taken by a crit if the unit does not have absorbtion --------
- Trigger - Turn off (This trigger)
- Unit - Cause (Damage source) to damage (Triggering unit), dealing (((Damage taken) x Crit_Damage) - (Damage taken)) damage of attack type Spells and damage type Normal
- Trigger - Turn on (This trigger)
- Set Damage_Taken = ((Damage taken) x Crit_Damage)
- Floating Text - Create floating text that reads (Critical! + (String((Integer(((Damage taken) x Crit_Damage)))))) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (Critical! + (String((Integer(((Damage taken) x Crit_Damage)))))) at (Position of (Triggering unit)) with Z offset 10.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- If - Conditions
- Else - Actions
- -------- If the attack/ability is not a crit --------
- -------- Checks for Absorbtion --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Triggering unit) has buff Absorbtion ) Equal to True
- Then - Actions
- -------- Checks damage taken with absorbtion --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Damage taken) Greater than Absorbtion_Life[(Custom value of (Triggering unit))]
- Then - Actions
- Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) - Absorbtion_Life[(Custom value of (Triggering unit))]))
- Set Damage_Taken = (Damage taken)
- Floating Text - Create floating text that reads (|c00ccbb44Absorb ( + (((String((Integer(Absorbtion_Life[(Custom value of (Triggering unit))])))) + )|r) + ( + (String((Integer(((Damage taken) - Absorbtion_Life[(Custom value of (Triggering unit))])))))))) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (|c00ccbb44Absorb ( + (((String((Integer(Absorbtion_Life[(Custom value of (Triggering unit))])))) + )|r) + ( + (String((Integer(((Damage taken) - Absorbtion_Life[(Custom value of (Triggering unit))])))))))) at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Set Absorbtion_Life[(Custom value of (Triggering unit))] = 0.00
- Unit - Remove Absorbtion buff from (Triggering unit)
- Else - Actions
- Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
- Set Damage_Taken = (Damage taken)
- Floating Text - Create floating text that reads (|c00ccbb44Absorb ( + ((String((Integer((Damage taken))))) + )|r)) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (|c00ccbb44Absorb ( + ((String((Integer((Damage taken))))) + )|r)) at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Set Absorbtion_Life[(Custom value of (Triggering unit))] = (Absorbtion_Life[(Custom value of (Triggering unit))] - (Damage taken))
- If - Conditions
- Else - Actions
- -------- Displays damage taken if the unit does not have absorbtion and the damage source does not crit --------
- Set Damage_Taken = (Damage taken)
- Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- If - Conditions
- If - Conditions
- Else - Actions
- -------- Displays missess/dodges --------
- Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
- Set Damage_Taken = 0.00
- Floating Text - Create floating text that reads |c00ccbb44Miss|r at (Position of (Triggering unit)) with Z offset 10.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Floating Text - Create floating text that reads |c00ccbb44Dodge|r at ((Position of (Triggering unit)) offset by (-50.00, 0.00)) with Z offset 10.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Damage source)) Equal to (Matching player)))
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- If - Conditions
this isnt the entire code, it was too long so i took off the npc/pet part