Hero get killed you get gold tigger help!!

ghost reaper

New Member
Reaction score
0
hey everyone just need help with 1 little tigger but can't work it out.
i wanna make it so when my hero kills over hero he gets gold but depends on his level eg...:banghead: level 2 * 5gold = 10:banghead:

thanks
 

sentrywiz

New Member
Reaction score
25
Here you go:

Trigger:
  • Hero Gold Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is A Hero) Equal to True
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Player - Add ((Hero level of (Killing unit)) x 5) to (Owner of (Killing unit)) Current gold


Just change the " x 5 " with whatever value you want the level of the hero multiplied with.

EDIT:

If your a Jass-guy, heres the code:

JASS:
function Trig_Hero_Gold_Kill_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetKillingUnitBJ(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Gold_Kill_Actions takes nothing returns nothing
    call AdjustPlayerStateBJ( ( GetHeroLevel(GetKillingUnitBJ()) * 5 ), GetOwningPlayer(GetKillingUnitBJ()), PLAYER_STATE_RESOURCE_GOLD )
endfunction

//===========================================================================
function InitTrig_Hero_Gold_Kill takes nothing returns nothing
    set gg_trg_Hero_Gold_Kill = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Gold_Kill, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Hero_Gold_Kill, Condition( function Trig_Hero_Gold_Kill_Conditions ) )
    call TriggerAddAction( gg_trg_Hero_Gold_Kill, function Trig_Hero_Gold_Kill_Actions )
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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