- Joined
- Dec 28, 2012
- Messages
- 377
So how do i make trigger which Multiplies heros all stats by 2x or 3x.and also divides heros stats by 2x or 3x.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
|
There's this line in trigger
Hero - Modify Strength of YourUnit: Set to ...
Just use math to multiply or divide your hero's stats.
Index Heroes

Events


Time - Elapsed game time is 0.00 seconds

Conditions

Actions


Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)



Loop - Actions




Set Key = (Custom value of (Picked unit))




Set StatsBaseStrength[Key] = (Real((Strength of (Picked unit) (Exclude bonuses))))




Set StatsBaseAgility[Key] = (Real((Agility of (Picked unit) (Exclude bonuses))))




Set StatsBaseIntelligence[Key] = (Real((Intelligence of (Picked unit) (Exclude bonuses))))




-------- --------------- --------




-------- Add Heroes Here --------




-------- --------------- --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Unit-type of (Picked unit)) Equal to Mountain King





Then - Actions






Set StatsGainStrength[Key] = 3.25






Set StatsGainAgility[Key] = 2.50






Set StatsGainIntelligence[Key] = 1.75





Else - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Unit-type of (Picked unit)) Equal to Paladin





Then - Actions






Set StatsGainStrength[Key] = 4.25






Set StatsGainAgility[Key] = 2.00






Set StatsGainIntelligence[Key] = 2.00





Else - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Unit-type of (Picked unit)) Equal to Archmage





Then - Actions






Set StatsGainStrength[Key] = 2.50






Set StatsGainAgility[Key] = 2.25






Set StatsGainIntelligence[Key] = 3.00





Else - Actions
Index Heroes 2

Events


Unit - A unit enters (Playable map area)

Conditions


((Triggering unit) is A Hero) Equal to True

Actions


Set Key = (Custom value of (Triggering unit))


Set StatsBaseStrength[Key] = (Real((Strength of (Triggering unit) (Exclude bonuses))))


Set StatsBaseAgility[Key] = (Real((Agility of (Triggering unit) (Exclude bonuses))))


Set StatsBaseIntelligence[Key] = (Real((Intelligence of (Triggering unit) (Exclude bonuses))))


-------- --------------- --------


-------- Add Heroes Here --------


-------- --------------- --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Unit-type of (Triggering unit)) Equal to Mountain King



Then - Actions




Set StatsGainStrength[Key] = 3.25




Set StatsGainAgility[Key] = 2.50




Set StatsGainIntelligence[Key] = 1.75



Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Unit-type of (Triggering unit)) Equal to Paladin



Then - Actions




Set StatsGainStrength[Key] = 4.25




Set StatsGainAgility[Key] = 2.00




Set StatsGainIntelligence[Key] = 2.00



Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Unit-type of (Triggering unit)) Equal to Archmage



Then - Actions




Set StatsGainStrength[Key] = 2.50




Set StatsGainAgility[Key] = 2.25




Set StatsGainIntelligence[Key] = 3.00



Else - Actions
Hero Level Up

Events


Unit - A unit Gains a level

Conditions

Actions


Set Key = (Custom value of (Triggering unit))


Set StatsLvlStrength[Key] = (((Real((Hero level of (Triggering unit)))) - 1.00) x StatsGainStrength[Key])


Set StatsLvlAgility[Key] = (((Real((Hero level of (Triggering unit)))) - 1.00) x StatsGainAgility[Key])


Set StatsLvlIntelligence[Key] = (((Real((Hero level of (Triggering unit)))) - 1.00) x StatsGainIntelligence[Key])


Hero - Modify Strength of (Triggering unit): Set to ((((Integer(StatsBaseStrength[Key])) + (Integer(StatsLvlStrength[Key]))) + (Integer(StatsTomeStrength[Key]))) / 2)


Hero - Modify Agility of (Triggering unit): Set to ((((Integer(StatsBaseAgility[Key])) + (Integer(StatsLvlAgility[Key]))) + (Integer(StatsTomeAgility[Key]))) / 2)


Hero - Modify Intelligence of (Triggering unit): Set to ((((Integer(StatsBaseIntelligence[Key])) + (Integer(StatsLvlIntelligence[Key]))) + (Integer(StatsTomeIntelligence[Key]))) / 2)
Hero Tomes

Events


Unit - A unit Acquires an item

Conditions

Actions


Set Key = (Custom value of (Triggering unit))


-------- Checks for Strength Tome --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Item-type of (Item being manipulated)) Equal to Tome of Strength



Then - Actions




