Bonus Triggered Spell Damage Help

MorbazanRhot

New Member
Reaction score
7
So I'm working with enhancing my spell damage by scaling it with the casters intelligence, but I've run into a problem: timing the damage to when the spell hits. This isn't as much of a problem with aoe spells because you can set the damage to happen after a certain amount of time, but for single target spells I've had to live with just using waits and hoping for the best (never a good thing). Let me give an example:

Firebolt Bonus
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Firebolt yes
Actions
Wait 0.30 seconds
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (0.50 x (Real(WizardSpellDamage))) damage of attack type Spells and damage type Fire

Now the first problem is that based on the distance from the target it may hit at a different time than projected making the damage look even more off. An even bigger problem is that if you issue another order (most usually move) before the wait time is up, the bonus damage wont even resolve. So that leads me to my question: Is there a way to make the trigger occur when a unit takes damage from or is affected by a spell as opposed to when the spell is cast/resolves? Or if there's no answer for that, is there atleast a better way of timing the damage so that it's not so buggy? Thanks a lot in advance, and of course, easy +rep for anyone who can help :).
 

THE_X

New Member
Reaction score
49
Code:
Firebolt Bonus
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Firebolt yes
Actions
Set (firebolttarget) equal to target of ablity being cast
Unit - Cause (Casting unit) to damage (firebolttarget), dealing (0.50 x (Real(WizardSpellDamage))) damage of attack type Spells and damage type Fire

you need to set the unit that it is casted upon into a variable
 

MorbazanRhot

New Member
Reaction score
7
Ah, that's a good call, that would fix the bug with not dealing the damage after a wait time, thanks. However, if possible I'd still like an answer to either (or both if possible) of my questions: how to make a trigger go off when a unit is affected by a spell and how to better time the damage of the spell to when the unit gets hit (without having instant or incredibly high-speed spells).
 

THE_X

New Member
Reaction score
49
if the unit has a buff then just use the wait for condition (wait until (firebolttarget) has the buff of (then the buff it has) waiting every ... seconds.

that way it will wait untill its effected checking the time u have but that is still a wait trigger but better fitted to have your wants
 

MorbazanRhot

New Member
Reaction score
7
Well that works, kind of. In firebolts's case, the buff would be a .1 sec stun, so that's not very likely to be detected, or atleast consistently. I could make it checked every .05 seconds, but I'm afraid of having enough of those going at the same time might cause some lag. And even if I decided to give it a buff that lasted, there aren't enough different base buffs in the game to give them to all the different spells. So while that is a good idea for handling some spells I have, it wont really solve the bulk of my problems. Any more ideas?
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
Use "Unit - A unit takes damage"

It's a specific unit event, so you'll have to dynamically add the event using Trigger - Add Event.
 

MorbazanRhot

New Member
Reaction score
7
I'm afraid I'm not sure quite what you mean... I'm aware of the event that occurs when a unit takes damage, and I know that upon casting the spell I could set the targetted unit to a variable and then have the unit takes damage trigger when that specific unit takes damage, which would work for when the spell hits, unforunately that still doesn't work. The unit could very easily take damage from another source before the spell hits, thereby triggering the event even though it shouldn't go off. So if that's what you meant, thanks anyway for the effort, or if it's not I could use a little clarification please. That or if anyone else wants to answer the question(s) for me, that would be great too. Pretty please? :)
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
Use the unit takes damage and, every time it happens, check if the unit has the buff.

You could also check if the damage source is your unit, although that wouldn't be MUI with just GUI.
 

MorbazanRhot

New Member
Reaction score
7
Well, I appreciate the idea because it would work if it weren't for the buff problem I mentioned above. There aren't enough base buffs in the game to assign one for each single-target spell, and then if different spells/abilities have the same buff then once again the damage could still trigger off of an incorrect source. Anyone/anything else? Please?
 

darth-yoda

New Member
Reaction score
15
If you want the damage to be timed more closely with the projectiles impact you could use...

Code:
Wait ((Distance between Caster_L and Target_L) / 1000.00) seconds

Just divide the distance by the projectiles speed to get a more accurate timing. However if the projectile is slow and the target moves the timing could end up pretty far off. But if the projectile is fast and the cast distance isn't like 2000 you proly wont notice the difference. Anyway thats what I'm using in my map for a similar spell.
 

MorbazanRhot

New Member
Reaction score
7
Wow, thanks, I had thought there must be some way to do something like that but really had no clue quite how. That should work very well and pretty much entirely solves my problems. Thanks again :). However, if anyone can answer my other question (how, if there is a way, to make a trigger occur when a unit gets affect by a spell rather than when a unit casts the spell) that would be awesome. Again I'm not sure it's even possible, so I'm just throwing this out there. Thanks again to everyone who has helped!
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
However, if anyone can answer my other question (how, if there is a way, to make a trigger occur when a unit gets affect by a spell rather than when a unit casts the spell) that would be awesome. Again I'm not sure it's even possible, so I'm just throwing this out there.
As I said, register Unit - Takes Damage. Then, either check if the unit has the buff (you can make as many custom buffs as you want), or check if the damage source was the caster, by use of a variable. Or check if the damage source's current order is your ability, if it has a reasonable follow-through time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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!
    +1
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top