[Trigger] Need MUI help :(

Status
Not open for further replies.
Level 2
Joined
Sep 1, 2008
Messages
5
BubbleInit
  • Unit - A unit Starts the effect of an ability
  • (Ability being cast) Equal to Bubble
  • Trigger - Run Mui NewIndex <gen> (ignoring conditions)
  • Set Bubble_Caster[CurrentIndex] = (Triggering unit)
  • Set Bubble_Level[CurrentIndex] = (Level of Bubble for Bubble_Caster[Integer_A])
  • Set CurrentIndex = (CurrentIndex + 1)
  • Set UnitCasterHealth[CurrentIndex] = (Life of Bubble_Caster[Integer_A])
  • Trigger - Turn on Bubble Loop <gen>

Bubble Loop
  • For each (Integer A) from 1 to 50, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bubble_Caster[Integer_A] Not equal to No unit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bubble_Damage[Integer_A] Greater than (250 + (50 x (Level of Bubble for Bubble_Caster[Integer_A])))
            • Then - Actions
              • -------- The If - Conditions above --------
              • -------- Is to make this trigger turn itself off if the caster doesnt have the " Bubble " buff any more. --------
              • -------- Is to make this trigger turn itself off if the caster isn't alive any more. --------
              • -------- Or the damage has exceeded the absorbing capability of the spell. --------
              • -------- This Trigger action turns the " BubbleCheck " off so that it stops doing the actions it has --------
              • Unit - Remove Bubble buff from Bubble_Caster[Integer_A]
              • Set Bubble_Heal[Integer_A] = 0
              • Set Bubble_Damage[Integer_A] = 0
              • Set CurrentIndex = Integer_A
              • Trigger - Run ReturnIndex <gen> (ignoring conditions)
              • -------- Removes the buff you get when you cast the ability. --------
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Bubble_Caster[Integer_A] has buff Bubble ) Equal to True
                  • (Life of Bubble_Caster[Integer_A]) Greater than UnitCasterHealth[Integer_A]
                • Then - Actions
                  • -------- The If - Conditions above --------
                  • -------- Is to make sure the Caster still have the " Bubble " buff. --------
                  • -------- Is to check if the Caster has more HP then the original HP when the spell was casted. --------
                  • -------- Remember the UnitCasterHealth Variable action i set before? --------
                  • -------- It saved the Original HP... --------
                  • Set Bubble_Heal[Integer_A] = ((Integer((Life of Bubble_Caster[Integer_A]))) - (Integer(UnitCasterHealth[Integer_A])))
                  • -------- The Integer variable " Bubble_Heal " is to check how much the Caster got healed. --------
                  • -------- Allowing the Caster to receive heals. --------
                  • Set UnitCasterHealth[Integer_A] = (UnitCasterHealth[Integer_A] + (Real(Bubble_Heal[Integer_A])))
                  • -------- This Real variable is to add the " Bubble_Heal " to the " UnitCasterHealth " . --------
                  • -------- Making the original HP numbers grow in size. --------
                  • Set Bubble_Heal[Integer_A] = 0
                  • -------- This Variable action Nulls the " Bubble_Heal ". --------
                  • -------- So the healing wouldn't stack and bug up the spell ;) --------
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Bubble_Caster[Integer_A] has buff Bubble ) Equal to True
                  • (Life of Bubble_Caster[Integer_A]) Less than UnitCasterHealth[Integer_A]
                • Then - Actions
                  • -------- The If - Conditions above --------
                  • -------- Is to make sure the Caster still have the " Bubble " buff. --------
                  • -------- Is to check if the Caster has less HP then the original HP when the spell was casted. --------
                  • Set Bubble_Damage[Integer_A] = (Bubble_Damage[Integer_A] + ((Integer(UnitCasterHealth[Integer_A])) - (Integer((Life of Bubble_Caster[Integer_A])))))
                  • -------- The Integer variable " Bubble_Damage " is to count how much the Caster got damaged. --------
                  • Unit - Set life of Bubble_Caster[Integer_A] to UnitCasterHealth[Integer_A]
                  • -------- This Unit action heals the caster back to original HP --------
                  • -------- That is ofcourse if the Caster hasn't gotten healed anything before then. --------
                  • -------- Then it would add Original HP + Healing done to Caster since the Spell was cast. --------
                  • -------- Heals; Heals from spells and Level ups and simple Health Regeneration --------
                  • -------- Basically anything that raises HP --------
                • Else - Actions
        • Else - Actions
