• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Gold Cost of the item

Status
Not open for further replies.
Level 10
Joined
Aug 25, 2004
Messages
473
I need a function that will set an Integer_X to the gold cost of an Item.
Ive also found this script:

Code:
function GetItemGoldCostById takes  integer Uid returns integer
    local integer Val = GetPlayerState(Player(15),PLAYER_STATE_RESOURCE_GOLD)
    local integer ValB = GetPlayerState(Player(15),PLAYER_STATE_RESOURCE_LUMBER)
    local integer Diff
    local unit U = CreateUnitAtLoc(Player(15),'nshe',GetRectCenter(GetPlayableMapRect()),bj_UNIT_FACING)
    call AdjustPlayerStateBJ(50000,Player(15),PLAYER_STATE_RESOURCE_GOLD)
    call AdjustPlayerStateBJ(50000,Player(15),PLAYER_STATE_RESOURCE_LUMBER)
    call UnitAddAbilityBJ('Asid',U)
    set Diff = GetPlayerState(Player(15),PLAYER_STATE_RESOURCE_GOLD)
    call AddItemToStockBJ(Uid,U,1,1)
    call IssueTrainOrderByIdBJ(U,Uid)
    set Diff = Diff - GetPlayerState(Player(15),PLAYER_STATE_RESOURCE_GOLD)
    call SetPlayerState(Player(15),PLAYER_STATE_RESOURCE_GOLD,Val)
    call SetPlayerState(Player(15),PLAYER_STATE_RESOURCE_LUMBER,ValB)
    call RemoveItem(FindNextItem(GetUnitLoc(U)))
    call RemoveUnit(U)
    return Diff
endfunction

What is the Custom script function to set Integer_X to the gold value of an item?
THe description also say that it Requires: FindNextItem . What does it mean?
 
Status
Not open for further replies.
Top