[Trigger] How to make this simply GUI MUI

Status
Not open for further replies.
Event: A unit starts casting an ability
Condition: Abilty being cast equal to Plagued Brain
Action:
-----Do some action with target unit of ability being cast-----
wait 5 seconds
-----Do some action with target unit of ability being cast-----

Because of the target unit of ability being cast is null after 5 seconds, it does not work corretly. Can anyone help me please?
 
  • Custom script: local unit udg_Tmp_Unit = GetSpellTargetUnit()
  • Custom script: local integer udg_Tmp_Integer = ( 5 + GetUnitAbilityLevelSwapped('A00O', GetTriggerUnit()) )
    • For each (Integer A) from 1 to Tmp_Integer, do (Actions)
      • Loop - Actions
        • Wait 1.00 game-time seconds
        • Unit - Cause (Triggering unit) to damage Tmp_Unit, dealing (12.50 + ((Real((Level of Weakening Epidemic for (Triggering unit)))) x 2.50)) damage of attack type spells and damage type magic
        • Set Tmp_Loc = (Position of Tmp_Unit)
        • Specialeffect - Create a special effect at Tmp_Loc using Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
        • Custom script: call RemoveLocation(udg_Tmp_Loc)
        • Set Tmp_Effect = (Last created special effect)
        • Specialeffect - Destroy Tmp_Effect
    • Custom script: set udg_Tmp_Unit = null
    • Custom script: set udg_Tmp_Integer = 0
And whats wrong with this?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Your trigger has no problems.

It could be coded better though.

You do not need to use the Special Effect variable. Simply create and destroy it in the following line (last created special effect).
You do not need to set the integer to 0 as it is a local.

A local variable loses its value when its function ends.
 
Status
Not open for further replies.
Top