- Joined
- Sep 6, 2008
- Messages
- 2
I recently started using JASS for triggering, and I want to make a passive that heals the hero for a % of the mana cost of the spell. However, I can't seem to find a function (I checked the API on sourceforge.net, although there's a good chance that I was looking in the wrong place) that would call the mana cost of the spell, and I would hate to have to go through and have to make a separate function for each level for each possible spell being cast.
For reference, I currently have this.
But I want to replace the 1 with the mana cost of the spell.
For reference, I currently have this.
Code:
function Trig_Magic_Mastery_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'E000' ) ) then
return false
endif
return true
endfunction
function Trig_Magic_Mastery_Actions takes nothing returns nothing
call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) + ( 0.75 * 1 ) ) )
call SetUnitManaBJ( GetTriggerUnit(), (
endfunction
//===========================================================================
function InitTrig_Magic_Mastery takes nothing returns nothing
set gg_trg_Magic_Mastery = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Magic_Mastery, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Magic_Mastery, Condition( function Trig_Magic_Mastery_Conditions ) )
call TriggerAddAction( gg_trg_Magic_Mastery, function Trig_Magic_Mastery_Actions )
endfunction
But I want to replace the 1 with the mana cost of the spell.