• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with a script

Status
Not open for further replies.
Level 4
Joined
Dec 2, 2011
Messages
76
[jass=Option]function Trig_GoldFarm_Conditions takes nothing returns boolean
if GetEventDamage() == 0 then
return false
endif
call ShowDamages()
if IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetEventDamageSource())) == false then
return false
endif
if GetUnitTypeId(GetEventDamageSource()) == 'H00D' then
return true
endif
if GetUnitTypeId(GetEventDamageSource()) == 'H000' then
return true
endif
return false
endfunction

function Trig_GoldFarm_Actions takes nothing returns nothing
call SetPlayerState( GetOwningPlayer(GetEventDamageSource()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetEventDamageSource()), PLAYER_STATE_RESOURCE_GOLD) + R2I(GetEventDamage()) )
endfunction

//===========================================================================
function InitTrig_GoldFarm takes nothing returns nothing
set gg_trg_GoldFarm = CreateTrigger( )
call TriggerAddCondition( gg_trg_GoldFarm, Condition( function Trig_GoldFarm_Conditions ) )
call TriggerAddAction( gg_trg_GoldFarm, function Trig_GoldFarm_Actions )
endfunction[/code]

I would like to multiply the gold output by 2 in this script, if you would please help me, I'm very new to jass
Thanks to all that help.
 
Last edited:
Status
Not open for further replies.
Top