- Joined
- Jun 4, 2011
- Messages
- 27
hi!
I need a endless gold mine, how can i do it?
Thanks.
I need a endless gold mine, how can i do it?
Thanks.
Thanks a lot khamarr3524I'll make a trigger real quick for you
EDIT: This should work. Checked it, working fine for me. You can set the 1M to whatever you want to as long as you're not setting it to a number <= the number you're extracting per harvest
- Endless Goldmine
- Events
- Time - Every 0.10 seconds of game time
- Conditions
- Actions
- Custom script: set bj_wantDestroyGroup = true
- Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Picked unit)) Equal to Gold Mine
- Then - Actions
- Neutral Building - Set (Picked unit) to 1000000 gold
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Picked unit)) Equal to Entangled Gold Mine
- Then - Actions
- Neutral Building - Set (Picked unit) to 1000000 gold
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Picked unit)) Equal to Haunted Gold Mine
- Then - Actions
- Neutral Building - Set (Picked unit) to 1000000 gold
- Else - Actions
Sure, I can make it in jass. Just give me a second...thanks Archangel678, but i thinks .10 is for testing.
anyway, can some1 give me that in jass? for just copy & peaste?
or demo map? or just tell me where is "Neutral Building - Set (Picked unit) to 100000 gold"
function EndlessGold takes nothing returns boolean
local unit f
local group g = CreateGroup()
local integer id
call GroupEnumUnitsInRange(g, 0,0, 300000, null)
loop
set f = FirstOfGroup(g)
exitwhen f == null
set id = GetUnitTypeId(f)
if id == 'ugol' or id == 'egol' or id == 'ngol' then
call SetResourceAmount( f, 100000 )
endif
call GroupRemoveUnit(g,f)
endloop
call DestroyGroup(g)
set g = null
set f = null
return false
endfunction
function InitTrig_EndlessGold takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 1, true)
call TriggerAddCondition(t, Condition(function EndlessGold))
set t = null
endfunction