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
 
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
 
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?
 
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.
 
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.
 
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?
 
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.
 
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.
 
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.
 
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.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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