undead damage

Kyux

Active Member
Reaction score
3
Hey, i want my dude to do extra damage to undead, but regular damage to anything else. i also dont want it to be a spell, and if so, i dont miind if its from a weapon.

thanks!
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
Reminds me of an item I made a while ago. It was an orb of lightning with the purge spell changed to a holy light spell. So it had a percent chance of casting holy light on the attacked unit. Holy light fails on enemy living units but would hit undead units for extra damage.
 

Cold

New Member
Reaction score
4
Something like

Code:
Trigger 1

Event - A unit is attacked

Condition - 
Attacking unit equal to (Your hero)
Attacked unit is undead equal to true

Actions - 
Set variable - UndeadUnit equal to attacked unit
Add event to (Trigger 2) UndeadUnit takes damage

Code:
Trigger 2

Events -

Conditions -

Events - 

Deal damage to UndeadUnit equal to X
 

Kyux

Active Member
Reaction score
3
thanks

hey, thanks a bunch, but, i want it to be a %. like, 300% to undead, so it works no matter what lvl the hero is.

and Naga'sshadow, how did you do that?, i'll just change the % to 100
 

Happy

Well-Known Member
Reaction score
71
why you dont just make X = (your pencent as real number for example 2.75 instead of 275%) multiplied by the dmg of your hero ?

that should work....
 

Summoned

New Member
Reaction score
51
Elaborating on Cold's idea, since it's pretty much exactly what you want, you just don't know it yet. :p You'll need to make 2 triggers.

Name the first trigger UndeadDamageInit (the name must be exact, with no spaces), convert to custom text (in the Edit option at the toolbar), check the Run On Map Initialization near the top of the window, and delete the code. Then copy/paste everything here inside:
JASS:
function Undead_Check takes nothing returns boolean
    if IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) then
        call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetTriggerUnit(), EVENT_UNIT_DAMAGED)
    endif
    return false
endfunction


function Undead_Check2 takes nothing returns boolean
    if IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) then
        call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetFilterUnit(), EVENT_UNIT_DAMAGED)
    endif
    return false
endfunction


function Trig_UndeadDamageInit_Actions takes nothing returns nothing
    local group g = CreateGroup()
    local trigger addnewcomers = CreateTrigger()
    local region R = CreateRegion()
    
    call RegionAddRect(R, bj_mapInitialPlayableArea)
    call TriggerRegisterEnterRegion(addnewcomers, R, Condition(function Undead_Check))
    
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Condition(function Undead_Check2))
    call DestroyGroup(g)
    set g = null
    set addnewcomers = null
endfunction


function InitTrig_UndeadDamageInit takes nothing returns nothing
    set gg_trg_UndeadDamageInit = CreateTrigger()
    call TriggerAddAction(gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions)
endfunction

Note: I did that in JASS because it would take 2 triggers in GUI and if done in GUI it uses a null boolean expression filter, which I've heard is bad. :p

The second trigger should be named UndeadDamageBonus (again, exact name), which looks like the following EXCEPT you should change the conditions:
Trigger:
  • UndeadDamageBonus
    • Events
    • Conditions
      • (Unit-type of (Damage source)) Equal to Paladin <--- use this condition for specific unit
      • ((Damage source) has an item of type Crown of Kings +5) Equal to True <--- use this condition for items
      • (Level of Holy Light for (Damage source)) Greater than 0 <--- use this condition for ability-based
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 2.00) damage of attack type Chaos and damage type Universal
      • --------- ^ Change the 2.00 to whatever number you want ---------
      • --------- 2.00 means 200% extra damage ---------
      • Trigger - Turn on (This trigger)
 

Sunchips

New Member
Reaction score
6
use the last one since you need to detect if it's damaged and not just attacked because otherwise you could hack it by spamattackins and pressing S between =)
 

Kyux

Active Member
Reaction score
3
thanks, but how?

