• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Always Active Ability

Status
Not open for further replies.
Level 3
Joined
Aug 17, 2005
Messages
24
How can I make a passive ability that's always disabled, but is enabled on a chance on attack? Example:

30% chance on hit: Increases attack speed by 200%.

Anyone know? Thanks for any help :)
 
Level 10
Joined
Jul 2, 2004
Messages
690
something like this.

Events-
A unit is attacked
Conditons-
Level of (ability) equal to #
Actions-
Set Random_integar = (random number between 1 and 10)
if-
Random_integar less than or equal to 3
then-
create 1 (dummy) at (position of attacking unit)
order (last created unit) to (Orc Shaman - Bloodlust) (attacking unit)

create a dummy unit and give it a bloodlust ability with 200$ increased attack speed.
 
Level 3
Joined
Aug 17, 2005
Messages
24
Thanks! And, while I'm at it...

I made a sort of sliding spell, but it doesn't look very smooth. My unit just slides at the same speed, then stops, and sometimes he even starts sliding in a different direction. Is there any way I can fix this?

Code:
Pit Fiend Swipe Start
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Swipe 
    Actions
        Set SwipeCaster = (Casting unit)
        Set SwipeTarget = (Target unit of ability being cast)
        Set SwipeEnd = ((Position of SwipeTarget) offset by 250.00 towards (Facing of SwipeCaster) degrees)
        Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Human\Defend\DefendCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Make SwipeTarget Invulnerable
        Countdown Timer - Start SwipeTimer[1] as a One-shot timer that will expire in 1.50 seconds
        Countdown Timer - Start SwipeTimer[2] as a Repeating timer that will expire in 0.01 seconds

Code:
Pit Fiend Swipe End
    Events
        Time - SwipeTimer[2] expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elapsed time for SwipeTimer[1]) Less than or equal to 1.49
            Then - Actions
                Unit - Move SwipeTarget instantly to ((Position of SwipeTarget) offset by 3.00 towards (Facing of SwipeCaster) degrees)
            Else - Actions
                Countdown Timer - Pause SwipeTimer[1]
                Countdown Timer - Pause SwipeTimer[2]
                Unit - Make (Triggering unit) Vulnerable
 
Level 3
Joined
Aug 17, 2005
Messages
24
Sorry to double post, but can anyone please help me with the spell above? I need to make it so the target starts sliding, but then slows down and eventually stops after about 1 or 2 seconds. Thanks! :eek:
 
Status
Not open for further replies.
Top