Mana Freeze ?

zero9x

Active Member
Reaction score
1
I saw a skill that will: reduce all mana of Target Unit and return it after few seconds. (Return 90/85/80/75% of the mana lost)

But i dont know how to do it, i tried to make this trigger, thats
Set: Temp_Real = Mana of Target Unit
Set mana of target unit = Temp_Real - Temp_Real
Wait 1.75/2/2.25/2.5 seconds
Set mana of Target Unit = Temp_Real + (Temp_Real x ((0.95 - 0.05 x Real Lv of Ability)))

But it isnt work, can u guys help me to make this skill with MUI?

Hope this spell will useful to some one:

Target a unit, cause it lose all mana, return 90/85/80/75% of the mana to that unit after 1.75/2.5/3.25/4s.

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Mana Freeze
    • Actions
      • Custom Script: local unit u = GetSpellTargetUnit()
      • Custom Script: local real delay = 1.00 + ( 0.75 * I2R(GetUnitAbilityLevelSwapped('XXXX', GetTriggerUnit()) ) )
      • Custom Script: local real mana = GetUnitStateSwap(UNIT_STATE_MANA, u) * ( 0.95 - ( 0.05 * I2R(GetUnitAbilityLevelSwapped('XXXX', GetTriggerUnit()) ) ) )
      • Custom Script: if ( GetUnitStateSwap(UNIT_STATE_MANA, u) > 0.00) then
      • Custom Script: call SetUnitManaBJ( u, 0.00 )
      • Custom Script: call TriggerSleepAction( delay )
      • Custom Script: call SetUnitManaBJ( u, mana )
      • Custom Script: endif
      • Custom Script: set u = null

change XXXX with the ability ID of mana freeze

Done by jnZ
 

jnZ

I
Reaction score
64
Set mana of target unit = Temp_Real - Temp_Real
- why not just set it to 0?

Set mana of Target Unit = Temp_Real + (Temp_Real x ((0.95 - 0.05 x Real Lv of Ability)))
- you want the unit to end up with 90/85/80/75% of its original mana right? so why are you increasing the mana of the unit? Remove the Temp_Real at the start of the addition.
 

zero9x

Active Member
Reaction score
1
For example:
If unit has 500/1000 mana, when i use this to that unit, remove all mana (equal = 0) and after few seconds, it will return 490/425/400/375 mana to that unit.

Can u help me plz?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
(Target unit of ability being cast) doesn't work after waits. Create a local variable to refer to the target, and another to refer to the original amount of mana (in case the ability gets cast again during the wait).
 

jnZ

I
Reaction score
64
like i said. in that case i don't understand why you are doing this:
Code:
Set mana of Target Unit = Temp_Real + (Temp_Real x ((0.95 - 0.05 x Real Lv of Ability)))
in the example with 500 mana that would set the units mana to
500 + 490 = 990
so remove the Temp_Real at the start of the addition.

just create a variable like you did with Temp_Real. Variably type unit and name it Temp_Unit for example.
at the beginning of your trigger set Temp_Unit to:
Code:
set Temp_Unit to Target Unit

and always use Temp_Unit instead of Target Unit in the rest of your trigger
 

zero9x

Active Member
Reaction score
1
Here is my trigger, my brother made it for me, but it isnt MUI, can u guys help me to "MUI" it plz :)

Target 1 enemy unit, cause it lose all mana and after few seconds, return the mana to that unit:
Level 1 - Return 90% mana, last 1,75s
Level 2 - Return 85% mana, last 2.5s
Level 3 - Return 80% mana, last 3.25s
Level 4 - Return 75% mana, last 4s.

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Mana Freeze
    • Actions
      • Set AAUnit = (Target unit of ability being cast)
      • Set AAInteger = (Integer((1.00 + (0.75 x (Real((Level of Mana Freeze for (Triggering unit))))))))
      • Set AAReal = ((Mana of AAUnit) x ((95.00 - (5.00 - (Real(AAInteger)))) / 100.00))
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Max mana of AAUnit) Less than or equal to (<=) 0.00
          • Then - Actions
            • Do nothing
          • Else - Actions
            • Unit - Set mana of AAUnit to 0.00
            • Countdown Timer - Start AATimer as a One-shot timer that will expire in (Real(AAInteger)) seconds


Trigger:
  • Events
    • Time - AATimer expires
    • Conditions
    • Actions
      • Unit - Set mana of AAUnit to ((Mana of AAUnit) + AAReal)
 

jnZ

I
Reaction score
64
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Mana Freeze
    • Actions
      • Custom Script: local unit u = GetSpellTargetUnit()
      • Custom Script: local real delay = 1.00 + ( 0.75 * I2R(GetUnitAbilityLevelSwapped('XXXX', u) ) )
      • Custom Script: local real mana = GetUnitStateSwap(UNIT_STATE_MANA, u) * ( 0.95 - ( 0.05 * I2R(GetUnitAbilityLevelSwapped('XXXX', u) ) ) )
      • Custom Script: if ( GetUnitStateSwap(UNIT_STATE_MANA, u) > 0.00) then
        • Custom Script: call SetUnitManaBJ( u, 0.00 )
        • Custom Script: call TriggerSleepAction( delay )
        • Custom Script: call SetUnitManaBJ( u, mana )
      • Custom Script: endif
      • Custom Script: set u = null


change XXXX with the ability ID of mana freeze

EDIT: fixed :>
 

jnZ

I
Reaction score
64
what do you mean? thats perfectly fine. it won't move the actions inside the then bracket slightly to the right like it does here in the forums. if thats what you mean
 

zero9x

Active Member
Reaction score
1
I tested, and found something:

The mana will return to that unit after 1.75s in all level
And that unit always lost 90% of it mana in all level

can u help me to fix that? My ability's raw code is A06X, i dunno what happened...
 

jnZ

I
Reaction score
64
oh yeah now that you mention it the flaw is obvious. it checks for the level of mana freeze at the targeted unit. but thats obviously wrong.

change:
Code:
Custom Script: local real delay = 1.00 + ( 0.75 * I2R(GetUnitAbilityLevelSwapped('XXXX', u) ) )
Custom Script: local real mana = GetUnitStateSwap(UNIT_STATE_MANA, u) * ( 0.95 - ( 0.05 * I2R(GetUnitAbilityLevelSwapped('XXXX', u) ) ) )

to:
Code:
Custom Script: local real delay = 1.00 + ( 0.75 * I2R(GetUnitAbilityLevelSwapped('XXXX', GetTriggerUnit()) ) )
Custom Script: local real mana = GetUnitStateSwap(UNIT_STATE_MANA, u) * ( 0.95 - ( 0.05 * I2R(GetUnitAbilityLevelSwapped('XXXX', GetTriggerUnit()) ) ) )

sorry about that
 

zero9x

Active Member
Reaction score
1
Worked, and one think i wanna say is: Perfect!

Thanks for helped me, jnZ xD
 

jnZ

I
Reaction score
64
you are welcome.

but you didn't say it like that because you just read my message in the chatbox right? :D
 

jnZ

I
Reaction score
64
if you are logged in and on the forum tab there should be a chatbox at the top of the site.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top