roaaaarrrr
New Member
- Reaction score
- 33
Trying to work the kinks out of my custom hero bounty. The trigger works just fine normally, but there are two heroes that I want to give more gold than everything else. The only function I could see that gets a hero id is IsHeroUnitID. But that doesn't seem to be doing what I need it to.
I tested it on level 21 heroes, and it gives me 725 gold no matter what the hero is. If anyone has any ideas I'd appreciate it!!
JASS:
function Trig_Hero_Bounty_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(GetKillingUnit()))
endfunction
function Trig_Hero_Bounty_Actions takes nothing returns nothing
local unit source = GetTriggerUnit()
local player owner = GetOwningPlayer(GetKillingUnit())
local integer Bounty
if IsHeroUnitId(039;N00O039;)==true then
set Bounty = (GetHeroLevel(source)-1) * 25 + 300
elseif IsHeroUnitId(039;H01D039;)==true then
set Bounty = (GetHeroLevel(source)-1) * 25 + 300
else
set Bounty = (GetHeroLevel(source)-1) * 25 + 100
endif
call SetPlayerState(owner, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(owner, PLAYER_STATE_RESOURCE_GOLD) + Bounty)
call TextTag_GoldBounty(source,"+"+I2S(Bounty),owner)
set source = null
set owner = null
endfunction
//===========================================================================
function InitTrig_Hero_Bounty takes nothing returns nothing
set gg_trg_Hero_Bounty = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Bounty, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Hero_Bounty, Condition( function Trig_Hero_Bounty_Conditions ) )
call TriggerAddAction( gg_trg_Hero_Bounty, function Trig_Hero_Bounty_Actions )
endfunction
I tested it on level 21 heroes, and it gives me 725 gold no matter what the hero is. If anyone has any ideas I'd appreciate it!!