• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Random Event

Status
Not open for further replies.
Level 3
Joined
Oct 8, 2008
Messages
28
I'm pretty newb to triggers. And I'd like to make a random event happen while using a skill.

So far I've got it saying if a unit begins casting an ability
and the ability = Skill: Fishing

but I need an action that gives it a small chance to create a hostile unit at the casters location.

My guess it to make a variable and make a random number on that variable from 1 to 100 every time you cast the ability. If the random number equals 1-5 then the unit is created. But I have no clue whatsoever on how to do that.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
  • Actions
    • Set ranomint = (Random integer number between 1 and 10)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ranomint Equal to 2
      • Then - Actions
        • Custom script: Random Event 1
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ranomint Equal to 2
          • Then - Actions
            • Custom script: Random Event 2
          • Else - Actions
            • etc...
global int gets set to a random number and depending on the number a different event appears.
You can also make kinda default event after the last if/then/else (into the last esle).
 
Status
Not open for further replies.
Top