Jass Return Item Cost

Doctor-Peppe

New Member
Reaction score
0
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?
 

exge

New Member
Reaction score
15
it means the function findnextitem is not defined in the header ...
i assume by custom script you mean GUI so its
set udg_Integer_X = GetItemGoldCostById('item raw id here')
to see raw id in the OE press ctrl-d
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top