MUI INIT
  • Events
    • Map initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 50, do (Actions)
      • Loop - Actions
        • Set BubbleID[Integer_A] = Integer_A
        • Set Bubble_Caster[Integer_A] = No unit
  • Mui NewIndex
    • Events
    • Conditions
    • Actions
      • Set BubbleIndex = (BubbleIndex + 1)
      • Set CurrentIndex = BubbleID[BubbleIndex]
  • ReturnIndex
    • Events
    • Conditions
    • Actions
      • Set BubbleID[BubbleIndex] = CurrentIndex
      • Set BubbleIndex = (BubbleIndex - 1)
this spell absorbs damage and i have tried the wyrmwrath MUI guide but it didnt work for this spell... please tell me how i should do it ;) that would be kind.

if anyone got the answer it would be sweet :)

im kinda new at this and you guys are like awesome with coding ;)
 

Attachments

  • Bubble.w3x
    26.8 KB · Views: 60
Last edited:
Level 14
Joined
Oct 18, 2008
Messages
599
well first you set current index in the first trigger +1 AFTER you set the caster so set the current index before setting the caster and everything else and that will fix 1 problem.

then u use for each integer A... never use that because that can bug alot ^^. instead use for each variable do 1 to current index do actions
and replace the "variable" part with a new variable to take the place of the current index variable. so set a random integer called CI or somthing like that and put that variable in the array of all the variables in the next trigger

eX: for each CI do 1 to currentindex do actions

set variable (CI) = something
set variable (CI) = something

and it goes like that but all i can say you are on the right track and just fix those few things that i see and it will probably work unless there is something i missed.
 
Level 2
Joined
Sep 1, 2008
Messages
5
well first you set current index in the first trigger +1 AFTER you set the caster so set the current index before setting the caster and everything else and that will fix 1 problem.

then u use for each integer A... never use that because that can bug alot ^^. instead use for each variable do 1 to current index do actions
and replace the "variable" part with a new variable to take the place of the current index variable. so set a random integer called CI or somthing like that and put that variable in the array of all the variables in the next trigger

eX: for each CI do 1 to currentindex do actions

set variable (CI) = something
set variable (CI) = something

and it goes like that but all i can say you are on the right track and just fix those few things that i see and it will probably work unless there is something i missed.


