Warcraft III resources & community, 2003–2006 · archived

Get Random Attach Point

not rated
Submitted by XinlitikFunctions0 downloads
Returns a random attach point (ones that would look good with an effect on them, that is). I know, I know, nothing special...I just needed it in my map so I decided to release in case anyone else needed it...

Source

function GetRandAP takes nothing returns string
   local integer i = GetRandomInt(1,7)

   if i == 1 then
      return "head"
   elseif i == 2 then
      return "chest"
   elseif i == 3 then
      return "hand,left"
   elseif i == 4 then
      return "hand,right"
   elseif i == 5 then
      return "weapon"
   elseif i == 6 then
      return "foot,left"
   elseif i == 7 then
      return "foot,right"
   endif
   return ""
endfunction

Comments

2
It's basically like putting another if into the else section of an if/then/else, but a bit more efficient.
whats elseif and then supose to be?