HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

please help me do this trigger><plz...

08-04-2004, 01:51 AM#1
nkknight
hi...this is the rigger i would liek to have....
when a unit take damage, the damage is randomly taken by 1 of the 5 towers instead.
i have totally no clue on how to make this trigger...plzplzplz help me out...this is a very importnt trigger to my new map><
08-04-2004, 05:04 AM#2
Ninja73
Use the WEU action - unit takes damage then set a variable to a random number between 1-5 and do if then else like if number = 1 then set tower 1 hp to tower 1 hp - 1 or whatever.
08-04-2004, 05:54 AM#3
Nasedo
sorry i can't help, i suck at triggers!!! -100% . thats how good i was
08-04-2004, 06:27 AM#4
Dark_Uber
First create a Integer Variable (I called it YourVariable) and change (Your Unit) to the unit that got attacked, then change all the tower names to your towers...

Code:
Trigger 001
    Events
        Unit - (Your Unit) <gen> Takes damage
    Conditions
    Actions
        Set (YourVariable) = (Random integer number between 1 and 5)
        Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
        If (YourVariable Equal to 1) then do (Unit - Set life of Tower 0001 <gen> to ((Life of Tower 0001 <gen>) - (Damage taken))) else do (Do nothing)
        If (YourVariable Equal to 2) then do (Unit - Set life of Tower 0002 <gen> to ((Life of Tower 0002 <gen>) - (Damage taken))) else do (Do nothing)
        If (YourVariable Equal to 3) then do (Unit - Set life of Tower 0003 <gen> to ((Life of Tower 0003 <gen>) - (Damage taken))) else do (Do nothing)
        If (YourVariable Equal to 4) then do (Unit - Set life of Tower 0004 <gen> to ((Life of Tower 0004 <gen>) - (Damage taken))) else do (Do nothing)
        If (YourVariable Equal to 5) then do (Unit - Set life of Tower 0005 <gen> to ((Life of Tower 0005 <gen>) - (Damage taken))) else do (Do nothing)

Hope this helps... :D