Jass documentation Database

JASS Documentation Database REFORGED


Results for the query "MeleeRandomHeroLoc" as a "function"

The search keyword must be a single word (no spaces).

Function MeleeRandomHeroLoc

Line: 8561
Location: blizzard.j
Constant? no
Type: function
Arguments: player p, integer id1, integer id2, integer id3, integer id4, location loc
Returns: unit

Preview

Extra spaces may have been removed from the original file to show the function in a comfortable way.
  1. function MeleeRandomHeroLoc takes player p, integer id1, integer id2, integer id3, integer id4, location loc returns unit
  2.     local unit    hero = null
  3.     local integer roll
  4.     local integer pick
  5.     local version v
  6.  
  7.     // The selection of heroes is dependant on the game version.
  8.     set v = VersionGet()
  9.     if (v == VERSION_REIGN_OF_CHAOS) then
  10.         set roll = GetRandomInt(1,3)
  11.     else
  12.         set roll = GetRandomInt(1,4)
  13.     endif
  14.  
  15.     // Translate the roll into a unitid.
  16.     if roll == 1 then
  17.         set pick = id1
  18.     elseif roll == 2 then
  19.         set pick = id2
  20.     elseif roll == 3 then
  21.         set pick = id3
  22.     elseif roll == 4 then
  23.         set pick = id4
  24.     else
  25.         // Unrecognized id index - pick the first hero in the list.
  26.         set pick = id1
  27.     endif
  28.  
  29.     // Create the hero.
  30.     set hero = CreateUnitAtLoc(p, pick, loc, bj_UNIT_FACING)
  31.         call MeleeGrantItemsToHero(hero)
  32.     endif
  33.     return hero
  34. endfunction
"Uh-oh, my Tinker bell." Hmmm... there's no info about this keyword... be the first one in contribute with the keyword MeleeRandomHeroLoc. You must be logged into the site in order to give us a hand in keeping updated the information. If you don't have an account, you can create one here.
Page loaded in 0.1019 seconds.
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...