Warcraft III resources & community, 2003–2006 · archived

Random effects?

2 posts
#1

Random effects?

hi i was just wondering how i could make a spell have like a 50% chance to do one action and a 50% chance to do another? for example i want to make spells in my new map "failable" and if a unit fails a spell i want them to take damage but if it doesnt fail i want the regular spell efect to happen, i also need to be able to do this in some triggers that arnt spell related so can someone give me a hand? :roll:
#2

Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Your Ability
    Actions
        Set Chance = (Random integer number between 1 and 2)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Chance Equal to 0
            Then - Actions
                -------- then actions --------
            Else - Actions
                -------- else actions --------


this will work