Jass:GetRandomSubGroupEnum – Mappedia

Jass:GetRandomSubGroupEnum

Aus Mappedia
Wechseln zu: Navigation, Suche
Funktion: GetRandomSubGroupEnum
Parameter: nothing
Rückgabewert: nothing
Autor: Blizzard
Quelle: Blizzard.j
Synchron: Unbekannt



Code

function GetRandomSubGroupEnum takes nothing returns nothing
    if (bj_randomSubGroupWant > 0) then
        if (bj_randomSubGroupWant >= bj_randomSubGroupTotal) or (GetRandomReal(0,1) < bj_randomSubGroupChance) then
            // We either need every remaining unit, or the unit passed its chance check.
            call GroupAddUnit(bj_randomSubGroupGroup, GetEnumUnit())
            set bj_randomSubGroupWant = bj_randomSubGroupWant - 1
        endif
    endif
    set bj_randomSubGroupTotal = bj_randomSubGroupTotal - 1
endfunction
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Warcraft-Mapping
Werkzeuge