- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright, I've been trying to set up an Aura and some other passives. However, the method I know of places a unit in a global variable once it learns the spell, then creates a new trigger and calls up that unit.
My spells HAVE to be MUI/MPI for the map I'm doing. So that means primarily local variables and other restrictions.
I found an example of an MUI/MPI Aura and am using it to the best of my ability, however it doesn't work.
So how do I set up an aura or a passive using the level of an ability on a stored unit to check the strength of the spell?
I'm trying this method but there's something wrong with it. :\ Any help is appreciated.
My spells HAVE to be MUI/MPI for the map I'm doing. So that means primarily local variables and other restrictions.
I found an example of an MUI/MPI Aura and am using it to the best of my ability, however it doesn't work.
So how do I set up an aura or a passive using the level of an ability on a stored unit to check the strength of the spell?
I'm trying this method but there's something wrong with it. :\ Any help is appreciated.
JASS:
function Trig_Illum_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'Illu' ) ) then
return false
endif
return true
endfunction
function IllumConditions takes nothing returns boolean
local unit PotM=GetTriggerUnit()
if GetBooleanAnd(IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(PotM)), (DistanceBetweenPoints(GetUnitLoc(PotM), GetUnitLoc(GetTriggerUnit())) >= 900.00 ) ) then
return false
endif
return true
endfunction
function IllumActions takes nothing returns nothing
local integer random = GetRandomInt(1, 100)
call PolledWait( 0.25 )
if random <= 10 + (10 * GetUnitAbilityLevelSwapped('Illu', GetTriggerUnit())) then
call SetUnitManaBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit()) + ( 1.50 * I2R( (random)) ) ) )
call AddSpecialEffectTargetUnitBJ( "origin", GetAttackedUnitBJ(), "Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl" )
call DestroyEffect( GetLastCreatedEffectBJ() )
set random = ( random * R2I(1.50) )
call CreateTextTagUnitBJ( I2S(random), GetTriggerUnit(), 0, 10.00, 25.00, 50.00, 100.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 10.00, 90.00 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.50 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 1.00 )
endif
endfunction
function Trig_Illum_Actions takes nothing returns nothing
local unit PotM=GetTriggerUnit()
local integer lvl=GetUnitAbilityLevel(PotM,'Illu')
local trigger trg
if lvl==1 then
set trg=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(trg,Condition(function IllumConditions))
call TriggerAddAction(trg,function IllumActions)
endif
endfunction
//===========================================================================
function InitTrig_Illum takes nothing returns nothing
set gg_trg_Illum = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Illum, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Illum, Condition( function Trig_Illum_Conditions ) )
call TriggerAddAction( gg_trg_Illum, function Trig_Illum_Actions )
endfunction