ya okay.. i got like 50% of that but wich triggers are you talking about when you say " First Trigger " because i have to know wich one that is .. is it the casting trigger or map initialization trigger?
  • BubbleInit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bubble
    • Actions
      • -------- The Event and Condition above --------
      • Trigger - Run Mui NewIndex <gen> (ignoring conditions)
      • -------- Basically is to let the Trigger know when to start its actions. --------
      • -------- This Integer variable is to tell the trigger when to stop absorbing damage. --------
      • -------- This integer variable allows the caster to be healed even whilst absorbing damage. --------
      • Set Bubble_Caster[CurrentIndex] = (Triggering unit)
      • Set Bubble_Level[CurrentIndex] = (Level of Bubble for Bubble_Caster[Integer_A])
      • -------- This saves the Casting unit so the Triggers can Recognize it. --------
      • Set UnitCasterHealth[CurrentIndex] = (Life of Bubble_Caster[Integer_A])
      • Set CurrentIndex = (CurrentIndex + 1)
      • -------- This Real variable saves the HP of caster when it has started the absorbing spell. --------
      • -------- This Trigger action turns on the originally turned off BubbleCheck --------
      • Trigger - Turn on Bubble Loop <gen>
  • Bubble Loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CI) from 1 to CurrentIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bubble_Caster[CI] Not equal to No unit
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bubble_Damage[CI] Greater than (250 + (50 x (Level of Bubble for Bubble_Caster[CI])))
                • Then - Actions
                  • -------- The If - Conditions above --------
                  • -------- Is to make this trigger turn itself off if the caster doesnt have the " Bubble " buff any more. --------
                  • -------- Is to make this trigger turn itself off if the caster isn't alive any more. --------
                  • -------- Or the damage has exceeded the absorbing capability of the spell. --------
                  • -------- This Trigger action turns the " BubbleCheck " off so that it stops doing the actions it has --------
                  • Unit - Remove Bubble buff from Bubble_Caster[CI]
                  • Set Bubble_Heal[CI] = 0
                  • Set Bubble_Damage[CI] = 0
                  • Set CurrentIndex = CI
                  • Trigger - Run ReturnIndex <gen> (ignoring conditions)
                  • -------- Removes the buff you get when you cast the ability. --------
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Bubble_Caster[CI] has buff Bubble ) Equal to True
                      • (Life of Bubble_Caster[CI]) Greater than UnitCasterHealth[CI]
                    • Then - Actions
                      • -------- The If - Conditions above --------
                      • -------- Is to make sure the Caster still have the " Bubble " buff. --------
                      • -------- Is to check if the Caster has more HP then the original HP when the spell was casted. --------
                      • -------- Remember the UnitCasterHealth Variable action i set before? --------
                      • -------- It saved the Original HP... --------
                      • Set Bubble_Heal[CI] = ((Integer((Life of Bubble_Caster[CI]))) - (Integer(UnitCasterHealth[CI])))
                      • -------- The Integer variable " Bubble_Heal " is to check how much the Caster got healed. --------
                      • -------- Allowing the Caster to receive heals. --------
                      • Set UnitCasterHealth[CI] = (UnitCasterHealth[CI] + (Real(Bubble_Heal[CI])))
                      • -------- This Real variable is to add the " Bubble_Heal " to the " UnitCasterHealth " . --------
                      • -------- Making the original HP numbers grow in size. --------
                      • Set Bubble_Heal[CI] = 0
                      • -------- This Variable action Nulls the " Bubble_Heal ". --------
                      • -------- So the healing wouldn't stack and bug up the spell ;) --------
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Bubble_Caster[CI] has buff Bubble ) Equal to True
                      • (Life of Bubble_Caster[CI]) Less than UnitCasterHealth[CI]
                    • Then - Actions
                      • -------- The If - Conditions above --------
                      • -------- Is to make sure the Caster still have the " Bubble " buff. --------
                      • -------- Is to check if the Caster has less HP then the original HP when the spell was casted. --------
                      • Set Bubble_Damage[CI] = (Bubble_Damage[CI] + ((Integer(UnitCasterHealth[CI])) - (Integer((Life of Bubble_Caster[CI])))))
                      • -------- The Integer variable " Bubble_Damage " is to count how much the Caster got damaged. --------
                      • Unit - Set life of Bubble_Caster[CI] to UnitCasterHealth[CI]
                      • -------- This Unit action heals the caster back to original HP --------
                      • -------- That is ofcourse if the Caster hasn't gotten healed anything before then. --------
                      • -------- Then it would add Original HP + Healing done to Caster since the Spell was cast. --------
                      • -------- Heals; Heals from spells and Level ups and simple Health Regeneration --------
                      • -------- Basically anything that raises HP --------
                    • Else - Actions
            • Else - Actions
  • Mui NewIndex
    • Events
    • Conditions
    • Actions
      • Set CI = CurrentIndex
      • Set BubbleIndex = (BubbleIndex + 1)
      • Set CurrentIndex = BubbleID[BubbleIndex]
  • ReturnIndex
    • Events
    • Conditions
    • Actions
      • Set CI = (CI - 1)
      • Set BubbleID[BubbleIndex] = CurrentIndex
      • Set BubbleIndex = (BubbleIndex - 1)
 
Status
Not open for further replies.
Top