Burn % of current mana

Archideas

Active Member
Reaction score
32
Right, so I'm trying to make a spell that burns away 20%/30%/40% of current mana of the picked enemy units and deals that amount in damage. I'm not really certain this formula I have so far is correct so I'm turning to you guys to help me out.

Trigger:
  • Almagest
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Almagest
    • Actions
      • Set HeroCaster = (Casting unit)
      • Set HeroCastPoint = (Position of HeroCaster)
      • Set HeroCastUnitGrp = (Units within 600.00 of HeroCastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of HeroCaster)) Equal to True))))
      • Unit Group - Pick every unit in HeroCastUnitGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause HeroCaster to damage (Picked unit), dealing ((Mana of (Picked unit)) x (0.10 + (0.10 x (Real((Level of Almagest for HeroCaster)))))) damage of attack type Spells and damage type Normal
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) x (0.10 + (0.10 x (Real((Level of Almagest for HeroCaster))))))
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup( udg_HeroCastUnitGrp )
      • Custom script: call RemoveLocation( udg_HeroCastPoint )
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Right, so I'm trying to make a spell that burns away 20%/30%/40% of current mana of the picked enemy units and deals that amount in damage. I'm not really certain this formula I have so far is correct so I'm turning to you guys to help me out.

Trigger:
  • Almagest
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Almagest
    • Actions
      • Set HeroCaster = (Casting unit)
      • Set HeroCastPoint = (Position of HeroCaster)
      • Set HeroCastUnitGrp = (Units within 600.00 of HeroCastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of HeroCaster)) Equal to True))))
      • Unit Group - Pick every unit in HeroCastUnitGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause HeroCaster to damage (Picked unit), dealing ((Mana of (Picked unit)) x (0.10 + (0.10 x (Real((Level of Almagest for HeroCaster)))))) damage of attack type Spells and damage type Normal
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) x (0.10 + (0.10 x (Real((Level of Almagest for HeroCaster))))))
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup( udg_HeroCastUnitGrp )
      • Custom script: call RemoveLocation( udg_HeroCastPoint )

Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - ((Mana of (Picked unit) x (0.10 + (0.10 x (Real((Level of Almagest for HeroCaster)))))))

That should work? ^^
 

Bogrim

y hello thar
Reaction score
154
There are other mistakes in this trigger.

1. You don't need to assign a variable for the casting unit, just use "Event Response - Triggering unit".

2. You need another condition in your unit group which detects if the unit has mana or not, e.g. (Mana of (Matching Unit)) Greater than 0.

3. The mana drain formula should be ((Mana of (Picked unit)) * (0.90 - (0.10 x (Real((Level of Almagest for HeroCaster)))))).
 

Archideas

Active Member
Reaction score
32
After your suggestions, my trigger looks like this now.

Trigger:
  • Almagest
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Almagest
    • Actions
      • Set HeroCaster = (Casting unit)
      • Set HeroCastPoint = (Position of HeroCaster)
      • Set HeroCastUnitGrp = (Units within 600.00 of HeroCastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Mana of (Matching unit)) Greater than 0.00) and ((((Matching unit) belongs to an enemy of (Owner of HeroCa
      • Unit Group - Pick every unit in HeroCastUnitGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause HeroCaster to damage (Picked unit), dealing ((Mana of (Picked unit)) x (0.10 + (0.10 x (Real((Level of Almagest for HeroCaster)))))) damage of attack type Spells and damage type Normal
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) x (0.90 - (0.10 x (Real((Level of Almagest for HeroCaster))))))
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup( udg_HeroCastUnitGrp )
      • Custom script: call RemoveLocation( udg_HeroCastPoint )
 

Ayanami

칼리
Reaction score
288
Can be further optimized to this. You do not need the variable "HeroCaster" at all.

Trigger:
  • Almagest
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Almagest
    • Actions
      • Set HeroCastPoint = (Position of (Triggering unit))
      • Set HeroCastUnitGrp = (Units within 600.00 of HeroCastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Mana of (Matching unit)) Greater than 0.00) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))
      • Unit Group - Pick every unit in HeroCastUnitGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Mana of (Picked unit)) x (0.10 + (0.10 x (Real((Level of Almagest for (Triggering unit))))))) damage of attack type Spells and damage type Magic
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) x (0.90 - (0.10 x (Real((Level of Almagest for HeroCaster))))))
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup( udg_HeroCastUnitGrp )
      • Custom script: call RemoveLocation( udg_HeroCastPoint )
 

Archideas

Active Member
Reaction score
32
Got another trigger that doesn't want to work as I want it to. This is supposed to drain 50 health from all enemy units within a 375 radius each second for 3 seconds. But somehow it won't work. I'm sure I missed something obvious but I can't find the problem.

Trigger:
  • Grand Cross
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grand Cross
    • Actions
      • Set GrandCrossPoint = (Target point of ability being cast)
      • Set GrandCrossCaster = (Casting unit)
      • Set CrossLoops = 0
      • Unit - Create 1 Grand Cross Dummy for (Owner of GrandCrossCaster) at GrandCrossPoint facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Trigger - Turn on Grand Cross DoT <gen>


