How to deal a specific element damage without triggering spell?

FarAwaY

TH.net Regular
Reaction score
9
Okay here's my problem:

I want to make a kind of system that deals Fire/Ice/Lightning, etc damage to my targets whenever I cast a spell.

The thing is, I don't want to be triggering every single spell (imagine 60-100 spells and I have to trigger...). I also dont want to be triggering a simple spell like chain lightning or shockwave when you already have that spell in the Object Editor.

So my question is, how do I deal a specific element damage for any spell without having to trigger the entire spell itself? I've looked through a few systems, but with my low understanding of JASS, I cant really use them.

Please help! +rep
 

canons200

New Member
Reaction score
50
use pierce, normal and magic attack to replace fire, ice amd lightning? at such you only need to change to armor rate, simple and easy
 

FarAwaY

TH.net Regular
Reaction score
9
I know.

But still, you have to trigger them. Imagine casting a chain lightning with 0 damage. How do you trigger every single unit being hit accurately...and dealing the elemental damage to them?
 

tommerbob

Minecraft. :D
Reaction score
110
you would likely need a damage detection system. Weep's GDD is the best if you want to use GUI. Then, whenever a spell is cast, place the spell caster in a unit group, and detect whenever damage is dealt. If the damage dealer is in the unit group, deal the appropriate damage/damage type. I think that would probably work. I don't think there's any way you can do this without triggering your spell damage.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Use a dummy to cast the spell, associate the caster with the dummy with a hashtable, and use damage detection to trigger the caster dealing the real damage when it detects the dummy's 0 damage.
 

FarAwaY

TH.net Regular
Reaction score
9
Use a dummy to cast the spell, associate the caster with the dummy with a hashtable, and use damage detection to trigger the caster dealing the real damage when it detects the dummy's 0 damage.

Mind explaining in detail or showing the code?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Mind explaining in detail or showing the code?
This assumes you're familiar with dummy units (which you can learn from other threads) and that you're using GDD for damage detection.

Here's an example for Chain Lightning, where the ability HeroChainLightning is a fake ability which does nothing but target a unit, and DummyChainLightning is a chain lightning spell dealing 0 damage:

Trigger:
  • Hashtable Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set DummyHash = (Last created hashtable)

Trigger:
  • CastSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to HeroChainLightning
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Hashtable - Save Handle Of(Triggering unit) as 0 of (Key (Last created unit)) in DummyHash
      • -------- The following is needed if the dummy is a ground unit, or it may be slightly askew --------
      • Custom script: call SetUnitX(bj_lastCreatedUnit, GetLocationX(udg_TempPoint))
      • Custom script: call SetUnitY(bj_lastCreatedUnit, GetLocationY(udg_TempPoint))
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Add DummyChainLightning to (Last created unit)
      • Unit - Set level of DummyChainLightning for (Last created unit) to (Level of HeroChainLightning for (Triggering unit))
      • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
      • Custom script: call RemoveLocation(udg_TempPoint)

Trigger:
  • Detect Hits
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of DummyChainLightning for GDD_DamageSource) Greater than 0
    • Actions
      • -------- This is to overcome a World Editor shortcoming where you can't use custom variables in Hashtable recall --------
      • Custom script: set bj_lastReplacedUnit = udg_GDD_DamageSource
      • Unit - Cause (Load 0 of (Key (Last replaced unit)) in DummyHash) to damage GDD_DamagedUnit, dealing (100.00 + (25.00 x (Real((Level of DummyChainLightning for GDD_DamageSource))))) damage of attack type Siege and damage type Normal


The hashtable is used to associate the hero with the dummy unit, so you can deal the damage from the actual hero, which will cause proper aggro from units it hits; if you just have the dummy unit as the source, targets will flee since the dummy is invulnerable.

Missile spells can be even simpler, using no dummy units and detecting when a unit takes damage in the presence of a buff placed by the missile spell, removing the buff and then dealing the actual damage. Damage over time would be more complicated, needing to be dealt with a periodic trigger.

There's no avoiding triggering damage for each spell that you want to deal non-spell type damage, but it can be easier than having to trigger the entire spell's effects.
 

FarAwaY

TH.net Regular
Reaction score
9
Thanks weep. However, if we have to trigger every single spell...that would mean 200-400+ triggers. Thats not very efficient.

Hence, I'll give u +rep for trying to help, though it also means anyone trying to do this on a large scale must be either insane, or insanely motivated. I am neither, so I think I'll pass on such a system.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
weeps solution is the best of all i could imagine. still, the triggers you need for every spell are not very big, you only need to create dummy units and give them the right abilities.
 

Bird

Ultra Cool Member
Reaction score
29
Okay here's my problem:

I want to make a kind of system that deals Fire/Ice/Lightning...

The thing is, I don't want to be triggering every single spell...
I'm afraid your wishes are non-congruous.

I presume you have Abilities/Items that add Fire/Ice/Lightning Resistance? Without them, what is the point of wanting to do Elemental damage? WC3, in and of itself, does not make use of Elements like Diablo 2 does (huge glaring oversight, IMO). So you cannot make use of Elemental Damage/Resistance without triggering it.

You have to make a formulas that first calculate the Damage, then make conditionals for each type of Resistance (does the Target have Fire Resistance Item, etc etc), THEN deal the damage.
 
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

      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