Damage Detection; Specific types of damage

sylvannis mb

New Member
Reaction score
6
Hi again guys (I love this website now :) )
ok so i'm trying to make a spell that will block only specific types of damage, ie: fire, frost, piercing, normal etc
Ive managed to do a spell to block close and far damage, but still no ideas on how to do specific damage types :D
any help would be greatly appreciated :D :D
 
The above system would be the best way to achieve such an effect.

Alternatively, you could deal the damage with certain types of dummy units, and then use the unit-type as your type of damage.
 
ok well see the "Damage" method..... i have no idea how to write in that code :S so i don't know how to make it work in my game....
I thought about making certain units do certain damage types, but the thing is, this damage block is meant to help against certain spells as well...
If anyone wants to write the code for me i would be very grateful, but if not can anyone think of another loophole i can do this through?
 
In my AOS I separe units in races and then I check the race of the source.

human = magical damage (can be raised, blocked, reduced)
orc = physical damage (can be raised, blocked, reduced)
undead = dark damage (can't be raised, blocked, reduced)
night elf = returned damage (can't be raised, blocked, reduced, returned)

the returned damage is a way I fond to not run damage detection trigger infinity times.
 
If anyone wants to write the code for me i would be very grateful, but if not can anyone think of another loophole i can do this through?
The code has already been written. GUI is Blizzard's pre-written code and if that doesn't work for you, you'll have to learn how to write JASS (it's really not that difficult). Use the resource linked or make a work-around in GUI. ;-)
 
ok well ive tried the thing where you said use the unit instead of the damage type.
so ive modified the spell so when you type skolir fra ______ if the ____ is equal to a units name, that units damage is reduced for 30 seconds when attacking the units you are shielding. The main problem im having with this is that i want the ability to be able to shield one unit from two different types of attack, and somewhere in my code, it has messed up and now none of the units damages are reduced.

these are my codes:

Trigger:
  • skolir fra string
    • Events
      • Player - Player 1 (Red) types a chat message containing skolir fra as A substring
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 500.00 of (Target point of ability being cast)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of (Triggering player)) Equal to True
            • Then - Actions
              • Hashtable - Save (Substring((Entered chat string), 12, 90)) as (Integer((Substring((Entered chat string), 12, 90)))) of (Key (Picked unit)) in HTable
              • Hashtable - Save 30.00 as (Integer((Substring((Entered chat string), 12, 90)))) of (Key (Picked unit)) in Secondarytable
              • Hashtable - Save (Substring((Entered chat string), 12, 90)) as 0 of (Key (Picked unit)) in Secondarytable
            • Else - Actions
      • Unit Group - Pick every unit in (Units of type Spell Caster) and do (Actions)
        • Loop - Actions
          • Unit - Move dummy[(Player number of (Owner of (Picked unit)))] instantly to (Position of (Picked unit))
      • Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Set redselect1 = (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
          • Unit - Add Shield to dummy[(Player number of (Triggering player))]
          • Unit - Order dummy[(Player number of (Triggering player))] to Orc Spirit Walker - Spirit Link redselect1


Trigger:
  • skolir fra brisingr
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to (Unit-type of (Load (Key (Units of type (Unit-type of (Triggering unit)))) of (Key (Units of type (Unit-type of GDD_DamagedUnit))) in HTable))
      • ((Triggering unit) has buff Redlink ) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units of type Spell Caster) and do (Actions)
        • Loop - Actions
          • Unit - Move dummy[(Player number of (Owner of (Picked unit)))] instantly to (Position of (Picked unit))
      • Set redlink = GDD_Damage
      • Set redlink1 = ((Life of (Attacked unit)) + GDD_Damage)
      • Unit - Set life of (Attacked unit) to redlink1
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Spell Caster) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - ((redlink / 10.00) + 1.00))
          • Unit - Set life of (Picked unit) to 100.00%


and the timer is

Trigger:
  • skolir timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Redlink ) Equal to True
              • (Load (Load 0 of (Key (Picked unit)) from Secondarytable) of (Key (Picked unit)) from Secondarytable) Greater than 0.00
            • Then - Actions
              • Hashtable - Save ((Load (Load 0 of (Key (Picked unit)) from Secondarytable) of (Key (Picked unit)) from Secondarytable) - 1.00) as (Load 0 of (Key (Picked unit)) from Secondarytable) of (Key (Picked unit)) in Secondarytable
            • Else - Actions
              • Hashtable - Save <Empty String> as (Integer((Load 0 of (Key (Picked unit)) from Secondarytable))) of (Key (Picked unit)) in HTable
 
I didn't look at your triggers, but as another suggestion for detecting damage (especially spell damage), you can trigger all of your damage spells, by adding the dummy casters to a unit group and then when damage is dealt, check if the damage source is in the unit group.
 
I didn't look at your triggers, but as another suggestion for detecting damage (especially spell damage), you can trigger all of your damage spells, by adding the dummy casters to a unit group and then when damage is dealt, check if the damage source is in the unit group.

I already gave him this idea
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • 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 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