Jass:BlightGoldMineForPlayerBJ – Mappedia

Jass:BlightGoldMineForPlayerBJ

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



Code

function BlightGoldMineForPlayerBJ takes unit goldMine, player whichPlayer returns unit
    local real    mineX
    local real    mineY
    local integer mineGold
    local unit    newMine

    // Make sure we're replacing a Gold Mine and not some other type of unit.
    if GetUnitTypeId(goldMine) != 'ngol' then
        return null
    endif

    // Save the Gold Mine's properties and remove it.
    set mineX    = GetUnitX(goldMine)
    set mineY    = GetUnitY(goldMine)
    set mineGold = GetResourceAmount(goldMine)
    call RemoveUnit(goldMine)

    // Create a Haunted Gold Mine to replace the Gold Mine.
    set newMine = CreateBlightedGoldmine(whichPlayer, mineX, mineY, bj_UNIT_FACING)
    call SetResourceAmount(newMine, mineGold)
    return newMine
endfunction

Parameter

Typ Name Beschreibung
unit goldMine
player whichPlayer
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Warcraft-Mapping
Werkzeuge