tyvm all for the help. just one thing... you said to delete the code and stuff when you were talking about the Jass. everything in that sentence i dont get.... could you explain it? thanks!
 

Summoned

New Member
Reaction score
51
Edit: Changed the JASS code a little bit. Should do the exact same thing, just a bit shorter.

Make the UndeadDamageInit trigger.
Trigger:
  • UndeadDamageInit
    • Events
    • Conditions
    • Actions

Click Edit, then Convert to Custom Text.
JASS:
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_UndeadDamageInit takes nothing returns nothing
    set gg_trg_UndeadDamageInit = CreateTrigger(  )
    call TriggerAddAction( gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions )
endfunction

Delete everything you see there. Check "Run on Map Initialization" at the top of the trigger window.

Copy/paste the jass code.

attachment.php
 

Summoned

New Member
Reaction score
51
JASS:
function Undead_Check takes nothing returns boolean
    if IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) then
        call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetTriggerUnit(), EVENT_UNIT_DAMAGED)
    endif
    return false
endfunction


function Undead_Check2 takes nothing returns boolean
    if IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) then
        call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetFilterUnit(), EVENT_UNIT_DAMAGED)
    endif
    return false
endfunction


function Trig_UndeadDamageInit_Actions takes nothing returns nothing
    local group g = CreateGroup()
    local trigger addnewcomers = CreateTrigger()
    local region R = CreateRegion()
    
    call RegionAddRect(R, bj_mapInitialPlayableArea)
    call TriggerRegisterEnterRegion(addnewcomers, R, Condition(function Undead_Check))
    
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Condition(function Undead_Check2))
    call DestroyGroup(g)
    set g = null
    set addnewcomers = null
endfunction


function InitTrig_UndeadDamageInit takes nothing returns nothing
    set gg_trg_UndeadDamageInit = CreateTrigger()
    call TriggerAddAction(gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions)
endfunction

is not the same as
JASS:
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_UndeadDamageInit takes nothing returns nothing
    set gg_trg_UndeadDamageInit = CreateTrigger(  )
    call TriggerAddAction( gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions )
endfunction

I guess that might have been confusing?
 

Kyux

Active Member
Reaction score
3
ok, im going to try it now.... but why wrte the first Jass if your just deleting it?

sorry....
 

Summoned

New Member
Reaction score
51
ok, im going to try it now.... but why wrte the first Jass if your just deleting it?

sorry....
Um...
JASS:
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_UndeadDamageInit takes nothing returns nothing
    set gg_trg_UndeadDamageInit = CreateTrigger(  )
    call TriggerAddAction( gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions )
endfunction

^ is an empty trigger. Which does absolutely nothing.
 

Kyux

Active Member
Reaction score
3
ahhk i see tyvm

ok im trying the trigger now, from your first post, im trying to do the item Compaision, where do i find it?
and the action too.

thanks
 

Summoned

New Member
Reaction score
51
The item condition is: Boolean Comparison -> Hero - Has Item, or something.

Actions are: Trigger - Turn Off, Unit - Damage Target, then Trigger - Turn On
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
Critical Strike, make it only apply to Undead units


maybe you can hax Demolish / Bash / some passives to do the same so you dont get ugly red text, but i know for a fact critical strike works
 

Kyux

Active Member
Reaction score
3
thanks both summoned and Narks, tyvm for your help, i have it sorted now!

ok, summoned, i tried it, got it all, but i got the action, where it says "damage taken" i couldn't get the x2.0, just damage taken (btw, it was Event response - Damage Taken)
 

Summoned

New Member
Reaction score
51
Use the "arithmetic" function whenever you need to do addition/subtraction/multiplication/division.
 

Kyux

Active Member
Reaction score
3
thanks, i'll give it a shot!

right, all i got was when your action said ((Damage taken) is[or w/e it was] 3.0) i got 1.00 x 3.00 nothing else, no damage taken or w/e. that was using arithmetic
 
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