- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright I tried this method:
But no matter what numbers I put in the stockMax or currentStock field, when a unit buys the item the item is gone from stock. So how do I set this up properly? Thanks. I mean, I can do a basic system that counts how many times the item was bought and readds it til it reaches 0, but I wanted to make sure there wasn't a simpler way first.
JASS:
function Trig_GainsEclipsingDream_Actions takes nothing returns boolean
if GetBuyingUnit() == gg_unit_nC84_0658 and GetItemTypeId(GetSoldItem()) == 'moon' then
call AddItemToStock(gg_unit_nC84_0658, 'moon', 1, 10)
endif
return false
endfunction
//===========================================================================
function InitTrig_GainsEclipsingDream takes nothing returns nothing
set gg_trg_GainsEclipsingDream = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_GainsEclipsingDream, EVENT_PLAYER_UNIT_PAWN_ITEM )
call TriggerAddCondition( gg_trg_GainsEclipsingDream, function Trig_GainsEclipsingDream_Actions )
endfunction
But no matter what numbers I put in the stockMax or currentStock field, when a unit buys the item the item is gone from stock. So how do I set this up properly? Thanks. I mean, I can do a basic system that counts how many times the item was bought and readds it til it reaches 0, but I wanted to make sure there wasn't a simpler way first.