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,462
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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • 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 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