• 🏆 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!

Making a spell cast at a random point within a 500 radius of caster

Status
Not open for further replies.
Level 3
Joined
Aug 25, 2009
Messages
18
Basically, like the title says, I wanna create a dummy unit within a 500 foot radius that can be cast with something like thunder clap and doesnt need a point. I know how to do the dummy and all that, just need to know how to create the random placed unit.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
500 foot.... Is how many WC3 units?

Anyway, you are after using the random integer or real functions which are passed 2 numbers of the corrosponding type and return a random number of the corrosponding type between those two. Combine that with simple arthimetic (for square area) or trig (for circlular area) and you have your formula.
 
Level 4
Joined
Jul 19, 2007
Messages
76
  • Events
  • Conditions
  • Actions
    • Set Temp_Group = (Units within 500.00 of (Position of (Casting unit)))
    • Unit Group - Pick every unit in (Random 1 units from Temp_Group) and do (Actions)
      • Loop - Actions
    • Custom script: call DestroyGroup (udg_Temp_Group)
 
  • Loltriggy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at ((Position of (Triggering unit)) offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
(Random real number between 0.00 and 500.00) towards (Random angle) degrees)
- That's the key.

~The_Clam
 
Status
Not open for further replies.
Top