Trigger:
  • Grand Cross DoT
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set GrandCrossGrp = (Units within 375.00 of GrandCrossPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of
      • Unit Group - Pick every unit in GrandCrossGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause GrandCrossCaster to damage (Picked unit), dealing 12.50 damage of attack type Chaos and damage type Universal
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set CrossLoops = (CrossLoops + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CrossLoops Equal to 12
            • Then - Actions
              • Custom script: call RemoveLocation( udg_GrandCrossPoint )
              • Custom script: call DestroyGroup( udg_GrandCrossGrp )
              • Trigger - Turn off (This trigger)
            • Else - Actions
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
This can be done in one trigger
(Handwritten)
Trigger:
  • GrandCross
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grand Cross
    • Actions
      • Set GrandCrossPoint = (Target point of ability being cast)
      • Set GrandCrossGrp = (Units within 375.00 of GrandCrossPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit........
      • Custom script: call RemoveLocation( udg_GrandCrossPoint )
      • For Each integer A from 1 to 12 do actions
        • loop-actions
          • Unit Group - Pick every unit in GrandGrossGrp and do multiple actions
            • loop-actions
              • Set life of (Triggering Unit) to: (Current life)+50
              • Set life of (picked unit) to: (Current life)-50
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Wait 0.25 seconds
      • Custom script: call DestroyGroup( udg_GrandCrossGrp )
 

Archideas

Active Member
Reaction score
32
So this way I can make it so all enemy units within a 375 radius of the target point have 12.5 health per 0.25 second drained from them over a course of 3 seconds?
 

HydraRancher

Truth begins in lies
Reaction score
197
So this way I can make it so all enemy units within a 375 radius of the target point have 12.5 health per 0.25 second drained from them over a course of 3 seconds?

It is not recommended to use this method, it may bugg up when using other (Integer A) actions. If you wish to have a repeatative draining system, you probably need to use Timers and/but not Hashtables.
 

Archideas

Active Member
Reaction score
32
I noticed I forgot to specify the problem. It basically won't last the 3 seconds I want it to. Even though it should drain 150 health in total, it only drains like 50. And as far as I know, 12.5 * 12 = 150, and 3 / 12 = 0.25. So I think my formula is right, but it still doesn't want to work. :<
 

HydraRancher

Truth begins in lies
Reaction score
197
I noticed I forgot to specify the problem. It basically won't last the 3 seconds I want it to. Even though it should drain 150 health in total, it only drains like 50. And as far as I know, 12.5 * 12 = 150, and 3 / 12 = 0.25. So I think my formula is right, but it still doesn't want to work. :<

Dont use set life = ...
Use Unit - Damage Target.
Where did you get your 3 from? (in 3 / 12 = 0.25)
 

Archideas

Active Member
Reaction score
32
Dont use set life = ...
Use Unit - Damage Target.
Where did you get your 3 from? (in 3 / 12 = 0.25)

I'm not using Set Life, I'm using Damage. The spell should drain 12.5 health per 0.25 second from enemy units within a 375 radius from where the spell is casted. And since it lasts 3 seconds in total, it should loop 12 times in total.

So the 3 / 12 = 0.25 basically means that if I want it to loop every 0.25 second for 3 seconds, I need to loop it 12 times. :<
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
I'm just gonna shoot this out: Why don't you make the dummy have permanent immolation? If damage is the only problem ^^
 

Archideas

Active Member
Reaction score
32
I'm just gonna shoot this out: Why don't you make the dummy have permanent immolation? If damage is the only problem ^^

My god... Why the fooking freckles didn't I think of that before? Thanks alot for the suggestion. xP
 

Ayanami

칼리
Reaction score
288
Your problem lies in this trigger.

Trigger:
  • Grand Cross DoT
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set GrandCrossGrp = (Units within 375.00 of GrandCrossPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of
      • Unit Group - Pick every unit in GrandCrossGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause GrandCrossCaster to damage (Picked unit), dealing 12.50 damage of attack type Chaos and damage type Universal
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set CrossLoops = (CrossLoops + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CrossLoops Equal to 12
            • Then - Actions
              • Custom script: call RemoveLocation( udg_GrandCrossPoint )
              • Custom script: call DestroyGroup( udg_GrandCrossGrp )
              • Trigger - Turn off (This trigger)
            • Else - Actions


It should look like this.

Trigger:
  • Grand Cross DoT
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set GrandCrossGrp = (Units within 375.00 of GrandCrossPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of
      • Unit Group - Pick every unit in GrandCrossGrp and do (Actions)
        • Loop - Actions
          • Unit - Cause GrandCrossCaster to damage (Picked unit), dealing 12.50 damage of attack type Chaos and damage type Universal
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Set CrossLoops = (CrossLoops + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CrossLoops Equal to 12
        • Then - Actions
          • Custom script: call RemoveLocation( udg_GrandCrossPoint )
          • Custom script: call DestroyGroup( udg_GrandCrossGrp )
          • Trigger - Turn off (This trigger)
        • Else - Actions


Due to your "Set CrossLoops" being inside your unit group loop, it will loop. Thus, let's say there are 3 units in the group. Then the set action would loop 3 times, resulting your DoT trigger to end faster than usual.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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