- Joined
- Sep 14, 2009
- Messages
- 284
I have a non-MUI spell that consists of two JASS triggers, but I want to make my map more compact and make spells consist of only one trigger (all code in one trigger). I have seen more advanced spells in only one trigger and I figure if I get some help with this one maybe I can figure out how to do it with the others as well.
Here are the triggers:
Here are the triggers:
JASS:
function MeditationCast_Conditions takes nothing returns boolean
return GetIssuedOrderIdBJ() == String2OrderIdBJ("immolation") and GetUnitAbilityLevelSwapped('A014', GetTriggerUnit()) >= 1
endfunction
function MeditationCast_Actions takes nothing returns nothing
set udg_MeditationCaster = GetTriggerUnit()
call StartTimerBJ(udg_MeditationTimer, false, 0.50)
endfunction
//===========================================================================
function InitTrig_MeditationCast takes nothing returns nothing
set gg_trg_MeditationCast = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_MeditationCast, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(gg_trg_MeditationCast, Condition(function MeditationCast_Conditions))
call TriggerAddAction(gg_trg_MeditationCast, function MeditationCast_Actions)
endfunction
JASS:
function MeditationHeal_Actions takes nothing returns nothing
if IsUnitAliveBJ(udg_MeditationCaster) == true and UnitHasBuffBJ(udg_MeditationCaster, 'B003') == true then
call GetSpellPower(udg_MeditationCaster)
set udg_HealAmount = 7.00 + (3.00 * I2R(GetUnitAbilityLevelSwapped('A014', udg_MeditationCaster))) + (0.15 * udg_GetSpellPowerAmount)
call Heal(udg_MeditationCaster, udg_MeditationCaster, udg_HealAmount)
call StartTimerBJ(udg_MeditationTimer, false, 1.00)
endif
endfunction
//===========================================================================
function InitTrig_MeditationHeal takes nothing returns nothing
set gg_trg_MeditationHeal = CreateTrigger()
call TriggerRegisterTimerExpireEventBJ(gg_trg_MeditationHeal, udg_MeditationTimer)
call TriggerAddAction(gg_trg_MeditationHeal, function MeditationHeal_Actions)
endfunction