Set StatsTomeStrength[Key] = (StatsTomeStrength[Key] + 1.00)




Hero - Modify Strength of (Triggering unit): Set to ((((Integer(StatsBaseStrength[Key])) + (Integer(StatsLvlStrength[Key]))) + (Integer(StatsTomeStrength[Key]))) / 2)



Else - Actions


-------- Checks for Agility Tome --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Item-type of (Item being manipulated)) Equal to Tome of Agility



Then - Actions




Set StatsTomeAgility[Key] = (StatsTomeAgility[Key] + 1.00)




Hero - Modify Agility of (Triggering unit): Set to ((((Integer(StatsBaseAgility[Key])) + (Integer(StatsLvlAgility[Key]))) + (Integer(StatsTomeAgility[Key]))) / 2)



Else - Actions


-------- Checks for Intelligence Tome --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Item-type of (Item being manipulated)) Equal to Tome of Intelligence



Then - Actions




Set StatsTomeIntelligence[Key] = (StatsTomeIntelligence[Key] + 1.00)




Hero - Modify Intelligence of (Triggering unit): Set to ((((Integer(StatsBaseIntelligence[Key])) + (Integer(StatsLvlIntelligence[Key]))) + (Integer(StatsTomeIntelligence[Key]))) / 2)



Else - Actions


-------- Checks for Knowledge Tome --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Item-type of (Item being manipulated)) Equal to Tome of Knowledge



Then - Actions




Set StatsTomeStrength[Key] = (StatsTomeStrength[Key] + 1.00)




Set StatsTomeAgility[Key] = (StatsTomeAgility[Key] + 1.00)




Set StatsTomeIntelligence[Key] = (StatsTomeIntelligence[Key] + 1.00)




Hero - Modify Strength of (Triggering unit): Set to ((((Integer(StatsBaseStrength[Key])) + (Integer(StatsLvlStrength[Key]))) + (Integer(StatsTomeStrength[Key]))) / 2)




Hero - Modify Agility of (Triggering unit): Set to ((((Integer(StatsBaseAgility[Key])) + (Integer(StatsLvlAgility[Key]))) + (Integer(StatsTomeAgility[Key]))) / 2)




Hero - Modify Intelligence of (Triggering unit): Set to ((((Integer(StatsBaseIntelligence[Key])) + (Integer(StatsLvlIntelligence[Key]))) + (Integer(StatsTomeIntelligence[Key]))) / 2)



Else - Actions
Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Stat Bonus

Actions


-------- Triggering unit is set to a variable, because it's used often and accessing variables is faster than functions. --------


Set Caster = (Triggering unit)


-------- Check if unit still has bonus stats from previous casts --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Caster is in StatGroup) Equal to True



Then - Actions




-------- If it has, remove old bonus and add a new one --------




Hero - Modify Strength of Caster: Subtract StatAmount[(Custom value of Caster)]




Set StatAmount[(Custom value of Caster)] = ((Strength of Caster (Exclude bonuses)) x 2)




Hero - Modify Strength of Caster: Add StatAmount[(Custom value of Caster)]



Else - Actions




-------- Else just add new bonus. In that case, caster must also be added to the group. --------




Set StatAmount[(Custom value of Caster)] = ((Strength of Caster (Exclude bonuses)) x 2)




Hero - Modify Strength of Caster: Add StatAmount[(Custom value of Caster)]




Unit Group - Add Caster to StatGroup




-------- Update the number of units under the effect of this ability. If this is the only active cast, turn on the loop trigger. --------




Set StatCount = (StatCount + 1)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






StatCount Equal to 1





Then - Actions






Trigger - Turn on Loop <gen>





Else - Actions


-------- Set spell duration --------


Set StatDuration[(Custom value of Caster)] = 15
Loop

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


-------- For every unit with stat bonuses... --------


Unit Group - Pick every unit in StatGroup and do (Actions)



Loop - Actions




Set Caster = (Picked unit)




-------- ..., update the remaining spell duration. --------




Set StatDuration[(Custom value of Caster)] = (StatDuration[(Custom value of Caster)] - 1)




-------- If duration == 0, spell ends. --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






StatDuration[(Custom value of Caster)] Equal to 0





Then - Actions






-------- Remove added bonus --------






Hero - Modify Strength of Caster: Subtract StatAmount[(Custom value of Caster)]






Unit Group - Remove Caster from StatGroup






-------- Update the number of active casts. If there are no active casts, disable loop trigger. --------






Set StatCount = (StatCount - 1)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








StatCount Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions





Else - Actions