1
1RingToRule
Guest
Hey all,
I read the tutorial, but I don't really know how well to translate that into my map since I have....lots....of global variables.
Here the global variables used are MonsterHate1-10, PlayerAttack3, PlayerAttack4, PlayerAttack5, and Hero.
If you guys could help me I would be greatly appreciative.
Thanks in advance,
-1RingToRule
I read the tutorial, but I don't really know how well to translate that into my map since I have....lots....of global variables.
Code:
Mob Attacked 1 6
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) has buff Player Damage (Non-stacking) 1) Equal to True) or (((Matching unit) has buff Player Damage (Stacking) 1) Equal to True))) and do (Actions)
Loop - Actions
Set SpellModifier[1] = 1.00
If ((Level of Brutal Accuracy for Hero[1]) Greater than or equal to 1) then do (Set SpellModifier[1] = (SpellModifier[1] + (Abs((0.05 x (Real((Level of Brutal Accuracy for Hero[1])))))))) else do (Do nothing)
Set MonsterDamageTaken[1] = (PlayerAtt3[1] + (PlayerAtt4[1] + PlayerAtt5[1]))
Set MonsterDamageTaken[1] = (MonsterDamageTaken[1] - MonsterDef1[(Hero level of (Picked unit))])
Set MonsterDamageTaken[1] = (Integer(((Real(MonsterDamageTaken[1])) x SpellModifier[1])))
If ((Hero[1] has buff Blood Frenzy ) Equal to True) then do (Set MonsterDamageTaken[1] = (MonsterDamageTaken[1] x 2)) else do (Do nothing)
If ((Hero[1] has buff Warriors Focus ) Equal to True) then do (Set MonsterDamageTaken[1] = (MonsterDamageTaken[1] x 3)) else do (Do nothing)
If ((Hero[1] has buff Warriors Focus ) Equal to True) then do (Unit - Remove Warriors Focus buff from Hero[1]) else do (Do nothing)
Set CriticalStrikeChance[1] = (5 + (Level of Critical Strike for Hero[1]))
If ((Random integer number between 1 and 100) Less than or equal to CriticalStrikeChance[1]) then do (Set MonsterDamageTaken[1] = (Integer(((Real(MonsterDamageTaken[1])) x 1.50)))) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MonsterDamageTaken[1] Less than or equal to 0
Then - Actions
Set MonsterDamageTaken[1] = 0
Floating Text - Create floating text that reads (- + (String(MonsterDamageTaken[1]))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Show (Last created floating text) for Player Group - Player 1 (Red)
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Unit - Remove Player Damage (Stacking) 1 buff from (Picked unit)
Unit - Remove Player Damage (Non-stacking) 1 buff from (Picked unit)
Else - Actions
Floating Text - Create floating text that reads (- + (String(MonsterDamageTaken[1]))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Show (Last created floating text) for Player Group - Player 1 (Red)
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MonsterDamageTaken[1] Greater than or equal to (Integer((Life of (Picked unit))))
Then - Actions
Set MonsterHate1[(Custom value of (Picked unit))] = 0
Set MonsterHate2[(Custom value of (Picked unit))] = 0
Set MonsterHate3[(Custom value of (Picked unit))] = 0
Set MonsterHate4[(Custom value of (Picked unit))] = 0
Set MonsterHate5[(Custom value of (Picked unit))] = 0
Set MonsterHate6[(Custom value of (Picked unit))] = 0
Set MonsterHate7[(Custom value of (Picked unit))] = 0
Set MonsterHate8[(Custom value of (Picked unit))] = 0
Set MonsterHate9[(Custom value of (Picked unit))] = 0
Set MonsterHate10[(Custom value of (Picked unit))] = 0
Unit - Kill (Picked unit)
Set MonsterDamageTaken[1] = 0
Trigger - Run Regive Orders 1 <gen> (checking conditions)
Unit - Remove Player Damage (Stacking) 1 buff from (Picked unit)
Unit - Remove Player Damage (Non-stacking) 1 buff from (Picked unit)
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Picked unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Set MonsterHate1[(Custom value of (Picked unit))] = (MonsterHate1[(Custom value of (Picked unit))] + 1))
Else - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Real(MonsterDamageTaken[1])))
If ((Level of Hateful Strokes for Hero[1]) Greater than or equal to 1) then do (Set SpellModifier[1] = (0.05 x (Real((Level of Hateful Strokes for Hero[1]))))) else do (Set SpellModifier[1] = 0.00)
Set SpellModifier[1] = (SpellModifier[1] + 1.00)
Set MonsterDamageTaken[1] = (Integer(((Real(MonsterDamageTaken[1])) x SpellModifier[1])))
Set MonsterHate1[(Custom value of (Picked unit))] = (MonsterHate1[(Custom value of (Picked unit))] + MonsterDamageTaken[1])
Set MonsterDamageTaken[1] = 0
Unit - Remove Player Damage (Stacking) 1 buff from (Picked unit)
Unit - Remove Player Damage (Non-stacking) 1 buff from (Picked unit)
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Picked unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Set MonsterHate1[(Custom value of (Picked unit))] = (MonsterHate1[(Custom value of (Picked unit))] + 1))
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) has buff Player Damage (Non-stacking) 6) Equal to True) or (((Matching unit) has buff Player Damage (Stacking) 6) Equal to True))) and do (Actions)
Loop - Actions
Set SpellModifier[6] = 1.00
If ((Level of Brutal Accuracy for Hero[6]) Greater than or equal to 1) then do (Set SpellModifier[6] = (SpellModifier[6] + (Abs((0.05 x (Real((Level of Brutal Accuracy for Hero[6])))))))) else do (Do nothing)
Set MonsterDamageTaken[6] = (PlayerAtt3[6] + (PlayerAtt4[6] + PlayerAtt5[6]))
Set MonsterDamageTaken[6] = (MonsterDamageTaken[6] - MonsterDef1[(Hero level of (Picked unit))])
Set MonsterDamageTaken[6] = (Integer(((Real(MonsterDamageTaken[6])) x SpellModifier[6])))
If ((Hero[6] has buff Blood Frenzy ) Equal to True) then do (Set MonsterDamageTaken[6] = (MonsterDamageTaken[6] x 2)) else do (Do nothing)
If ((Hero[6] has buff Warriors Focus ) Equal to True) then do (Set MonsterDamageTaken[6] = (MonsterDamageTaken[6] x 3)) else do (Do nothing)
If ((Hero[6] has buff Warriors Focus ) Equal to True) then do (Unit - Remove Warriors Focus buff from Hero[6]) else do (Do nothing)
Set CriticalStrikeChance[6] = (5 + (Level of Critical Strike for Hero[6]))
If ((Random integer number between 1 and 100) Less than or equal to CriticalStrikeChance[6]) then do (Set MonsterDamageTaken[6] = (Integer(((Real(MonsterDamageTaken[6])) x 1.50)))) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MonsterDamageTaken[6] Less than or equal to 0
Then - Actions
Set MonsterDamageTaken[6] = 0
Floating Text - Create floating text that reads (- + (String(MonsterDamageTaken[6]))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Show (Last created floating text) for Player Group - Player 6 (Orange)
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Unit - Remove Player Damage (Stacking) 6 buff from (Picked unit)
Unit - Remove Player Damage (Non-stacking) 6 buff from (Picked unit)
Else - Actions
Floating Text - Create floating text that reads (- + (String(MonsterDamageTaken[6]))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Show (Last created floating text) for Player Group - Player 6 (Orange)
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MonsterDamageTaken[6] Greater than or equal to (Integer((Life of (Picked unit))))
Then - Actions
Set MonsterHate1[(Custom value of (Picked unit))] = 0
Set MonsterHate2[(Custom value of (Picked unit))] = 0
Set MonsterHate3[(Custom value of (Picked unit))] = 0
Set MonsterHate4[(Custom value of (Picked unit))] = 0
Set MonsterHate5[(Custom value of (Picked unit))] = 0
Set MonsterHate6[(Custom value of (Picked unit))] = 0
Set MonsterHate7[(Custom value of (Picked unit))] = 0
Set MonsterHate8[(Custom value of (Picked unit))] = 0
Set MonsterHate9[(Custom value of (Picked unit))] = 0
Set MonsterHate10[(Custom value of (Picked unit))] = 0
Unit - Kill (Picked unit)
Set MonsterDamageTaken[6] = 0
Trigger - Run Regive Orders 6 <gen> (checking conditions)
Unit - Remove Player Damage (Stacking) 6 buff from (Picked unit)
Unit - Remove Player Damage (Non-stacking) 6 buff from (Picked unit)
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Picked unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Set MonsterHate6[(Custom value of (Picked unit))] = (MonsterHate6[(Custom value of (Picked unit))] + 1))
Else - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Real(MonsterDamageTaken[6])))
If ((Level of Hateful Strokes for Hero[6]) Greater than or equal to 1) then do (Set SpellModifier[6] = (0.05 x (Real((Level of Hateful Strokes for Hero[6]))))) else do (Set SpellModifier[6] = 0.00)
Set SpellModifier[6] = (SpellModifier[6] + 1.00)
Set MonsterDamageTaken[6] = (Integer(((Real(MonsterDamageTaken[6])) x SpellModifier[6])))
Set MonsterHate6[(Custom value of (Picked unit))] = (MonsterHate6[(Custom value of (Picked unit))] + MonsterDamageTaken[6])
Set MonsterDamageTaken[6] = 0
Unit - Remove Player Damage (Stacking) 6 buff from (Picked unit)
Unit - Remove Player Damage (Non-stacking) 6 buff from (Picked unit)
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Picked unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Set MonsterHate6[(Custom value of (Picked unit))] = (MonsterHate6[(Custom value of (Picked unit))] + 1))
Here the global variables used are MonsterHate1-10, PlayerAttack3, PlayerAttack4, PlayerAttack5, and Hero.
If you guys could help me I would be greatly appreciative.
Thanks in advance,
-1RingToRule