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!
 
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.
 
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
 
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
 
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....
 
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)
 
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 =)
 
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!
 
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
 
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?
 
ok, im going to try it now.... but why wrte the first Jass if your just deleting it?

sorry....
 
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.
 
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
 
The item condition is: Boolean Comparison -> Hero - Has Item, or something.

Actions are: Trigger - Turn Off, Unit - Damage Target, then Trigger - Turn On
 
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
 
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)
 
Use the "arithmetic" function whenever you need to do addition/subtraction/multiplication/division.
 
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.
  • 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